- https://culturedrecipes.herokuapp.com/
- Test: email:made@name.com password:999999999
- A recipe search and diet app. A user suppose to be able to search for a recipe, see the intructions to that recipe and add it to their list
- HTML
- CSS
- Express and nodejs
- PostgreSQL
- Sequelize
- Unsplash.com
- www.grabient.com
- lingojam.com
- stackoverflow.com
- mdn.com
- w2school.com
- What is the app minimal requirements:
- Setup Auth Utilized auth, including hashed passwords and an authorization flow.
- Planned out features and functionality
- Draw a wireframe
- Got database running with models and associations.
- Integrated recipe API so that users could can search for a recipe
- Stubbed out Routes and completed the get, post, put, and delete functionality
- Protected my routes so users won't be able to access each other profile, faves and delete comments
- Completed MVP level functionality
- User can be able to signUp or login into the website
- User can be able to search for a recipe
- User can be able to create a new recipe
- User can be able to add a recipe to their favourites
- User can be able to delete a recipe from their favourites list
- User can be able to comment on a recipe
- User can choose category/culture for a recipe
- Include sign up/log in functionality
- Have at least 2 models
- Incorporate at least one third-party API
- Have complete RESTful route
- Utilize an ORM to create a database table structure
- readme file
- Incorporate the diet data from the api into the app
- Add more categories
- Do a more responsive web design styling
- Understanding my api and getting it to work
- The comment route
- Database and relations between models
- create a node app
- .gitingore
- install and set up express
- stubbed out the GET auth/login, GET auth/signup, POST auth/login, POST auth/signup
- configured auth controller
- set up ejs, express-ejs-layouts,
- npm i sequelize pg
- sequelize init *sequelize db:create express_auth_dev
-
Fork and clone
-
Install dependencies
-
Create a
config.jsonwith the following code:
{ "development": { "database": "express_auth_development", "host": "127.0.0.1", "dialect": "postgres" }, "test": { "database": "express_auth_test", "host": "127.0.0.1", "dialect": "postgres" }, "production": { "database": "express_auth_production", "host": "127.0.0.1", "dialect": "postgres" } }
Note If your database requires a username and password, you'll need to include these fields as well.
- Create a database
sequelize db:create <insert db name here>
- Migrate the
usermodel to your database
sequelize db:migrate
- ADD
SESSION_SECRETandPORTenvironment variables in a.envfile
| Crud | Route | Function |
|---|---|---|
| GET | / | home page |
| GET | /auth/login | renders login page |
| POST | /auth/login | signs in existing user |
| GET | /auth/signup | renders sign up page |
| POST | /auth/signup | creates new user in database |
| GET | /auth/logout | logs out user |
| GET | /recipes | loads full recipes database |
| GET | /favorites | loads user favorites database |
| POST | /favorites | adds a recipe to the user favorite page |
| DELETE | /favorites/:id | deletes a recipe from the favorite page |
| GET | favorites/:id/comments | adds comment to individual recipe |
| PUT | favorites/:id/comments | edit a comment to individual recipe |
| Delete | favorites/:id/comments | deletes comment to individual recipe |
| GET | /profile | user's profile page |
| GET | /vegan | loads full vegan recipes database |
| GET | /drinks | loads full drinks recipes database |
| GET | /meat | loads full meat recipes database |
| GET | /deserts | loads full deserts recipes database |
| Crud | Schema | Association |
|---|---|---|
| recipe | name,img_url,url,source | belongsToMany user through recipeuser hasMany comments |
| recipeuser | userId,recipeId | |
| comment | name,content,recipeId,userId | belongs to recipes and user |
| user | name,email,password | belongsToMany recipe through recipeuser hasMany comments |