Express framework is highly scalable and follows MVC architecture pattern for designing backend applications. Implement authentication as well as authorisation for securing applications. Connect Express to any SQL or NoSQL database to work with data.
Express Fundamentals
Learn how to create a basic Express server, work with different HTTP methods, learn about different types of middlewares and learn to capture data from clients
- NPM & pacakge.json
- Semantic VersioningPRO
- What is Express ?
- MVC architecture in ExpressPRO
- Middlewares in Express
- Built in middlewares and third party middlewaresPRO
- Routing in Express
- Error handler middlewares in ExpressPRO
- Create a package.json file manually
- Create a package.json file using npm scripts
- Create a basic express server
- Create a middleware that consoles current time on each request
- Use logger middleware in express applicationPRO
- Add middlewares to capture form and JSON data in Express applicationPRO
- Handle GET request on `/` and `/about` using express routingPRO
- Use error handler middleware in express application to handle errorsPRO
- Create middleware to handle 404 page for unhandled routes
Mongoose.js
Mongoose is a wrapper around MongoDB database which helps in defining structure of the data being saved into the database, adding proper validations for the data.
- Mongoose Introduction
- Connecting Express with MongoDB using mongoose
- Schema using mongoosePRO
- Validations using mongoosePRO
- Creating models using mongoosePRO
- CRUD operations using mongoosePRO
- Connect to mongodb database in Express using mongoose
- What are Schemas in mongoose ?
- Create an article schema with given fields in link
- Create a user schema with given fields
- update user schema to make email lowercase and default age to be 0
- Update user schema to contain password field with minimum 5 characters
- Create user model from schema and export it
CRUD operations in Express
In MERN applications, Express CRUD uses MongoDB database to store data and uses these data to send to clients as a webpage.
- Views layer in Express
- Routing conventions in ExpressPRO
- Routing in ExpressPRO
- Create Operation in CRUDPRO
- Read/query Operation in CRUDPRO
- Update Operation in CRUDPRO
- Delete Operation in CRUDPRO
- Use ejs as templating engine in Express
- Create users routes and handle routes provided in link
- Render list of users in an ejs template
- Render single user in an ejs template
- Render a registration form for adding users
- Create a blog app where users can create, list, view, update and delete articlesPRO
Express CRUD with Associations
CRUD applications usually interact with multiple resources. Associations help in managing and tracking multiple resources in the database as well as inside the applications.There are different types of associations.
- Express Generator
- Nodemon to monitor node server
- What are associations ?
- Types of associations
- Using associations in an Express appPRO
- Associating comments with articles in blog appPRO
- Using mongoose populate methodPRO
- Create an express application named as blog using express generator
- Use nodemon to monitor and restart express application
- Explain different types of association with example
- What is the difference between embedding and referencing in mongoDB ?
- Create a blog app with articles and comments associatedPRO
Authentication in Express
Authentication helps secure Express applications from unwanted sessions. It also gives acsess to user demographics which helps in understanding the user base as well as enhance the reach of the application.
- What is authentication ?PRO
- Use cases of authentication in ExpressPRO
- User registration processPRO
- Pre save hook in mongoosePRO
- Hash password using bcryptPRO
- User login processPRO
- Creating session and cookies for loggedIn userPRO
- Logout UserPRO
- Flash messages in expressPRO
- What is pre(save) hook in mongoose ?
- Hash password using bcrypt in a pre-save hook
- Create a user registration panelPRO
- Create a user login panel where registered user can loginPRO
- Create a task management app where logged in user can manage todosPRO
Authorisation in Express
Authorisation provides authority for logged in user to access specific content on the application. Authorisation determines roles and permissions for different kinds of user on the application.
- What is Authorisation ?PRO
- Understanding Authorisation FlowPRO
- Adding middleware to check logged in userPRO
- Authorising routesPRO
- Passing logged user information into requestPRO
- Passing logged user information into templates via localsPRO
- Associating logged in user with resourcesPRO
- Explain the role of authorisation
- Create authorisation middleware to check logged in userPRO
- Create middleware to protect certain routes for logged in user onlyPRO
- create middleware to pass logged in user data to routesPRO
- create middleware to pass logged in user data to templatesPRO
OAuth using passport in Express.js
OAuth allows application to integrate login via credentials from 3rd party trusted applications like google, github, twitter etc.. Passport is a npm package which facilitates integrating 3rd party login in Express app
- Introduction to OAuth
- Introduction to Passport
- Understanding Oauth FlowPRO
- Obtaining credentials for OAuth appPRO
- Adding request and callback routesPRO
- Implementing OAuth StrategyPRO
- Handling public profile data in local applicationPRO
- SerialiseUser and deserialiseUser functionPRO
- What is OAuth and role of passport in Express applications ?
- Explain the OAuth flow
- Implement Github login in an express applicationPRO
- Implement Google login in an express applicationPRO
- Implement both Github and Google login in an express applicationPRO