# lycorecoil/ccva-c3m architecture

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

- Interactive diagram: https://gitdiagram.com/lycorecoil/ccva-c3m
- Repository: https://github.com/lycorecoil/ccva-c3m

## Overview

C3M is a mobile-money payment and caisse-management system, with a customer payment portal, an offline-capable staff PWA, and a backend that also supports station/account administration, reporting, notifications, audit, and support. The customer journey is operator and service selection, payment details and OTP confirmation, then success/receipt; staff can manage caisse operations and synchronize offline payments. The tree and sampled controllers establish key responsibilities, but no README or route wiring was supplied, so uncertain frontend-to-backend and unsampled service relationships are omitted.

Main entry points: [`backend/src/sync/sync.controller.js`](https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/sync/sync.controller.js) (Offline sync API), [`backend/src/payments/payment.service.js`](https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/payments/payment.service.js) (Payment processing), [`backend/src/payments/payment.controller.js`](https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/payments/payment.controller.js) (Payment API), [`backend/src/reports/reports.controller.js`](https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/reports/reports.controller.js) (Reports)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer portal"]
  node_portal_app["Portal app<br/>[App.jsx]"]
  node_choose_operator["Choose operator<br/>[ChooseOperator.jsx]"]
  node_choose_service["Choose service<br/>[ChooseService.jsx]"]
  node_payment_form["Payment details<br/>[PaymentForm.jsx]"]
  node_otp_confirm["OTP confirmation<br/>[OtpConfirm.jsx]"]
  node_success["Payment success<br/>[Success.jsx]"]
  node_portal_api["Portal API client<br/>[api.service.js]"]
end

subgraph group_staff["Staff PWA"]
  node_pwa_app["Staff app<br/>[App.jsx]"]
  node_offline_entry["Offline entry<br/>[OfflineEntry.jsx]"]
  node_offline_queue["Offline queue<br/>[queue.js]"]
  node_pwa_api["PWA API client<br/>[api.service.js]"]
end

subgraph group_payments["Payments backend"]
  node_sync_controller["Offline sync API<br/>[sync.controller.js]"]
  node_sync_service["Offline sync<br/>[sync.service.js]"]
  node_caisse["Caisse operations<br/>[caisses.service.js]"]
  node_payment_controller["Payment API"]
  node_payment_service["Payment processing<br/>[payment.service.js]"]
  node_operators["Operator adapters"]
end

subgraph group_operations["Operations backend"]
  node_auth["Authentication<br/>[auth.service.js]"]
  node_accounts["Accounts"]
  node_stations["Stations"]
  node_services["Service catalog"]
  node_reports["Reports"]
  node_notifications["Notifications"]
  node_audit["Audit log<br/>[audit.service.js]"]
  node_support["Support tools<br/>[support.service.js]"]
end

subgraph group_infra["Runtime infrastructure"]
  node_db[("Database pool<br/>[pool.js]")]
  node_socket["Realtime sockets<br/>[socket.js]"]
end

node_customer(("Customer"))
node_staff_user(("Staff user"))

node_customer -->|"uses"| node_portal_app
node_staff_user -->|"uses"| node_pwa_app
node_payment_controller -->|"invokes"| node_payment_service
node_sync_controller -->|"invokes"| node_sync_service
node_sync_controller -->|"finds caisse"| node_caisse
node_sync_controller -->|"records action"| node_audit
node_payment_service -.->|"operator selection"| node_operators
node_reports --> node_db

click node_portal_app "https://github.com/lycorecoil/ccva-c3m/blob/main/portail-client/src/App.jsx"
click node_choose_operator "https://github.com/lycorecoil/ccva-c3m/blob/main/portail-client/src/pages/ChooseOperator.jsx"
click node_choose_service "https://github.com/lycorecoil/ccva-c3m/blob/main/portail-client/src/pages/ChooseService.jsx"
click node_payment_form "https://github.com/lycorecoil/ccva-c3m/blob/main/portail-client/src/pages/PaymentForm.jsx"
click node_otp_confirm "https://github.com/lycorecoil/ccva-c3m/blob/main/portail-client/src/pages/OtpConfirm.jsx"
click node_success "https://github.com/lycorecoil/ccva-c3m/blob/main/portail-client/src/pages/Success.jsx"
click node_portal_api "https://github.com/lycorecoil/ccva-c3m/blob/main/portail-client/src/services/api.service.js"
click node_pwa_app "https://github.com/lycorecoil/ccva-c3m/blob/main/frontend-pwa/src/App.jsx"
click node_offline_entry "https://github.com/lycorecoil/ccva-c3m/blob/main/frontend-pwa/src/pages/OfflineEntry.jsx"
click node_offline_queue "https://github.com/lycorecoil/ccva-c3m/blob/main/frontend-pwa/src/offline/queue.js"
click node_pwa_api "https://github.com/lycorecoil/ccva-c3m/blob/main/frontend-pwa/src/services/api.service.js"
click node_auth "https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/auth/auth.service.js"
click node_accounts "https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/accounts/accounts.service.js"
click node_stations "https://github.com/lycorecoil/ccva-c3m/tree/main/backend/src/stations"
click node_services "https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/services/services.service.js"
click node_reports "https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/reports/reports.controller.js"
click node_notifications "https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/notifications/notifications.service.js"
click node_audit "https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/audit/audit.service.js"
click node_support "https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/support/support.service.js"
click node_sync_controller "https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/sync/sync.controller.js"
click node_sync_service "https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/sync/sync.service.js"
click node_caisse "https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/caisses/caisses.service.js"
click node_payment_controller "https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/payments/payment.controller.js"
click node_payment_service "https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/payments/payment.service.js"
click node_operators "https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/operators/operator.factory.js"
click node_db "https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/db/pool.js"
click node_socket "https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/realtime/socket.js"

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_portal_app,node_choose_operator,node_choose_service,node_payment_form,node_otp_confirm,node_success,node_portal_api,node_staff_user toneBlue
class node_pwa_app,node_offline_entry,node_offline_queue,node_pwa_api toneAmber
class node_sync_controller,node_sync_service,node_caisse,node_payment_controller,node_payment_service,node_operators toneMint
class node_auth,node_accounts,node_stations,node_services,node_reports,node_notifications,node_audit,node_support toneRose
class node_db,node_socket,node_customer toneIndigo
```

## Components

### Customer portal

- [Portal app](https://github.com/lycorecoil/ccva-c3m/blob/main/portail-client/src/App.jsx): `portail-client/src/App.jsx`
- [Choose operator](https://github.com/lycorecoil/ccva-c3m/blob/main/portail-client/src/pages/ChooseOperator.jsx): `portail-client/src/pages/ChooseOperator.jsx`
- [Choose service](https://github.com/lycorecoil/ccva-c3m/blob/main/portail-client/src/pages/ChooseService.jsx): `portail-client/src/pages/ChooseService.jsx`
- [Payment details](https://github.com/lycorecoil/ccva-c3m/blob/main/portail-client/src/pages/PaymentForm.jsx): `portail-client/src/pages/PaymentForm.jsx`
- [OTP confirmation](https://github.com/lycorecoil/ccva-c3m/blob/main/portail-client/src/pages/OtpConfirm.jsx): `portail-client/src/pages/OtpConfirm.jsx`
- [Payment success](https://github.com/lycorecoil/ccva-c3m/blob/main/portail-client/src/pages/Success.jsx): `portail-client/src/pages/Success.jsx`
- [Portal API client](https://github.com/lycorecoil/ccva-c3m/blob/main/portail-client/src/services/api.service.js): `portail-client/src/services/api.service.js`

### Staff PWA

- [Staff app](https://github.com/lycorecoil/ccva-c3m/blob/main/frontend-pwa/src/App.jsx): `frontend-pwa/src/App.jsx`
- [Offline entry](https://github.com/lycorecoil/ccva-c3m/blob/main/frontend-pwa/src/pages/OfflineEntry.jsx): `frontend-pwa/src/pages/OfflineEntry.jsx`
- [Offline queue](https://github.com/lycorecoil/ccva-c3m/blob/main/frontend-pwa/src/offline/queue.js): `frontend-pwa/src/offline/queue.js`
- [PWA API client](https://github.com/lycorecoil/ccva-c3m/blob/main/frontend-pwa/src/services/api.service.js): `frontend-pwa/src/services/api.service.js`

### Payments backend

- [Offline sync API](https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/sync/sync.controller.js): `backend/src/sync/sync.controller.js`
- [Offline sync](https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/sync/sync.service.js): `backend/src/sync/sync.service.js`
- [Caisse operations](https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/caisses/caisses.service.js): `backend/src/caisses/caisses.service.js`
- [Payment API](https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/payments/payment.controller.js): `backend/src/payments/payment.controller.js`
- [Payment processing](https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/payments/payment.service.js): `backend/src/payments/payment.service.js`
- [Operator adapters](https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/operators/operator.factory.js): `backend/src/operators/operator.factory.js`

### Operations backend

- [Authentication](https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/auth/auth.service.js): `backend/src/auth/auth.service.js`
- [Accounts](https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/accounts/accounts.service.js): `backend/src/accounts/accounts.service.js`
- [Stations](https://github.com/lycorecoil/ccva-c3m/tree/main/backend/src/stations): `backend/src/stations`
- [Service catalog](https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/services/services.service.js): `backend/src/services/services.service.js`
- [Reports](https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/reports/reports.controller.js): `backend/src/reports/reports.controller.js`
- [Notifications](https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/notifications/notifications.service.js): `backend/src/notifications/notifications.service.js`
- [Audit log](https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/audit/audit.service.js): `backend/src/audit/audit.service.js`
- [Support tools](https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/support/support.service.js): `backend/src/support/support.service.js`

### Runtime infrastructure

- [Database pool](https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/db/pool.js): `backend/src/db/pool.js`
- [Realtime sockets](https://github.com/lycorecoil/ccva-c3m/blob/main/backend/src/realtime/socket.js): `backend/src/realtime/socket.js`

### Other components

- **Customer**
- **Staff user**

## Connections

- Customer → Portal app: uses
- Staff user → Staff app: uses
- Payment API → Payment processing: invokes
- Offline sync API → Offline sync: invokes
- Offline sync API → Caisse operations: finds caisse
- Offline sync API → Audit log: records action
- Payment processing → Operator adapters: operator selection
- Reports → Database pool
