How amourramanantsiresy/examen-mob1-api works
Posu API is a personal-finance and project-management REST service. Users authenticate, then manage account-scoped wallets, transactions, labels, goals, configuration, subscriptions, and projects; project transactions support budget statistics and PDF reports. The sampled project path shows route dispatch, validation, service operations, REST mapping, and Prisma persistence. Other domain modules are represented from the tree and server mounts, but their internal call wiring was not sampled.
Main entry points: server.ts Express server · project-controllers.ts Project controller · project-services.ts Project services · project-routes.ts Project API
Components 21
API entry
- Express server
src/server.ts - Authentication routes
src/routes/auth-routes.ts - Security middleware
src/middlewares/security-middleware.ts
Account finance
- Wallet API
src/routes/wallet-routes.ts - Transaction API
src/routes/transaction-routes.ts - Label API
src/routes/label-routes.ts - Goal API
src/routes/goal-routes.ts - Configuration API
src/routes/configuration-routes.ts - Subscription API
src/routes/subscription-routes.ts - Domain controllers
src/controllers
Projects and reports
- Project API
src/routes/project-routes.ts - Project controller
src/controllers/project-controllers.ts - Project services
src/services/project-services.ts - PDF generation
src/utilities/pdf-generator.ts
Application core
- Domain services
src/services - Request validation
src/validator - REST mapping
src/mappers - Prisma database
src/configs/prisma-client.ts - Error handling
src/middlewares/error-handler-middleware.ts
Generated client
- TypeScript API client
clients/apis/index.ts
Other components
- API consumer
Connections 20
- API consumer → Express server: sends requests
- Express server → Authentication routes: mounts /auth
- Express server → Security middleware: protects account routes
- Express server → Wallet API: mounts wallet routes
- Express server → Transaction API: mounts transaction routes
- Express server → Label API: mounts label routes
- Express server → Goal API: mounts goal routes
- Express server → Configuration API: mounts configuration routes
- Express server → Subscription API: mounts subscription routes
- Express server → Project API: mounts project routes
- Project API → Project controller: dispatches handlers
- Project controller → Request validation: validates input
- Project controller → Project services: calls operations
- Project controller → REST mapping: maps responses
- Project controller → PDF generation: generates reports
- Project services → Prisma database: reads and writes
- Project services → Domain services: uses wallet operations
- Domain services → Prisma database: persists domain data
- Express server → Error handling: installs error handler
- API consumer → TypeScript API client: uses generated client