
Build modern back-end applications with Node.js, Express, and MongoDB through a four-part bootcamp, featuring a Natours project with RESTful API and server-side rendered website, authentication, and deployment.
Install node.js on macOS, Windows, and Linux by downloading from nodejs.org, choose the lts version (10 in this course) or the current version (12), and verify with node -v.
Kick off the Node.js bootcamp by writing Node.js code quickly, using core modules to build a small, fun project, with later sections exploring deeper concepts.
Discover what Node.js is, a JavaScript runtime built on the V8 engine for server-side use. Explore its event-driven, non-blocking I/O model for fast, scalable APIs and back-end apps with MongoDB.
Learn to run JavaScript outside the browser by using Node.js in the terminal, start the Node REPL, and explore ES6 syntax, Node modules, and handy REPL shortcuts in VS Code.
Learn to run your first Node.js script, require core modules like fs, and explore Node.js documentation to read files from disk using read file sync in future lessons.
Learn to read from input.txt and write to output.txt in node.js using the fs module, with readFileSync and writeFileSync, utf8 encoding, and template strings.
Explore the asynchronous nature of Node.js, contrasting synchronous blocking code with non-blocking asynchronous code using callbacks and readFile. Understand the single-thread model and how to avoid callback hell.
Learn to read and write files asynchronously in Node.js using the fs module, callbacks, and the error-first pattern, including reading start.txt, read this.txt, and append.txt, then writing a final file.
Create a simple web server in Node.js using the http module's createServer, handling requests and sending responses with res.end, and listen on port 8000.
Develop a basic Node.js routing pattern by inspecting req.url, mapping paths like /overview and /product to specific responses, handling root and unknown routes with 404 status and content-type headers.
Build a simple web API in Node.js that serves product data from a JSON file at /api. Load the data once at startup with a synchronous read and return application/json.
design and implement templates for product detail and overview pages, using json data to populate names, images, origin, nutrients, quantity, price, and description, with inlined css and dynamic product cards.
Preload HTML templates into memory and replace placeholders with product data to render the overview page with dynamic product cards.
Learn to parse variables from the URL using the Node.js URL module, convert the query to an object, extract id and pathname, and render a dynamic product page.
Create a custom node module by exporting a function with module.exports in modules/replaceTemplate.js, then import it in index.js with require, demonstrating that Node.js treats each file as a module.
Learn how npm, the node package manager, handles installing and managing open-source packages from the npm registry, and how the package.json file configures your Node.js project.
Learn to distinguish regular dependencies and development dependencies, install them locally or globally with npm, use npm scripts, and see how nodemon and slugify populate package.json and enable global tools.
Learn how to require third-party modules from the npm registry, install and use slugify to generate url slugs, and integrate a new package as a project dependency.
Master semantic versioning in npm, including major, minor, and patch changes and their backward compatibility. Learn to update, install, and uninstall packages, and share code with package.json and package-lock.json.
Install and configure the Prettier extension in VS Code, enable format on save, and use a prettierrc file to enforce single quotes and consistent formatting across a team.
Review the section's progress by recalling file operations, module imports, and building a web server with routing and templating; look ahead to backend theory, Node.js internals, and Express next.
Learn back end development fundamentals that underpin Node.js, Express, and databases. Understand how the web works, the request-response model, HTTP and TCP/IP, static versus dynamic websites, and APIs.
Explore how the browser sends HTTP requests, uses DNS to resolve domains, and retrieves pages. See how the initial HTML triggers loading of assets and page rendering.
Explore http in action by inspecting browser dev tools' network tab: observe requests and responses, disable cache, and review headers, cookies, and assets like css, images, and js.
Explore front-end and back-end distinctions in web development and the client-server workflow. See how HTML, CSS, and JavaScript power the front end, while Node.js and MongoDB drive the back end.
Clarify static versus dynamic websites and API-powered sites, contrast server-side rendering with client-side rendering, and show how Node.js powers APIs delivering JSON data across clients.
Explore how Node.js works behind the scenes, covering architecture, event loop, streams, and modules. Apply theory with code to gain a competitive edge as a Node developer.
Explore Node architecture by examining core dependencies such as the V8 engine and libuv, and how C++ and JavaScript enable the event loop and thread pool for server-side code.
Explore how Node runs on a single thread and how the libuv provided thread pool offloads heavy tasks—files, cryptography, compression, and DNS lookups—keeping the event loop responsive.
The event loop is the heart of the Node.js architecture, orchestrating callback-driven work and offloading tasks to the thread pool. It manages timers, I/O, and microtask queues to prevent blocking.
Explore the event loop in practice by coding setTimeout, setImmediate, and file I/O to observe execution order, process.nextTick, microtasks, and thread-pool effects.
Explore Node.js event-driven architecture with event emitters and listeners, using the HTTP module to handle requests, and apply the observer pattern for decoupled, multi-listener reactions.
Master Node.js event emitters and listeners through practical examples, including newSale events and multiple listeners. Extend EventEmitter with ES6 classes and observe event-driven http server behavior.
Explore how streams process data in chunks to improve memory and speed, covering readable, writable, duplex, and transform streams, with practical piping and event handling in Node.js.
Explore streaming large files in node by comparing readFile, readStream with res.write, and the pipe operator to handle backpressure.
Explore how Node.js resolves and loads modules using core, developer, and npm modules, and how require wraps, exports, and caches module code.
Explore how Node.js wraps module code in a wrapper function, export and import patterns using module.exports and exports, and how caching affects repeated requires.
Learn how modern Node.js handles asynchronous code with promises and async/await, moving beyond callbacks, and get up to speed on these essential tools for this course.
Explore how excessive callbacks lead to callback hell in Node.js, illustrated by nested readfile and http requests. Learn how promises and async/await improve readability and maintainability.
Learn to escape callback hell by using promises with the super agent library get method. Understand pending, fulfilled, and rejected states, and master then and catch for clean, chained code.
Learn how to promisify read file and write file, return promises, and chain then and catch to manage async flow with ES6 promises.
Master async/await to replace promise then-handlers and write cleaner promise-based code. Use async functions, await expressions, and try-catch error handling for robust API calls and file operations.
Explore how async functions return promises, how to retrieve their values with await or then, and improve error handling using try/catch and IIFE patterns in Node.js.
Learn to run multiple promises in parallel with Promise.all to fetch three random dog images, map responses to messages, and assemble a final output.
Start building your API with Express in Node.js, the popular framework that speeds development and simplifies writing Node.js code for your complete bootcamp project.
Explore Express, a minimal node.js framework built on top of node.js, offering complex routing, request and response handling, middleware, server-side rendering, and MVC-friendly structure to speed up node.js development.
Install Postman to test APIs and explore http methods like get, post, put, and patch. Save requests, create collections, run tests, and manage environments for api development.
Set up express and create a simple server to learn basic routing for the natours project, using app.get and post, with json responses and rest-style api testing.
Learn RESTful API design by structuring resources, using resource-based URLs, and applying HTTP methods (GET, POST, PUT, PATCH, DELETE) for CRUD, with JSON and JSEND, in stateless APIs.
Start building the API by creating a GET endpoint for tours, reading data from a json file, and returning a JSend-formatted response with data and results.
Implement a post route with express.json middleware to parse req.body, create a new id from last tour via Object.assign, merge it with body, and save to json file with 201.
Learn how to define route parameters in Express URLs, read them with req.params, and return a single tour by id or a 404 error when the id is invalid.
Explore handling patch requests in an Express app to update only changed fields via api/v1/tours/:id, compare patch with put, and return appropriate 200, 404 responses.
Change the route to handle delete with an id, return 204 no content with null data, and verify via Postman that the response shows no content.
Refactor routes by exporting handler functions and grouping routes for better readability. Use app.route with chained get, post, patch, and delete to preserve functionality while keeping a clear structure.
Explore how Express uses a middleware stack to handle the request-response cycle. Middleware processes request and response objects in code-defined order, advancing with next until the route sends the response.
Create and test custom middleware in Express using app.use, access req, res, and next, and add request time to the request object, while understanding how middleware order affects route handling.
install and configure morgan, a popular logging middleware, to log request data in the console using the dev preset, and add it as the first middleware in express.
Implement the users resource routes under /api/v1/users, including get all users, get user, create user, update user, and delete with placeholders. Plan to separate routes into controllers.
Learn to create and mount multiple express routers, separating routes and handlers into resource-specific files, and attach tour and user routers as middleware.
Refactor your Node.js app by modularizing routers and controllers, embrace the model-view-controller pattern, and wire routers via app.js, then start the server with server.js and npm start.
Explore param middleware that runs for a specific url parameter, add a checkID middleware to validate ids, and streamline routes by placing validation in the Express middleware stack.
Chain multiple middleware functions for a route by adding a checkBody middleware before createTour to validate name and price; return 400 bad request if missing, otherwise proceed to createTour.
Learn to serve static files with express using the express.static middleware and a public folder, enabling access to overview.html, images, css, and javascript via the browser.
Explore how environment variables define development and production contexts, configure via .env and dotenv, and control behavior such as login, debugging, and database selection in node.js and express apps.
Learn to set up eslint and prettier in VS Code to improve code quality, integrate the Airbnb style guide, and configure plugins and rules for Node.js and Express.
Explore the popular MongoDB database system by installing MongoDB, creating databases, inserting data, and querying data in multiple ways in this section of the complete bootcamp.
Explore MongoDB, a NoSQL document database that offers scalability and flexibility, storing data in collections of JSON-like documents with embedded data and de-normalization, contrasting with relational databases.
Install MongoDB on macOS by downloading and extracting the community server, copying binaries to /usr/local/bin, starting mongod, and connecting with the mongo shell, noting Atlas cloud options.
Learn how to install MongoDB on Windows, including the MongoDB Community Server. Install MongoDB Compass, create data and db directories, run mongod, and add MongoDB to the system path.
Create your first local MongoDB database with the Mongo Shell, switch databases with use, and insert documents into a tours collection using insertOne or insertMany.
Learn how to create multiple MongoDB documents with insertMany, adding fields like name, price, rating, and optional difficulty, and verify with find in the tours collection.
Learn to query documents in MongoDB with find, using filters and projection on fields like price and rating. Apply operators such as lt, lte, and, or to compose precise conditions.
Update documents in MongoDB using updateOne and updateMany by applying a filter and the $set operator to adjust fields like price and add a premium flag.
Learn how to delete documents in MongoDB using deleteOne and deleteMany, including deleting by a rating condition and the need for backups before deleting all documents with an empty query.
Learn to use MongoDB Compass for crud operations, connect to a local database, run queries with lt and lte, edit and delete documents, and explore aggregations, schemas, and indexes.
Create a remote MongoDB Atlas database, a database-as-a-service, with a free M0 cluster (512 MB, 100 connections) for cloud development.
Connect a remote Atlas cluster to Compass and the Mongo shell, whitelisting your IP and creating a user, then verify natours and tours with the connection string.
Connect a MongoDB database with our application using Mongoose, enabling real data from a real database. We'll explore data models, API features, data validation, and the advanced aggregation pipeline.
Connect the MongoDB atlas database to the express app by obtaining the connection string, storing it as an environment variable, and configuring mongoose with deprecation options to verify the connection.
Mongoose provides schemas, validation, a simple query API, and middleware as an object data modeling library for MongoDB and Node.js, simplifying data modeling and document operations.
Create a simple Mongoose schema and model to manage tour documents, including required name and price, default rating, and basic schema type options for validation.
Create a testTour document from the tour model, save it to MongoDB with testTour.save, and handle success and errors, including duplicate key and price validation, with _id shown in Compass.
Explore the model-view-controller architecture with model, view, and controller layers, distinguish business logic from application logic, and learn how routers, controllers, and models create modular, scalable back-end applications.
Refactor for MVC by moving the tour schema to a model, exporting it, and wiring it into the tour controller to prepare for getting, creating, updating, and deleting tours.
Create tour documents using Tour.create with data from req.body, replacing the older new Tour().save approach. Apply async/await with try/catch for error handling and return clear bad request messages.
Learn to read documents with Mongoose by fetching all tours with find and fetching a single tour with findById via req.params.id, using async/await and try/catch for error handling.
Update documents with mongoose by finding by id and applying changes from the request body via a patch update, returning the updated document with new: true and runValidators: true.
Delete documents using findByIdAndDelete in a RESTful API, returning a 204 no-content status, and practice this CRUD operation alongside update in Node.js, Express, and MongoDB.
Model and validate tour data using a richer Mongoose schema, adding fields such as name, duration, maxGroupSize, difficulty, ratingsAverage, ratingsQuantity, price, priceDiscount, imageCover, images, startDates, and createdAt.
Create a standalone Node.js script to import tour data from a JSON file into MongoDB using mongoose, and support command-line options to import or delete data, exiting cleanly.
Enhance your api with filtering using a query string, access req.query in Express, and implement Mongoose filters via objects or chained methods, while excluding paging, sort, limit, and fields.
Implement advanced filtering by supporting greater than, greater or equal than, less than, and less or equal than operators, converting them to MongoDB dollar operators for precise filtering.
Learn to implement api sorting by price, ascending or descending, using the query string and Mongoose, with multi-field support (price, ratings average) and a default sort by created at descending.
Limit API payloads with field limiting and projection; specify fields via a fields query (name, duration, difficulty, price) and use minus to exclude others; hide sensitive data in schema.
Implement pagination in your API with page and limit, compute skip as page minus one times limit, apply Mongoose skip and limit, and validate with countDocuments to handle unavailable pages.
Add an alias route for top five cheap tours by using a middleware that presets the query with limit five, sort by ratings average and price, and select key fields.
Refactor API features into a reusable APIFeatures class to clean up code and enable modular, chainable operations (filter, sort, limit, paginate). Move to a utilities module for cross-resource reuse.
Explore the MongoDB aggregation pipeline, a multi-stage framework to transform documents through match and group stages to compute ratings average, average price, min and max prices across tours.
Master the aggregation pipeline to unwind start dates, group by month, project results, and build a get monthly plan function to identify the busiest month of a year.
Define Mongoose virtual properties to derive fields like duration weeks from days on the tour schema, using a getter. Enable virtuals in JSON outputs; they are not persisted or queryable.
Learn document middleware in mongoose, a pre and post hook around save and create, including slug generation, with limits like not triggering on insertMany or findByIdAndUpdate, and query middleware.
Explore query middleware in mongoose: create pre-find and post-find hooks, filter secret tours by secretTour, apply to all find variants with a regex, and log query duration.
Learn aggregation middleware in Node.js with MongoDB, using the aggregate hook to modify the pipeline by unshifting a match stage that excludes secretTour true, ensuring only non-secret tours are aggregated.
Learn how to validate data in mongoose with built-in validators such as required, max/min length, min/max for numbers, and enum values, and apply runValidators for updates.
Build custom validators in mongoose to ensure the price discount is lower than the price, with a clear message. Note this keyword limitation and use the validator library isAlpha.
Build a robust error-handling workflow for backend applications using Express and environment variables. Discover how this section demonstrates applying a better error-handling strategy to future projects.
Learn to debug Node.js with the ndb tool, install and run it, set breakpoints, inspect variables, and fix issues in an Express app.
Define a catch-all route with app.all('*') after all routers to handle unhandled routes, returning a 404 JSON with the requested URL (req.originalUrl) to improve API friendliness.
Explore the distinction between operational and programming errors in Express, and implement a global error handling middleware to centralize error responses.
Implement a global error handling middleware in Express with an error-first function of four arguments. Read error status and message, default to 500, and centralize responses for 404 errors.
Create a robust AppError class that extends Error, sets message and statusCode, and marks isOperational. Capture the stack trace and wire a global error handler with an error controller.
Refactor async error handling by introducing a catchAsync wrapper that returns a function accepting (req, res, next), removing per-function try-catch blocks, and routing errors to global middleware.
Implement 404 not found errors using the AppError class, catchAsync, and targeted handling in tour routes for getTour, updateTour, and delete, with proper returns to global error handling.
Distinguish development vs production error handling in a node app by exposing detailed errors in development and sending safe messages in production, using operational errors and a centralized error controller.
Learn to turn Mongoose errors into operational ones by handling CastError, duplicate key, and ValidationError, creating friendly AppError messages and producing meaningful 400 responses in production.
Handle duplicate field errors in MongoDB by matching error code 11000, extracting the conflicting value with a regular expression, and responding with a clear 400 bad request via AppError.
Learn to handle Mongoose validation errors by extracting multiple field messages from error.errors, building a combined, user-friendly message, and returning a robust operational error in production.
Explore handling unhandled promise rejections outside express by using process.on('unhandledRejection') to log errors and shut down gracefully with server.close.
Discover how to catch uncaught exceptions in Node apps using the uncaughtException handler, log the full error, crash safely, and prepare automatic restarts for production.
Learn to implement authentication and authorization with JSON web tokens to protect access to app features. Build secure API interactions by verifying users as they sign up and log in.
Model a user with mongoose for authentication and authorization, including name, email, photo, password, and passwordConfirm, with email validation, uniqueness, and lowercase normalization, then export the user model.
Create new users via an auth-focused signup controller that uses the User model to create and return the user, with a post /signup route and catchAsync-based async error handling.
Validate password equals confirm password with a custom validator on create and save; hash passwords with bcrypt with cost 12 in a pre-save middleware and remove the confirm field.
Explore how json web tokens enable stateless authentication for restful APIs by issuing a token at login, storing it on the client, and using it to access protected resources.
Implement a real signup with automatic login by signing and verifying json web tokens using a secret, restricting signup data to name, email, and password, and enforcing token expiration.
Validate login by reading email and password, verify the user exists and the password matches, then sign and return a jwt. Use bcrypt for password comparison and error handling.
protect tour routes by adding a protect middleware that reads a bearer token from the authorization header, validates it, and allows access to getAllTours only for logged-in users.
Implement a jwt protected middleware using promisified jwt.verify, handling JsonWebTokenError and TokenExpiredError with AppError, validating user existence and password changes, and attaching currentUser to req for protected routes.
Learn to set up advanced Postman environments with development and production URLs, manage variables like URL and JWT, and automate bearer token handling for protected routes.
Implement authorization by adding a role-based restrictTo middleware, protect routes with authentication, and enforce admin and lead guide permissions to delete tours.
Implement password reset in a Node.js app by handling forgot password requests, generating a random token (not JWT), encrypting it, storing it with a 10-minute expiry, and emailing it.
Learn to send password reset emails using nodemailer by building a mail transporter, configuring options, and handling errors with async/await while testing with mailtrap.
Master the password reset flow: validate the reset token, set the new password with validators, clear reset fields, and issue a JWT while updating passwordChangedAt.
Learn to let a logged in user update their password by verifying the current password, saving with validation, and reissuing a token via a dedicated update password flow.
Update the currently authenticated user's data with the updateMe route, enforcing password update restrictions and using findByIdAndUpdate with a filtered body containing only name and email, protected by token-based authentication.
Learn to delete the current user by marking the user as inactive with an active boolean, using deleteMe to set active to false and return a 204 response.
Apply bcrypt-based password protection, use http-only cookies for jwt tokens, implement rate limiting and denial-of-service defenses, sanitize inputs, set secure headers, enforce https, and adopt mongoose-based NoSQL injection defenses.
Send the JSON web token as a secure httpOnly cookie with res.cookie, set an expires date (90 days) and apply production secure flag for HTTPS.
Implement a rate limiting middleware with express-rate-limit to cap IP requests at 100 per hour for /api route, preventing denial of service and brute force attacks, exposing RateLimit-Limit and RateLimit-Remaining.
Use the helmet npm package to configure security http headers in an express app, placing it early in the middleware stack and enabling xss protection and strict transport security.
Apply data sanitization to defend against NoSQL query injection and cross-site scripting by using express-mongo-sanitize and XSS_clean middleware that cleanses request data.
Learn to prevent parameter pollution in a Node.js, Express API by using the HPP middleware to eliminate duplicate query parameters, with examples on sorting and whitelisting.
Do you want to build fast and powerful back-end applications with JavaScript? Would you like to become a more complete and in-demand developer?
Then Node.js is the hot technology for you to learn right now, and you came to the right place to do it!
Welcome to the Complete Node.js, Express, and MongoDB Bootcamp, your fast track to modern back-end development.
This course is the perfect all-in-one package that will take you from a complete beginner to an advanced, highly-skilled Node.js developer.
Like all my other courses, this one is completely project-based! And not just any project: it's a complete, beautiful, and feature-rich application, containing both a RESTful API and a server-side rendered website. It's the most fantastic and complete project that you will find in any Node.js course on the internet!
By building this huge project, you will learn all the skills that you need in order to plan, build, and deploy your own modern back-end applications with Node.js and related technologies.
(If you feel like exploring the project, you can do so at www[.]natours[.]dev. And this is only a small part of the project! Log in with "laura@example.com" and password "test1234")
After finishing this course, you will:
1) Be building your own fast, scalable, and powerful Node.js RESTful APIs or web applications;
2) Truly understand how Node.js works behind the scenes;
3) Be able to work with NoSQL data and model data in real-world situations (a hugely important skill);
4) Know how modern back-end development works, and how all the different technologies fit together (hard to understand from scattered tutorials and videos);
5) Have experience in professionally used tools and libraries like Express, Mongoose, Stripe, Sendgrid, Atlas, Compass, Git, Heroku, and many more;
6) Have built a complete application, which is a perfect starting point for your own applications in the future.
Please note that this course is NOT for absolute web development beginners, so you should already be familiar with basic JavaScript. NO back-end experience required though!
It's an absolutely full-packed, deep-dive course with over 40 hours of content!
Since this is the "Complete Node.js Bootcamp", the course is crammed with tons of different technologies, techniques, and tools, so that you walk away from the course as a complete Node.js developer.
That's why the course turned out to be over 40 hours long. But if that sounds like too much for you, don't worry, there are videos or entire sections that you can safely skip.
Here is exactly what you're gonna learn:
Fundamentals of Node.js, core modules, and NPM (Node Package Manager)
How Node.js works behind the scenes: event loop, blocking vs non-blocking code, event-driven architecture, streams, modules, etc.
Fundamentals of Express (Node.js framework): routing, middleware, sending responses, etc.
RESTful API design and development with advanced features: filtering, sorting, aliasing, pagination
Server-side website rendering (HTML) with Pug templates
CRUD operations with MongoDB database locally and on the Atlas platform (in the cloud)
Advanced MongoDB: geospatial queries, aggregation pipeline, and operators
Fundamentals of Mongoose (MongoDB JS driver): Data models, CRUD operations, data validation, and middleware
Advanced Mongoose features: modeling geospatial data, populates, virtual populates, indexes, etc.
Using the MVC (Model-View-Controller) architecture
How to work with data in NoSQL databases
Advanced data modelling: relationships between data, embedding, referencing, and more
Complete modern authentication with JWT: user sign up, log in, password reset, secure cookies, etc.
Authorization (user roles)
Security: best practices, encryption, sanitization, rate limiting, etc.
Accepting credit card payments with Stripe: Complete integration on the back-end and front-end
Uploading files and image processing
Sending emails with Mailtrap and Sendgrid
Advanced error handling workflows
Deploying Node.js application to production with Heroku
Git and GitHub crash course
And so much more!
Why should you learn Node.js and take this course?
If you want to learn Node.js and modern back-end development, then there is no doubt that this course is for you!
It's the biggest Node.js course on the internet, it has by far the most complete course project, and offers the most in-depth explanations of all topics included.
And even if you already know some Node.js, you should still take this course, because it contains subjects that are not covered anywhere else, or not in the same depth!
But maybe you're not yet convinced that Node.js really is the right technology for you to learn right now?
Well, first, Node.js will allow you to use your JavaScript skills to build applications on the back-end. That itself is a huge gain, which makes your full-stack development process so much easier and faster.
Plus, popularity and opportunities for Node.js are off the charts. It's a modern, proven, and reliable technology, used by tech giants (and 6-figure-salary-paying companies) like Netflix, PayPal, Uber, and many more.
Node.js really is what you should invest your time in, instead of outdated technology like PHP.
In summary, if you already know JavaScript, learning Node is the logical next step for you! It will make you a better, more versatile, and more complete developer, which will ultimately boost your opportunities in the job market!
And I created this course to help you do exactly that! It really is the course I wish I had when I was first learning back-end development with Node.js and all related technologies.
And this is what you get by signing up today:
Lifetime access to 40+ hours of HD quality videos. No monthly subscription. Learn at your own pace, whenever you want;
Friendly and fast support in the course Q&A whenever you have questions or get stuck;
English closed captions (not the auto-generated ones provided by Udemy);
Course slides in PDF format;
Downloadable assets, starter code, and final code for each section;
Lots of small challenges are included in the videos so you can track your progress.
And now, I hope to welcome you as a new student in my course! So click that "Enroll" button right now, and join me in this adventure today!
But if you're not 100% sure yet, just go ahead and watch the promo video to take a look at the course project. I promise you will be amazed :)
See you in the course!