Context

NestJS makes a module a decorated class with imports/providers/exports arrays. That descriptor exists to feed an IoC container. Without a container, the descriptor has no job.

Decision

A module is a directory under app/. Its public surface is whatever its index.ts re-exports; its HTTP surface is whatever routes.ts exports. No defineModule() registration object is required.

Consequences

Zero ceremony to declare a module — make a folder. The "module graph" is just the import graph. Cost: conventions (file names, the app/ root) are load-bearing; the build must know them.

Patties design specifications · a design exploration · All decisions