# jonathancqa/atlasbank architecture

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

- Interactive diagram: https://gitdiagram.com/jonathancqa/atlasbank
- Repository: https://github.com/jonathancqa/atlasbank

## Overview

AtlasBank is a modular-monolith digital banking API. Its main workflow is account registration and login, followed by authenticated wallet creation and balance, statement, deposit, withdrawal, or transfer operations. Application handlers coordinate domain rules and persistence; wallet mutations use idempotency and optimistic concurrency, while transfers commit through a Unit of Work. The graph preserves the planned Payments capability as separate from implemented flows. Evidence is limited to the supplied README, tree, SOURCE INDEX, and excerpts; unsampled wiring is omitted or marked unverified.

Main entry points: [`src/Modules/Wallets/AtlasBank.Wallets.Application/Commands/Deposit/DepositHandler.cs`](https://github.com/jonathancqa/atlasbank/blob/main/src/Modules/Wallets/AtlasBank.Wallets.Application/Commands/Deposit/DepositHandler.cs) (Wallet Handlers), [`src/AtlasBank.API/Controllers/WalletsController.cs`](https://github.com/jonathancqa/atlasbank/blob/main/src/AtlasBank.API/Controllers/WalletsController.cs) (Wallets API), [`src/Modules/Wallets/AtlasBank.Wallets.Domain/Entities/Wallet.cs`](https://github.com/jonathancqa/atlasbank/blob/main/src/Modules/Wallets/AtlasBank.Wallets.Domain/Entities/Wallet.cs) (Wallet Domain), [`src/Modules/Wallets/AtlasBank.Wallets.Infrastructure/Persistence/Repositories/WalletRepository.cs`](https://github.com/jonathancqa/atlasbank/blob/main/src/Modules/Wallets/AtlasBank.Wallets.Infrastructure/Persistence/Repositories/WalletRepository.cs) (Wallet Repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and Security"]
  node_accounts_api["Accounts API"]
  node_wallets_api["Wallets API"]
  node_api_host["API Host<br/>[Program.cs]"]
end

subgraph group_accounts["Accounts Module"]
  node_account_commands["Account Commands<br/>[Commands]"]
  node_account_handlers["Account Handlers"]
  node_account_login["Login Handler<br/>[LoginHandler.cs]"]
  node_account_domain["Account Domain<br/>[Account.cs]"]
  node_account_repository["Account Repository"]
  node_account_store[("Accounts Store")]
  node_jwt["JWT Service<br/>[JwtService.cs]"]
end

subgraph group_wallets["Wallets Module"]
  node_wallet_usecases["Wallet Operations<br/>[Commands]"]
  node_wallet_handlers["Wallet Handlers<br/>[DepositHandler.cs]"]
  node_balance_query["Balance Query"]
  node_statement_query["Statement Query"]
  node_wallet_domain["Wallet Domain<br/>[Wallet.cs]"]
  node_wallet_repository["Wallet Repository"]
  node_wallet_store[("Wallets Store")]
end

subgraph group_shared["Shared Kernel"]
  node_shared_primitives["Shared Primitives<br/>[Result.cs]"]
  node_money["Money Value<br/>[Money.cs]"]
  node_validation["Validation Pipeline"]
  node_concurrency["Concurrency Errors"]
end

node_client(("API Client"))
node_payments["Planned Payments"]

node_client -->|"calls"| node_accounts_api
node_client -->|"calls"| node_wallets_api
node_accounts_api -.->|"dispatches"| node_account_commands
node_wallets_api -->|"dispatches"| node_wallet_usecases
node_wallets_api -->|"dispatches"| node_balance_query
node_wallets_api -->|"dispatches"| node_statement_query
node_account_handlers -->|"checks and saves"| node_account_repository
node_account_handlers -->|"creates"| node_account_domain
node_account_login -->|"loads account"| node_account_repository
node_account_login -->|"issues token"| node_jwt
node_account_repository -->|"reads and writes"| node_account_store
node_wallet_handlers -->|"loads and saves"| node_wallet_repository
node_wallet_handlers -->|"applies operations"| node_wallet_domain
node_wallet_handlers -.->|"commits via unit of work"| node_wallet_store
node_wallet_domain -->|"uses amounts"| node_money
node_wallet_domain -->|"returns results"| node_shared_primitives
node_wallet_repository -->|"reads and writes"| node_wallet_store
node_wallet_repository -.->|"returns statement data"| node_statement_query
node_api_host -->|"configures"| node_account_store
node_api_host -->|"configures"| node_wallet_store
node_validation -->|"returns failures"| node_shared_primitives
node_wallet_handlers -->|"handles conflicts"| node_concurrency

click node_accounts_api "https://github.com/jonathancqa/atlasbank/blob/main/src/AtlasBank.API/Controllers/AccountsController.cs"
click node_wallets_api "https://github.com/jonathancqa/atlasbank/blob/main/src/AtlasBank.API/Controllers/WalletsController.cs"
click node_api_host "https://github.com/jonathancqa/atlasbank/blob/main/src/AtlasBank.API/Program.cs"
click node_account_commands "https://github.com/jonathancqa/atlasbank/tree/main/src/Modules/Accounts/AtlasBank.Accounts.Application/Commands"
click node_account_handlers "https://github.com/jonathancqa/atlasbank/blob/main/src/Modules/Accounts/AtlasBank.Accounts.Application/Commands/CreateAccount/CreateAccountHandler.cs"
click node_account_login "https://github.com/jonathancqa/atlasbank/blob/main/src/Modules/Accounts/AtlasBank.Accounts.Application/Commands/Login/LoginHandler.cs"
click node_account_domain "https://github.com/jonathancqa/atlasbank/blob/main/src/Modules/Accounts/AtlasBank.Accounts.Domain/Entities/Account.cs"
click node_account_repository "https://github.com/jonathancqa/atlasbank/blob/main/src/Modules/Accounts/AtlasBank.Accounts.Infrastructure/Persistence/Repositories/AccountRepository.cs"
click node_account_store "https://github.com/jonathancqa/atlasbank/blob/main/src/Modules/Accounts/AtlasBank.Accounts.Infrastructure/Persistence/AccountsDbContext.cs"
click node_jwt "https://github.com/jonathancqa/atlasbank/blob/main/src/Modules/Accounts/AtlasBank.Accounts.Infrastructure/Services/JwtService.cs"
click node_wallet_usecases "https://github.com/jonathancqa/atlasbank/tree/main/src/Modules/Wallets/AtlasBank.Wallets.Application/Commands"
click node_wallet_handlers "https://github.com/jonathancqa/atlasbank/blob/main/src/Modules/Wallets/AtlasBank.Wallets.Application/Commands/Deposit/DepositHandler.cs"
click node_balance_query "https://github.com/jonathancqa/atlasbank/blob/main/src/Modules/Wallets/AtlasBank.Wallets.Application/Queries/GetBalance/GetBalanceHandler.cs"
click node_statement_query "https://github.com/jonathancqa/atlasbank/blob/main/src/Modules/Wallets/AtlasBank.Wallets.Application/Queries/GetStatement/GetStatementHandler.cs"
click node_wallet_domain "https://github.com/jonathancqa/atlasbank/blob/main/src/Modules/Wallets/AtlasBank.Wallets.Domain/Entities/Wallet.cs"
click node_wallet_repository "https://github.com/jonathancqa/atlasbank/blob/main/src/Modules/Wallets/AtlasBank.Wallets.Infrastructure/Persistence/Repositories/WalletRepository.cs"
click node_wallet_store "https://github.com/jonathancqa/atlasbank/blob/main/src/Modules/Wallets/AtlasBank.Wallets.Infrastructure/Persistence/WalletsDbContext.cs"
click node_payments "https://github.com/jonathancqa/atlasbank/tree/main/src/Modules/Payments"
click node_shared_primitives "https://github.com/jonathancqa/atlasbank/blob/main/src/AtlasBank.SharedKernel/Primitives/Result.cs"
click node_money "https://github.com/jonathancqa/atlasbank/blob/main/src/AtlasBank.SharedKernel/ValueObjects/Money.cs"
click node_validation "https://github.com/jonathancqa/atlasbank/blob/main/src/AtlasBank.SharedKernel/Behaviors/ValidationPipelineBehavior.cs"
click node_concurrency "https://github.com/jonathancqa/atlasbank/blob/main/src/AtlasBank.SharedKernel/Exceptions/ConcurrencyException.cs"

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_accounts_api,node_wallets_api,node_api_host,node_client toneBlue
class node_account_commands,node_account_handlers,node_account_login,node_account_domain,node_account_repository,node_account_store,node_jwt toneAmber
class node_wallet_usecases,node_wallet_handlers,node_balance_query,node_statement_query,node_wallet_domain,node_wallet_repository,node_wallet_store toneMint
class node_shared_primitives,node_money,node_validation,node_concurrency toneRose
class node_payments toneTeal
```

## Components

### API and Security

- [Accounts API](https://github.com/jonathancqa/atlasbank/blob/main/src/AtlasBank.API/Controllers/AccountsController.cs): `src/AtlasBank.API/Controllers/AccountsController.cs`
- [Wallets API](https://github.com/jonathancqa/atlasbank/blob/main/src/AtlasBank.API/Controllers/WalletsController.cs): `src/AtlasBank.API/Controllers/WalletsController.cs`
- [API Host](https://github.com/jonathancqa/atlasbank/blob/main/src/AtlasBank.API/Program.cs): `src/AtlasBank.API/Program.cs`

### Accounts Module

- [Account Commands](https://github.com/jonathancqa/atlasbank/tree/main/src/Modules/Accounts/AtlasBank.Accounts.Application/Commands): `src/Modules/Accounts/AtlasBank.Accounts.Application/Commands`
- [Account Handlers](https://github.com/jonathancqa/atlasbank/blob/main/src/Modules/Accounts/AtlasBank.Accounts.Application/Commands/CreateAccount/CreateAccountHandler.cs): `src/Modules/Accounts/AtlasBank.Accounts.Application/Commands/CreateAccount/CreateAccountHandler.cs`
- [Login Handler](https://github.com/jonathancqa/atlasbank/blob/main/src/Modules/Accounts/AtlasBank.Accounts.Application/Commands/Login/LoginHandler.cs): `src/Modules/Accounts/AtlasBank.Accounts.Application/Commands/Login/LoginHandler.cs`
- [Account Domain](https://github.com/jonathancqa/atlasbank/blob/main/src/Modules/Accounts/AtlasBank.Accounts.Domain/Entities/Account.cs): `src/Modules/Accounts/AtlasBank.Accounts.Domain/Entities/Account.cs`
- [Account Repository](https://github.com/jonathancqa/atlasbank/blob/main/src/Modules/Accounts/AtlasBank.Accounts.Infrastructure/Persistence/Repositories/AccountRepository.cs): `src/Modules/Accounts/AtlasBank.Accounts.Infrastructure/Persistence/Repositories/AccountRepository.cs`
- [Accounts Store](https://github.com/jonathancqa/atlasbank/blob/main/src/Modules/Accounts/AtlasBank.Accounts.Infrastructure/Persistence/AccountsDbContext.cs): `src/Modules/Accounts/AtlasBank.Accounts.Infrastructure/Persistence/AccountsDbContext.cs`
- [JWT Service](https://github.com/jonathancqa/atlasbank/blob/main/src/Modules/Accounts/AtlasBank.Accounts.Infrastructure/Services/JwtService.cs): `src/Modules/Accounts/AtlasBank.Accounts.Infrastructure/Services/JwtService.cs`

### Wallets Module

- [Wallet Operations](https://github.com/jonathancqa/atlasbank/tree/main/src/Modules/Wallets/AtlasBank.Wallets.Application/Commands): `src/Modules/Wallets/AtlasBank.Wallets.Application/Commands`
- [Wallet Handlers](https://github.com/jonathancqa/atlasbank/blob/main/src/Modules/Wallets/AtlasBank.Wallets.Application/Commands/Deposit/DepositHandler.cs): `src/Modules/Wallets/AtlasBank.Wallets.Application/Commands/Deposit/DepositHandler.cs`
- [Balance Query](https://github.com/jonathancqa/atlasbank/blob/main/src/Modules/Wallets/AtlasBank.Wallets.Application/Queries/GetBalance/GetBalanceHandler.cs): `src/Modules/Wallets/AtlasBank.Wallets.Application/Queries/GetBalance/GetBalanceHandler.cs`
- [Statement Query](https://github.com/jonathancqa/atlasbank/blob/main/src/Modules/Wallets/AtlasBank.Wallets.Application/Queries/GetStatement/GetStatementHandler.cs): `src/Modules/Wallets/AtlasBank.Wallets.Application/Queries/GetStatement/GetStatementHandler.cs`
- [Wallet Domain](https://github.com/jonathancqa/atlasbank/blob/main/src/Modules/Wallets/AtlasBank.Wallets.Domain/Entities/Wallet.cs): `src/Modules/Wallets/AtlasBank.Wallets.Domain/Entities/Wallet.cs`
- [Wallet Repository](https://github.com/jonathancqa/atlasbank/blob/main/src/Modules/Wallets/AtlasBank.Wallets.Infrastructure/Persistence/Repositories/WalletRepository.cs): `src/Modules/Wallets/AtlasBank.Wallets.Infrastructure/Persistence/Repositories/WalletRepository.cs`
- [Wallets Store](https://github.com/jonathancqa/atlasbank/blob/main/src/Modules/Wallets/AtlasBank.Wallets.Infrastructure/Persistence/WalletsDbContext.cs): `src/Modules/Wallets/AtlasBank.Wallets.Infrastructure/Persistence/WalletsDbContext.cs`

### Shared Kernel

- [Shared Primitives](https://github.com/jonathancqa/atlasbank/blob/main/src/AtlasBank.SharedKernel/Primitives/Result.cs): `src/AtlasBank.SharedKernel/Primitives/Result.cs`
- [Money Value](https://github.com/jonathancqa/atlasbank/blob/main/src/AtlasBank.SharedKernel/ValueObjects/Money.cs): `src/AtlasBank.SharedKernel/ValueObjects/Money.cs`
- [Validation Pipeline](https://github.com/jonathancqa/atlasbank/blob/main/src/AtlasBank.SharedKernel/Behaviors/ValidationPipelineBehavior.cs): `src/AtlasBank.SharedKernel/Behaviors/ValidationPipelineBehavior.cs`
- [Concurrency Errors](https://github.com/jonathancqa/atlasbank/blob/main/src/AtlasBank.SharedKernel/Exceptions/ConcurrencyException.cs): `src/AtlasBank.SharedKernel/Exceptions/ConcurrencyException.cs`

### Other components

- **API Client**
- [Planned Payments](https://github.com/jonathancqa/atlasbank/tree/main/src/Modules/Payments): `src/Modules/Payments`

## Connections

- API Client → Accounts API: calls (evidence: `README.md`)
- API Client → Wallets API: calls (evidence: `README.md`)
- Accounts API → Account Commands: dispatches (evidence: `src/AtlasBank.API/Controllers/AccountsController.cs`)
- Wallets API → Wallet Operations: dispatches (evidence: `src/AtlasBank.API/Controllers/WalletsController.cs`)
- Wallets API → Balance Query: dispatches (evidence: `src/AtlasBank.API/Controllers/WalletsController.cs`)
- Wallets API → Statement Query: dispatches (evidence: `src/AtlasBank.API/Controllers/WalletsController.cs`)
- Account Handlers → Account Repository: checks and saves (evidence: `src/Modules/Accounts/AtlasBank.Accounts.Application/Commands/CreateAccount/CreateAccountHandler.cs`)
- Account Handlers → Account Domain: creates (evidence: `src/Modules/Accounts/AtlasBank.Accounts.Application/Commands/CreateAccount/CreateAccountHandler.cs`)
- Login Handler → Account Repository: loads account (evidence: `src/Modules/Accounts/AtlasBank.Accounts.Application/Commands/Login/LoginHandler.cs`)
- Login Handler → JWT Service: issues token (evidence: `src/Modules/Accounts/AtlasBank.Accounts.Application/Commands/Login/LoginHandler.cs`)
- Account Repository → Accounts Store: reads and writes (evidence: `src/Modules/Accounts/AtlasBank.Accounts.Infrastructure/Persistence/Repositories/AccountRepository.cs`)
- Wallet Handlers → Wallet Repository: loads and saves (evidence: `src/Modules/Wallets/AtlasBank.Wallets.Application/Commands/Deposit/DepositHandler.cs`)
- Wallet Handlers → Wallet Domain: applies operations (evidence: `src/Modules/Wallets/AtlasBank.Wallets.Application/Commands/Deposit/DepositHandler.cs`)
- Wallet Handlers → Wallets Store: commits via unit of work (evidence: `README.md`)
- Wallet Domain → Money Value: uses amounts (evidence: `src/Modules/Wallets/AtlasBank.Wallets.Domain/Entities/Wallet.cs`)
- Wallet Domain → Shared Primitives: returns results (evidence: `src/Modules/Wallets/AtlasBank.Wallets.Domain/Entities/Wallet.cs`)
- Wallet Repository → Wallets Store: reads and writes (evidence: `src/Modules/Wallets/AtlasBank.Wallets.Infrastructure/Persistence/Repositories/WalletRepository.cs`)
- Wallet Repository → Statement Query: returns statement data
- API Host → Accounts Store: configures (evidence: `src/AtlasBank.API/Program.cs`)
- API Host → Wallets Store: configures (evidence: `src/AtlasBank.API/Program.cs`)
- Validation Pipeline → Shared Primitives: returns failures (evidence: `src/AtlasBank.SharedKernel/Behaviors/ValidationPipelineBehavior.cs`)
- Wallet Handlers → Concurrency Errors: handles conflicts (evidence: `src/Modules/Wallets/AtlasBank.Wallets.Application/Commands/Deposit/DepositHandler.cs`)
