# aditya4453/devchallenge architecture

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

- Interactive diagram: https://gitdiagram.com/aditya4453/devchallenge
- Repository: https://github.com/aditya4453/devchallenge

## Overview

ExpenseAI is a personal-finance dashboard whose main workflow is entering English or Hinglish transaction text, parsing and storing it through the Express API, then viewing monthly summaries and transaction analytics. Users can also import spreadsheets, filter and sort records, delete transactions, and export CSV or chart images. The frontend mirrors transactions in localStorage; backend records are in memory. Ollama parsing is optional, with a keyword fallback. Backend internals are not excerpted, so their relationships rely on README documentation.

Main entry points: [`frontend/src/App.jsx`](https://github.com/aditya4453/devchallenge/blob/master/frontend/src/App.jsx) (Dashboard state), [`backend/server.js`](https://github.com/aditya4453/devchallenge/blob/master/backend/server.js) (Transaction parsing), [`frontend/src/components/TransactionList.jsx`](https://github.com/aditya4453/devchallenge/blob/master/frontend/src/components/TransactionList.jsx) (Transaction list), [`frontend/src/main.jsx`](https://github.com/aditya4453/devchallenge/blob/master/frontend/src/main.jsx) (React entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Dashboard"]
  node_entry["React entry<br/>[main.jsx]"]
  node_app["Dashboard state<br/>[App.jsx]"]
  node_header["Month controls<br/>[Header.jsx]"]
  node_import["Spreadsheet import<br/>[ImportModal.jsx]"]
  node_input["Natural-language input<br/>[HeroInput.jsx]"]
  node_api["API client<br/>[api.js]"]
  node_browserstore[("Browser persistence<br/>[App.jsx]")]
  node_toast["Notifications"]
  node_loading["Loading screen<br/>[LoadingScreen.jsx]"]
end

subgraph group_backend["Transaction API"]
  node_parser["Transaction parsing<br/>[server.js]"]
  node_store[("In-memory transactions<br/>[server.js]")]
end

subgraph group_analytics["Views and exports"]
  node_summary["Monthly summaries<br/>[SummaryCards.jsx]"]
  node_chart["Category chart<br/>[CategoryChart.jsx]"]
  node_transactions["Transaction list"]
  node_colors["Category colors<br/>[categoryColors.js]"]
end

subgraph group_integrations["External services"]
  node_ollama["Ollama model"]
end

node_user(("User"))

node_user -->|"opens dashboard"| node_entry
node_entry -->|"renders"| node_app
node_app -->|"renders"| node_header
node_app -->|"renders"| node_input
node_app -->|"renders"| node_summary
node_app -->|"renders"| node_chart
node_app -->|"renders"| node_transactions
node_app -->|"renders"| node_toast
node_app -->|"renders"| node_loading
node_header -->|"renders"| node_import
node_input -.->|"submits text"| node_app
node_import -.->|"returns imported rows"| node_app
node_app -->|"calls transaction API"| node_api
node_api -->|"sends parse requests"| node_parser
node_parser -->|"stores transactions"| node_store
node_parser -.->|"requests parsing"| node_ollama
node_app -->|"reads and writes"| node_browserstore
node_app -->|"provides filtered totals"| node_summary
node_app -->|"provides filtered transactions"| node_chart
node_app -->|"provides filtered transactions"| node_transactions
node_transactions -->|"uses category styles"| node_colors

click node_entry "https://github.com/aditya4453/devchallenge/blob/master/frontend/src/main.jsx"
click node_app "https://github.com/aditya4453/devchallenge/blob/master/frontend/src/App.jsx"
click node_header "https://github.com/aditya4453/devchallenge/blob/master/frontend/src/components/Header.jsx"
click node_import "https://github.com/aditya4453/devchallenge/blob/master/frontend/src/components/ImportModal.jsx"
click node_input "https://github.com/aditya4453/devchallenge/blob/master/frontend/src/components/HeroInput.jsx"
click node_api "https://github.com/aditya4453/devchallenge/blob/master/frontend/src/services/api.js"
click node_browserstore "https://github.com/aditya4453/devchallenge/blob/master/frontend/src/App.jsx"
click node_parser "https://github.com/aditya4453/devchallenge/blob/master/backend/server.js"
click node_store "https://github.com/aditya4453/devchallenge/blob/master/backend/server.js"
click node_summary "https://github.com/aditya4453/devchallenge/blob/master/frontend/src/components/SummaryCards.jsx"
click node_chart "https://github.com/aditya4453/devchallenge/blob/master/frontend/src/components/CategoryChart.jsx"
click node_transactions "https://github.com/aditya4453/devchallenge/blob/master/frontend/src/components/TransactionList.jsx"
click node_colors "https://github.com/aditya4453/devchallenge/blob/master/frontend/src/lib/categoryColors.js"
click node_toast "https://github.com/aditya4453/devchallenge/blob/master/frontend/src/components/ToastNotification.jsx"
click node_loading "https://github.com/aditya4453/devchallenge/blob/master/frontend/src/components/LoadingScreen.jsx"

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_entry,node_app,node_header,node_import,node_input,node_api,node_browserstore,node_toast,node_loading,node_user toneBlue
class node_parser,node_store toneAmber
class node_summary,node_chart,node_transactions,node_colors toneMint
class node_ollama toneRose
```

## Components

### Dashboard

- [React entry](https://github.com/aditya4453/devchallenge/blob/master/frontend/src/main.jsx): `frontend/src/main.jsx`
- [Dashboard state](https://github.com/aditya4453/devchallenge/blob/master/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Month controls](https://github.com/aditya4453/devchallenge/blob/master/frontend/src/components/Header.jsx): `frontend/src/components/Header.jsx`
- [Spreadsheet import](https://github.com/aditya4453/devchallenge/blob/master/frontend/src/components/ImportModal.jsx): `frontend/src/components/ImportModal.jsx`
- [Natural-language input](https://github.com/aditya4453/devchallenge/blob/master/frontend/src/components/HeroInput.jsx): `frontend/src/components/HeroInput.jsx`
- [API client](https://github.com/aditya4453/devchallenge/blob/master/frontend/src/services/api.js): `frontend/src/services/api.js`
- [Browser persistence](https://github.com/aditya4453/devchallenge/blob/master/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Notifications](https://github.com/aditya4453/devchallenge/blob/master/frontend/src/components/ToastNotification.jsx): `frontend/src/components/ToastNotification.jsx`
- [Loading screen](https://github.com/aditya4453/devchallenge/blob/master/frontend/src/components/LoadingScreen.jsx): `frontend/src/components/LoadingScreen.jsx`

### Transaction API

- [Transaction parsing](https://github.com/aditya4453/devchallenge/blob/master/backend/server.js): `backend/server.js`
- [In-memory transactions](https://github.com/aditya4453/devchallenge/blob/master/backend/server.js): `backend/server.js`

### Views and exports

- [Monthly summaries](https://github.com/aditya4453/devchallenge/blob/master/frontend/src/components/SummaryCards.jsx): `frontend/src/components/SummaryCards.jsx`
- [Category chart](https://github.com/aditya4453/devchallenge/blob/master/frontend/src/components/CategoryChart.jsx): `frontend/src/components/CategoryChart.jsx`
- [Transaction list](https://github.com/aditya4453/devchallenge/blob/master/frontend/src/components/TransactionList.jsx): `frontend/src/components/TransactionList.jsx`
- [Category colors](https://github.com/aditya4453/devchallenge/blob/master/frontend/src/lib/categoryColors.js): `frontend/src/lib/categoryColors.js`

### External services

- **Ollama model**

### Other components

- **User**

## Connections

- User → React entry: opens dashboard (evidence: `frontend/src/main.jsx`)
- React entry → Dashboard state: renders (evidence: `frontend/src/main.jsx`)
- Dashboard state → Month controls: renders (evidence: `frontend/src/App.jsx`)
- Dashboard state → Natural-language input: renders (evidence: `frontend/src/App.jsx`)
- Dashboard state → Monthly summaries: renders (evidence: `frontend/src/App.jsx`)
- Dashboard state → Category chart: renders (evidence: `frontend/src/App.jsx`)
- Dashboard state → Transaction list: renders (evidence: `frontend/src/App.jsx`)
- Dashboard state → Notifications: renders (evidence: `frontend/src/App.jsx`)
- Dashboard state → Loading screen: renders (evidence: `frontend/src/App.jsx`)
- Month controls → Spreadsheet import: renders (evidence: `frontend/src/components/Header.jsx`)
- Natural-language input → Dashboard state: submits text (evidence: `frontend/src/App.jsx`)
- Spreadsheet import → Dashboard state: returns imported rows
- Dashboard state → API client: calls transaction API (evidence: `frontend/src/App.jsx`)
- API client → Transaction parsing: sends parse requests (evidence: `README.md`)
- Transaction parsing → In-memory transactions: stores transactions (evidence: `README.md`)
- Transaction parsing → Ollama model: requests parsing (evidence: `README.md`)
- Dashboard state → Browser persistence: reads and writes (evidence: `README.md`)
- Dashboard state → Monthly summaries: provides filtered totals (evidence: `frontend/src/App.jsx`)
- Dashboard state → Category chart: provides filtered transactions (evidence: `frontend/src/App.jsx`)
- Dashboard state → Transaction list: provides filtered transactions (evidence: `frontend/src/App.jsx`)
- Transaction list → Category colors: uses category styles (evidence: `frontend/src/components/TransactionList.jsx`)
