# lithish13/frontend architecture

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

- Interactive diagram: https://gitdiagram.com/lithish13/frontend
- Repository: https://github.com/lithish13/frontend

## Overview

This is a React frontend for a personal expense and budget tracker: users sign in, record and categorize expenses, then review spending summaries and insights. App.jsx routes users to the dashboard, expense list, budget, insights, and settings; those screens use a shared API client to communicate with the backend. The README is only a generic Vite template and does not document product capabilities. Some page implementations were not excerpted, so their internal behavior is not expanded here.

Main entry points: [`src/App.jsx`](https://github.com/lithish13/frontend/blob/main/src/App.jsx) (Route app), [`src/services/api.js`](https://github.com/lithish13/frontend/blob/main/src/services/api.js) (API client), [`src/Pages/Dashboard.jsx`](https://github.com/lithish13/frontend/blob/main/src/Pages/Dashboard.jsx) (Dashboard), [`src/Pages/Expenses.jsx`](https://github.com/lithish13/frontend/blob/main/src/Pages/Expenses.jsx) (Expense list)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routing["App shell"]
  node_app["Route app<br/>[App.jsx]"]
  node_landing["Landing page<br/>[Landing.jsx]"]
  node_header["Navigation header<br/>[Header.jsx]"]
end

subgraph group_identity["Identity"]
  node_settings["Profile settings<br/>[Settings.jsx]"]
  node_login["Login<br/>[Login.jsx]"]
  node_signup["Signup<br/>[Signup.jsx]"]
  node_auth_callback["OAuth callback<br/>[AuthCallback.jsx]"]
  node_auth_context["Auth state<br/>[AuthContext.jsx]"]
  node_oauth["OAuth redirect<br/>[oauth.js]"]
  node_forgot_password["Forgot password<br/>[ForgotPassword.jsx]"]
  node_reset_password["Reset password<br/>[ResetPassword.jsx]"]
end

subgraph group_spending["Expense management"]
  node_expenses["Expense list<br/>[Expenses.jsx]"]
  node_add_edit["Add/edit expense"]
  node_expense_card["Expense card<br/>[ExpenseCard.jsx]"]
  node_category_helpers["Category helpers<br/>[categoryHelpers.js]"]
  node_expense_utils["Expense utilities<br/>[expenses.js]"]
end

subgraph group_finance["Financial views"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_budget["Budget view<br/>[Budget.jsx]"]
  node_insights["Insights view<br/>[Insights.jsx]"]
end

subgraph group_shared["Shared services"]
  node_expense_ui["Expense UI state"]
  node_chatbot["AI chat<br/>[AIChatBot.jsx]"]
  node_api["API client<br/>[api.js]"]
end

node_user(("User"))
node_backend["Backend API"]

node_user -->|"opens"| node_app
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_expenses
node_app -->|"routes to"| node_budget
node_app -->|"routes to"| node_insights
node_app -->|"routes to"| node_settings
node_app -->|"routes to"| node_landing
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_signup
node_app -->|"routes to"| node_auth_callback
node_app -->|"routes to"| node_forgot_password
node_app -->|"routes to"| node_reset_password
node_app -->|"renders"| node_header
node_app -->|"provides"| node_auth_context
node_app -->|"provides"| node_expense_ui
node_app -->|"renders"| node_chatbot
node_dashboard -->|"requests data"| node_api
node_dashboard -->|"sorts expenses"| node_expense_utils
node_dashboard -->|"renders"| node_expense_card
node_dashboard -->|"opens"| node_add_edit
node_dashboard -->|"reads user"| node_auth_context
node_dashboard -->|"requests modal"| node_expense_ui
node_expenses -->|"requests data"| node_api
node_expenses -->|"renders"| node_expense_card
node_expenses -->|"opens"| node_add_edit
node_expenses -->|"sorts expenses"| node_expense_utils
node_expenses -->|"uses"| node_category_helpers
node_add_edit -->|"saves expenses"| node_api
node_add_edit -->|"manages categories"| node_category_helpers
node_expense_card -->|"loads categories"| node_api
node_expense_card -->|"parses categories"| node_category_helpers
node_budget -->|"requests data"| node_api
node_insights -->|"requests data"| node_api
node_settings -->|"requests data"| node_api
node_settings -->|"uses auth"| node_auth_context
node_login -->|"authenticates"| node_api
node_login -->|"starts OAuth"| node_oauth
node_signup -->|"creates account"| node_api
node_signup -->|"starts OAuth"| node_oauth
node_auth_callback -->|"reads callback"| node_oauth
node_auth_callback -->|"logs in"| node_auth_context
node_auth_context -->|"loads profile"| node_api
node_oauth -->|"requests redirect"| node_backend
node_header -->|"uses auth"| node_auth_context
node_header -->|"sets search"| node_expense_ui
node_chatbot -->|"sends requests"| node_api
node_api -->|"sends API calls"| node_backend

click node_app "https://github.com/lithish13/frontend/blob/main/src/App.jsx"
click node_dashboard "https://github.com/lithish13/frontend/blob/main/src/Pages/Dashboard.jsx"
click node_expenses "https://github.com/lithish13/frontend/blob/main/src/Pages/Expenses.jsx"
click node_add_edit "https://github.com/lithish13/frontend/blob/main/src/Components/AddExpenseModal.jsx"
click node_expense_card "https://github.com/lithish13/frontend/blob/main/src/Components/ExpenseCard.jsx"
click node_category_helpers "https://github.com/lithish13/frontend/blob/main/src/utils/categoryHelpers.js"
click node_expense_utils "https://github.com/lithish13/frontend/blob/main/src/utils/expenses.js"
click node_budget "https://github.com/lithish13/frontend/blob/main/src/Pages/Budget.jsx"
click node_insights "https://github.com/lithish13/frontend/blob/main/src/Pages/Insights.jsx"
click node_settings "https://github.com/lithish13/frontend/blob/main/src/Pages/Settings.jsx"
click node_landing "https://github.com/lithish13/frontend/blob/main/src/Pages/Landing.jsx"
click node_login "https://github.com/lithish13/frontend/blob/main/src/Pages/Login.jsx"
click node_signup "https://github.com/lithish13/frontend/blob/main/src/Pages/Signup.jsx"
click node_auth_callback "https://github.com/lithish13/frontend/blob/main/src/Pages/AuthCallback.jsx"
click node_auth_context "https://github.com/lithish13/frontend/blob/main/src/context/AuthContext.jsx"
click node_oauth "https://github.com/lithish13/frontend/blob/main/src/utils/oauth.js"
click node_forgot_password "https://github.com/lithish13/frontend/blob/main/src/Pages/ForgotPassword.jsx"
click node_reset_password "https://github.com/lithish13/frontend/blob/main/src/Pages/ResetPassword.jsx"
click node_header "https://github.com/lithish13/frontend/blob/main/src/Components/Header.jsx"
click node_expense_ui "https://github.com/lithish13/frontend/blob/main/src/context/ExpenseUIContext.jsx"
click node_chatbot "https://github.com/lithish13/frontend/blob/main/src/Components/AIChatBot.jsx"
click node_api "https://github.com/lithish13/frontend/blob/main/src/services/api.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_app,node_landing,node_header,node_user toneBlue
class node_settings,node_login,node_signup,node_auth_callback,node_auth_context,node_oauth,node_forgot_password,node_reset_password toneAmber
class node_expenses,node_add_edit,node_expense_card,node_category_helpers,node_expense_utils,node_backend toneMint
class node_dashboard,node_budget,node_insights toneRose
class node_expense_ui,node_chatbot,node_api toneIndigo
```

## Components

### App shell

- [Route app](https://github.com/lithish13/frontend/blob/main/src/App.jsx): `src/App.jsx`
- [Landing page](https://github.com/lithish13/frontend/blob/main/src/Pages/Landing.jsx): `src/Pages/Landing.jsx`
- [Navigation header](https://github.com/lithish13/frontend/blob/main/src/Components/Header.jsx): `src/Components/Header.jsx`

### Identity

- [Profile settings](https://github.com/lithish13/frontend/blob/main/src/Pages/Settings.jsx): `src/Pages/Settings.jsx`
- [Login](https://github.com/lithish13/frontend/blob/main/src/Pages/Login.jsx): `src/Pages/Login.jsx`
- [Signup](https://github.com/lithish13/frontend/blob/main/src/Pages/Signup.jsx): `src/Pages/Signup.jsx`
- [OAuth callback](https://github.com/lithish13/frontend/blob/main/src/Pages/AuthCallback.jsx): `src/Pages/AuthCallback.jsx`
- [Auth state](https://github.com/lithish13/frontend/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [OAuth redirect](https://github.com/lithish13/frontend/blob/main/src/utils/oauth.js): `src/utils/oauth.js`
- [Forgot password](https://github.com/lithish13/frontend/blob/main/src/Pages/ForgotPassword.jsx): `src/Pages/ForgotPassword.jsx`
- [Reset password](https://github.com/lithish13/frontend/blob/main/src/Pages/ResetPassword.jsx): `src/Pages/ResetPassword.jsx`

### Expense management

- [Expense list](https://github.com/lithish13/frontend/blob/main/src/Pages/Expenses.jsx): `src/Pages/Expenses.jsx`
- [Add/edit expense](https://github.com/lithish13/frontend/blob/main/src/Components/AddExpenseModal.jsx): `src/Components/AddExpenseModal.jsx`
- [Expense card](https://github.com/lithish13/frontend/blob/main/src/Components/ExpenseCard.jsx): `src/Components/ExpenseCard.jsx`
- [Category helpers](https://github.com/lithish13/frontend/blob/main/src/utils/categoryHelpers.js): `src/utils/categoryHelpers.js`
- [Expense utilities](https://github.com/lithish13/frontend/blob/main/src/utils/expenses.js): `src/utils/expenses.js`

### Financial views

- [Dashboard](https://github.com/lithish13/frontend/blob/main/src/Pages/Dashboard.jsx): `src/Pages/Dashboard.jsx`
- [Budget view](https://github.com/lithish13/frontend/blob/main/src/Pages/Budget.jsx): `src/Pages/Budget.jsx`
- [Insights view](https://github.com/lithish13/frontend/blob/main/src/Pages/Insights.jsx): `src/Pages/Insights.jsx`

### Shared services

- [Expense UI state](https://github.com/lithish13/frontend/blob/main/src/context/ExpenseUIContext.jsx): `src/context/ExpenseUIContext.jsx`
- [AI chat](https://github.com/lithish13/frontend/blob/main/src/Components/AIChatBot.jsx): `src/Components/AIChatBot.jsx`
- [API client](https://github.com/lithish13/frontend/blob/main/src/services/api.js): `src/services/api.js`

### Other components

- **User**
- **Backend API**

## Connections

- User → Route app: opens
- Route app → Dashboard: routes to (evidence: `src/App.jsx`)
- Route app → Expense list: routes to (evidence: `src/App.jsx`)
- Route app → Budget view: routes to (evidence: `src/App.jsx`)
- Route app → Insights view: routes to (evidence: `src/App.jsx`)
- Route app → Profile settings: routes to (evidence: `src/App.jsx`)
- Route app → Landing page: routes to (evidence: `src/App.jsx`)
- Route app → Login: routes to (evidence: `src/App.jsx`)
- Route app → Signup: routes to (evidence: `src/App.jsx`)
- Route app → OAuth callback: routes to (evidence: `src/App.jsx`)
- Route app → Forgot password: routes to (evidence: `src/App.jsx`)
- Route app → Reset password: routes to (evidence: `src/App.jsx`)
- Route app → Navigation header: renders (evidence: `src/App.jsx`)
- Route app → Auth state: provides (evidence: `src/App.jsx`)
- Route app → Expense UI state: provides (evidence: `src/App.jsx`)
- Route app → AI chat: renders (evidence: `src/App.jsx`)
- Dashboard → API client: requests data (evidence: `src/Pages/Dashboard.jsx`)
- Dashboard → Expense utilities: sorts expenses (evidence: `src/Pages/Dashboard.jsx`)
- Dashboard → Expense card: renders (evidence: `src/Pages/Dashboard.jsx`)
- Dashboard → Add/edit expense: opens (evidence: `src/Pages/Dashboard.jsx`)
- Dashboard → Auth state: reads user (evidence: `src/Pages/Dashboard.jsx`)
- Dashboard → Expense UI state: requests modal (evidence: `src/Pages/Dashboard.jsx`)
- Expense list → API client: requests data (evidence: `src/Pages/Expenses.jsx`)
- Expense list → Expense card: renders (evidence: `src/Pages/Expenses.jsx`)
- Expense list → Add/edit expense: opens (evidence: `src/Pages/Expenses.jsx`)
- Expense list → Expense utilities: sorts expenses (evidence: `src/Pages/Expenses.jsx`)
- Expense list → Category helpers: uses (evidence: `src/Pages/Expenses.jsx`)
- Add/edit expense → API client: saves expenses (evidence: `src/Components/AddExpenseModal.jsx`)
- Add/edit expense → Category helpers: manages categories (evidence: `src/Components/AddExpenseModal.jsx`)
- Expense card → API client: loads categories (evidence: `src/Components/ExpenseCard.jsx`)
- Expense card → Category helpers: parses categories (evidence: `src/Components/ExpenseCard.jsx`)
- Budget view → API client: requests data (evidence: `src/Pages/Budget.jsx`)
- Insights view → API client: requests data (evidence: `src/Pages/Insights.jsx`)
- Profile settings → API client: requests data (evidence: `src/Pages/Settings.jsx`)
- Profile settings → Auth state: uses auth (evidence: `src/Pages/Settings.jsx`)
- Login → API client: authenticates (evidence: `src/Pages/Login.jsx`)
- Login → OAuth redirect: starts OAuth (evidence: `src/Pages/Login.jsx`)
- Signup → API client: creates account (evidence: `src/Pages/Signup.jsx`)
- Signup → OAuth redirect: starts OAuth (evidence: `src/Pages/Signup.jsx`)
- OAuth callback → OAuth redirect: reads callback (evidence: `src/Pages/AuthCallback.jsx`)
- OAuth callback → Auth state: logs in (evidence: `src/Pages/AuthCallback.jsx`)
- Auth state → API client: loads profile (evidence: `src/context/AuthContext.jsx`)
- OAuth redirect → Backend API: requests redirect (evidence: `src/utils/oauth.js`)
- Navigation header → Auth state: uses auth (evidence: `src/Components/Header.jsx`)
- Navigation header → Expense UI state: sets search (evidence: `src/Components/Header.jsx`)
- AI chat → API client: sends requests (evidence: `src/Components/AIChatBot.jsx`)
- API client → Backend API: sends API calls (evidence: `src/services/api.js`)
