# yashpatel7025/expensemanager architecture

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

- Interactive diagram: https://gitdiagram.com/yashpatel7025/expensemanager
- Repository: https://github.com/yashpatel7025/expensemanager

## Overview

##### Project Identification
- This is a console-based expense manager application.
- It leverages a Linked List data structure to manage expenses and incomes.
- File Handling is used to persist data between application sessions.

##### Main Components
a. Console User Interface (UI):
- Represents the command-line interface where users add, view, and track daily expenses and incomes.
- Handles reading user input and displaying output.

b. Business Logic / Data Management:
- The heart of the application, where the linked list operations are implemented.
- Includes functions to insert, delete, update, and traverse the expense/income records.
- This component encapsulates the "model" that holds the current session's financial records.

c. Persistence Layer (File Handling):
- Manages reading from and writing to the file system. This ensures that data persists even when the application terminates.
- Includes logic for fetching and storing previous records from the file that holds all historical data.

##### Relationships and Interactions
- The Console UI gathers user input and sends corresponding commands to the Business Logic.
- The Business Logic uses linked list functions to update the data model as well as to generate views of the current records.
- When data changes or on startup, the Business Logic interacts with the Persistence Layer to read or save data.

##### Architectural Patterns and Concepts
- Separation of Concerns: Even if implemented in a single file, logically separate the UI, Business Logic, and Persistence functionalities.
- Data Structures: Emphasize the linked list as the main data structure for maintaining the dynamic list of expenses and incomes.
- Persistence through File I/O: Show how data is loaded at startup and stored upon termination to persist user records.

##### Incorporate Relevant Technologies and Concepts
- Language: C.
- Data Structures: Linked Lists.
- File Handling: Procedures to interact with file-system for persistent storage.

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "Expense Manager Application"
        UI["Console UI"]:::ui
        BL["Business Logic / Data Management"]:::bl
        LS["Linked List Operations"]:::ls
        PL["Persistence Layer (File Handling)"]:::pl
    end

    UI -->|"sendsCommand"| BL
    BL -->|"managesOperations"| LS
    BL -->|"persistsData"| PL
    PL -->|"loadsData"| BL

    click UI "https://github.com/yashpatel7025/expensemanager/blob/master/ds1.c"
    click BL "https://github.com/yashpatel7025/expensemanager/blob/master/ds1.c"
    click PL "https://github.com/yashpatel7025/expensemanager/blob/master/ds1.c"

    classDef ui fill:#AED6F1,stroke:#1F618D,stroke-width:2px
    classDef bl fill:#ABEBC6,stroke:#28B463,stroke-width:2px
    classDef ls fill:#FADBD8,stroke:#E74C3C,stroke-width:2px
    classDef pl fill:#F9E79F,stroke:#F1C40F,stroke-width:2px
```
