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

39 lines
706 B
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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.
```text
apps/api/
src/
domain/
shared/
```
Within feature modules:
```text
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:
- [`docs/architecture/api/API_DATA_FLOW.md`](docs/architecture/api/API_DATA_FLOW.md:1)