Lesson 3 / 33

Project Structure

How NestJS organizes code into modules, controllers, and services.

Folder layout

Each feature lives in its own folder with its module, controller, and service.

src/
  main.ts
  app.module.ts
  users/
    users.module.ts
    users.controller.ts
    users.service.ts
  posts/
    posts.module.ts
    posts.controller.ts
    posts.service.ts

Module = a slice of the app

A module groups related controllers and services. The root AppModule imports all feature modules; the app assembles them into a tree.