- Fastify
- TypeORM
- SQLite for the control plane
- SQLite and libsql for managed databases
cd backend
npm install
npm run buildnpm run dev- development servernpm run build- TypeScript buildnpm run start- start compiled app
src/domain- entities and pure business rulessrc/application- use cases and orchestrationsrc/infrastructure- storage, crypto, database clients, utilitiessrc/presentation- HTTP routes, controllers, guards and plugins
- keep business rules out of controllers
- keep storage paths in one place
- avoid hidden side effects in route handlers
- validate inputs before calling use cases
- use audit logging for administrative actions
- Add or update domain entities if the model changes.
- Add application service methods.
- Add infrastructure helpers only when needed.
- Expose the feature in a controller.
- Document the endpoint in
docs/API.md. - Add migration logic if the metadata schema changes.