- Install Express
- Install Express packages:
- sequelize
- sequelize-cli
- pg
- connect-pg-simple
- express-session
- bcrypt
- passport
- passport-local
- Create a database
- Initialize Sequelize via the command line
- Configure database in config.json
- Create a User model
- Configure User model
- Make id field uuid
- Configure other column fields if necessary
- Create UUID extension -- CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
- Configure your table data to be created every time the server starts, if it doesn't already exist
- Sync User table by starting server
- Create a new registration template
- Configure your index.js to accept a GET and POST route for the registration page
- Test your form submission by passing 'res.send()' into your POST route functionality
- Configure POST route so that data from the form will be sent to the server after you submission
- Test
- Using bcrypt, create functionality to encrypt user registration passwords (known as hashing) and randomizing them (known as salting) to make it harder for hackers to reverse engineer passwords
- We must add in the encryption configuration in the User model, then use Sequelize's beforeCreate() hook function to make sure that whenever we submit the data to the server, it hashes and encrypts the password BEFORE it saves it to the database.
- Go through registration for and submit the information again. Check your database and make sure the password field is hashed and salted.