Node.js and Express 5: build and secure a REST API

Routes, validation with Zod, PostgreSQL with Prisma, authentication, security middleware, testing and deployment for a real API

7 ratings 3,240 students Sample

Created by Amara Okafor

  • Updated September 2026
  • English
  • Beginner

What you will learn

  • Build REST endpoints with Express 5 routers and middleware
  • Validate input with Zod and return consistent JSON errors
  • Model and query PostgreSQL data with Prisma
  • Implement sign up and sign in with hashed passwords and protected routes
  • Apply security middleware and rate limiting correctly
  • Test endpoints with Supertest and deploy the API

Course content

5 sections, 24 lessons, 4h 5m total

Node.js and Express basics 5 lessons · 50 min
  • Video: How a Node.js server works Preview 8 min
  • Article: Your first Express 5 server Preview 12 min
  • Article: Routers, middleware and error handling 13 min
  • Article: Validating input with Zod 12 min
  • Quiz: Check your understanding 5 min
Data with PostgreSQL and Prisma 5 lessons · 55 min
  • Video: Setting up PostgreSQL and Prisma 10 min
  • Video: Modelling recipes, ingredients and tags 13 min
  • Video: Migrations in development and production 10 min
  • Video: CRUD queries and pagination 13 min
  • Article: Transactions and data integrity 9 min
Authentication and authorisation 4 lessons · 44 min
  • Video: Sign up with hashed passwords 11 min
  • Video: Sessions or tokens 11 min
  • Video: Protecting routes and ownership checks 12 min
  • Video: Password reset flow 10 min
Security essentials 4 lessons · 39 min
  • Article: Helmet and CORS configured properly 9 min
  • Video: Rate limiting and brute force protection 10 min
  • Video: Common vulnerabilities and how we avoid them 12 min
  • Article: Keeping dependencies safe 8 min
Testing, logging and deployment 6 lessons · 57 min
  • Video: Testing with node:test and Supertest 13 min
  • Video: Structured logging with pino 9 min
  • Article: Migrating from Express 4 8 min
  • Video: Documenting the API with OpenAPI 10 min
  • Video: Deploying the API 12 min
  • Quiz: Final check 5 min

Requirements

  • JavaScript including async await
  • Node.js 22 or newer installed
  • Docker for running PostgreSQL locally, or a hosted database

Description

Node.js lets JavaScript developers build servers with the language they already know, and Express is still the most widely used way to do it. Express 5, the current major version, finally handles errors thrown in async route handlers natively, which removes one of the most common sources of crashed servers and hanging requests.

In this course you build Recipebox, a REST API for saving and sharing recipes. It has users, recipes, ingredients, tags and public collections. We start with a single file and end with a structured, tested and deployed API.

What you will learn

  • How Node.js runs server code, and the tools built into modern Node
  • Express 5 routing, middleware and error handling
  • Request validation with Zod and consistent error responses
  • PostgreSQL with Prisma: schema, migrations and queries
  • Authentication with hashed passwords and sessions or tokens
  • Security essentials: Helmet, CORS, rate limiting and input limits
  • Testing with the Node test runner and Supertest
  • Logging, configuration and deployment

Who this is for

You know JavaScript, including functions, objects, arrays and async await, and you want to build back ends. No previous server experience is required. Every concept, such as middleware, status codes and database migrations, is explained when we first need it.

By the end, you will understand every line of a small but realistic API, and you will know the security basics that many tutorials skip.

Who this course is for

  • Front end developers moving into back end work
  • JavaScript learners building their first server
  • Developers updating older Express 4 projects to Express 5

Instructor

Amara Okafor

Full stack JavaScript developer teaching React, Next.js and Node through real projects

  • 4.5 instructor rating
  • 22 reviews
  • 9,044 students
  • 3 courses
  • Sample

I build web applications for small product teams, mostly with React, Next.js, Node.js and PostgreSQL. Most of my week goes into the unglamorous parts: data fetching, forms, auth, error states and deployments that do not break on a Friday.

My courses follow one project from an empty folder to a deployed app. I explain why a pattern exists before I show it, and I leave my mistakes in when they teach something useful.

Outside client work I mentor junior developers and review a lot of pull requests, which is where most of my lesson ideas come from.

View profile

Student reviews

4.4 7 ratings
5 star 57%
4 star 29%
3 star 14%
2 star 0%
1 star 0%
Aisha F. Sep 27, 2026
Sample

Every line made sense

Starting from one file and growing the structure step by step made everything easy to follow.

Gabriela M. Sep 14, 2026
Sample

Perfect first backend course

I am a front end developer and this was the clearest path into backend work I have found.

Stefan K. Aug 15, 2026
Sample

Security section is excellent

Ownership checks, rate limiting and the OWASP walkthrough are things most tutorials skip entirely.

Nkechi E. Jul 7, 2026
Sample

Great intro to Express 5

The async error handling explanation was very helpful. Prisma section could include more advanced queries.

Ravi P. May 28, 2026
Sample

Zod validation middleware is gold

The reusable validation middleware now protects every route in my project.

Hannah W. Apr 24, 2026
Sample

Upgraded our app from Express 4

The migration checklist saved us a lot of time. Smooth upgrade with only one surprise.

Leon D. Mar 5, 2026
Sample

I wanted TypeScript throughout

Good content, but I would have preferred TypeScript throughout instead of plain JavaScript.

$39.99 Enroll now
SampleSample catalog: the instructors, courses, reviews and stats on this site are demo content.