# jeremyzhang0130/bas architecture

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

- Interactive diagram: https://gitdiagram.com/jeremyzhang0130/bas
- Repository: https://github.com/jeremyzhang0130/bas
- Video tour (about a minute): https://gitdiagram.com/jeremyzhang0130/bas/video

## Overview

BAS is a homework bank-administration command-line program. A user enters line-oriented commands; the main loop passes each command to a dispatcher, which validates and routes account, user, date, and persistence operations and prints their results. Account and user records are held in shared in-memory state, while date operations calculate interest as time advances. The README is brief, so the capability map follows the sampled command dispatcher and modules; unsampled implementation details are not inferred.

Main entry points: [`Cate.h`](https://github.com/jeremyzhang0130/bas/blob/main/Cate.h) (Command dispatcher), [`MainFile.cpp`](https://github.com/jeremyzhang0130/bas/blob/main/MainFile.cpp) (Runtime collections), [`BasicFunctions.h`](https://github.com/jeremyzhang0130/bas/blob/main/BasicFunctions.h) (Account commands), [`UserFunctions.h`](https://github.com/jeremyzhang0130/bas/blob/main/UserFunctions.h) (User commands)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Command entry"]
  node_main["Input loop<br/>[MainFile.cpp]"]
  node_dispatcher["Command dispatcher<br/>[Cate.h]"]
end

subgraph group_banking["Banking operations"]
  node_accounts_ops["Account commands<br/>[BasicFunctions.h]"]
  node_history["Save and history<br/>[BasicFunctions.h]"]
end

subgraph group_identity["User administration"]
  node_user_ops["User commands<br/>[UserFunctions.h]"]
end

subgraph group_time["Date and interest"]
  node_calendar["Date and interest<br/>[TimeInterest.h]"]
end

subgraph group_state["Shared state"]
  node_account_model["Account records<br/>[Account.h]"]
  node_shared_state[("Runtime collections<br/>[MainFile.cpp]")]
end

node_operator(("CLI user"))

node_operator -->|"enters commands"| node_main
node_main -->|"dispatches lines"| node_dispatcher
node_dispatcher -->|"routes banking"| node_accounts_ops
node_dispatcher -->|"routes users"| node_user_ops
node_dispatcher -->|"routes dates"| node_calendar
node_dispatcher -->|"routes history"| node_history
node_accounts_ops -->|"updates records"| node_account_model
node_accounts_ops -->|"reads and writes"| node_shared_state
node_user_ops -->|"reads and writes"| node_shared_state
node_calendar -->|"accrues interest"| node_shared_state
node_main -->|"initializes state"| node_shared_state

click node_main "https://github.com/jeremyzhang0130/bas/blob/main/MainFile.cpp"
click node_dispatcher "https://github.com/jeremyzhang0130/bas/blob/main/Cate.h"
click node_accounts_ops "https://github.com/jeremyzhang0130/bas/blob/main/BasicFunctions.h"
click node_history "https://github.com/jeremyzhang0130/bas/blob/main/BasicFunctions.h"
click node_user_ops "https://github.com/jeremyzhang0130/bas/blob/main/UserFunctions.h"
click node_calendar "https://github.com/jeremyzhang0130/bas/blob/main/TimeInterest.h"
click node_account_model "https://github.com/jeremyzhang0130/bas/blob/main/Account.h"
click node_shared_state "https://github.com/jeremyzhang0130/bas/blob/main/MainFile.cpp"

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_main,node_dispatcher,node_operator toneBlue
class node_accounts_ops,node_history toneAmber
class node_user_ops toneMint
class node_calendar toneRose
class node_account_model,node_shared_state toneIndigo
```

## Components

### Command entry

- [Input loop](https://github.com/jeremyzhang0130/bas/blob/main/MainFile.cpp): `MainFile.cpp`
- [Command dispatcher](https://github.com/jeremyzhang0130/bas/blob/main/Cate.h): `Cate.h`

### Banking operations

- [Account commands](https://github.com/jeremyzhang0130/bas/blob/main/BasicFunctions.h): `BasicFunctions.h`
- [Save and history](https://github.com/jeremyzhang0130/bas/blob/main/BasicFunctions.h): `BasicFunctions.h`

### User administration

- [User commands](https://github.com/jeremyzhang0130/bas/blob/main/UserFunctions.h): `UserFunctions.h`

### Date and interest

- [Date and interest](https://github.com/jeremyzhang0130/bas/blob/main/TimeInterest.h): `TimeInterest.h`

### Shared state

- [Account records](https://github.com/jeremyzhang0130/bas/blob/main/Account.h): `Account.h`
- [Runtime collections](https://github.com/jeremyzhang0130/bas/blob/main/MainFile.cpp): `MainFile.cpp`

### Other components

- **CLI user**

## Connections

- CLI user → Input loop: enters commands (evidence: `MainFile.cpp`)
- Input loop → Command dispatcher: dispatches lines (evidence: `MainFile.cpp`)
- Command dispatcher → Account commands: routes banking (evidence: `Cate.h`)
- Command dispatcher → User commands: routes users (evidence: `Cate.h`)
- Command dispatcher → Date and interest: routes dates (evidence: `Cate.h`)
- Command dispatcher → Save and history: routes history (evidence: `Cate.h`)
- Account commands → Account records: updates records (evidence: `BasicFunctions.h`)
- Account commands → Runtime collections: reads and writes (evidence: `BasicFunctions.h`)
- User commands → Runtime collections: reads and writes (evidence: `UserFunctions.h`)
- Date and interest → Runtime collections: accrues interest (evidence: `TimeInterest.h`)
- Input loop → Runtime collections: initializes state (evidence: `MainFile.cpp`)
