# rootmoataz/paper-maker-banking-app architecture

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

- Interactive diagram: https://gitdiagram.com/rootmoataz/paper-maker-banking-app
- Repository: https://github.com/rootmoataz/paper-maker-banking-app

## Overview

Paper Maker Banking App is a FastAPI banking REST API with process-local in-memory records. The principal workflow is a client request entering the routes, passing model validation, and reaching customer or account services for business rules and storage; successful money operations update balances and record history. Customer/account CRUD, ownership checks, deletion constraints, and transaction-history retrieval are distinct capabilities. The sampled source confirms route-to-service calls and direct service access to repositories; broader endpoint behavior is also documented in the README.

Main entry points: [`app/services.py`](https://github.com/rootmoataz/paper-maker-banking-app/blob/1_backend-rest-api-without-db/app/services.py) (Account service), [`app/main.py`](https://github.com/rootmoataz/paper-maker-banking-app/blob/1_backend-rest-api-without-db/app/main.py) (API routes), [`app/repositories.py`](https://github.com/rootmoataz/paper-maker-banking-app/blob/1_backend-rest-api-without-db/app/repositories.py) (Memory store and lock), [`app/models.py`](https://github.com/rootmoataz/paper-maker-banking-app/blob/1_backend-rest-api-without-db/app/models.py) (Request and response models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_http["HTTP API"]
  node_routes["API routes<br/>[main.py]"]
  node_models["Request and response models<br/>[models.py]"]
end

subgraph group_domain["Banking services"]
  node_customer_service["Customer service<br/>[services.py]"]
  node_account_service["Account service<br/>[services.py]"]
  node_bank_error["Bank errors<br/>[services.py]"]
end

subgraph group_storage["In-memory storage"]
  node_memory_store[("Memory store and lock<br/>[repositories.py]")]
  node_users[("User records<br/>[repositories.py]")]
  node_accounts[("Account records<br/>[repositories.py]")]
  node_transactions[("Transaction history<br/>[repositories.py]")]
end

node_client(("API client"))

node_client -->|"sends requests"| node_routes
node_routes -->|"validates and serializes"| node_models
node_routes -->|"calls customer operations"| node_customer_service
node_routes -->|"calls account operations"| node_account_service
node_customer_service -->|"creates customer results"| node_models
node_account_service -->|"creates account and transaction results"| node_models
node_customer_service -->|"reads and writes"| node_users
node_customer_service -->|"checks ownership and updates names"| node_accounts
node_account_service -->|"checks customer"| node_users
node_account_service -->|"reads and writes"| node_accounts
node_account_service -->|"records and reads history"| node_transactions
node_customer_service -->|"raises"| node_bank_error
node_account_service -->|"raises"| node_bank_error
node_routes -->|"maps errors to responses"| node_bank_error
node_memory_store -->|"owns repository"| node_users
node_memory_store -->|"owns repository"| node_accounts
node_memory_store -->|"owns repository"| node_transactions

click node_routes "https://github.com/rootmoataz/paper-maker-banking-app/blob/1_backend-rest-api-without-db/app/main.py"
click node_models "https://github.com/rootmoataz/paper-maker-banking-app/blob/1_backend-rest-api-without-db/app/models.py"
click node_customer_service "https://github.com/rootmoataz/paper-maker-banking-app/blob/1_backend-rest-api-without-db/app/services.py"
click node_account_service "https://github.com/rootmoataz/paper-maker-banking-app/blob/1_backend-rest-api-without-db/app/services.py"
click node_bank_error "https://github.com/rootmoataz/paper-maker-banking-app/blob/1_backend-rest-api-without-db/app/services.py"
click node_memory_store "https://github.com/rootmoataz/paper-maker-banking-app/blob/1_backend-rest-api-without-db/app/repositories.py"
click node_users "https://github.com/rootmoataz/paper-maker-banking-app/blob/1_backend-rest-api-without-db/app/repositories.py"
click node_accounts "https://github.com/rootmoataz/paper-maker-banking-app/blob/1_backend-rest-api-without-db/app/repositories.py"
click node_transactions "https://github.com/rootmoataz/paper-maker-banking-app/blob/1_backend-rest-api-without-db/app/repositories.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_routes,node_models,node_client toneBlue
class node_customer_service,node_account_service,node_bank_error toneAmber
class node_memory_store,node_users,node_accounts,node_transactions toneMint
```

## Components

### HTTP API

- [API routes](https://github.com/rootmoataz/paper-maker-banking-app/blob/1_backend-rest-api-without-db/app/main.py): `app/main.py`
- [Request and response models](https://github.com/rootmoataz/paper-maker-banking-app/blob/1_backend-rest-api-without-db/app/models.py): `app/models.py`

### Banking services

- [Customer service](https://github.com/rootmoataz/paper-maker-banking-app/blob/1_backend-rest-api-without-db/app/services.py): `app/services.py`
- [Account service](https://github.com/rootmoataz/paper-maker-banking-app/blob/1_backend-rest-api-without-db/app/services.py): `app/services.py`
- [Bank errors](https://github.com/rootmoataz/paper-maker-banking-app/blob/1_backend-rest-api-without-db/app/services.py): `app/services.py`

### In-memory storage

- [Memory store and lock](https://github.com/rootmoataz/paper-maker-banking-app/blob/1_backend-rest-api-without-db/app/repositories.py): `app/repositories.py`
- [User records](https://github.com/rootmoataz/paper-maker-banking-app/blob/1_backend-rest-api-without-db/app/repositories.py): `app/repositories.py`
- [Account records](https://github.com/rootmoataz/paper-maker-banking-app/blob/1_backend-rest-api-without-db/app/repositories.py): `app/repositories.py`
- [Transaction history](https://github.com/rootmoataz/paper-maker-banking-app/blob/1_backend-rest-api-without-db/app/repositories.py): `app/repositories.py`

### Other components

- **API client**

## Connections

- API client → API routes: sends requests
- API routes → Request and response models: validates and serializes
- API routes → Customer service: calls customer operations
- API routes → Account service: calls account operations
- Customer service → Request and response models: creates customer results
- Account service → Request and response models: creates account and transaction results
- Customer service → User records: reads and writes
- Customer service → Account records: checks ownership and updates names
- Account service → User records: checks customer
- Account service → Account records: reads and writes
- Account service → Transaction history: records and reads history
- Customer service → Bank errors: raises
- Account service → Bank errors: raises
- API routes → Bank errors: maps errors to responses
- Memory store and lock → User records: owns repository
- Memory store and lock → Account records: owns repository
- Memory store and lock → Transaction history: owns repository
