Weeks 6-7 of FAC-15: building a recommendation web app in node.js w/ backend postgres db
To run this project locally:
- Clone or fork this repo
- Go into the project repo:
cd facGuidebook
npm i
npm start
If you'd like to use the form, you'll need to:
- Create a local database
- Create a
.config.env
file with your db credentials, for example:DB_URL = postgres://[username]:[password]@localhost:5432/[db_name]
- Build the database table by:
- going into
src/database/db_build.js
- uncomment the line
// dbBuilder();
- run
node src/database/db_build.js
- go back into
src/database/db_build.js
and comment out the line// dbBuilder();
- going into
If you'd like to test the project, you'll need to:
- Create a local testing database
- Create a
.config.env
file with your db credentials, for example:TEST_DB_URL = postgres://[test_username]:[test_password]@localhost:5432/[test_db_name]
The original repo for was created by @Whooolia, @charlielafosse, @tantsandras, and myself.
-
User can view ๐ existing posts
- Pull and display data from db
-
Click to add โ own post
- Check for cookie to see if user is logged in
-
If not logged in ๐ : Prompted to login or signup
- (If logged in, jump to step 6)
-
User signs up ๐
- Client side validation - check that password is at least 8 chars, with at least 1 numb, 1 uppercase and 1 lowercase
- Server side - Check if user name already exists in the db
- If no error, submit form to new row in USERS table with a HASHED password
-
User logs in ๐
- Server side - check that username is present in db, then check that the hash of the input matches that user's hashed password.
- If success, creates a JWT with info about specific user
-
User can now access the post form (protected route) ๐
-
User submits post form ๐
- Client side - check that fields are not empty
- Server side - check if the restaurant already exists/that a post hasn't already been made referencing it
- If success, submit form to POSTS table and RESTAURANTS table
-
User can view ๐ updated home page!
- Creating a new database on Heroku and linking it to the new repo (this took longer than expected, we're still not sure why!)
- Signup form validation on the client side (unmatching passwords, patterns)
- We spent a long time tracking our callback functions through different files to figure out where to put the login form validation (to compare the password in the database with the password that is submitted)
- whiteboard coding
- Updated our user journey
- Client-side validation for the sign up page
- Handling the USER LOGIN logic
- Signup form validation
- Client side - check that password is at least 8 chars, with at least 1 numb, 1 uppercase and 1 lowercase.
- Server side - Check is user name already exists in the db
-
Server side - check that username is present in db, then check that the hash of the input matches that user's hashed password!
-
Post form validation (everything we had in there last week...)
- Add logout button & home button
- Add the required rules for the password validation
- Handle the length of the resturant review
- Travis CI - All passing! ๐
This project is absolutely open to contributers! Please browse through the open issues, or suggest your own.
First timers are ofcourse welcome. Check out the open