# manu-7/wallet-ledger-platform architecture

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

- Interactive diagram: https://gitdiagram.com/manu-7/wallet-ledger-platform
- Repository: https://github.com/manu-7/wallet-ledger-platform

## Overview

Wallet & Ledger is a web wallet with a FastAPI backend and React client. Users authenticate, create or view wallets, look up recipients by email, deposit, transfer, and review transaction history. Transfers and deposits create paired ledger entries; account balances are cached for reads, while scheduled reconciliation checks ledger invariants. The graph follows the documented product capabilities, but some links—particularly unsampled history and reconciliation internals—are based on README statements rather than inspected implementation details.

Main entry points: [`frontend/src/App.jsx`](https://github.com/manu-7/wallet-ledger-platform/blob/main/frontend/src/App.jsx) (Wallet interface), [`app/services/transaction_service.py`](https://github.com/manu-7/wallet-ledger-platform/blob/main/app/services/transaction_service.py) (Transfer and deposit), [`app/routers/account.py`](https://github.com/manu-7/wallet-ledger-platform/blob/main/app/routers/account.py) (Account routes), [`app/main.py`](https://github.com/manu-7/wallet-ledger-platform/blob/main/app/main.py) (FastAPI application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Wallet client"]
  node_web_app["Wallet interface<br/>[App.jsx]"]
  node_auth_screen["Sign-in screen<br/>[AuthScreen.jsx]"]
  node_account_panel["Account panel<br/>[AccountsPanel.jsx]"]
  node_transfer_form["Transfer form<br/>[TransferForm.jsx]"]
  node_history_view["Payment history<br/>[PaymentHistory.jsx]"]
  node_auth_context["Session context<br/>[AuthContext.jsx]"]
  node_api_client["HTTP client<br/>[api.js]"]
end

subgraph group_api["API and identity"]
  node_fastapi["FastAPI application<br/>[main.py]"]
  node_auth_routes["Authentication routes<br/>[auth.py]"]
  node_account_routes["Account routes<br/>[account.py]"]
  node_transaction_routes["Transaction routes<br/>[transaction.py]"]
  node_identity["JWT identity<br/>[security.py]"]
  node_auth_dependency["Request authorization<br/>[dependencies.py]"]
end

subgraph group_money["Wallet and ledger"]
  node_transfer_service["Transfer and deposit"]
  node_system_accounts["Funding account<br/>[system_accounts.py]"]
  node_balance_cache["Balance cache<br/>[redis_client.py]"]
  node_wallet_models["Wallet and ledger records"]
  node_postgres[("PostgreSQL")]
  node_redis[("Redis")]
end

subgraph group_ops["Reconciliation"]
  node_reconciliation["Ledger reconciliation"]
  node_reconciliation_task["Scheduled task"]
  node_celery["Celery worker and scheduler<br/>[celery_app.py]"]
end

node_wallet_user(("Wallet user"))

node_wallet_user -->|"uses"| node_web_app
node_web_app -->|"renders"| node_auth_screen
node_web_app -->|"renders"| node_account_panel
node_web_app -->|"renders"| node_transfer_form
node_web_app -->|"renders"| node_history_view
node_auth_screen -->|"uses"| node_auth_context
node_web_app -->|"reads session"| node_auth_context
node_auth_context -->|"sends auth requests"| node_api_client
node_web_app -->|"sends wallet requests"| node_api_client
node_api_client -.->|"calls API"| node_fastapi
node_fastapi -->|"mounts"| node_auth_routes
node_fastapi -->|"mounts"| node_account_routes
node_fastapi -->|"mounts"| node_transaction_routes
node_auth_routes -->|"creates tokens"| node_identity
node_auth_dependency -->|"validates tokens"| node_identity
node_auth_routes -->|"reads and writes users"| node_postgres
node_account_routes -->|"requires user"| node_auth_dependency
node_transaction_routes -->|"requires user"| node_auth_dependency
node_account_routes -->|"reads and writes accounts"| node_postgres
node_transaction_routes -->|"delegates transfers"| node_transfer_service
node_account_routes -->|"delegates deposits"| node_transfer_service
node_account_routes -->|"reads and fills cache"| node_balance_cache
node_transfer_service -->|"gets funding account"| node_system_accounts
node_transfer_service -->|"invalidates balances"| node_balance_cache
node_transfer_service -->|"creates ledger entries"| node_wallet_models
node_transfer_service -->|"commits transactions"| node_postgres
node_balance_cache -->|"reads and invalidates"| node_redis
node_wallet_models -.->|"persists ledger data"| node_postgres
node_reconciliation_task -->|"registers task"| node_celery
node_reconciliation_task -->|"invokes check"| node_reconciliation
node_reconciliation -.->|"verifies ledger"| node_postgres

click node_web_app "https://github.com/manu-7/wallet-ledger-platform/blob/main/frontend/src/App.jsx"
click node_auth_screen "https://github.com/manu-7/wallet-ledger-platform/blob/main/frontend/src/components/AuthScreen.jsx"
click node_account_panel "https://github.com/manu-7/wallet-ledger-platform/blob/main/frontend/src/components/AccountsPanel.jsx"
click node_transfer_form "https://github.com/manu-7/wallet-ledger-platform/blob/main/frontend/src/components/TransferForm.jsx"
click node_history_view "https://github.com/manu-7/wallet-ledger-platform/blob/main/frontend/src/components/PaymentHistory.jsx"
click node_auth_context "https://github.com/manu-7/wallet-ledger-platform/blob/main/frontend/src/context/AuthContext.jsx"
click node_api_client "https://github.com/manu-7/wallet-ledger-platform/blob/main/frontend/src/api.js"
click node_fastapi "https://github.com/manu-7/wallet-ledger-platform/blob/main/app/main.py"
click node_auth_routes "https://github.com/manu-7/wallet-ledger-platform/blob/main/app/routers/auth.py"
click node_account_routes "https://github.com/manu-7/wallet-ledger-platform/blob/main/app/routers/account.py"
click node_transaction_routes "https://github.com/manu-7/wallet-ledger-platform/blob/main/app/routers/transaction.py"
click node_identity "https://github.com/manu-7/wallet-ledger-platform/blob/main/app/core/security.py"
click node_auth_dependency "https://github.com/manu-7/wallet-ledger-platform/blob/main/app/dependencies.py"
click node_transfer_service "https://github.com/manu-7/wallet-ledger-platform/blob/main/app/services/transaction_service.py"
click node_system_accounts "https://github.com/manu-7/wallet-ledger-platform/blob/main/app/services/system_accounts.py"
click node_balance_cache "https://github.com/manu-7/wallet-ledger-platform/blob/main/app/core/redis_client.py"
click node_wallet_models "https://github.com/manu-7/wallet-ledger-platform/tree/main/app/models"
click node_reconciliation "https://github.com/manu-7/wallet-ledger-platform/blob/main/app/services/reconciliation_service.py"
click node_reconciliation_task "https://github.com/manu-7/wallet-ledger-platform/blob/main/app/tasks/reconciliation_tasks.py"
click node_celery "https://github.com/manu-7/wallet-ledger-platform/blob/main/app/tasks/celery_app.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_web_app,node_auth_screen,node_account_panel,node_transfer_form,node_history_view,node_auth_context,node_api_client,node_wallet_user toneBlue
class node_fastapi,node_auth_routes,node_account_routes,node_transaction_routes,node_identity,node_auth_dependency toneAmber
class node_transfer_service,node_system_accounts,node_balance_cache,node_wallet_models,node_postgres,node_redis toneMint
class node_reconciliation,node_reconciliation_task,node_celery toneRose
```

## Components

### Wallet client

- [Wallet interface](https://github.com/manu-7/wallet-ledger-platform/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Sign-in screen](https://github.com/manu-7/wallet-ledger-platform/blob/main/frontend/src/components/AuthScreen.jsx): `frontend/src/components/AuthScreen.jsx`
- [Account panel](https://github.com/manu-7/wallet-ledger-platform/blob/main/frontend/src/components/AccountsPanel.jsx): `frontend/src/components/AccountsPanel.jsx`
- [Transfer form](https://github.com/manu-7/wallet-ledger-platform/blob/main/frontend/src/components/TransferForm.jsx): `frontend/src/components/TransferForm.jsx`
- [Payment history](https://github.com/manu-7/wallet-ledger-platform/blob/main/frontend/src/components/PaymentHistory.jsx): `frontend/src/components/PaymentHistory.jsx`
- [Session context](https://github.com/manu-7/wallet-ledger-platform/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [HTTP client](https://github.com/manu-7/wallet-ledger-platform/blob/main/frontend/src/api.js): `frontend/src/api.js`

### API and identity

- [FastAPI application](https://github.com/manu-7/wallet-ledger-platform/blob/main/app/main.py): `app/main.py`
- [Authentication routes](https://github.com/manu-7/wallet-ledger-platform/blob/main/app/routers/auth.py): `app/routers/auth.py`
- [Account routes](https://github.com/manu-7/wallet-ledger-platform/blob/main/app/routers/account.py): `app/routers/account.py`
- [Transaction routes](https://github.com/manu-7/wallet-ledger-platform/blob/main/app/routers/transaction.py): `app/routers/transaction.py`
- [JWT identity](https://github.com/manu-7/wallet-ledger-platform/blob/main/app/core/security.py): `app/core/security.py`
- [Request authorization](https://github.com/manu-7/wallet-ledger-platform/blob/main/app/dependencies.py): `app/dependencies.py`

### Wallet and ledger

- [Transfer and deposit](https://github.com/manu-7/wallet-ledger-platform/blob/main/app/services/transaction_service.py): `app/services/transaction_service.py`
- [Funding account](https://github.com/manu-7/wallet-ledger-platform/blob/main/app/services/system_accounts.py): `app/services/system_accounts.py`
- [Balance cache](https://github.com/manu-7/wallet-ledger-platform/blob/main/app/core/redis_client.py): `app/core/redis_client.py`
- [Wallet and ledger records](https://github.com/manu-7/wallet-ledger-platform/tree/main/app/models): `app/models`
- **PostgreSQL**
- **Redis**

### Reconciliation

- [Ledger reconciliation](https://github.com/manu-7/wallet-ledger-platform/blob/main/app/services/reconciliation_service.py): `app/services/reconciliation_service.py`
- [Scheduled task](https://github.com/manu-7/wallet-ledger-platform/blob/main/app/tasks/reconciliation_tasks.py): `app/tasks/reconciliation_tasks.py`
- [Celery worker and scheduler](https://github.com/manu-7/wallet-ledger-platform/blob/main/app/tasks/celery_app.py): `app/tasks/celery_app.py`

### Other components

- **Wallet user**

## Connections

- Wallet user → Wallet interface: uses (evidence: `frontend/src/App.jsx`)
- Wallet interface → Sign-in screen: renders (evidence: `frontend/src/App.jsx`)
- Wallet interface → Account panel: renders (evidence: `frontend/src/App.jsx`)
- Wallet interface → Transfer form: renders (evidence: `frontend/src/App.jsx`)
- Wallet interface → Payment history: renders (evidence: `frontend/src/App.jsx`)
- Sign-in screen → Session context: uses (evidence: `frontend/src/components/AuthScreen.jsx`)
- Wallet interface → Session context: reads session (evidence: `frontend/src/App.jsx`)
- Session context → HTTP client: sends auth requests (evidence: `frontend/src/context/AuthContext.jsx`)
- Wallet interface → HTTP client: sends wallet requests (evidence: `frontend/src/App.jsx`)
- HTTP client → FastAPI application: calls API
- FastAPI application → Authentication routes: mounts (evidence: `app/main.py`)
- FastAPI application → Account routes: mounts (evidence: `app/main.py`)
- FastAPI application → Transaction routes: mounts (evidence: `app/main.py`)
- Authentication routes → JWT identity: creates tokens (evidence: `app/routers/auth.py`)
- Request authorization → JWT identity: validates tokens (evidence: `app/dependencies.py`)
- Authentication routes → PostgreSQL: reads and writes users (evidence: `app/routers/auth.py`)
- Account routes → Request authorization: requires user (evidence: `app/routers/account.py`)
- Transaction routes → Request authorization: requires user (evidence: `app/routers/transaction.py`)
- Account routes → PostgreSQL: reads and writes accounts (evidence: `app/routers/account.py`)
- Transaction routes → Transfer and deposit: delegates transfers (evidence: `app/routers/transaction.py`)
- Account routes → Transfer and deposit: delegates deposits (evidence: `app/routers/account.py`)
- Account routes → Balance cache: reads and fills cache (evidence: `app/routers/account.py`)
- Transfer and deposit → Funding account: gets funding account (evidence: `app/services/transaction_service.py`)
- Transfer and deposit → Balance cache: invalidates balances (evidence: `app/services/transaction_service.py`)
- Transfer and deposit → Wallet and ledger records: creates ledger entries (evidence: `app/services/transaction_service.py`)
- Transfer and deposit → PostgreSQL: commits transactions (evidence: `app/services/transaction_service.py`)
- Balance cache → Redis: reads and invalidates (evidence: `app/core/redis_client.py`)
- Wallet and ledger records → PostgreSQL: persists ledger data
- Scheduled task → Celery worker and scheduler: registers task (evidence: `app/tasks/reconciliation_tasks.py`)
- Scheduled task → Ledger reconciliation: invokes check (evidence: `app/tasks/reconciliation_tasks.py`)
- Ledger reconciliation → PostgreSQL: verifies ledger
