- how to run the backend
npm install
npm run dev / npm start
- how to run frontend
npm install
npm start
table 1:
- users
- user
- foodIntake
- {food}
- calorieData
- foodName
- servingSize
- totalCalories
- {food}
- foodIntake
- user
table 2:
- reviews
- reivew
-
login/logout: firebase auth
-
POST api/searchFood: call the third party api to get cal for food
- input: req.body.foodName
- output: a json object: {name, image, imageType, calories}
-
POST api/selectAllFood: get all food for the user
- input: req.body.username
- output: allFood(json)
-
POST api/addFood: Add food (only 1, can't take other number)
- input: req.body.username (username), req.body.foodName, req.body.calories, req.body.number
- output: 200/error
-
POST api/deleteFood: delete food fron firestore
- input: req.body.username, req.body.foodName
- output: 200/400
-
PUT api/updateFood: update the number of the food, only add 1
- input: req.body.username, req.body.foodName
- output: 201/400
-
GET api/reviews
-
POST api/reviews
-
POST api/checkUser: create user when login
- input: req.body.username
- 201/400