Architecture Map
Budgeti backend follows a layered architecture where each layer has clear ownership:
- Product context: Budgeti is a mobile-first finance app with AI-assisted capture.
- Documentation scope here: backend implementation map for the currently ready component.
Layer map
Section titled “Layer map”Presentation: Express routes, controllers, and HTTP middlewares.Application: use-case orchestration and service ports.Domain: entities, invariants, and repository interfaces.Infrastructure: Prisma repositories, external service adapters, logging.Shared: cross-cutting errors, schemas, types, and utilities.
Request path example
Section titled “Request path example”POST /api/v1/wallet flows through these files:
backend/src/Presentation/Routes/WalletRoutes.tsbackend/src/Presentation/Controllers/WalletController.tsbackend/src/Application/UseCases/Wallet/CreateWalletImpl.tsbackend/src/Infrastructure/Repositories/Prisma/WalletRepositoryImpl.ts
Composition root
Section titled “Composition root”- All bindings live in
backend/src/Containers/inversify.config.ts. - Symbol registry is declared in
backend/src/Containers/Types.ts.
Error and response model
Section titled “Error and response model”- Canonical error definition and status map:
backend/src/Shared/Errors.ts. - Error serialization middleware:
backend/src/Presentation/Middlewares/errorsMiddleware.ts.
Health and readiness
Section titled “Health and readiness”- Lightweight liveness endpoint:
GET /healthinbackend/src/app.ts.