# antso-niaina/madavola architecture

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

- Interactive diagram: https://gitdiagram.com/antso-niaina/madavola
- Repository: https://github.com/antso-niaina/madavola

## Overview

MadaVola is a role-based mobile-wallet application with a React web client and Django backend. Users authenticate (including OTP), then clients can inspect balances and history, send money, pay by QR, and perform cash operations; merchants manage QR sales and withdrawals; administrators review validations, users, transactions, and reports. The frontend dashboard source confirms wallet and transaction-history reads through the API service. Backend responsibilities are inferred from the app tree; backend view-to-model wiring was not sampled, and the README is empty.

Main entry points: [`madavolaWeb/src/services/api.ts`](https://github.com/antso-niaina/madavola/blob/main/madavolaWeb/src/services/api.ts) (API client), [`madavolaWeb/src/App.tsx`](https://github.com/antso-niaina/madavola/blob/main/madavolaWeb/src/App.tsx) (Route application), [`madavolaWeb/src/pages/auth/OTP.tsx`](https://github.com/antso-niaina/madavola/blob/main/madavolaWeb/src/pages/auth/OTP.tsx) (Login and OTP), [`madavolaWeb/src/pages/client/ClientDashboard.tsx`](https://github.com/antso-niaina/madavola/blob/main/madavolaWeb/src/pages/client/ClientDashboard.tsx) (Client pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Route application<br/>[App.tsx]"]
  node_authpages["Login and OTP<br/>[OTP.tsx]"]
  node_clientpages["Client pages"]
  node_merchantpages["Merchant pages"]
  node_adminpages["Admin pages"]
  node_api["API client<br/>[api.ts]"]
end

subgraph group_identity["Identity and accounts"]
  node_authstate["Session state<br/>[useAuthStore.tsx]"]
  node_authbackend["Authentication endpoints<br/>[views.py]"]
  node_accountbackend["Account endpoints<br/>[views.py]"]
  node_accountdata[("Account records<br/>[models.py]")]
end

subgraph group_wallet["Wallet operations"]
  node_walletbackend["Wallet endpoints<br/>[views.py]"]
  node_walletdata[("Wallet records<br/>[models.py]")]
  node_txbackend["Transaction endpoints<br/>[views.py]"]
  node_txdata[("Transaction records<br/>[models.py]")]
end

subgraph group_merchant["Merchant services"]
  node_merchantbackend["Merchant endpoints<br/>[views.py]"]
  node_merchantdata[("Merchant records<br/>[models.py]")]
end

subgraph group_admin["Administration"]
  node_statsbackend["Admin statistics<br/>[views.py]"]
  node_statsdata[("Statistics records<br/>[models.py]")]
end

node_user(("User"))

node_user -->|"opens"| node_app
node_app -->|"routes"| node_authpages
node_app -->|"routes"| node_clientpages
node_app -->|"routes"| node_merchantpages
node_app -->|"routes"| node_adminpages
node_authpages -->|"requests"| node_api
node_authpages -->|"sets session"| node_authstate
node_authstate -->|"loads profile"| node_api
node_clientpages -->|"reads wallet"| node_api
node_clientpages -->|"reads history"| node_api
node_merchantpages -->|"requests"| node_api
node_adminpages -->|"requests"| node_api
node_api -->|"calls"| node_authbackend
node_api -->|"calls"| node_accountbackend
node_api -->|"calls"| node_walletbackend
node_api -->|"calls"| node_txbackend
node_api -->|"calls"| node_merchantbackend
node_api -->|"calls"| node_statsbackend
node_authbackend -->|"accesses"| node_accountdata
node_accountbackend -->|"accesses"| node_accountdata
node_walletbackend -->|"accesses"| node_walletdata
node_txbackend -->|"accesses"| node_txdata
node_merchantbackend -->|"accesses"| node_merchantdata
node_statsbackend -->|"accesses"| node_statsdata

click node_app "https://github.com/antso-niaina/madavola/blob/main/madavolaWeb/src/App.tsx"
click node_authpages "https://github.com/antso-niaina/madavola/blob/main/madavolaWeb/src/pages/auth/OTP.tsx"
click node_clientpages "https://github.com/antso-niaina/madavola/blob/main/madavolaWeb/src/pages/client/ClientDashboard.tsx"
click node_merchantpages "https://github.com/antso-niaina/madavola/tree/main/madavolaWeb/src/pages/merchant"
click node_adminpages "https://github.com/antso-niaina/madavola/tree/main/madavolaWeb/src/pages/admin"
click node_authstate "https://github.com/antso-niaina/madavola/blob/main/madavolaWeb/src/hooks/useAuthStore.tsx"
click node_api "https://github.com/antso-niaina/madavola/blob/main/madavolaWeb/src/services/api.ts"
click node_authbackend "https://github.com/antso-niaina/madavola/blob/main/backend/authentification/views.py"
click node_accountbackend "https://github.com/antso-niaina/madavola/blob/main/backend/compte/views.py"
click node_accountdata "https://github.com/antso-niaina/madavola/blob/main/backend/compte/models.py"
click node_walletbackend "https://github.com/antso-niaina/madavola/blob/main/backend/portfeuilles/views.py"
click node_walletdata "https://github.com/antso-niaina/madavola/blob/main/backend/portfeuilles/models.py"
click node_txbackend "https://github.com/antso-niaina/madavola/blob/main/backend/transaction/views.py"
click node_txdata "https://github.com/antso-niaina/madavola/blob/main/backend/transaction/models.py"
click node_merchantbackend "https://github.com/antso-niaina/madavola/blob/main/backend/commercants/views.py"
click node_merchantdata "https://github.com/antso-niaina/madavola/blob/main/backend/commercants/models.py"
click node_statsbackend "https://github.com/antso-niaina/madavola/blob/main/backend/statsAdmin/views.py"
click node_statsdata "https://github.com/antso-niaina/madavola/blob/main/backend/statsAdmin/models.py"

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_authpages,node_clientpages,node_merchantpages,node_adminpages,node_api,node_user toneBlue
class node_authstate,node_authbackend,node_accountbackend,node_accountdata toneAmber
class node_walletbackend,node_walletdata,node_txbackend,node_txdata toneMint
class node_merchantbackend,node_merchantdata toneRose
class node_statsbackend,node_statsdata toneIndigo
```

## Components

### Web application

- [Route application](https://github.com/antso-niaina/madavola/blob/main/madavolaWeb/src/App.tsx): `madavolaWeb/src/App.tsx`
- [Login and OTP](https://github.com/antso-niaina/madavola/blob/main/madavolaWeb/src/pages/auth/OTP.tsx): `madavolaWeb/src/pages/auth/OTP.tsx`
- [Client pages](https://github.com/antso-niaina/madavola/blob/main/madavolaWeb/src/pages/client/ClientDashboard.tsx): `madavolaWeb/src/pages/client/ClientDashboard.tsx`
- [Merchant pages](https://github.com/antso-niaina/madavola/tree/main/madavolaWeb/src/pages/merchant): `madavolaWeb/src/pages/merchant`
- [Admin pages](https://github.com/antso-niaina/madavola/tree/main/madavolaWeb/src/pages/admin): `madavolaWeb/src/pages/admin`
- [API client](https://github.com/antso-niaina/madavola/blob/main/madavolaWeb/src/services/api.ts): `madavolaWeb/src/services/api.ts`

### Identity and accounts

- [Session state](https://github.com/antso-niaina/madavola/blob/main/madavolaWeb/src/hooks/useAuthStore.tsx): `madavolaWeb/src/hooks/useAuthStore.tsx`
- [Authentication endpoints](https://github.com/antso-niaina/madavola/blob/main/backend/authentification/views.py): `backend/authentification/views.py`
- [Account endpoints](https://github.com/antso-niaina/madavola/blob/main/backend/compte/views.py): `backend/compte/views.py`
- [Account records](https://github.com/antso-niaina/madavola/blob/main/backend/compte/models.py): `backend/compte/models.py`

### Wallet operations

- [Wallet endpoints](https://github.com/antso-niaina/madavola/blob/main/backend/portfeuilles/views.py): `backend/portfeuilles/views.py`
- [Wallet records](https://github.com/antso-niaina/madavola/blob/main/backend/portfeuilles/models.py): `backend/portfeuilles/models.py`
- [Transaction endpoints](https://github.com/antso-niaina/madavola/blob/main/backend/transaction/views.py): `backend/transaction/views.py`
- [Transaction records](https://github.com/antso-niaina/madavola/blob/main/backend/transaction/models.py): `backend/transaction/models.py`

### Merchant services

- [Merchant endpoints](https://github.com/antso-niaina/madavola/blob/main/backend/commercants/views.py): `backend/commercants/views.py`
- [Merchant records](https://github.com/antso-niaina/madavola/blob/main/backend/commercants/models.py): `backend/commercants/models.py`

### Administration

- [Admin statistics](https://github.com/antso-niaina/madavola/blob/main/backend/statsAdmin/views.py): `backend/statsAdmin/views.py`
- [Statistics records](https://github.com/antso-niaina/madavola/blob/main/backend/statsAdmin/models.py): `backend/statsAdmin/models.py`

### Other components

- **User**

## Connections

- User → Route application: opens
- Route application → Login and OTP: routes
- Route application → Client pages: routes
- Route application → Merchant pages: routes
- Route application → Admin pages: routes
- Login and OTP → API client: requests
- Login and OTP → Session state: sets session
- Session state → API client: loads profile
- Client pages → API client: reads wallet
- Client pages → API client: reads history
- Merchant pages → API client: requests
- Admin pages → API client: requests
- API client → Authentication endpoints: calls
- API client → Account endpoints: calls
- API client → Wallet endpoints: calls
- API client → Transaction endpoints: calls
- API client → Merchant endpoints: calls
- API client → Admin statistics: calls
- Authentication endpoints → Account records: accesses
- Account endpoints → Account records: accesses
- Wallet endpoints → Wallet records: accesses
- Transaction endpoints → Transaction records: accesses
- Merchant endpoints → Merchant records: accesses
- Admin statistics → Statistics records: accesses
