# MercadoDeVida backend — modular monolith skeleton TypeScript + Fastify modular monolith. Simple code, clear modules, small changes, no magic. ## Requirements - Node.js >= 22 - npm ## Commands ```bash npm install # install dependencies npm run build # compile to dist/ npm start # run compiled server (PORT, HOST env vars) npm test # vitest unit/integration tests npm run typecheck # tsc --noEmit npm run lint # eslint + prettier check npm run lint:boundaries # module boundary check ``` ## Layout ```text src/ ├── app/ # composition root (only place that wires modules) ├── infrastructure/ # http server entrypoint (later: db, redis, providers) ├── modules/ # business modules, one folder each │ └── health/ # exemplar module: public API only via index.ts └── shared/ # cross-cutting helpers (error envelope) ``` ## Module rules - A module exposes its public API only through its `index.ts`. - Files inside a module may import: own subtree, `src/shared`, Node builtins, npm packages. - Code outside modules (app/infrastructure) may import a module only via its `index.ts`. - `npm run lint:boundaries` enforces these rules.