# amourramanantsiresy/examen-mob1-api architecture

> Architecture diagram of the GitHub repository amourramanantsiresy/examen-mob1-api, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/amourramanantsiresy/examen-mob1-api
- Repository: https://github.com/amourramanantsiresy/examen-mob1-api

## Overview

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: [`src/server.ts`](https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/server.ts) (Express server), [`src/controllers/project-controllers.ts`](https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/controllers/project-controllers.ts) (Project controller), [`src/services/project-services.ts`](https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/services/project-services.ts) (Project services), [`src/routes/project-routes.ts`](https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/routes/project-routes.ts) (Project API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["API entry"]
  node_server["Express server<br/>[server.ts]"]
  node_auth["Authentication routes<br/>[auth-routes.ts]"]
  node_security["Security middleware"]
end

subgraph group_account["Account finance"]
  node_wallet["Wallet API<br/>[wallet-routes.ts]"]
  node_transactions["Transaction API"]
  node_labels["Label API<br/>[label-routes.ts]"]
  node_goals["Goal API<br/>[goal-routes.ts]"]
  node_configuration["Configuration API"]
  node_subscriptions["Subscription API"]
  node_controllers["Domain controllers"]
end

subgraph group_projects["Projects and reports"]
  node_projects["Project API<br/>[project-routes.ts]"]
  node_project_controller["Project controller"]
  node_project_service["Project services"]
  node_pdf["PDF generation<br/>[pdf-generator.ts]"]
end

subgraph group_core["Application core"]
  node_services["Domain services"]
  node_validators["Request validation"]
  node_mappers["REST mapping"]
  node_database[("Prisma database<br/>[prisma-client.ts]")]
  node_errors["Error handling"]
end

subgraph group_client["Generated client"]
  node_sdk["TypeScript API client<br/>[index.ts]"]
end

node_user(("API consumer"))

node_user -->|"sends requests"| node_server
node_server -->|"mounts /auth"| node_auth
node_server -->|"protects account routes"| node_security
node_server -->|"mounts wallet routes"| node_wallet
node_server -->|"mounts transaction routes"| node_transactions
node_server -->|"mounts label routes"| node_labels
node_server -->|"mounts goal routes"| node_goals
node_server -->|"mounts configuration routes"| node_configuration
node_server -->|"mounts subscription routes"| node_subscriptions
node_server -->|"mounts project routes"| node_projects
node_projects -->|"dispatches handlers"| node_project_controller
node_project_controller -->|"validates input"| node_validators
node_project_controller -->|"calls operations"| node_project_service
node_project_controller -->|"maps responses"| node_mappers
node_project_controller -->|"generates reports"| node_pdf
node_project_service -->|"reads and writes"| node_database
node_project_service -->|"uses wallet operations"| node_services
node_services -->|"persists domain data"| node_database
node_server -->|"installs error handler"| node_errors
node_user -.->|"uses generated client"| node_sdk

click node_server "https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/server.ts"
click node_auth "https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/routes/auth-routes.ts"
click node_security "https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/middlewares/security-middleware.ts"
click node_wallet "https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/routes/wallet-routes.ts"
click node_transactions "https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/routes/transaction-routes.ts"
click node_labels "https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/routes/label-routes.ts"
click node_goals "https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/routes/goal-routes.ts"
click node_configuration "https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/routes/configuration-routes.ts"
click node_subscriptions "https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/routes/subscription-routes.ts"
click node_projects "https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/routes/project-routes.ts"
click node_project_controller "https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/controllers/project-controllers.ts"
click node_project_service "https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/services/project-services.ts"
click node_pdf "https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/utilities/pdf-generator.ts"
click node_controllers "https://github.com/amourramanantsiresy/examen-mob1-api/tree/dev/src/controllers"
click node_services "https://github.com/amourramanantsiresy/examen-mob1-api/tree/dev/src/services"
click node_validators "https://github.com/amourramanantsiresy/examen-mob1-api/tree/dev/src/validator"
click node_mappers "https://github.com/amourramanantsiresy/examen-mob1-api/tree/dev/src/mappers"
click node_database "https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/configs/prisma-client.ts"
click node_errors "https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/middlewares/error-handler-middleware.ts"
click node_sdk "https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/clients/apis/index.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_server,node_auth,node_security toneBlue
class node_wallet,node_transactions,node_labels,node_goals,node_configuration,node_subscriptions,node_controllers toneAmber
class node_projects,node_project_controller,node_project_service,node_pdf,node_user toneMint
class node_services,node_validators,node_mappers,node_database,node_errors toneRose
class node_sdk toneIndigo
```

## Components

### API entry

- [Express server](https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/server.ts): `src/server.ts`
- [Authentication routes](https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/routes/auth-routes.ts): `src/routes/auth-routes.ts`
- [Security middleware](https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/middlewares/security-middleware.ts): `src/middlewares/security-middleware.ts`

### Account finance

- [Wallet API](https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/routes/wallet-routes.ts): `src/routes/wallet-routes.ts`
- [Transaction API](https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/routes/transaction-routes.ts): `src/routes/transaction-routes.ts`
- [Label API](https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/routes/label-routes.ts): `src/routes/label-routes.ts`
- [Goal API](https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/routes/goal-routes.ts): `src/routes/goal-routes.ts`
- [Configuration API](https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/routes/configuration-routes.ts): `src/routes/configuration-routes.ts`
- [Subscription API](https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/routes/subscription-routes.ts): `src/routes/subscription-routes.ts`
- [Domain controllers](https://github.com/amourramanantsiresy/examen-mob1-api/tree/dev/src/controllers): `src/controllers`

### Projects and reports

- [Project API](https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/routes/project-routes.ts): `src/routes/project-routes.ts`
- [Project controller](https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/controllers/project-controllers.ts): `src/controllers/project-controllers.ts`
- [Project services](https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/services/project-services.ts): `src/services/project-services.ts`
- [PDF generation](https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/utilities/pdf-generator.ts): `src/utilities/pdf-generator.ts`

### Application core

- [Domain services](https://github.com/amourramanantsiresy/examen-mob1-api/tree/dev/src/services): `src/services`
- [Request validation](https://github.com/amourramanantsiresy/examen-mob1-api/tree/dev/src/validator): `src/validator`
- [REST mapping](https://github.com/amourramanantsiresy/examen-mob1-api/tree/dev/src/mappers): `src/mappers`
- [Prisma database](https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/configs/prisma-client.ts): `src/configs/prisma-client.ts`
- [Error handling](https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/src/middlewares/error-handler-middleware.ts): `src/middlewares/error-handler-middleware.ts`

### Generated client

- [TypeScript API client](https://github.com/amourramanantsiresy/examen-mob1-api/blob/dev/clients/apis/index.ts): `clients/apis/index.ts`

### Other components

- **API consumer**

## Connections

- 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
