# akashathani09/expense-track architecture

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

- Interactive diagram: https://gitdiagram.com/akashathani09/expense-track
- Repository: https://github.com/akashathani09/expense-track

## Overview

Expense-Track is a browser-based income and expense tracker backed by an Express API and MongoDB. Users add transactions through a form, review their transaction history, delete entries, and see calculated balance totals and an expense chart. The frontend context loads and updates transaction state through HTTP requests; the server routes those requests to controller operations backed by a transaction model. The README is minimal, so capabilities and relationships here are based on the sampled source and source index; the chart implementation and model details were not excerpted.

Main entry points: [`server/client/src/Context/GlobalState.jsx`](https://github.com/akashathani09/expense-track/blob/main/server/client/src/Context/GlobalState.jsx) (Global State), [`server/client/src/App.jsx`](https://github.com/akashathani09/expense-track/blob/main/server/client/src/App.jsx) (Dashboard App), [`server/client/src/components/TransactionList.jsx`](https://github.com/akashathani09/expense-track/blob/main/server/client/src/components/TransactionList.jsx) (Transaction History), [`server/client/src/components/TransactionForm.jsx`](https://github.com/akashathani09/expense-track/blob/main/server/client/src/components/TransactionForm.jsx) (Transaction Form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Expense Dashboard"]
  node_dashboard["Dashboard App<br/>[App.jsx]"]
  node_form["Transaction Form"]
  node_history["Transaction History"]
  node_summary["Balance Summary<br/>[BalanceSummery.jsx]"]
  node_chart["Expense Chart<br/>[ExpenseChart.jsx]"]
end

subgraph group_state["Client State"]
  node_globalstate["Global State<br/>[GlobalState.jsx]"]
end

subgraph group_api["Transaction API"]
  node_api["Transaction Routes"]
  node_server["Server Setup<br/>[server.js]"]
  node_controller["Transaction Controller"]
end

subgraph group_persistence["Persistence"]
  node_model["Transaction Model<br/>[transaction.js]"]
  node_dbconfig["Database Connector<br/>[db.js]"]
end

node_user(("Tracker User"))
node_mongo[("MongoDB")]

node_user -->|"enters data"| node_form
node_user -->|"requests deletion"| node_history
node_dashboard -->|"provides state"| node_globalstate
node_dashboard -->|"renders"| node_form
node_dashboard -->|"renders"| node_history
node_dashboard -->|"renders"| node_summary
node_dashboard -->|"renders"| node_chart
node_form -->|"adds transaction"| node_globalstate
node_history -->|"deletes transaction"| node_globalstate
node_globalstate -->|"supplies transactions"| node_history
node_globalstate -->|"supplies transactions"| node_summary
node_globalstate -->|"supplies transactions"| node_chart
node_globalstate -->|"sends HTTP requests"| node_api
node_server -->|"mounts routes"| node_api
node_api -->|"dispatches requests"| node_controller
node_controller -->|"queries and updates"| node_model
node_server -->|"connects database"| node_dbconfig
node_dbconfig -->|"opens connection"| node_mongo

click node_dashboard "https://github.com/akashathani09/expense-track/blob/main/server/client/src/App.jsx"
click node_form "https://github.com/akashathani09/expense-track/blob/main/server/client/src/components/TransactionForm.jsx"
click node_history "https://github.com/akashathani09/expense-track/blob/main/server/client/src/components/TransactionList.jsx"
click node_summary "https://github.com/akashathani09/expense-track/blob/main/server/client/src/components/BalanceSummery.jsx"
click node_chart "https://github.com/akashathani09/expense-track/blob/main/server/client/src/components/ExpenseChart.jsx"
click node_globalstate "https://github.com/akashathani09/expense-track/blob/main/server/client/src/Context/GlobalState.jsx"
click node_api "https://github.com/akashathani09/expense-track/blob/main/server/routes/transactionRoutes.js"
click node_server "https://github.com/akashathani09/expense-track/blob/main/server/server.js"
click node_controller "https://github.com/akashathani09/expense-track/blob/main/server/controllers/transactionController.js"
click node_model "https://github.com/akashathani09/expense-track/blob/main/server/models/transaction.js"
click node_dbconfig "https://github.com/akashathani09/expense-track/blob/main/server/config/db.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_dashboard,node_form,node_history,node_summary,node_chart,node_user toneBlue
class node_globalstate,node_mongo toneAmber
class node_api,node_server,node_controller toneMint
class node_model,node_dbconfig toneRose
```

## Components

### Expense Dashboard

- [Dashboard App](https://github.com/akashathani09/expense-track/blob/main/server/client/src/App.jsx): `server/client/src/App.jsx`
- [Transaction Form](https://github.com/akashathani09/expense-track/blob/main/server/client/src/components/TransactionForm.jsx): `server/client/src/components/TransactionForm.jsx`
- [Transaction History](https://github.com/akashathani09/expense-track/blob/main/server/client/src/components/TransactionList.jsx): `server/client/src/components/TransactionList.jsx`
- [Balance Summary](https://github.com/akashathani09/expense-track/blob/main/server/client/src/components/BalanceSummery.jsx): `server/client/src/components/BalanceSummery.jsx`
- [Expense Chart](https://github.com/akashathani09/expense-track/blob/main/server/client/src/components/ExpenseChart.jsx): `server/client/src/components/ExpenseChart.jsx`

### Client State

- [Global State](https://github.com/akashathani09/expense-track/blob/main/server/client/src/Context/GlobalState.jsx): `server/client/src/Context/GlobalState.jsx`

### Transaction API

- [Transaction Routes](https://github.com/akashathani09/expense-track/blob/main/server/routes/transactionRoutes.js): `server/routes/transactionRoutes.js`
- [Server Setup](https://github.com/akashathani09/expense-track/blob/main/server/server.js): `server/server.js`
- [Transaction Controller](https://github.com/akashathani09/expense-track/blob/main/server/controllers/transactionController.js): `server/controllers/transactionController.js`

### Persistence

- [Transaction Model](https://github.com/akashathani09/expense-track/blob/main/server/models/transaction.js): `server/models/transaction.js`
- [Database Connector](https://github.com/akashathani09/expense-track/blob/main/server/config/db.js): `server/config/db.js`

### Other components

- **Tracker User**
- **MongoDB**

## Connections

- Tracker User → Transaction Form: enters data (evidence: `server/client/src/components/TransactionForm.jsx`)
- Tracker User → Transaction History: requests deletion (evidence: `server/client/src/components/TransactionList.jsx`)
- Dashboard App → Global State: provides state (evidence: `server/client/src/App.jsx`)
- Dashboard App → Transaction Form: renders (evidence: `server/client/src/App.jsx`)
- Dashboard App → Transaction History: renders (evidence: `server/client/src/App.jsx`)
- Dashboard App → Balance Summary: renders (evidence: `server/client/src/App.jsx`)
- Dashboard App → Expense Chart: renders (evidence: `server/client/src/App.jsx`)
- Transaction Form → Global State: adds transaction (evidence: `server/client/src/components/TransactionForm.jsx`)
- Transaction History → Global State: deletes transaction (evidence: `server/client/src/components/TransactionList.jsx`)
- Global State → Transaction History: supplies transactions (evidence: `server/client/src/components/TransactionList.jsx`)
- Global State → Balance Summary: supplies transactions (evidence: `server/client/src/components/BalanceSummery.jsx`)
- Global State → Expense Chart: supplies transactions (evidence: `server/client/src/Context/GlobalState.jsx`)
- Global State → Transaction Routes: sends HTTP requests (evidence: `server/client/src/Context/GlobalState.jsx`)
- Server Setup → Transaction Routes: mounts routes (evidence: `server/server.js`)
- Transaction Routes → Transaction Controller: dispatches requests (evidence: `server/routes/transactionRoutes.js`)
- Transaction Controller → Transaction Model: queries and updates (evidence: `server/controllers/transactionController.js`)
- Server Setup → Database Connector: connects database (evidence: `server/server.js`)
- Database Connector → MongoDB: opens connection (evidence: `server/config/db.js`)
