# kirubakaran83/expense_tracker architecture

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

- Interactive diagram: https://gitdiagram.com/kirubakaran83/expense_tracker
- Repository: https://github.com/kirubakaran83/expense_tracker

## Overview

AI Finance Tracker is a Django personal-finance application. Users manage transactions and budgets, then view summaries, charts, alerts, and financial-health insights; they can also use AI chat and voice-assisted transaction entry. The graph preserves documented capabilities such as recurring entries, PDF reports, and PWA support. Some implementation details are unsampled, so those branches rely on README documentation and are shown only where the relationship is explicit.

Main entry points: [`transactions/views.py`](https://github.com/kirubakaran83/expense_tracker/blob/main/transactions/views.py) (Finance dashboard), [`transactions/models.py`](https://github.com/kirubakaran83/expense_tracker/blob/main/transactions/models.py) (Transactions & budgets), [`insights/services.py`](https://github.com/kirubakaran83/expense_tracker/blob/main/insights/services.py) (Summaries & snapshots), [`insights/chat_engine.py`](https://github.com/kirubakaran83/expense_tracker/blob/main/insights/chat_engine.py) (Finance chatbot)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Accounts &amp; Access"]
  node_account_views["Registration &amp; profile<br/>[views.py]"]
  node_account_models[("User profiles<br/>[models.py]")]
end

subgraph group_finance["Finance Records"]
  node_transaction_views["Finance dashboard<br/>[views.py]"]
  node_transaction_models[("Transactions &amp; budgets<br/>[models.py]")]
  node_recurring["Recurring entries<br/>[run_recurring.py]"]
end

subgraph group_insights["Analytics &amp; Budgets"]
  node_analytics_services["Summaries &amp; snapshots<br/>[services.py]"]
  node_budget_alerts["Budget alerts<br/>[budget_alerts.py]"]
  node_budget_progress["Budget progress<br/>[budget_progress.py]"]
  node_budget_suggest["Budget suggestions<br/>[budget_suggest.py]"]
  node_health["Financial health<br/>[health_score.py]"]
  node_comparison["Month comparison<br/>[month_compare.py]"]
  node_charts["Charts<br/>[charts.py]"]
  node_insight_snapshots[("Insight snapshots<br/>[models.py]")]
end

subgraph group_ai["AI &amp; Capture"]
  node_chat["Finance chatbot<br/>[chat_engine.py]"]
  node_classifier["Transaction classifier<br/>[ai_engine.py]"]
  node_parser["Transaction text parser"]
  node_voice["Voice entry<br/>[voice_service.py]"]
end

subgraph group_experience["Reports &amp; App"]
  node_pdf["Monthly PDF report<br/>[pdf.py]"]
  node_pwa["Offline PWA support<br/>[service-worker.js]"]
end

node_user(("Finance user"))
node_groq{{"Groq AI service"}}
node_ollama_openai{{"Ollama / OpenAI"}}

node_user -->|"registers"| node_account_views
node_user -->|"manages finances"| node_transaction_views
node_transaction_views -->|"reads and writes"| node_transaction_models
node_transaction_models -->|"classifies descriptions"| node_classifier
node_recurring -->|"creates entries"| node_transaction_models
node_transaction_views -->|"requests summaries"| node_analytics_services
node_analytics_services -->|"aggregates records"| node_transaction_models
node_analytics_services -->|"updates snapshots"| node_insight_snapshots
node_analytics_services -->|"generates alerts"| node_budget_alerts
node_budget_alerts -->|"checks spending"| node_transaction_models
node_transaction_views -->|"requests progress"| node_budget_progress
node_transaction_views -->|"requests suggestions"| node_budget_suggest
node_transaction_views -->|"requests health score"| node_health
node_transaction_views -->|"requests comparison"| node_comparison
node_transaction_views -.->|"serves chart data"| node_charts
node_user -->|"asks questions"| node_chat
node_transaction_views -->|"dispatches chat"| node_chat
node_chat -->|"builds financial context"| node_transaction_models
node_chat -->|"requests completions"| node_groq
node_classifier -->|"classifies with LLM"| node_groq
node_transaction_views -->|"parses entry text"| node_parser
node_transaction_views -.->|"handles voice entry"| node_voice
node_user -->|"downloads report"| node_pdf
node_pdf -->|"gets monthly summary"| node_analytics_services
node_user -->|"installs app"| node_pwa
node_classifier -.->|"may use alternate AI"| node_ollama_openai

click node_account_views "https://github.com/kirubakaran83/expense_tracker/blob/main/accounts/views.py"
click node_account_models "https://github.com/kirubakaran83/expense_tracker/blob/main/accounts/models.py"
click node_transaction_views "https://github.com/kirubakaran83/expense_tracker/blob/main/transactions/views.py"
click node_transaction_models "https://github.com/kirubakaran83/expense_tracker/blob/main/transactions/models.py"
click node_recurring "https://github.com/kirubakaran83/expense_tracker/blob/main/transactions/management/commands/run_recurring.py"
click node_analytics_services "https://github.com/kirubakaran83/expense_tracker/blob/main/insights/services.py"
click node_budget_alerts "https://github.com/kirubakaran83/expense_tracker/blob/main/insights/budget_alerts.py"
click node_budget_progress "https://github.com/kirubakaran83/expense_tracker/blob/main/insights/budget_progress.py"
click node_budget_suggest "https://github.com/kirubakaran83/expense_tracker/blob/main/insights/budget_suggest.py"
click node_health "https://github.com/kirubakaran83/expense_tracker/blob/main/insights/health_score.py"
click node_comparison "https://github.com/kirubakaran83/expense_tracker/blob/main/insights/month_compare.py"
click node_charts "https://github.com/kirubakaran83/expense_tracker/blob/main/insights/charts.py"
click node_insight_snapshots "https://github.com/kirubakaran83/expense_tracker/blob/main/insights/models.py"
click node_chat "https://github.com/kirubakaran83/expense_tracker/blob/main/insights/chat_engine.py"
click node_classifier "https://github.com/kirubakaran83/expense_tracker/blob/main/insights/ai_engine.py"
click node_parser "https://github.com/kirubakaran83/expense_tracker/blob/main/insights/transaction_parser.py"
click node_voice "https://github.com/kirubakaran83/expense_tracker/blob/main/insights/voice_service.py"
click node_pdf "https://github.com/kirubakaran83/expense_tracker/blob/main/transactions/pdf.py"
click node_pwa "https://github.com/kirubakaran83/expense_tracker/blob/main/static/service-worker.js"

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_account_views,node_account_models,node_user toneBlue
class node_transaction_views,node_transaction_models,node_recurring toneAmber
class node_analytics_services,node_budget_alerts,node_budget_progress,node_budget_suggest,node_health,node_comparison,node_charts,node_insight_snapshots toneMint
class node_chat,node_classifier,node_parser,node_voice toneRose
class node_pdf,node_pwa,node_groq,node_ollama_openai toneIndigo
```

## Components

### Accounts & Access

- [Registration & profile](https://github.com/kirubakaran83/expense_tracker/blob/main/accounts/views.py): `accounts/views.py`
- [User profiles](https://github.com/kirubakaran83/expense_tracker/blob/main/accounts/models.py): `accounts/models.py`

### Finance Records

- [Finance dashboard](https://github.com/kirubakaran83/expense_tracker/blob/main/transactions/views.py): `transactions/views.py`
- [Transactions & budgets](https://github.com/kirubakaran83/expense_tracker/blob/main/transactions/models.py): `transactions/models.py`
- [Recurring entries](https://github.com/kirubakaran83/expense_tracker/blob/main/transactions/management/commands/run_recurring.py): `transactions/management/commands/run_recurring.py`

### Analytics & Budgets

- [Summaries & snapshots](https://github.com/kirubakaran83/expense_tracker/blob/main/insights/services.py): `insights/services.py`
- [Budget alerts](https://github.com/kirubakaran83/expense_tracker/blob/main/insights/budget_alerts.py): `insights/budget_alerts.py`
- [Budget progress](https://github.com/kirubakaran83/expense_tracker/blob/main/insights/budget_progress.py): `insights/budget_progress.py`
- [Budget suggestions](https://github.com/kirubakaran83/expense_tracker/blob/main/insights/budget_suggest.py): `insights/budget_suggest.py`
- [Financial health](https://github.com/kirubakaran83/expense_tracker/blob/main/insights/health_score.py): `insights/health_score.py`
- [Month comparison](https://github.com/kirubakaran83/expense_tracker/blob/main/insights/month_compare.py): `insights/month_compare.py`
- [Charts](https://github.com/kirubakaran83/expense_tracker/blob/main/insights/charts.py): `insights/charts.py`
- [Insight snapshots](https://github.com/kirubakaran83/expense_tracker/blob/main/insights/models.py): `insights/models.py`

### AI & Capture

- [Finance chatbot](https://github.com/kirubakaran83/expense_tracker/blob/main/insights/chat_engine.py): `insights/chat_engine.py`
- [Transaction classifier](https://github.com/kirubakaran83/expense_tracker/blob/main/insights/ai_engine.py): `insights/ai_engine.py`
- [Transaction text parser](https://github.com/kirubakaran83/expense_tracker/blob/main/insights/transaction_parser.py): `insights/transaction_parser.py`
- [Voice entry](https://github.com/kirubakaran83/expense_tracker/blob/main/insights/voice_service.py): `insights/voice_service.py`

### Reports & App

- [Monthly PDF report](https://github.com/kirubakaran83/expense_tracker/blob/main/transactions/pdf.py): `transactions/pdf.py`
- [Offline PWA support](https://github.com/kirubakaran83/expense_tracker/blob/main/static/service-worker.js): `static/service-worker.js`

### Other components

- **Finance user**
- **Groq AI service**
- **Ollama / OpenAI**

## Connections

- Finance user → Registration & profile: registers (evidence: `accounts/views.py`)
- Finance user → Finance dashboard: manages finances (evidence: `README.md`)
- Finance dashboard → Transactions & budgets: reads and writes (evidence: `transactions/views.py`)
- Transactions & budgets → Transaction classifier: classifies descriptions (evidence: `transactions/models.py`)
- Recurring entries → Transactions & budgets: creates entries (evidence: `transactions/management/commands/run_recurring.py`)
- Finance dashboard → Summaries & snapshots: requests summaries (evidence: `transactions/views.py`)
- Summaries & snapshots → Transactions & budgets: aggregates records (evidence: `insights/services.py`)
- Summaries & snapshots → Insight snapshots: updates snapshots (evidence: `insights/services.py`)
- Summaries & snapshots → Budget alerts: generates alerts (evidence: `insights/services.py`)
- Budget alerts → Transactions & budgets: checks spending (evidence: `insights/budget_alerts.py`)
- Finance dashboard → Budget progress: requests progress (evidence: `transactions/views.py`)
- Finance dashboard → Budget suggestions: requests suggestions (evidence: `transactions/views.py`)
- Finance dashboard → Financial health: requests health score (evidence: `transactions/views.py`)
- Finance dashboard → Month comparison: requests comparison (evidence: `transactions/views.py`)
- Finance dashboard → Charts: serves chart data
- Finance user → Finance chatbot: asks questions (evidence: `README.md`)
- Finance dashboard → Finance chatbot: dispatches chat (evidence: `transactions/views.py`)
- Finance chatbot → Transactions & budgets: builds financial context (evidence: `insights/chat_engine.py`)
- Finance chatbot → Groq AI service: requests completions (evidence: `insights/chat_engine.py`)
- Transaction classifier → Groq AI service: classifies with LLM (evidence: `insights/ai_engine.py`)
- Finance dashboard → Transaction text parser: parses entry text (evidence: `transactions/views.py`)
- Finance dashboard → Voice entry: handles voice entry
- Finance user → Monthly PDF report: downloads report (evidence: `README.md`)
- Monthly PDF report → Summaries & snapshots: gets monthly summary (evidence: `transactions/pdf.py`)
- Finance user → Offline PWA support: installs app (evidence: `README.md`)
- Transaction classifier → Ollama / OpenAI: may use alternate AI (evidence: `README.md`)
