andreweinkoetz / foodo-backend Goto Github PK
View Code? Open in Web Editor NEWThe backend repository for the food taxonomy project 'foodo'. This is a project of five TUM students of the course: Future Business Labs (IN2106, IN2128, IN212807)
The backend repository for the food taxonomy project 'foodo'. This is a project of five TUM students of the course: Future Business Labs (IN2106, IN2128, IN212807)
Users which are currently registered lack some of our required attributes (e.g. dislikes, goal,..)
No problem as it will be set during registration process.
Currently, the backend provides the status code 501 (service not available). I do not think this is a very reasonable error code for failed login due to no user found.
Using a more sophisticated logging functionality than console.log would be quite nice especially when it comes to debugging the deployed backend on Amazon EB.
Possible packages:
Need an endpoint to receive the details of a specific standard recipe
As mentioned in #3 , all :id
params in routes have to be replaced after we enable the authentication via the oauth-service.
The userId is only stored within the token (stored in req.body.token.token). Accessing the userId would require to access req.body.token.token.user._id
This is bad practice: To improve accessing the userId after a valid authentication, The userId should be stored in req.body.userId.
Under ingredient: /setallergies (POST) with
{ _id: INGREDIENT_ID, notForAllergy: [ INGREDIENT_ID ] } as body
/user/recipes/substitute PUT:
{ substituteId: INGREDIENT_ID,
originalId: INGREDIENT_ID,
amount: AMOUNT_OF_SUBSTITUTE,
_id: USERRECIPE_ID }
/user/recipes/substitute DELETE:
{ historyId: ID_OF_NEW_HISTORY,
_id: USERRECIPE_ID }
Below you can find the information i extracted from the db-dump of our advisors. If you want to take a look yourself at all the models and examples - i imported their entire db into a mlab mongodb:
As i am responsible for designing our db model (or at least the starting layout) please give me your feedback regarding the food attributes (long list) e.g. is that enough info? Do we need more or less?
And if you have some ideas regarding the model for recipes and ingredients (examples from advisors below) just leave a comment :-)
Thanks!
{
"name": String,
"preparationTime": Time as Int32,
"meal": Type as String (e.g. lunch),
"ingredients":[ Array of ingredients with their food attributes ],
"directions": [ Strings of instruction steps ],
"foodProperties": { same as in ingredients }
"servings": [
// Examples:
{
"name": "1/2 Rezeptmenge",
"weight": 615
},
{
"name": "1 Rezeptmenge",
"weight": 1230
}
],
"noGoNutrition": [ Strings of probably IDs (?) maybe used for allergies],
"imgUrl": String,
"kcal": Int32,
"people": "ca. 1 Liter" // unclear,
"factor": 1 // unclear
}
{
"dataSource": "BLS", // unclear, maybe irrelevant
"name": String,
"foodGroup": "Other", // ?
"foodAttributes": { nutrition values as above }
"servings": [ as above]
}
Please comment your required endpoints and their functionality below this issue.
I will split them into multiple issues once we gathered some endpoints.
Current top-level routes are:
From my point of view there would be one route i would like to add:
For the user profile, we need following routes to post and delete:
aggregated in issue #5
To create and update a user recipe, we need:
aggregated in issue #7
All userId related endpoints will be replaced.
Reason:
The user id is provided with after validating the access token. Selection via req.params is therefore not necessary and can be replaced:
See #9 for this
For @MrMaux we need the populated ingredients array of the origRecipe in the userRecipe. Meaning that in getUserRecipe we need the ingredients also of the origRecipe to be populated in order to compare how much the nutriscore has changed.
Current routes have to be renamed in order to match the current standard of apis.
e.g. instead of /recipe/:id it will be /recipes/:id
We need an endpoint to get substitutes based on our algorithm.
The endpoint should be based on /recipe.
Endpoint /recipe/substitution
=> for second prototype:
applcation
into Foodo Website
or Foodo App
As we display the last edited by clientId, a nicer name would be a good enhancement for the second prototype.
/ingredients/setlifestyles POST
{ _id: INGREDIENT_ID,
notForLifestyles: [ LIFESTYLE_ID ]
}
Rewrite whole document
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.