Coder Social home page Coder Social logo

food-finder's Introduction

LIST OF ENDPOINTS

- GET -

/auth - Redirects to a login page

/auth/logout - Logs the user out

/api/getprofile - Returns all user data on session

/api/getPreferences - Returns user preferences from the user table

/api/favoriteRecipe/:id' - add a specific recipe id to your favorites list

/api/getShoppingList - Returns the list from the shopping_lists table

/api/getRecipe - /api/getRecipe - POST - Returns a list of recipes based on the ingredients the user has entered, and the items that have been blacklisted. Client should send an object with a .ingredients property {"ingredients": ['chicken', 'carrot', 'cheese']} and a .nutrition_info object (accepts `x +`, `x - y`, or `< y` values, where x/y are min/max numbers respectively) -- { "calories": "1000+", "carbs": "<50", "protein": "10-70" }

- POST -

/api/blacklist - Accepts an object with type: add/remove, and a string of ingredients separated by a comma. Ex: {type: add, ingredients: "list, of, ingredients")

/api/postShoppingList - Accepts an object with key value pair, ingredient: true/false. True values get put on shopping list. False go to the pantry in the users table. Ex: {chicken: true, cheese: false}

/api/updateShoppingList - Accepts an object. 'items' as the key, and a string of comma separated items to replace the current shopping list in shopping_lists. Ex: {items: "chicken, cheese"}

/api/appendShoppingList - Accepts an object. 'items' as the key, and a string of comma separated items to append to the current shopping list

/api/pantrySetup - Accepts an object. 'items' as key, and an array of items to add to the pantry

food-finder's People

Contributors

dandrewgarvin avatar freeflight-code avatar kikoro86us avatar robinsonnathan avatar

Stargazers

 avatar

Watchers

 avatar  avatar

food-finder's Issues

Bug 306

So we can tag bugs...

  • in list format

  • this is cool

favorites doesnt

favorites doesn't work. You can not add to favorites by clicking the favorites icon or remove from profile

Updating Shopping List / Pantry error

(node:44676) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'items' of undefined

I received this error when I created a new user, and tried to add items to my shopping cart. It may have something to do with the fact that it is a new user account, so default values are NULL?

need user id fixed on backend for get blacklist and get favorites

TypeError: Cannot read property 'id' of undefined
at app.get (C:\Users\COMP\Desktop\food-finder\server\server.js:700:42)
at Layer.handle [as handle_request] (C:\Users\COMP\Desktop\food-finder\node_modules\express\lib\router\layer.js:95:5)
at next (C:\Users\COMP\Desktop\food-finder\node_modules\express\lib\router\route.js:137:13)
at Route.dispatch (C:\Users\COMP\Desktop\food-finder\node_modules\express\lib\router\route.js:112:3)
at Layer.handle [as handle_request] (C:\Users\COMP\Desktop\food-finder\node_modules\express\lib\router\layer.js:95:5)
at C:\Users\COMP\Desktop\food-finder\node_modules\express\lib\router\index.js:281:22

shopping list retrieve

TypeError: Cannot read property 'get_shopping_list' of undefined
at app.get (C:\Users\COMP\Desktop\food-finder\server\server.js:636:18)
at Layer.handle [as handle_request] (C:\Users\COMP\Desktop\food-finder\node_modules\express\lib\router\layer.js:95:5)
at next (C:\Users\COMP\Desktop\food-finder\node_modules\express\lib\router\route.js:137:13)
at Route.dispatch (C:\Users\COMP\Desktop\food-finder\node_modules\express\lib\router\route.js:112:3)
at Layer.handle [as handle_request] (C:\Users\COMP\Desktop\food-finder\node_modules\express\lib\router\layer.js:95:5)
at C:\Users\COMP\Desktop\food-finder\node_modules\express\lib\router\index.js:281:22
at Function.process_params (C:\Users\COMP\Desktop\food-finder\node_modules\express\lib\router\index.js:335:12)
at next (C:\Users\COMP\Desktop\food-finder\node_modules\express\lib\router\index.js:275:10)
at SessionStrategy.strategy.pass (C:\Users\COMP\Desktop\food-finder\node_modules\passport\lib\middleware\authenticate.js:338:9)
at SessionStrategy.authenticate (C:\Users\COMP\Desktop\food-finder\node_modules\passport\lib\strategies\session.js:75:10)

Searching for a blacklisted item cancels out

If a user has blacklisted 'cheese', then searches for 'cheese', they cancel each other out, and the user receives 0 recipes. The user should be notified that this is what is happening, by receiving an alert that they have entered a blacklisted item.

Ingredient search pulls all items

For example, if a user types 'ham' in the search box, it will also pull recipes that have 'graham crackers'. This should not be the default, but the user should have a wildcard option * to have this type of entry

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.