Login authentication app with user sessions. Features server-side rendering and password encryption.
- Install dependencies
- express
- express-session
- bcryptjs
- passport
- passport-local
- express-ejs-layouts
- mongoose
- connect-flash
- Install dev-dependencies
- nodemon
- Create app.js
- Edit configs
- Connect to MongoDB
- MongoDB Atlas
- Passport login authentication
- Ensure user session (protected routes)
- Connect to MongoDB
- Set routes
- /
- /dashboard
- /users
- /register
- Validate fields
- Encrypt password
- /login
- Authenticate
- /logout
- /register
- /
- Define schema
- User
- Create ejs views
- Welcome
- Login
- Display any stored messages from /partials/messages
- Register
- Display any stored messages from /partials/messages
- Dashboard
- Partials
- Store error/success messages