Files
gridpilot.gg/docs/architecture/api/API_FILE_STRUCTURE.md
2026-01-11 14:42:54 +01:00

706 B
Raw Blame History

API File Structure (Strict)

This document defines the canonical physical structure for apps/api/**.

It describes where code lives, not the full behavioral rules.

1) API is feature-based

The API is organized by feature modules.

apps/api/
  src/
    domain/
    shared/

Within feature modules:

apps/api/src/domain/<feature>/
  <Feature>Controller.ts
  <Feature>Service.ts
  <Feature>Module.ts
  dto/
  presenters/

2) What belongs where (strict)

  • Controllers: HTTP boundary only
  • DTOs: HTTP contracts only
  • Presenters: map Core results  response DTOs

API flow rules: