
Build a production-ready back-end API with Node.js, Express, and MongoDB, featuring authentication, middleware, Postman testing, JWT security, and deployment to Digital Ocean with SSL.
Explore building a production-ready api with Express and MongoDB, covering boot camps, courses, reviews, and users authentication, plus Postman documentation and deployment with Nginx and Let's Encrypt.
Set up the Node.js environment with nodejs.org, npm, VS Code, and Postman to build and test your API, using Git and GitHub for version control and deployment.
Explore the Node.js core http module to build a basic server, manage the request-response cycle with headers and body, and return json with status codes like 200 and 404.
Install nodemon as a dev dependency using npm install -D, initialize package.json with npm init, and update npm scripts to run nodemon so the server auto-restarts during development.
Learn to respond with data using express; set content-type headers, return json data with res.send or stringify a data object, and understand request and response headers.
Learn how HTTP status codes indicate outcomes from 2xx to 5xx, including 201 created and 204 no content, 404 not found, and 500 server errors, with res.status and writeHead usage.
Send headers and json body data to the server, including authorization tokens, and build the body from data chunks with the HTTP module, then access it in Express via request.body.
Learn common http methods such as get, post, put or patch, and delete; design restful routes like /todos; handle request bodies, statuses, and basic in-memory to dos.
Master the project specifications for a Node.js API with Express and MongoDB, covering resource setup, authentication, CRUD for boot camps and courses, and deployment plans.
learn to set up a basic express server with dotenv for environment variables, create package.json, scripts for development and production, and initialize git with proper ignore policies.
Create and test express routes using app.get, res.send, and res.json, including status handling and route parameters for a versioned api like /api/v1/boot-camps with create, read, update, delete operations.
Refactor boot camp routes by introducing the Express router, creating a routes folder, mounting the router in server.js under api version one boot camps, and move logic to controllers.
Create and export controller methods for each route, wire them to routes, and structure a neat Node.js API using boot camps, with public and private routes and middleware.
Learn how express middleware runs during the request-response cycle, sets values on the request object, and uses next to pass control, including a simple logging example with Morgan.
Configure Postman for the dev camper API by creating an account, setting a global URL variable, and building a boot camps collection with CRUD requests for testing and documentation.
Set up a MongoDB Atlas cloud database and Compass GUI to scaffold a fast NoSQL backend, create a free AWS cluster, and configure user access and IP access control.
Connect to MongoDB Atlas with Mongoose in a Node.js app by configuring a DB.js and a Mongo Uri environment variable, using async/await for the connection.
Enhance Node.js console output with the colors package, styling server and database messages in bold yellow and errors in red for easier log visibility.
Define a mongoose boot camp model with validated fields, a MapQuest geocoder-generated GeoJSON location and slug, and computed averages from reviews and tuition, plus data seeding.
Create a boot camp endpoint in node.js using express and mongoose, handling request bodies as json. Implement error handling for duplicates and bad requests with async/await and try/catch.
Fetch bootcamps using async/await with mongoose find and findById, returning 200 success data for all bootcamps or a single bootcamp, and handle 400 errors for invalid or missing bootcamps.
Update bootcamps with put using findByIdAndUpdate to return the new data and run validators, and delete bootcamps by id with appropriate 200 or 400 responses, demonstrated in Postman.
Implement custom error handling in express by passing errors to next, using error handler middleware to return json errors, log issues, and customize status codes.
Create a utils error response class that extends Error, accepts a message and status code, exports as errorResponse, and use it to return 404 or 500 responses in Express routes.
Learn to catch Mongoose cast errors in a centralized error handler, return a 404 with a custom error response, and apply the pattern to get, update, and delete boot camps.
Learn to handle mongoose errors, including duplicate key (code 11000) and validation errors, by inspecting the error object and returning a 400 bad request with extracted messages.
Wrap async routes with a reusable async handler to remove repetitive try/catch blocks. Preview Mongoose middleware that creates slugs and converts addresses into GeoJSON coordinates.
Explore mongoose middleware, including document and query hooks with pre and post operations. Create a slug from the bootcamp name with slugify to add an SEO-friendly slug field.
Geocode client addresses with node geocoder to create a geojson location (longitude, latitude, city, state, country) using MapQuest and a pre-save middleware that stores the location and drops the address.
Create a Node.js seeder script to import and delete boot camps data into MongoDB using Mongoose, dotenv, and JSON files with command line options for import and destroy.
Build a route and controller to fetch boot camps within a zip code radius using geojson locations, geocoder geocoding, and a geo within center sphere query.
Master advanced filtering in a Node.js API by building dynamic queries from request.query, using operators like gt, gte, lt, lte, and in, and prepare for field selection.
Learn how to filter, project, and sort data in a Node.js API using Express and MongoDB by implementing select fields, excluding query keys, and flexible sort options.
Implement server-side pagination in a Node.js API using limit, page, skip, and total counts, returning next and previous pages for bootcamps.
Create a Mongoose course model with title, description, weeks, tuition, minimum skill, scholarship flag, and a boot camp reference; seed data and connect routes to controllers.
Implement course routes and a controller to fetch all courses or those for a specific boot camp, using mergeParams, async handler, and boot camp–based queries.
Use mongoose populate to enrich courses with boot camp data, implement virtuals for reverse course listings, and enable cascade delete so deleting a boot camp removes its courses.
Build a Node.js API with Express and boot camp associations, enabling get all courses, get single course by id, and add, update, or delete courses via routes and controllers.
Learn to calculate and store the average course tuition for each boot camp using MongoDB aggregation, static model methods, and auto-update of boot camp documents.
Implement boot camp photo upload with express file upload, validating image presence and type, saving to public/uploads, updating the boot camp record, and serving images from the public folder.
Learn to implement a reusable advanced results middleware in Node.js that handles filtering, selecting fields, limiting, pagination, and optional populate for any model, demonstrated with bootcamps and courses.
Develop a user model for authentication in Node.js api using mongoose, including name, email, role, password, and reset token expiry. Set up auth routes with json web token and bcryptjs.
Register new users by extracting name, email, password, and role from the request body and creating the user with mongoose, using a pre-save middleware to hash the password with bcrypt.
Sign a json web token using the user's id, a secret from config, and a 30-day expiry via a mongoose method, then return the token in the response.
Validate email and password, find the user by email, compare the entered password with the hashed one, and return a token containing the user id.
Learn to send a JWT via an HttpOnly cookie using cookie-parser in a Node.js Express API, with a 30-day expiration and production secure options.
Build a protect middleware with JWT to require a bearer token in the authorization header for protected routes, decode the token to fetch the user and attach to the request.
Learn to store the login token in a Postman environment variable and reuse it as a bearer token for protected routes, simplifying authenticated requests across routes.
Create an authorize middleware to grant access to specific roles, integrate it with the protect middleware, and enforce 403 forbidden when a user's role isn't authorized for a route.
Establish user relationships for boot camps by auto-adding the logged-in user to boot camp data, enforcing one boot camp per publisher while allowing admins multiple, using mongoose ObjectId references.
Enforce boot camp ownership with owner and admin permissions for updating, deleting, and uploading photos, using token-based authentication and robust authorization for courses.
Enforces boot camp ownership by the logged-in user when adding courses. Validates permissions before updating or deleting courses.
Implement forgot password and generate a reset token by hashing and storing it with a 10-minute expiration in the user document, using crypto in Node.js.
Set up password reset email delivery with nodemailer and mail trap, configure smtp settings, and build a reusable send email utility to send a tokenized reset url.
Implement a secure reset password flow by hashing the token with crypto, locating the user by token and expiry, updating the password, and returning an auth token.
Update the logged-in user's name and email via a protected put request, using specified fields to update; securely change password with current and new values and return a token.
Design admin-only users CRUD endpoints in Node.js using Express, with protected routes, advanced results middleware, and admin authorization to create, read, update, and delete users.
create a review model with title, text, and a 1–10 rating linked to boot camps and users, then implement routes to get all reviews and boot camp reviews.
Calculate and persist the average rating for boot camps using a static method on the review schema and update the boot camp model to reflect the average after each change.
Add and secure update and delete review routes in a Node.js API built with Express and MongoDB, enforcing owner or admin permissions with put, delete, and validation.
Implement a logout route that clears the token cookie, expires it, and invalidates the session, while showing token delivery via cookie or bearer header.
Learn to prevent NoSQL injection by sanitizing data in a Node.js, Express, MongoDB app using express-mongo-sanitize middleware, and prepare for helmet security headers.
Install and enable helmet to add security headers, then implement xss-clean to sanitize input and prevent cross-site scripting, reducing noSQL injections risks; prepare rate limiting for the next video.
Implement rate limiting and http parameter pollution protection with express-rate-limit and an http parameter pollution guard, enable cors for cross-origin access, and introduce api documentation via Postman and Doc Gen.
This is a project based course where we build an extensive, in-depth backend API for DevCamper, a bootcamp directory API. We will start from scratch and end up with a professional deployed API with documentation. We will dive deep into Node, Express and MongoDB. Here is some of what you will learn in this course and project...
HTTP Essentials
Postman Client
RESTful APIs
Express Framework
Routing & Controller Methods
MongoDB Atlas & Compass
Mongoose ODM
Advanced Query (Pagination, filter, etc)
Models & Relationships
Middleware (Express & Mongoose)
MongoDB Geospatial Index / GeoJSON
Geocoding
Custom Error Handling
User Roles & Permissions
Aggregation
Photo Upload
Authentication With JWT & Cookies
Emailing Password Reset Tokens
Custom Database Seeder Using JSON Files
Password & Token Hashing
Security: NoSQL Injection, XSS, etc
Creating Documentation
Deployment With PM2, NGINX, SSL
Web development is changing. We used to render all of our views and templates on the server, but since the rise of frontend frameworks like React, Angular and Vue, we are now splitting projects up into backend and frontend, where the backend is doing all of the database interaction and serving JSON and the frontend is fetching that data and creating the user interface to interact with. This course will teach you the entire backend side of things so that you can build extensive APIs and then use whatever you want on the frontend.
We will do a lot more than just build a simple CRUD REST API like many other Node.js and Express tutorials. We will be implementing authentication, roles and permissions, password reset tokens, email functionality, geocoding and much more. This course teaches what it's like to be a real backend engineer.