Node.js & Express Tutorial
A complete Node.js and Express path from beginner to pro - modules, APIs, auth, databases, testing, and real backend projects.
Curriculum
Work through each section in order. Every lesson ends with practice and key points so the idea sticks.
Getting Started
- 1What is Node.js?
Learn what Node.js is, where it runs, and why JavaScript developers use it for servers and tools.
10 min - 2Node.js vs Browser JavaScript
Compare Node.js and browser JavaScript so you know which APIs exist in each environment.
10 min - 3Install Node.js & npm
Install a modern Node.js version, check npm, and understand common version choices.
12 min - 4Your First Node Script
Create a JavaScript file, run it with Node, and read command-line arguments.
10 min - 5REPL, Scripts & package scripts
Use the Node REPL for quick experiments and npm scripts for repeatable project commands.
11 min
Node Foundations
- 6CommonJS Modules (require/module.exports)
Learn the classic Node module system using require and module.exports.
12 min - 7ES Modules (import/export)
Learn modern JavaScript modules in Node.js using import and export.
12 min - 8npm Basics
Understand npm, install packages, and distinguish dependencies from development dependencies.
12 min - 9package.json Explained
Learn the important fields in package.json and how they shape a Node.js project.
11 min - 10Core Modules Overview
Meet the built-in Node.js modules you will use before reaching for npm packages.
10 min - 11File System (fs)
Read and write files with Node.js using the fs module and promise-based APIs.
13 min - 12path & URL utilities
Use Node path and URL helpers to safely build paths and parse web addresses.
12 min - 13Events & EventEmitter
Understand event-driven code and use EventEmitter for simple Node.js events.
12 min - 14Creating a Server with http
Build a small HTTP server using Node.js before learning Express.
15 min
Express Basics
- 15What is Express?
Learn what Express adds to Node.js and when to use it for backend apps.
10 min - 16Your First Express App
Install Express, create a server, and respond to your first routes.
13 min - 17Routes & HTTP Methods
Understand Express routes and the common HTTP methods used in APIs.
13 min - 18Route Params & Query Strings
Read dynamic path values with req.params and optional URL filters with req.query.
12 min - 19Request Body & JSON
Accept JSON request bodies in Express and validate basic input before creating data.
13 min - 20Middleware Explained
Learn how Express middleware runs between the request and the final route response.
13 min - 21Serving Static Files
Use express.static to serve images, CSS, JavaScript, and simple public files.
10 min - 22express.Router()
Organize related Express routes into smaller router modules.
12 min - 23Basic Error Handling
Return helpful error responses and add a basic Express error-handling middleware.
13 min - 24Environment Variables & nodemon
Configure ports with environment variables and restart your app automatically during development.
12 min
Putting It Together
APIs
- 26REST API Design Basics
Design predictable Express APIs with resources, HTTP methods, status codes, JSON responses, and consistent error shapes.
12 min - 27Controllers & Route Organization
Split Express routes into routers and controllers so APIs stay readable as features grow.
11 min - 28Service Layer Pattern
Move business logic out of controllers and into services that can be reused and tested without HTTP.
13 min - 29Validation (manual + zod/joi style)
Validate request bodies, params, and query strings manually or with schema-style libraries before data reaches your services.
14 min - 30Async Routes & Error Propagation
Handle rejected promises in Express routes and centralize API errors with async wrappers and error middleware.
12 min
Auth & Security
- 31JWT Authentication
Use signed JSON Web Tokens to authenticate API requests while keeping secrets in environment variables.
16 min - 32Refresh Tokens & Sessions Overview
Understand refresh-token and session tradeoffs for keeping users logged in safely.
13 min - 33Password Hashing (bcrypt)
Store passwords safely with bcrypt hashes, never plaintext or fast general-purpose hashes.
12 min - 34Helmet, CORS & Secure Headers
Use secure HTTP headers and deliberate CORS rules so browsers interact with your API safely.
12 min - 35Rate Limiting
Protect login, signup, and public API endpoints from abuse with rate limiting strategies.
11 min
Data
- 36MongoDB with the Node Driver
Connect Express to MongoDB using the official Node driver, ObjectId, indexes, and shared clients.
15 min - 37Mongoose ODM
Use Mongoose schemas, models, validation, and queries when you want a structured MongoDB object model.
14 min - 38PostgreSQL with node-postgres/Prisma patterns
Query PostgreSQL from Express with pg pools, parameterized queries, transactions, and a Prisma-style workflow overview.
16 min - 39Migrations & Seeding Mindset
Treat database schema changes and seed data as versioned application changes, not manual dashboard work.
11 min
App Features
- 40File Uploads
Accept file uploads in Express while validating file type, size, storage location, and public access.
13 min - 41Sending Email
Send transactional email from Express through a provider while keeping SMTP credentials and API keys out of source code.
11 min - 42Pagination, Filtering & Sorting
Build list endpoints that support predictable pagination, safe filters, and controlled sort options.
13 min
Quality
- 43Logging for APIs
Log useful request and application events without leaking secrets or overwhelming production systems.
10 min - 44Testing Express Apps
Test Express routes, services, middleware, and error responses with focused unit and integration tests.
15 min - 45API Docs Mindset (OpenAPI/Swagger)
Document Express APIs as contracts using examples, schemas, response codes, and OpenAPI-style descriptions.
10 min - 46TypeScript with Express (Practical Intro)
Add TypeScript to Express for typed requests, responses, services, and environment configuration.
15 min
Delivery
Pro Architecture
- 49Structuring Larger Express Apps
Organize Express applications into predictable modules that can grow without becoming a single giant server file.
16 min - 50Clean Request → Controller → Service → Data
Build a clean Express flow where validation, controllers, services, repositories, and errors each have one job.
17 min
Scale & Reliability
- 51Node/Express Performance Mindset
Understand event loop health, slow routes, payload size, streaming, clustering, and the habits that make Node services reliable under load.
18 min - 52Caching with Redis Patterns
Use Redis with Express for cache-aside reads, invalidation, TTLs, rate limiting, and safe production caching decisions.
18 min - 53Background Jobs & Queues
Move slow work out of Express requests with queue-based workers, retries, idempotency, and safe job status APIs.
18 min - 54WebSockets / realtime with Express
Add realtime behavior to an Express application using an HTTP server, Socket.IO-style events, rooms, authentication, and scaling rules.
17 min
Production
- 55Advanced API Security
Harden production Express APIs with secure headers, CORS, rate limits, input limits, tokens, authorization, and dependency hygiene.
19 min - 56Logging, Metrics & Health Checks
Make Express production-ready with structured logs, request IDs, metrics, readiness checks, and useful error context.
18 min - 57Dockerizing Node/Express
Package an Express app in Docker with small images, environment variables, health checks, compose files, and production-friendly commands.
18 min
Capstone Projects
- 58Mini Project: Full REST API
Build a complete Express REST API with folder structure, validation, controllers, services, in-memory data, errors, and pagination.
20 min - 59Mini Project: Auth API (register/login/protected routes)
Build an Express authentication API with registration, login, password hashing, JWT access tokens, protected routes, and safe responses.
20 min - 60Mini Project: Realtime Chat/Notifications Shell
Build a followable Express and Socket.IO shell for rooms, chat messages, notifications, and a tiny browser client.
20 min
Polish & Next Steps
- 61Common Node/Express Mistakes (and Fixes)
Recognize the mistakes that make Express apps fragile, slow, insecure, or hard to maintain, and learn practical fixes.
15 min - 62Ecosystem: Nest, Fastify, tRPC & When to Switch
Compare Express with NestJS, Fastify, tRPC, and other backend tools so you can choose the right framework for the project.
14 min - 63Building a Backend Portfolio
Turn Node and Express skills into portfolio projects that show architecture, production thinking, tests, and deployment ability.
13 min - 64Node/Express with Next.js Frontends
Connect Express APIs to Next.js frontends with environment variables, cookies, CORS, server-side fetching, and deployment boundaries.
16 min - 65What to Learn After Node/Express
Choose the next backend skills after Express: databases, TypeScript depth, testing, cloud, architecture, security, and distributed systems.
12 min