Skip to content

Repository for the MachtSpass App - Server Backend - of our team at hackaTUM

License

Notifications You must be signed in to change notification settings

MobileAppVault/hackaTUM-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MachtSpass - Server

Server Backend for MachtSpass iOS App! Read more about the project here: [https://github.com/ffittschen/hackaTUM]

Videos

Question - Buyer

Answer - Club Member

Infrastructure

Database

  • Azure DocumentDB - MongoDB

API

  • Azure API App ( NodeJS / Express )

Push Notification

Open Todos

  • Mongoose -> use related database item with ref
  • REST API Authentication ( API_KEY/ TOKEN )
  • Azure Analitics Services

Credits

Node-APN - Copyright © 2010 Andrew Naylor ExpressJS - Copyright © 2016 StrongLoop, IBM, and other expressjs.com contributors. Node.js Copyright © 2016 Joyent.


API endpoints

inspect data

[/api/v1/profiles]

[/api/v1/products]

[/api/v1/questions]

[/api/v1/answers]

[/api/v1/ratings?page=1&limit=10]

Initial Setup (triggered manualy)

setup fake data

GET: /api/v1/fakedata

User Profile

create new user profile

POST: /api/v1/profile
{
  name: String,
  avatar: String,
  pushid: String,
  notificationactive: Boolean
}

get user profile

GET: /api/v1/profile:id

update profile

PUT: /api/v1/profile:id
{
  name: String,
  avatar: String,
  pushid: String,
  notificationactive: Boolean
}

Product

get product data includes rating & and setup user if not exists

( huge performance improvement in process flow )

POST: /api/v1/product
{
    "productid":"",
    "userid":"",
    "pushid":"", // device token
}

return

{
  userid: String,
  product: {
    productid: String,
    title: String,
    content: String,
    features: String,
    link: String,
    image: String,
    price: Number
  },
  rating: {
    funfactor: Number,
    likes: Number,
    dislikes: Number
  }
}

Qestion

send question "Macht Spaß?"

POST: /api/v1/question
{
  "userid": "",
  "productid": "",
  "latitude": "",
  "longitude": ""
}

return

{
  "status": "OK",
  "message": "",
  "questionid": "",
  "waitfor": "500"
}

pull question status

GET: /api/v1/question/:id/status

return

{
    "status": "OK",
    "message": "",
    "questionid": 0,
    "likes": 10,
    "dislikes": 2,
    "funfactor": 10
}

get question details

GET: /api/v1/question:id

return

{
    "questionid": "",
    "product": {
        productid: String,
        title: String,
        content: String,
        features: String,
        link: String,
        image: String,
        price: Number
    },
}

Answer

send Answer ( Macht Spaß | Macht kein Spaß )

POST: /api/v1/answer
{
  "userid": "",
  "productid": "",
  "like": 1,
  "dislike": 0
}

return

{
  "status": "OK",
  "message": "",
}

About

Repository for the MachtSpass App - Server Backend - of our team at hackaTUM

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published