# daoudaboye/dalal_diamm architecture

> Architecture diagram of the GitHub repository daoudaboye/dalal_diamm, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/daoudaboye/dalal_diamm
- Repository: https://github.com/daoudaboye/dalal_diamm

## Overview

Dalal Diamou is a caisse and microfinance operations platform: staff authenticate, use role-protected screens to manage cash desks, mobile-money balances, savings and loans, and close daily cash statements; managers then review discrepancies, alerts, audit history, and reports. The React frontend calls a Laravel API whose controllers apply access rules and coordinate domain models, with relational records holding operational state. The graph preserves documented dashboard, access, inventory, UV-transfer, and reporting capabilities. Source excerpts are limited, so uncertain links to unsampled feature controllers are omitted; the README supplied no capability documentation.

Main entry points: [`dalal-diamou-frontend/src/App.jsx`](https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-frontend/src/App.jsx) (Application routes), [`dalal-diamou-backend/routes/api.php`](https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/routes/api.php) (API route dispatch), [`dalal-diamou-backend/app/Http/Controllers/BilanJournalierController.php`](https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/app/Http/Controllers/BilanJournalierController.php) (Daily statement workflow), [`dalal-diamou-frontend/src/api/client.js`](https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-frontend/src/api/client.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Staff application"]
  node_app["Application routes<br/>[App.jsx]"]
  node_authui["Sign-in and session<br/>[AuthContext.jsx]"]
  node_cashui["Cash desk screens<br/>[Caisses.jsx]"]
  node_clientui["Savings and loans screens<br/>[EpargnePret.jsx]"]
  node_dashboardui["Dashboards and reports<br/>[TableauDeBord.jsx]"]
  node_adminui["Alerts and administration<br/>[Alertes.jsx]"]
  node_apiclient["API client<br/>[client.js]"]
end

subgraph group_api["API and access"]
  node_routes["API route dispatch<br/>[api.php]"]
  node_authapi["Authentication<br/>[AuthController.php]"]
  node_access["Role and service guards"]
  node_user[("User and assignments<br/>[Utilisateur.php]")]
  node_entity[("Entity and services<br/>[Entite.php]")]
end

subgraph group_cash["Cash operations"]
  node_bilanapi["Daily statement workflow"]
  node_cashmodels["Cash desk calculations<br/>[Caisse.php]"]
  node_bilanmodel[("Daily statement records")]
  node_discrepancy[("Discrepancy records<br/>[Ecart.php]")]
  node_account[("Accounts and balances<br/>[Compte.php]")]
end

subgraph group_finance["Client finance"]
  node_clientapi["Client finance API"]
  node_clientaccount[("Savings account<br/>[CompteClient.php]")]
  node_loan[("Loan records<br/>[Pret.php]")]
end

subgraph group_oversight["Administration"]
  node_alerts[("Alerts<br/>[Alerte.php]")]
  node_audit["Operation journal<br/>[JournalLogger.php]"]
  node_dashboardapi["Dashboard aggregation"]
end

node_staff(("Staff"))
node_database[("Relational database")]
node_backend(("Laravel API service"))

node_staff -->|"uses"| node_app
node_app -->|"provides session"| node_authui
node_app -->|"routes to"| node_cashui
node_app -->|"routes to"| node_clientui
node_app -->|"routes to"| node_dashboardui
node_app -->|"routes to"| node_adminui
node_cashui -.->|"requests data"| node_apiclient
node_clientui -.->|"requests data"| node_apiclient
node_dashboardui -.->|"requests data"| node_apiclient
node_adminui -.->|"requests data"| node_apiclient
node_apiclient -.->|"sends API requests"| node_backend
node_backend -->|"dispatches requests"| node_routes
node_routes -->|"routes authentication"| node_authapi
node_routes -->|"routes statements"| node_bilanapi
node_routes -->|"routes clients"| node_clientapi
node_routes -->|"routes dashboard"| node_dashboardapi
node_routes -.->|"applies guards"| node_access
node_authapi -->|"authenticates"| node_user
node_access -->|"checks profile"| node_user
node_access -->|"checks services"| node_entity
node_bilanapi -->|"calculates totals"| node_cashmodels
node_bilanapi -->|"creates statement"| node_bilanmodel
node_bilanapi -->|"records variance"| node_discrepancy
node_cashmodels -->|"reads balances"| node_account
node_clientapi -.->|"manages savings"| node_clientaccount
node_clientaccount -->|"calculates debt"| node_loan
node_bilanapi -->|"resolves alerts"| node_alerts
node_dashboardapi -->|"reads statements"| node_bilanmodel
node_dashboardapi -->|"reads cash desks"| node_cashmodels
node_dashboardapi -->|"reads accounts"| node_account
node_database -.->|"stores"| node_bilanmodel
node_database -.->|"stores"| node_clientaccount
node_database -.->|"stores"| node_loan

click node_app "https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-frontend/src/App.jsx"
click node_authui "https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-frontend/src/context/AuthContext.jsx"
click node_cashui "https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-frontend/src/pages/Caisses.jsx"
click node_clientui "https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-frontend/src/pages/EpargnePret.jsx"
click node_dashboardui "https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-frontend/src/pages/TableauDeBord.jsx"
click node_adminui "https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-frontend/src/pages/Alertes.jsx"
click node_apiclient "https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-frontend/src/api/client.js"
click node_routes "https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/routes/api.php"
click node_authapi "https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/app/Http/Controllers/Auth/AuthController.php"
click node_access "https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/app/Http/Middleware/VerifierAccesService.php"
click node_bilanapi "https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/app/Http/Controllers/BilanJournalierController.php"
click node_cashmodels "https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/app/Models/Caisse.php"
click node_bilanmodel "https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/app/Models/BilanJournalier.php"
click node_discrepancy "https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/app/Models/Ecart.php"
click node_account "https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/app/Models/Compte.php"
click node_clientapi "https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/app/Http/Controllers/ClientController.php"
click node_clientaccount "https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/app/Models/CompteClient.php"
click node_loan "https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/app/Models/Pret.php"
click node_user "https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/app/Models/Utilisateur.php"
click node_entity "https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/app/Models/Entite.php"
click node_alerts "https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/app/Models/Alerte.php"
click node_audit "https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/app/Support/JournalLogger.php"
click node_dashboardapi "https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/app/Http/Controllers/TableauDeBordController.php"

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_app,node_authui,node_cashui,node_clientui,node_dashboardui,node_adminui,node_apiclient toneBlue
class node_routes,node_authapi,node_access,node_user,node_entity,node_database toneAmber
class node_bilanapi,node_cashmodels,node_bilanmodel,node_discrepancy,node_account,node_backend toneMint
class node_clientapi,node_clientaccount,node_loan toneRose
class node_alerts,node_audit,node_dashboardapi,node_staff toneIndigo
```

## Components

### Staff application

- [Application routes](https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-frontend/src/App.jsx): `dalal-diamou-frontend/src/App.jsx`
- [Sign-in and session](https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-frontend/src/context/AuthContext.jsx): `dalal-diamou-frontend/src/context/AuthContext.jsx`
- [Cash desk screens](https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-frontend/src/pages/Caisses.jsx): `dalal-diamou-frontend/src/pages/Caisses.jsx`
- [Savings and loans screens](https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-frontend/src/pages/EpargnePret.jsx): `dalal-diamou-frontend/src/pages/EpargnePret.jsx`
- [Dashboards and reports](https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-frontend/src/pages/TableauDeBord.jsx): `dalal-diamou-frontend/src/pages/TableauDeBord.jsx`
- [Alerts and administration](https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-frontend/src/pages/Alertes.jsx): `dalal-diamou-frontend/src/pages/Alertes.jsx`
- [API client](https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-frontend/src/api/client.js): `dalal-diamou-frontend/src/api/client.js`

### API and access

- [API route dispatch](https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/routes/api.php): `dalal-diamou-backend/routes/api.php`
- [Authentication](https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/app/Http/Controllers/Auth/AuthController.php): `dalal-diamou-backend/app/Http/Controllers/Auth/AuthController.php`
- [Role and service guards](https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/app/Http/Middleware/VerifierAccesService.php): `dalal-diamou-backend/app/Http/Middleware/VerifierAccesService.php`
- [User and assignments](https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/app/Models/Utilisateur.php): `dalal-diamou-backend/app/Models/Utilisateur.php`
- [Entity and services](https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/app/Models/Entite.php): `dalal-diamou-backend/app/Models/Entite.php`

### Cash operations

- [Daily statement workflow](https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/app/Http/Controllers/BilanJournalierController.php): `dalal-diamou-backend/app/Http/Controllers/BilanJournalierController.php`
- [Cash desk calculations](https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/app/Models/Caisse.php): `dalal-diamou-backend/app/Models/Caisse.php`
- [Daily statement records](https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/app/Models/BilanJournalier.php): `dalal-diamou-backend/app/Models/BilanJournalier.php`
- [Discrepancy records](https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/app/Models/Ecart.php): `dalal-diamou-backend/app/Models/Ecart.php`
- [Accounts and balances](https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/app/Models/Compte.php): `dalal-diamou-backend/app/Models/Compte.php`

### Client finance

- [Client finance API](https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/app/Http/Controllers/ClientController.php): `dalal-diamou-backend/app/Http/Controllers/ClientController.php`
- [Savings account](https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/app/Models/CompteClient.php): `dalal-diamou-backend/app/Models/CompteClient.php`
- [Loan records](https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/app/Models/Pret.php): `dalal-diamou-backend/app/Models/Pret.php`

### Administration

- [Alerts](https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/app/Models/Alerte.php): `dalal-diamou-backend/app/Models/Alerte.php`
- [Operation journal](https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/app/Support/JournalLogger.php): `dalal-diamou-backend/app/Support/JournalLogger.php`
- [Dashboard aggregation](https://github.com/daoudaboye/dalal_diamm/blob/main/dalal-diamou-backend/app/Http/Controllers/TableauDeBordController.php): `dalal-diamou-backend/app/Http/Controllers/TableauDeBordController.php`

### Other components

- **Staff**
- **Relational database**
- **Laravel API service**

## Connections

- Staff → Application routes: uses (evidence: `dalal-diamou-frontend/src/App.jsx`)
- Application routes → Sign-in and session: provides session (evidence: `dalal-diamou-frontend/src/App.jsx`)
- Application routes → Cash desk screens: routes to (evidence: `dalal-diamou-frontend/src/App.jsx`)
- Application routes → Savings and loans screens: routes to (evidence: `dalal-diamou-frontend/src/App.jsx`)
- Application routes → Dashboards and reports: routes to (evidence: `dalal-diamou-frontend/src/App.jsx`)
- Application routes → Alerts and administration: routes to (evidence: `dalal-diamou-frontend/src/App.jsx`)
- Cash desk screens → API client: requests data
- Savings and loans screens → API client: requests data
- Dashboards and reports → API client: requests data
- Alerts and administration → API client: requests data
- API client → Laravel API service: sends API requests
- Laravel API service → API route dispatch: dispatches requests
- API route dispatch → Authentication: routes authentication (evidence: `dalal-diamou-backend/routes/api.php`)
- API route dispatch → Daily statement workflow: routes statements (evidence: `dalal-diamou-backend/routes/api.php`)
- API route dispatch → Client finance API: routes clients (evidence: `dalal-diamou-backend/routes/api.php`)
- API route dispatch → Dashboard aggregation: routes dashboard (evidence: `dalal-diamou-backend/routes/api.php`)
- API route dispatch → Role and service guards: applies guards
- Authentication → User and assignments: authenticates (evidence: `dalal-diamou-backend/app/Http/Controllers/Auth/AuthController.php`)
- Role and service guards → User and assignments: checks profile (evidence: `dalal-diamou-backend/app/Http/Middleware/VerifierAccesService.php`)
- Role and service guards → Entity and services: checks services (evidence: `dalal-diamou-backend/app/Http/Middleware/VerifierAccesService.php`)
- Daily statement workflow → Cash desk calculations: calculates totals (evidence: `dalal-diamou-backend/app/Http/Controllers/BilanJournalierController.php`)
- Daily statement workflow → Daily statement records: creates statement (evidence: `dalal-diamou-backend/app/Http/Controllers/BilanJournalierController.php`)
- Daily statement workflow → Discrepancy records: records variance (evidence: `dalal-diamou-backend/app/Http/Controllers/BilanJournalierController.php`)
- Cash desk calculations → Accounts and balances: reads balances (evidence: `dalal-diamou-backend/app/Models/Caisse.php`)
- Client finance API → Savings account: manages savings
- Savings account → Loan records: calculates debt (evidence: `dalal-diamou-backend/app/Models/CompteClient.php`)
- Daily statement workflow → Alerts: resolves alerts (evidence: `dalal-diamou-backend/app/Models/Alerte.php`)
- Dashboard aggregation → Daily statement records: reads statements (evidence: `dalal-diamou-backend/app/Http/Controllers/TableauDeBordController.php`)
- Dashboard aggregation → Cash desk calculations: reads cash desks (evidence: `dalal-diamou-backend/app/Http/Controllers/TableauDeBordController.php`)
- Dashboard aggregation → Accounts and balances: reads accounts (evidence: `dalal-diamou-backend/app/Http/Controllers/TableauDeBordController.php`)
- Relational database → Daily statement records: stores
- Relational database → Savings account: stores
- Relational database → Loan records: stores
