A simple authentication application using Authentication Routes, Middleware, Dababase and Passport (Auth) packages without any CSS styling.
- Set up folder structure
- Install needed packages
- Add root route and template
- Add secret route and template
- Create User model
- Configure passport
- Add Register routes
- Add Register form
- Add Login routes
- Add Login form
- Add Logout Route
- Add isLoggedIn middleware
- The root page will provide options to SignUp, LogIn and SignOut.
- SignUp by creating a username and password and SignOut and LogIn again.
- Include all the dependencies from package.json file.
- Now run
node app.js
from Cloud9 console.
- [Node.js] (https://nodejs.org) - JavaScript runtime
- [Express] (https://expressjs.com/) - Fast, unopinionated, minimalist web framework for Node.js
- [MongoDB] (https://mongodb.com) - Cross-platform document-oriented database program
- [Mongoose.js] (https://mongoosejs.com/) - MongoDB object modeling for Node.js
- [npm] (https://npmjs.com/) - JavaScript Package manager
- [ejs package] (https://npmjs.com/package/ejs) - Embedded JavaScript templates
- [body-parser package] (https://npmjs.com/package/body-parser) - Node.js body parsing middleware
- [express-session package] (https://npmjs.com/package/express-session) - Creates a session middleware
- [passport package] (https://npmjs.com/package/passport) - Express-compatible authentication middleware for Node.js
- [passport-local package] (https://npmjs.com/package/passport-local) - Passport strategy for authenticating with a username and password.
- [passport-local-mongoose package] (https://npmjs.com/package/passport-local-mongoose) - A Mongoose plugin for building username and password login with Passport.
- [JSON] (https://json.org) - Lightweight data-interchange format
- [Javascript] (https://www.javascript.com/) - High-level, interpreted programming language
- [AWS Cloud9 IDE] (https://aws.amazon.com/cloud9/) - Cloud-based integrated development environment (IDE)
- xjanus (https://github.com/xjanus)
- Colt Steele's Bootcamp course