# kashifali-it/fingen architecture

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

- Interactive diagram: https://gitdiagram.com/kashifali-it/fingen
- Repository: https://github.com/kashifali-it/fingen

## Overview

FinGenius is a Gradio personal-finance application. Users interact with its interface to manage finances and, in the main evidenced flow, receipt data is extracted, optionally categorized, and saved. The large `app.py` file combines interface, domain behavior, and SQLite access; a separate chatbot module provides language-aware financial advice through Groq. The README is only metadata, so major capabilities are identified from sampled UI and source excerpts; unsampled workflows and their connections are not asserted.

Main entry points: [`fin_genius_chatbot.py`](https://github.com/kashifali-it/fingen/blob/main/fin_genius_chatbot.py) (Chat Handler), [`app.py`](https://github.com/kashifali-it/fingen/blob/main/app.py) (Receipt Processing), [`components/fingenius.db`](https://github.com/kashifali-it/fingen/blob/main/components/fingenius.db) (SQLite Database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_finance["Finance App"]
  node_app_ui["Finance Interface<br/>[app.py]"]
  node_account["Account Management<br/>[app.py]"]
  node_expenses["Expense Tracking<br/>[app.py]"]
  node_investments["Investment Tracking<br/>[app.py]"]
  node_analytics["Financial Analytics<br/>[app.py]"]
  node_budget["Budget Calculator<br/>[logic.py]"]
end

subgraph group_receipt["Receipt Handling"]
  node_receipt_flow["Receipt Processing<br/>[app.py]"]
  node_categorization["Expense Categorization<br/>[app.py]"]
end

subgraph group_storage["Persistence"]
  node_db_service["Database Service<br/>[app.py]"]
  node_db_file[("SQLite Database<br/>[fingenius.db]")]
end

subgraph group_chat["Financial Chat"]
  node_chat_ui["Chat Interface"]
  node_language["Language Detection"]
  node_chat_handler["Chat Handler"]
  node_groq{{"Groq API"}}
end

node_user(("User"))

node_user -->|"uses"| node_app_ui
node_user -->|"chats with"| node_chat_ui
node_receipt_flow -->|"requests category"| node_categorization
node_receipt_flow -->|"saves receipt"| node_db_service
node_db_service -->|"stores data"| node_db_file
node_chat_ui -->|"submits message"| node_chat_handler
node_chat_handler -->|"detects language"| node_language
node_chat_handler -->|"requests completion"| node_groq

click node_app_ui "https://github.com/kashifali-it/fingen/blob/main/app.py"
click node_account "https://github.com/kashifali-it/fingen/blob/main/app.py"
click node_expenses "https://github.com/kashifali-it/fingen/blob/main/app.py"
click node_investments "https://github.com/kashifali-it/fingen/blob/main/app.py"
click node_analytics "https://github.com/kashifali-it/fingen/blob/main/app.py"
click node_budget "https://github.com/kashifali-it/fingen/blob/main/components/logic.py"
click node_receipt_flow "https://github.com/kashifali-it/fingen/blob/main/app.py"
click node_categorization "https://github.com/kashifali-it/fingen/blob/main/app.py"
click node_db_service "https://github.com/kashifali-it/fingen/blob/main/app.py"
click node_db_file "https://github.com/kashifali-it/fingen/blob/main/components/fingenius.db"
click node_chat_ui "https://github.com/kashifali-it/fingen/blob/main/fin_genius_chatbot.py"
click node_language "https://github.com/kashifali-it/fingen/blob/main/fin_genius_chatbot.py"
click node_chat_handler "https://github.com/kashifali-it/fingen/blob/main/fin_genius_chatbot.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_app_ui,node_account,node_expenses,node_investments,node_analytics,node_budget,node_user toneBlue
class node_receipt_flow,node_categorization toneAmber
class node_db_service,node_db_file toneMint
class node_chat_ui,node_language,node_chat_handler,node_groq toneRose
```

## Components

### Finance App

- [Finance Interface](https://github.com/kashifali-it/fingen/blob/main/app.py): `app.py`
- [Account Management](https://github.com/kashifali-it/fingen/blob/main/app.py): `app.py`
- [Expense Tracking](https://github.com/kashifali-it/fingen/blob/main/app.py): `app.py`
- [Investment Tracking](https://github.com/kashifali-it/fingen/blob/main/app.py): `app.py`
- [Financial Analytics](https://github.com/kashifali-it/fingen/blob/main/app.py): `app.py`
- [Budget Calculator](https://github.com/kashifali-it/fingen/blob/main/components/logic.py): `components/logic.py`

### Receipt Handling

- [Receipt Processing](https://github.com/kashifali-it/fingen/blob/main/app.py): `app.py`
- [Expense Categorization](https://github.com/kashifali-it/fingen/blob/main/app.py): `app.py`

### Persistence

- [Database Service](https://github.com/kashifali-it/fingen/blob/main/app.py): `app.py`
- [SQLite Database](https://github.com/kashifali-it/fingen/blob/main/components/fingenius.db): `components/fingenius.db`

### Financial Chat

- [Chat Interface](https://github.com/kashifali-it/fingen/blob/main/fin_genius_chatbot.py): `fin_genius_chatbot.py`
- [Language Detection](https://github.com/kashifali-it/fingen/blob/main/fin_genius_chatbot.py): `fin_genius_chatbot.py`
- [Chat Handler](https://github.com/kashifali-it/fingen/blob/main/fin_genius_chatbot.py): `fin_genius_chatbot.py`
- **Groq API**

### Other components

- **User**

## Connections

- User → Finance Interface: uses (evidence: `app.py`)
- User → Chat Interface: chats with (evidence: `fin_genius_chatbot.py`)
- Receipt Processing → Expense Categorization: requests category (evidence: `app.py`)
- Receipt Processing → Database Service: saves receipt (evidence: `app.py`)
- Database Service → SQLite Database: stores data (evidence: `app.py`)
- Chat Interface → Chat Handler: submits message (evidence: `fin_genius_chatbot.py`)
- Chat Handler → Language Detection: detects language (evidence: `fin_genius_chatbot.py`)
- Chat Handler → Groq API: requests completion (evidence: `fin_genius_chatbot.py`)
