# mobtone/bankapi architecture

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

- Interactive diagram: https://gitdiagram.com/mobtone/bankapi
- Repository: https://github.com/mobtone/bankapi

## Overview

This is a layered banking API for administering customers and managing accounts, transactions, loans, and authentication. The principal workflow is an HTTP request reaching a controller, invoking business logic, and accessing persisted banking data through repositories. The graph preserves documented API capabilities; some controller-to-service links are dashed because their implementations were not sampled. The README describes the layers, while source excerpts and the index provide stronger evidence for the customer-registration and authentication paths.

Main entry points: [`BankApp.Core/Services/CustomerService.cs`](https://github.com/mobtone/bankapi/blob/master/BankApp.Core/Services/CustomerService.cs) (Customer service), [`BankApp.Data/DataModels/BankAppDbContext.cs`](https://github.com/mobtone/bankapi/blob/master/BankApp.Data/DataModels/BankAppDbContext.cs) (Database context), [`BankAPI/Controllers/AuthorizationController.cs`](https://github.com/mobtone/bankapi/blob/master/BankAPI/Controllers/AuthorizationController.cs) (Login endpoint), [`BankApp.Core/Services/AdminService.cs`](https://github.com/mobtone/bankapi/blob/master/BankApp.Core/Services/AdminService.cs) (Admin service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_admin_api["Admin endpoints<br/>[AdminController.cs]"]
  node_auth_api["Login endpoint"]
  node_verify_api["Admin verification"]
  node_customer_auth_api["Customer security key"]
  node_account_api["Account endpoints"]
  node_new_account_api["New account endpoint"]
  node_transaction_api["Transfer endpoint"]
  node_account_transactions_api["Account transactions"]
  node_account_types_api["Account types"]
  node_loan_api["Loan endpoint<br/>[LoanController.cs]"]
end

subgraph group_identity["Identity &amp; Admin"]
  node_admin_service["Admin service<br/>[AdminService.cs]"]
  node_jwt_service["JWT service<br/>[JwtService.cs]"]
  node_authorization_service["Customer authorization"]
  node_security_key["Security key generator"]
end

subgraph group_banking["Banking Operations"]
  node_customer_service["Customer service<br/>[CustomerService.cs]"]
  node_account_service["Account service<br/>[AccountService.cs]"]
  node_account_type_service["Account type service"]
  node_transaction_service["Transaction service"]
end

subgraph group_data["Data &amp; Domain"]
  node_customer_repo["Customer repository<br/>[CustomerRepo.cs]"]
  node_account_repo["Account repository<br/>[AccountRepo.cs]"]
  node_account_type_repo["Account type repository<br/>[AccountTypeRepo.cs]"]
  node_admin_repo["Admin repository<br/>[AdminRepo.cs]"]
  node_transaction_repo["Transaction repository<br/>[TransactionRepo.cs]"]
  node_db_context[("Database context")]
  node_customer_model["Customer &amp; account<br/>[Customer.cs]"]
  node_admin_model["Admin<br/>[Admin.cs]"]
end

node_client(("API client"))

node_client -->|"submits login"| node_auth_api
node_client -->|"registers customer"| node_admin_api
node_client -->|"requests admin security"| node_verify_api
node_client -->|"requests security key"| node_customer_auth_api
node_client -->|"views accounts"| node_account_api
node_client -->|"creates account"| node_new_account_api
node_client -->|"transfers funds"| node_transaction_api
node_client -->|"views transactions"| node_account_transactions_api
node_client -->|"lists account types"| node_account_types_api
node_client -->|"adds customer loan"| node_loan_api
node_admin_api -->|"registers customer"| node_customer_service
node_auth_api -->|"checks admin login"| node_admin_service
node_auth_api -->|"checks customer login"| node_customer_service
node_auth_api -->|"generates token"| node_jwt_service
node_customer_auth_api -->|"gets security key"| node_customer_service
node_account_api -->|"requests overview"| node_account_service
node_new_account_api -->|"creates account"| node_account_service
node_verify_api -->|"manages credentials"| node_admin_service
node_admin_service -->|"accesses admin data"| node_admin_repo
node_admin_service -->|"generates security key"| node_security_key
node_customer_service -->|"delegates customer data"| node_customer_repo
node_customer_repo -->|"gets connection"| node_db_context
node_transaction_api -.->|"handles transfer"| node_transaction_service
node_transaction_service -.->|"accesses transaction data"| node_transaction_repo
node_account_transactions_api -.->|"loads account history"| node_account_service
node_account_types_api -.->|"loads account types"| node_account_type_service
node_loan_api -.->|"adds customer loan"| node_customer_service
node_account_service -.->|"accesses account data"| node_account_repo
node_account_type_service -.->|"accesses type data"| node_account_type_repo
node_admin_repo -.->|"uses database"| node_db_context
node_account_repo -.->|"uses database"| node_db_context
node_account_type_repo -.->|"uses database"| node_db_context
node_transaction_repo -.->|"uses database"| node_db_context

click node_admin_api "https://github.com/mobtone/bankapi/blob/master/BankAPI/Controllers/AdminController.cs"
click node_auth_api "https://github.com/mobtone/bankapi/blob/master/BankAPI/Controllers/AuthorizationController.cs"
click node_verify_api "https://github.com/mobtone/bankapi/blob/master/BankAPI/Controllers/AdminVerificationController.cs"
click node_customer_auth_api "https://github.com/mobtone/bankapi/blob/master/BankAPI/Controllers/CustomerAuthController.cs"
click node_account_api "https://github.com/mobtone/bankapi/blob/master/BankAPI/Controllers/CustomerAccountsController.cs"
click node_new_account_api "https://github.com/mobtone/bankapi/blob/master/BankAPI/Controllers/NewAccountController.cs"
click node_transaction_api "https://github.com/mobtone/bankapi/blob/master/BankAPI/Controllers/TransactionController.cs"
click node_account_transactions_api "https://github.com/mobtone/bankapi/blob/master/BankAPI/Controllers/AccountTransactionsController.cs"
click node_account_types_api "https://github.com/mobtone/bankapi/blob/master/BankAPI/Controllers/AccountTypesController.cs"
click node_loan_api "https://github.com/mobtone/bankapi/blob/master/BankAPI/Controllers/LoanController.cs"
click node_customer_service "https://github.com/mobtone/bankapi/blob/master/BankApp.Core/Services/CustomerService.cs"
click node_account_service "https://github.com/mobtone/bankapi/blob/master/BankApp.Core/Services/AccountService.cs"
click node_account_type_service "https://github.com/mobtone/bankapi/blob/master/BankApp.Core/Services/AccountTypeService.cs"
click node_transaction_service "https://github.com/mobtone/bankapi/blob/master/BankApp.Core/Services/TransactionService.cs"
click node_admin_service "https://github.com/mobtone/bankapi/blob/master/BankApp.Core/Services/AdminService.cs"
click node_jwt_service "https://github.com/mobtone/bankapi/blob/master/BankApp.Core/Services/JwtService.cs"
click node_authorization_service "https://github.com/mobtone/bankapi/blob/master/BankApp.Core/Services/AuthorizationService.cs"
click node_security_key "https://github.com/mobtone/bankapi/blob/master/BankApp.Core/Services/SecurityKeyGenerator.cs"
click node_customer_repo "https://github.com/mobtone/bankapi/blob/master/BankApp.Data/Repositories/Repos/CustomerRepo.cs"
click node_account_repo "https://github.com/mobtone/bankapi/blob/master/BankApp.Data/Repositories/Repos/AccountRepo.cs"
click node_account_type_repo "https://github.com/mobtone/bankapi/blob/master/BankApp.Data/Repositories/Repos/AccountTypeRepo.cs"
click node_admin_repo "https://github.com/mobtone/bankapi/blob/master/BankApp.Data/Repositories/Repos/AdminRepo.cs"
click node_transaction_repo "https://github.com/mobtone/bankapi/blob/master/BankApp.Data/Repositories/Repos/TransactionRepo.cs"
click node_db_context "https://github.com/mobtone/bankapi/blob/master/BankApp.Data/DataModels/BankAppDbContext.cs"
click node_customer_model "https://github.com/mobtone/bankapi/blob/master/BankApp.Domain/Models/Customer.cs"
click node_admin_model "https://github.com/mobtone/bankapi/blob/master/BankApp.Domain/Models/Admin.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_admin_api,node_auth_api,node_verify_api,node_customer_auth_api,node_account_api,node_new_account_api,node_transaction_api,node_account_transactions_api,node_account_types_api,node_loan_api,node_client toneBlue
class node_admin_service,node_jwt_service,node_authorization_service,node_security_key toneAmber
class node_customer_service,node_account_service,node_account_type_service,node_transaction_service toneMint
class node_customer_repo,node_account_repo,node_account_type_repo,node_admin_repo,node_transaction_repo,node_db_context,node_customer_model,node_admin_model toneRose
```

## Components

### HTTP API

- [Admin endpoints](https://github.com/mobtone/bankapi/blob/master/BankAPI/Controllers/AdminController.cs): `BankAPI/Controllers/AdminController.cs`
- [Login endpoint](https://github.com/mobtone/bankapi/blob/master/BankAPI/Controllers/AuthorizationController.cs): `BankAPI/Controllers/AuthorizationController.cs`
- [Admin verification](https://github.com/mobtone/bankapi/blob/master/BankAPI/Controllers/AdminVerificationController.cs): `BankAPI/Controllers/AdminVerificationController.cs`
- [Customer security key](https://github.com/mobtone/bankapi/blob/master/BankAPI/Controllers/CustomerAuthController.cs): `BankAPI/Controllers/CustomerAuthController.cs`
- [Account endpoints](https://github.com/mobtone/bankapi/blob/master/BankAPI/Controllers/CustomerAccountsController.cs): `BankAPI/Controllers/CustomerAccountsController.cs`
- [New account endpoint](https://github.com/mobtone/bankapi/blob/master/BankAPI/Controllers/NewAccountController.cs): `BankAPI/Controllers/NewAccountController.cs`
- [Transfer endpoint](https://github.com/mobtone/bankapi/blob/master/BankAPI/Controllers/TransactionController.cs): `BankAPI/Controllers/TransactionController.cs`
- [Account transactions](https://github.com/mobtone/bankapi/blob/master/BankAPI/Controllers/AccountTransactionsController.cs): `BankAPI/Controllers/AccountTransactionsController.cs`
- [Account types](https://github.com/mobtone/bankapi/blob/master/BankAPI/Controllers/AccountTypesController.cs): `BankAPI/Controllers/AccountTypesController.cs`
- [Loan endpoint](https://github.com/mobtone/bankapi/blob/master/BankAPI/Controllers/LoanController.cs): `BankAPI/Controllers/LoanController.cs`

### Identity & Admin

- [Admin service](https://github.com/mobtone/bankapi/blob/master/BankApp.Core/Services/AdminService.cs): `BankApp.Core/Services/AdminService.cs`
- [JWT service](https://github.com/mobtone/bankapi/blob/master/BankApp.Core/Services/JwtService.cs): `BankApp.Core/Services/JwtService.cs`
- [Customer authorization](https://github.com/mobtone/bankapi/blob/master/BankApp.Core/Services/AuthorizationService.cs): `BankApp.Core/Services/AuthorizationService.cs`
- [Security key generator](https://github.com/mobtone/bankapi/blob/master/BankApp.Core/Services/SecurityKeyGenerator.cs): `BankApp.Core/Services/SecurityKeyGenerator.cs`

### Banking Operations

- [Customer service](https://github.com/mobtone/bankapi/blob/master/BankApp.Core/Services/CustomerService.cs): `BankApp.Core/Services/CustomerService.cs`
- [Account service](https://github.com/mobtone/bankapi/blob/master/BankApp.Core/Services/AccountService.cs): `BankApp.Core/Services/AccountService.cs`
- [Account type service](https://github.com/mobtone/bankapi/blob/master/BankApp.Core/Services/AccountTypeService.cs): `BankApp.Core/Services/AccountTypeService.cs`
- [Transaction service](https://github.com/mobtone/bankapi/blob/master/BankApp.Core/Services/TransactionService.cs): `BankApp.Core/Services/TransactionService.cs`

### Data & Domain

- [Customer repository](https://github.com/mobtone/bankapi/blob/master/BankApp.Data/Repositories/Repos/CustomerRepo.cs): `BankApp.Data/Repositories/Repos/CustomerRepo.cs`
- [Account repository](https://github.com/mobtone/bankapi/blob/master/BankApp.Data/Repositories/Repos/AccountRepo.cs): `BankApp.Data/Repositories/Repos/AccountRepo.cs`
- [Account type repository](https://github.com/mobtone/bankapi/blob/master/BankApp.Data/Repositories/Repos/AccountTypeRepo.cs): `BankApp.Data/Repositories/Repos/AccountTypeRepo.cs`
- [Admin repository](https://github.com/mobtone/bankapi/blob/master/BankApp.Data/Repositories/Repos/AdminRepo.cs): `BankApp.Data/Repositories/Repos/AdminRepo.cs`
- [Transaction repository](https://github.com/mobtone/bankapi/blob/master/BankApp.Data/Repositories/Repos/TransactionRepo.cs): `BankApp.Data/Repositories/Repos/TransactionRepo.cs`
- [Database context](https://github.com/mobtone/bankapi/blob/master/BankApp.Data/DataModels/BankAppDbContext.cs): `BankApp.Data/DataModels/BankAppDbContext.cs`
- [Customer & account](https://github.com/mobtone/bankapi/blob/master/BankApp.Domain/Models/Customer.cs): `BankApp.Domain/Models/Customer.cs`
- [Admin](https://github.com/mobtone/bankapi/blob/master/BankApp.Domain/Models/Admin.cs): `BankApp.Domain/Models/Admin.cs`

### Other components

- **API client**

## Connections

- API client → Login endpoint: submits login
- API client → Admin endpoints: registers customer
- API client → Admin verification: requests admin security
- API client → Customer security key: requests security key
- API client → Account endpoints: views accounts
- API client → New account endpoint: creates account
- API client → Transfer endpoint: transfers funds
- API client → Account transactions: views transactions
- API client → Account types: lists account types
- API client → Loan endpoint: adds customer loan
- Admin endpoints → Customer service: registers customer (evidence: `BankAPI/Controllers/AdminController.cs`)
- Login endpoint → Admin service: checks admin login (evidence: `BankAPI/Controllers/AuthorizationController.cs`)
- Login endpoint → Customer service: checks customer login (evidence: `BankAPI/Controllers/AuthorizationController.cs`)
- Login endpoint → JWT service: generates token (evidence: `BankAPI/Controllers/AuthorizationController.cs`)
- Customer security key → Customer service: gets security key (evidence: `BankAPI/Controllers/CustomerAuthController.cs`)
- Account endpoints → Account service: requests overview (evidence: `BankAPI/Controllers/CustomerAccountsController.cs`)
- New account endpoint → Account service: creates account (evidence: `BankAPI/Controllers/NewAccountController.cs`)
- Admin verification → Admin service: manages credentials (evidence: `BankAPI/Controllers/AdminVerificationController.cs`)
- Admin service → Admin repository: accesses admin data (evidence: `BankApp.Core/Services/AdminService.cs`)
- Admin service → Security key generator: generates security key (evidence: `BankApp.Core/Services/AdminService.cs`)
- Customer service → Customer repository: delegates customer data (evidence: `BankApp.Core/Services/CustomerService.cs`)
- Customer repository → Database context: gets connection (evidence: `BankApp.Data/Repositories/Repos/CustomerRepo.cs`)
- Transfer endpoint → Transaction service: handles transfer
- Transaction service → Transaction repository: accesses transaction data
- Account transactions → Account service: loads account history
- Account types → Account type service: loads account types
- Loan endpoint → Customer service: adds customer loan
- Account service → Account repository: accesses account data
- Account type service → Account type repository: accesses type data
- Admin repository → Database context: uses database
- Account repository → Database context: uses database
- Account type repository → Database context: uses database
- Transaction repository → Database context: uses database
