# muthugopi/fundflow architecture

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

- Interactive diagram: https://gitdiagram.com/muthugopi/fundflow
- Repository: https://github.com/muthugopi/fundflow

## Overview

FundFlow is a command-line personal finance manager. A user authenticates, then issues commands through the CLI for member records, balances, loans, and interest; results are displayed or persisted. The main domain layer manages member state and summaries, while separate code handles compound-interest calculations, authentication, and audit logging. The README also documents save/load and log-viewing capabilities. Runtime links below are based on the excerpts; file locations are shown only where supported by the tree or source.

Main entry points: [`src/main.cpp`](https://github.com/muthugopi/fundflow/blob/main/src/main.cpp) (Command loop), [`src/log_controller/log_service.cpp`](https://github.com/muthugopi/fundflow/blob/main/src/log_controller/log_service.cpp) (Action logging), [`include/data_manager.h`](https://github.com/muthugopi/fundflow/blob/main/include/data_manager.h) (Member state), [`src/data_manager.cpp`](https://github.com/muthugopi/fundflow/blob/main/src/data_manager.cpp) (Member operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Command interface"]
  node_cli["Command loop<br/>[main.cpp]"]
end

subgraph group_finance["Finance operations"]
  node_memberops["Member operations<br/>[data_manager.cpp]"]
  node_summaries["Balance summaries<br/>[data_manager.cpp]"]
  node_loans["Loan management<br/>[data_manager.cpp]"]
  node_interestapply["Applied interest<br/>[data_manager.cpp]"]
  node_interestcalc["Interest calculation<br/>[intrest.cpp]"]
  node_memberstate[("Member state<br/>[data_manager.h]")]
end

subgraph group_identity["Authentication"]
  node_auth["Login<br/>[auth.cpp]"]
  node_credentialfile[("Credential file")]
end

subgraph group_audit["Persistence and audit"]
  node_persistence["Save and load<br/>[data_manager.cpp]"]
  node_datafile[("Member data file")]
  node_logger["Action logging<br/>[log_service.cpp]"]
  node_logfile[("Log file")]
end

node_user(("Finance user"))

node_user -->|"enters commands"| node_cli
node_cli -->|"requests login"| node_auth
node_auth -->|"checks credentials"| node_credentialfile
node_cli -->|"manages members"| node_memberops
node_cli -->|"requests totals"| node_summaries
node_cli -->|"issues loans"| node_loans
node_cli -->|"applies interest"| node_interestapply
node_cli -->|"calculates interest"| node_interestcalc
node_memberops -->|"updates records"| node_memberstate
node_summaries -->|"totals balances"| node_memberstate
node_loans -->|"updates loans"| node_memberstate
node_interestapply -->|"updates balances"| node_memberstate
node_interestcalc -->|"reads savings"| node_memberstate
node_cli -->|"saves or loads"| node_persistence
node_persistence -->|"serializes records"| node_memberstate
node_persistence -->|"reads and writes"| node_datafile
node_memberops -->|"records actions"| node_logger
node_summaries -->|"records totals"| node_logger
node_persistence -->|"records persistence"| node_logger
node_cli -->|"records commands"| node_logger
node_cli -->|"views logs"| node_logger
node_memberops -->|"reads log history"| node_logfile
node_logger -->|"appends entries"| node_logfile

click node_cli "https://github.com/muthugopi/fundflow/blob/main/src/main.cpp"
click node_auth "https://github.com/muthugopi/fundflow/blob/main/src/auth/auth.cpp"
click node_memberops "https://github.com/muthugopi/fundflow/blob/main/src/data_manager.cpp"
click node_summaries "https://github.com/muthugopi/fundflow/blob/main/src/data_manager.cpp"
click node_loans "https://github.com/muthugopi/fundflow/blob/main/src/data_manager.cpp"
click node_interestapply "https://github.com/muthugopi/fundflow/blob/main/src/data_manager.cpp"
click node_interestcalc "https://github.com/muthugopi/fundflow/blob/main/src/intrest.cpp"
click node_memberstate "https://github.com/muthugopi/fundflow/blob/main/include/data_manager.h"
click node_persistence "https://github.com/muthugopi/fundflow/blob/main/src/data_manager.cpp"
click node_logger "https://github.com/muthugopi/fundflow/blob/main/src/log_controller/log_service.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_cli,node_user toneBlue
class node_memberops,node_summaries,node_loans,node_interestapply,node_interestcalc,node_memberstate toneAmber
class node_auth,node_credentialfile toneMint
class node_persistence,node_datafile,node_logger,node_logfile toneRose
```

## Components

### Command interface

- [Command loop](https://github.com/muthugopi/fundflow/blob/main/src/main.cpp): `src/main.cpp`

### Finance operations

- [Member operations](https://github.com/muthugopi/fundflow/blob/main/src/data_manager.cpp): `src/data_manager.cpp`
- [Balance summaries](https://github.com/muthugopi/fundflow/blob/main/src/data_manager.cpp): `src/data_manager.cpp`
- [Loan management](https://github.com/muthugopi/fundflow/blob/main/src/data_manager.cpp): `src/data_manager.cpp`
- [Applied interest](https://github.com/muthugopi/fundflow/blob/main/src/data_manager.cpp): `src/data_manager.cpp`
- [Interest calculation](https://github.com/muthugopi/fundflow/blob/main/src/intrest.cpp): `src/intrest.cpp`
- [Member state](https://github.com/muthugopi/fundflow/blob/main/include/data_manager.h): `include/data_manager.h`

### Authentication

- [Login](https://github.com/muthugopi/fundflow/blob/main/src/auth/auth.cpp): `src/auth/auth.cpp`
- **Credential file**

### Persistence and audit

- [Save and load](https://github.com/muthugopi/fundflow/blob/main/src/data_manager.cpp): `src/data_manager.cpp`
- **Member data file**
- [Action logging](https://github.com/muthugopi/fundflow/blob/main/src/log_controller/log_service.cpp): `src/log_controller/log_service.cpp`
- **Log file**

### Other components

- **Finance user**

## Connections

- Finance user → Command loop: enters commands (evidence: `README.md`)
- Command loop → Login: requests login (evidence: `src/main.cpp`)
- Login → Credential file: checks credentials (evidence: `src/auth/auth.cpp`)
- Command loop → Member operations: manages members (evidence: `src/main.cpp`)
- Command loop → Balance summaries: requests totals (evidence: `src/main.cpp`)
- Command loop → Loan management: issues loans (evidence: `src/main.cpp`)
- Command loop → Applied interest: applies interest (evidence: `src/main.cpp`)
- Command loop → Interest calculation: calculates interest (evidence: `src/main.cpp`)
- Member operations → Member state: updates records (evidence: `src/data_manager.cpp`)
- Balance summaries → Member state: totals balances (evidence: `src/data_manager.cpp`)
- Loan management → Member state: updates loans (evidence: `src/data_manager.cpp`)
- Applied interest → Member state: updates balances (evidence: `src/data_manager.cpp`)
- Interest calculation → Member state: reads savings (evidence: `src/intrest.cpp`)
- Command loop → Save and load: saves or loads (evidence: `src/main.cpp`)
- Save and load → Member state: serializes records (evidence: `src/data_manager.cpp`)
- Save and load → Member data file: reads and writes (evidence: `src/data_manager.cpp`)
- Member operations → Action logging: records actions (evidence: `src/data_manager.cpp`)
- Balance summaries → Action logging: records totals (evidence: `src/data_manager.cpp`)
- Save and load → Action logging: records persistence (evidence: `src/data_manager.cpp`)
- Command loop → Action logging: records commands (evidence: `src/main.cpp`)
- Command loop → Action logging: views logs (evidence: `src/main.cpp`)
- Member operations → Log file: reads log history (evidence: `src/data_manager.cpp`)
- Action logging → Log file: appends entries (evidence: `src/log_controller/log_service.cpp`)
