Skip to content
DevTrail

Express & REST APIs with TypeScript

Build real REST APIs with Express 5 and TypeScript, from first route to Docker.

modules
6
topics
51
exercises
162
of practice
42 h 15 min

About this course

Design and build production-style REST APIs with Express 5 and TypeScript in very easy English: routing, middleware, validation with Zod, errors, testing, PostgreSQL with Drizzle, auth, security, uploads, real-time, Redis, jobs, observability and Docker, then finish with projects.

What you'll learn

6 modules and 51 topics. Every topic has short lessons, a quiz, hands-on exercises checked in your browser, and interview questions.

Includes 15 editor tasks: you write the code in your own editor and push it to your practice repo on GitHub, and the task is marked done. How it works

  1. 1REST and HTTP API Design Essentials

    Design clean HTTP APIs: resources and URLs, methods, status codes, JSON shapes, pagination, versioning and OpenAPI.

    • Resources, Collections and URLs
    • Methods, Safety and Idempotency
    • Status Codes for APIs
    • Request and Response Shapes
    • Pagination, Filtering and Sorting
    • Versioning and Evolving an API
    • OpenAPI at a Glance
    • Project: Orders API Contract
    • REST and HTTP API Design Essentials — assessment
  2. 2Your First Express App and Routing

    Build your first Express 5 app in TypeScript: routes, path syntax, params and query, body parsing and routers.

    • Your First Express App
    • Routes and Responses
    • Express 5 Path Syntax
    • Route Params and the Query String
    • Parsing Request Bodies
    • Routers and Mounting
    • Typing Requests and Responses
    • Project: Product Catalogue API
    • Your First Express App and Routing — assessment
  3. 3Middleware

    How middleware works in Express 5: order and next, writing your own, async handlers and error middleware.

    • What Middleware Is
    • Middleware Order and next
    • Writing Your Own Middleware
    • Async Handlers in Express 5
    • Error-Handling Middleware
    • Common Middleware: Static Files, Cookies, Compression
    • Project: Middleware for the Catalogue API
    • Middleware — assessment
  4. 4Validation with Zod

    Validate bodies, params and queries with Zod 4 and get typed handlers from one schema.

    • Why Validate at the Edge
    • Zod Schemas: Describing Your Data
    • parse, safeParse and Error Messages
    • Coercion and Query Strings
    • A validate() Middleware
    • Transforms, Refinements and Pipes
    • Shared Schemas and Types
    • Project: Validate the Catalogue API
    • Validation with Zod — assessment
  5. 5Error Handling and Problem Details

    Error classes, a central error handler and RFC 9457 problem details for every failure.

    • Error Classes for HTTP APIs
    • Problem Details (RFC 9457)
    • One Central Error Handler
    • Not Found and Method Not Allowed
    • Errors from Databases and Other Services
    • Safe Error Responses and Logging
    • Project: Problem Details for the Catalogue API
    • Error Handling and Problem Details — assessment
  6. 6Project Structure and Configuration

    Controllers, services and repositories, dependency injection by hand and typed configuration from the environment.

    • Controllers, Services and Repositories
    • Dependency Injection by Hand
    • Repository Interfaces and In-Memory Implementations
    • Typed Configuration from the Environment
    • Folder Structure: by Feature or by Layer
    • TypeScript Build Setup for Node
    • Project: Refactor the Orders API into Layers
    • Project Structure and Configuration — assessment