Node.js lets you use the JavaScript you already know on the server, and Express is still the most common way to put an HTTP API on top of it. Express is small on purpose: it gives you routing and middleware and leaves the rest to you. That is what makes it a good place to learn how a backend actually works. This course builds one API from an empty folder to a deployed service, explaining each decision instead of hiding it behind a generator.
What you'll learn
- How Node.js runs your code: the event loop, async/await and why blocking calls hurt
- Setting up a modern project: ES modules, npm scripts, environment variables and the built-in watch mode
- Routing, route parameters and organising an app into routers and controllers
- Writing and ordering middleware for logging, CORS, rate limiting and security headers
- Validating request bodies with a schema library such as Zod
- Connecting to PostgreSQL through a query builder or ORM, and running migrations
- Authentication with sessions or JSON Web Tokens, password hashing and protected routes
- Consistent error handling and HTTP status codes, including async errors in Express 5
- Testing endpoints with the built-in Node test runner or Vitest and Supertest
- Deploying the API with environment config, health checks and a process manager or container
Who it's for
- Front-end developers who want to build the API their app talks to
- Beginners to backend work who already write some JavaScript
- Freelancers who need a lightweight backend for client projects, forms and integrations
Prerequisites
- Comfortable with modern JavaScript: functions, objects, promises and async/await (our Modern JavaScript Essentials course covers this)
- Basic understanding of HTTP requests and JSON
- Node.js (current LTS) and a code editor installed
Outcomes
By the end of this course you will be able to:
- Structure an Express API so it stays readable as it grows.
- Build validated, authenticated CRUD endpoints backed by a real database.
- Handle errors consistently and return the right status codes.
- Write automated tests for your endpoints and deploy the API with a repeatable process.
Projects you'll build
- Bookings API: A REST API for a small booking system with users, services and time slots, validated with Zod and stored in PostgreSQL. Practises routing, migrations and using transactions to prevent double bookings.
- Auth and roles layer: Sign-up, login, password hashing with Argon2 or bcrypt, and role-based access so customers and admins see different data. Practises middleware, token or session handling and tests that prove one user cannot read another's records.
- Deployed, documented service: Containerise the API with Docker, add a health check, structured logs and an OpenAPI description, and deploy it to a VPS or hosting platform. Practises configuration, logging and a repeatable release.
Tools you'll use
- Node.js (current LTS) and npm
- Express 5
- Zod for validation
- PostgreSQL with Drizzle ORM or Prisma
- Vitest or the built-in node:test runner, with Supertest
- Pino, Helmet, cors and express-rate-limit
- Docker
- Postman or Bruno for manual API testing
Course outline
| Module | Topic |
|---|---|
| 1 | How Node.js works: the event loop, modules and npm |
| 2 | Project setup, environment variables and tooling |
| 3 | Express basics: routes, requests and responses |
| 4 | Middleware: logging, CORS, security headers and rate limiting |
| 5 | Request validation with schemas |
| 6 | Databases: PostgreSQL, migrations and a query layer |
| 7 | Authentication: password hashing, sessions and JWTs |
| 8 | Authorisation, roles and protecting routes |
| 9 | Error handling, logging and status codes |
| 10 | Testing endpoints with a test runner and Supertest |
| 11 | File uploads, pagination and API documentation |
| 12 | Deployment: configuration, health checks and monitoring |
FAQ
JavaScript or TypeScript?
The examples work in both. We start in JavaScript to keep the focus on how the server works, then show how to add TypeScript once the structure is in place.
Why Express and not a newer framework?
Express is widely used, well documented and minimal, so you learn the concepts every Node framework shares. Once you are comfortable, moving to a more opinionated option such as NestJS is straightforward (see NestJS Backend Development with TypeScript).
Do I need to know SQL?
A little helps. We explain the queries we use, and SQL and PostgreSQL Essentials goes deeper if you want it.
What mistakes do people make in their first Express API?
Skipping input validation, putting database queries directly in route handlers, returning 200 for errors and leaking stack traces in production. Each has a module that shows the fix and a test that catches it if it comes back.
How do I join?
Get in touch and we'll share the current format, schedule and enrolment details.