Architecture
One deployable application with strong internal boundaries. Module ownership, pragmatic DDD, and why Ninaku is not a set of microservices.
Read the baseline
A modular monolith on NestJS and PostgreSQL. Every contract here is enforced by executable checks run before every merge, and the API reference is generated from the running service — not written by hand.
| If you are | Start with | Then read |
|---|---|---|
| New to the codebase | Architecture | Domain map |
| Building or changing an endpoint | Foundation HTTP contract | API and schema discipline |
| Understanding how the system flows | System flows | Client integration |
| Integrating against the API | Client integration | API reference |
| Looking for a past decision | Decisions | Roadmap |
The service exposes 292 operations on 238 paths, counted from docs/generated/openapi.json (the client integration guide shows the count per group and the command that recounts it):
The two health probes stay unversioned and unprefixed on purpose, because Railway's healthcheck depends on that exact path; they are outside the data envelope. Every other route is under /api/v1/.
Not built yet: payments, till and cash, credit, promotions, price dimensions, quotas and availability, supply-route administration and receiving over REST. Receiving with serials, supply routes and the stock ledger exist in the database without a REST route. E-invoicing and country tax calculation belong to an external service. Each flow with a diagram: System flows; details: Client integration.
docs/generated/openapi.json is produced by npm run openapi:generate from the running application and its Zod schemas, then verified byte for byte by npm run openapi:check. It is never edited by hand.