# codebrust/banksystem_in_c architecture

> Architecture diagram of the GitHub repository codebrust/banksystem_in_c, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/codebrust/banksystem_in_c
- Repository: https://github.com/codebrust/banksystem_in_c

## Overview

##### Project type and purpose
- This is a self-contained, console-based bank management system written in C, compiled via MinGW.
- It provides basic account operations (create, deposit, withdraw, display, search) and persists data to disk.

##### File structure
- Only three files:
- Makefile – build script using mingw32-make
- Readme.md – project description and build/run instructions
- main.c – entire codebase containing UI, logic, and file I/O

##### Main components
a. User Interface (CLI)
- Reads commands from stdin
- Displays menus, prompts, and results to stdout
b. Core Business Logic
- Processes user actions: createAccount(), deposit(), withdraw(), searchAccount(), modifyAccount(), deleteAccount(), viewAllAccounts()
- Enforces rules (e.g., non-negative balance)
c. Data Persistence
- File I/O module handling reading/writing account records to “account.dat” (or similar)
- Structures in memory (e.g., struct Account) serialized to disk

##### Architectural patterns and design principles
- Separation of concerns: UI vs. logic vs. persistence (even if all in one file, conceptually group them)
- Procedural modularity: each operation is a separate function
- Single binary deployment, no external services

##### Key technologies and frameworks
- Language: C99 or later
- Compiler: MinGW (mingw32-make)
- Build system: Makefile

##### Diagramming conventions
- Use rectangles for components (CLI, Business Logic, Data Store)
- Blue for UI components
- Green for business-logic modules
- Orange for persistence layer

b. Within the logic layer, split out the main functions as sub-blocks (Create, Deposit, Withdraw, Search).

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Bank Management System Architecture"
        UI["User Interface (CLI)"]:::ui
        Logic["Core Business Logic"]:::logic
        Persistence["Data Persistence"]:::persistence
    end

    Build["Build System (Makefile → a.exe)"]:::build
    Doc["Project Documentation (Readme.md)"]:::doc

    UI -->|"user requests"| Logic
    Logic -->|"load/store records"| Persistence
    Persistence -->|"return account data"| Logic
    Logic -->|"operation results"| UI
    Build -.->|compiles| UI
    Doc -.->|documents| UI

    click UI "https://github.com/codebrust/banksystem_in_c/blob/master/main.c"
    click Logic "https://github.com/codebrust/banksystem_in_c/blob/master/main.c"
    click Persistence "https://github.com/codebrust/banksystem_in_c/blob/master/main.c"
    click Build "https://github.com/codebrust/banksystem_in_c/tree/master/Makefile"
    click Doc "https://github.com/codebrust/banksystem_in_c/blob/master/Readme.md"

    classDef ui fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef logic fill:#90EE90,stroke:#333,stroke-width:1px
    classDef persistence fill:#FFA500,stroke:#333,stroke-width:1px
    classDef build fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef doc fill:#F5F5F5,stroke:#333,stroke-width:1px
```
