# sravanigeddavalasa/walletwise architecture

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

- Interactive diagram: https://gitdiagram.com/sravanigeddavalasa/walletwise
- Repository: https://github.com/sravanigeddavalasa/walletwise

## Overview

WalletWise is a personal-finance web application with a React client and Express backend. Users sign in or register, then manage expenses, income, budgets, and reports; dashboard and insight endpoints support financial review. The client can fall back to local mock data when API calls fail. The graph captures the sampled authentication flow and the documented API route structure; several feature-specific implementations were not excerpted, so their internal calls are left out.

Main entry points: [`wallet-wise/src/routes/AppRoutes.tsx`](https://github.com/sravanigeddavalasa/walletwise/blob/main/wallet-wise/src/routes/AppRoutes.tsx) (Client routes), [`walletwise-backend/src/service/auth.service.js`](https://github.com/sravanigeddavalasa/walletwise/blob/main/walletwise-backend/src/service/auth.service.js) (Auth service), [`walletwise-backend/src/app.js`](https://github.com/sravanigeddavalasa/walletwise/blob/main/walletwise-backend/src/app.js) (HTTP application), [`wallet-wise/src/context/AuthContext.tsx`](https://github.com/sravanigeddavalasa/walletwise/blob/main/wallet-wise/src/context/AuthContext.tsx) (Auth state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_routes["Client routes<br/>[AppRoutes.tsx]"]
  node_authui["Auth state<br/>[AuthContext.tsx]"]
  node_authpages["Sign-in pages<br/>[Login.tsx]"]
  node_mock[("Local mock data<br/>[mockDb.ts]")]
  node_api["API client<br/>[axiosInstance.ts]"]
end

subgraph group_finance["Finance features"]
  node_expensesui["Expense tracking<br/>[Expenses.tsx]"]
  node_incomesui["Income management<br/>[Income.tsx]"]
  node_budgetui["Budget planning<br/>[Budget.tsx]"]
  node_reportsui["Reports<br/>[Reports.tsx]"]
  node_dashboardui["Dashboard<br/>[Dashboard.tsx]"]
  node_expenseservice["Expense service<br/>[expense.service.js]"]
end

subgraph group_server["API server"]
  node_serverapp["HTTP application<br/>[app.js]"]
  node_authroutes["Auth routes<br/>[auth.routes.js]"]
  node_expense_routes["Expense routes<br/>[expense.routes.js]"]
  node_finance_routes["Finance routes"]
  node_authcontroller["Auth controller<br/>[auth.controller.js]"]
  node_expensecontroller["Expense controller"]
end

subgraph group_identity["Identity and storage"]
  node_authservice["Auth service<br/>[auth.service.js]"]
  node_authrepo["Auth repository<br/>[auth.repository.js]"]
  node_models[("Data models")]
  node_jwt["JWT utilities<br/>[jwt.middleware.js]"]
  node_mail["Email service<br/>[mail.service.js]"]
  node_db[("Database")]
end

node_user(("User"))

node_user -->|"navigates"| node_routes
node_routes -->|"routes to"| node_authpages
node_routes -->|"routes to"| node_expensesui
node_routes -->|"routes to"| node_incomesui
node_routes -->|"routes to"| node_budgetui
node_routes -->|"routes to"| node_reportsui
node_routes -->|"routes to"| node_dashboardui
node_authpages -->|"uses auth"| node_authui
node_authui -->|"calls API"| node_api
node_authui -->|"falls back"| node_mock
node_api -.->|"requests auth"| node_authroutes
node_expensesui -.->|"uses client"| node_api
node_serverapp -->|"mounts"| node_authroutes
node_serverapp -->|"mounts"| node_expense_routes
node_serverapp -->|"mounts"| node_finance_routes
node_authroutes -->|"dispatches"| node_authcontroller
node_expense_routes -->|"dispatches"| node_expensecontroller
node_authcontroller -->|"calls"| node_authservice
node_expensecontroller -->|"calls"| node_expenseservice
node_authservice -->|"reads and writes"| node_authrepo
node_authservice -->|"issues tokens"| node_jwt
node_authservice -->|"sends email"| node_mail
node_authrepo -->|"uses models"| node_models
node_models -.->|"persists to"| node_db

click node_routes "https://github.com/sravanigeddavalasa/walletwise/blob/main/wallet-wise/src/routes/AppRoutes.tsx"
click node_authui "https://github.com/sravanigeddavalasa/walletwise/blob/main/wallet-wise/src/context/AuthContext.tsx"
click node_authpages "https://github.com/sravanigeddavalasa/walletwise/blob/main/wallet-wise/src/pages/auth/Login.tsx"
click node_expensesui "https://github.com/sravanigeddavalasa/walletwise/blob/main/wallet-wise/src/pages/expenses/Expenses.tsx"
click node_incomesui "https://github.com/sravanigeddavalasa/walletwise/blob/main/wallet-wise/src/pages/income/Income.tsx"
click node_budgetui "https://github.com/sravanigeddavalasa/walletwise/blob/main/wallet-wise/src/pages/budget/Budget.tsx"
click node_reportsui "https://github.com/sravanigeddavalasa/walletwise/blob/main/wallet-wise/src/pages/reports/Reports.tsx"
click node_dashboardui "https://github.com/sravanigeddavalasa/walletwise/blob/main/wallet-wise/src/pages/dashboard/Dashboard.tsx"
click node_mock "https://github.com/sravanigeddavalasa/walletwise/blob/main/wallet-wise/src/services/mockDb.ts"
click node_api "https://github.com/sravanigeddavalasa/walletwise/blob/main/wallet-wise/src/api/axiosInstance.ts"
click node_serverapp "https://github.com/sravanigeddavalasa/walletwise/blob/main/walletwise-backend/src/app.js"
click node_authroutes "https://github.com/sravanigeddavalasa/walletwise/blob/main/walletwise-backend/src/routes/auth.routes.js"
click node_expense_routes "https://github.com/sravanigeddavalasa/walletwise/blob/main/walletwise-backend/src/routes/expense.routes.js"
click node_finance_routes "https://github.com/sravanigeddavalasa/walletwise/tree/main/walletwise-backend/src/routes"
click node_authcontroller "https://github.com/sravanigeddavalasa/walletwise/blob/main/walletwise-backend/src/controller/auth.controller.js"
click node_expensecontroller "https://github.com/sravanigeddavalasa/walletwise/blob/main/walletwise-backend/src/controller/expense.controller.js"
click node_authservice "https://github.com/sravanigeddavalasa/walletwise/blob/main/walletwise-backend/src/service/auth.service.js"
click node_expenseservice "https://github.com/sravanigeddavalasa/walletwise/blob/main/walletwise-backend/src/service/expense.service.js"
click node_authrepo "https://github.com/sravanigeddavalasa/walletwise/blob/main/walletwise-backend/src/repository/auth.repository.js"
click node_models "https://github.com/sravanigeddavalasa/walletwise/tree/main/walletwise-backend/src/model"
click node_jwt "https://github.com/sravanigeddavalasa/walletwise/blob/main/walletwise-backend/src/middleware/jwt.middleware.js"
click node_mail "https://github.com/sravanigeddavalasa/walletwise/blob/main/walletwise-backend/src/service/mail.service.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_routes,node_authui,node_authpages,node_mock,node_api,node_user toneBlue
class node_expensesui,node_incomesui,node_budgetui,node_reportsui,node_dashboardui,node_expenseservice toneAmber
class node_serverapp,node_authroutes,node_expense_routes,node_finance_routes,node_authcontroller,node_expensecontroller toneMint
class node_authservice,node_authrepo,node_models,node_jwt,node_mail,node_db toneRose
```

## Components

### Web client

- [Client routes](https://github.com/sravanigeddavalasa/walletwise/blob/main/wallet-wise/src/routes/AppRoutes.tsx): `wallet-wise/src/routes/AppRoutes.tsx`
- [Auth state](https://github.com/sravanigeddavalasa/walletwise/blob/main/wallet-wise/src/context/AuthContext.tsx): `wallet-wise/src/context/AuthContext.tsx`
- [Sign-in pages](https://github.com/sravanigeddavalasa/walletwise/blob/main/wallet-wise/src/pages/auth/Login.tsx): `wallet-wise/src/pages/auth/Login.tsx`
- [Local mock data](https://github.com/sravanigeddavalasa/walletwise/blob/main/wallet-wise/src/services/mockDb.ts): `wallet-wise/src/services/mockDb.ts`
- [API client](https://github.com/sravanigeddavalasa/walletwise/blob/main/wallet-wise/src/api/axiosInstance.ts): `wallet-wise/src/api/axiosInstance.ts`

### Finance features

- [Expense tracking](https://github.com/sravanigeddavalasa/walletwise/blob/main/wallet-wise/src/pages/expenses/Expenses.tsx): `wallet-wise/src/pages/expenses/Expenses.tsx`
- [Income management](https://github.com/sravanigeddavalasa/walletwise/blob/main/wallet-wise/src/pages/income/Income.tsx): `wallet-wise/src/pages/income/Income.tsx`
- [Budget planning](https://github.com/sravanigeddavalasa/walletwise/blob/main/wallet-wise/src/pages/budget/Budget.tsx): `wallet-wise/src/pages/budget/Budget.tsx`
- [Reports](https://github.com/sravanigeddavalasa/walletwise/blob/main/wallet-wise/src/pages/reports/Reports.tsx): `wallet-wise/src/pages/reports/Reports.tsx`
- [Dashboard](https://github.com/sravanigeddavalasa/walletwise/blob/main/wallet-wise/src/pages/dashboard/Dashboard.tsx): `wallet-wise/src/pages/dashboard/Dashboard.tsx`
- [Expense service](https://github.com/sravanigeddavalasa/walletwise/blob/main/walletwise-backend/src/service/expense.service.js): `walletwise-backend/src/service/expense.service.js`

### API server

- [HTTP application](https://github.com/sravanigeddavalasa/walletwise/blob/main/walletwise-backend/src/app.js): `walletwise-backend/src/app.js`
- [Auth routes](https://github.com/sravanigeddavalasa/walletwise/blob/main/walletwise-backend/src/routes/auth.routes.js): `walletwise-backend/src/routes/auth.routes.js`
- [Expense routes](https://github.com/sravanigeddavalasa/walletwise/blob/main/walletwise-backend/src/routes/expense.routes.js): `walletwise-backend/src/routes/expense.routes.js`
- [Finance routes](https://github.com/sravanigeddavalasa/walletwise/tree/main/walletwise-backend/src/routes): `walletwise-backend/src/routes`
- [Auth controller](https://github.com/sravanigeddavalasa/walletwise/blob/main/walletwise-backend/src/controller/auth.controller.js): `walletwise-backend/src/controller/auth.controller.js`
- [Expense controller](https://github.com/sravanigeddavalasa/walletwise/blob/main/walletwise-backend/src/controller/expense.controller.js): `walletwise-backend/src/controller/expense.controller.js`

### Identity and storage

- [Auth service](https://github.com/sravanigeddavalasa/walletwise/blob/main/walletwise-backend/src/service/auth.service.js): `walletwise-backend/src/service/auth.service.js`
- [Auth repository](https://github.com/sravanigeddavalasa/walletwise/blob/main/walletwise-backend/src/repository/auth.repository.js): `walletwise-backend/src/repository/auth.repository.js`
- [Data models](https://github.com/sravanigeddavalasa/walletwise/tree/main/walletwise-backend/src/model): `walletwise-backend/src/model`
- [JWT utilities](https://github.com/sravanigeddavalasa/walletwise/blob/main/walletwise-backend/src/middleware/jwt.middleware.js): `walletwise-backend/src/middleware/jwt.middleware.js`
- [Email service](https://github.com/sravanigeddavalasa/walletwise/blob/main/walletwise-backend/src/service/mail.service.js): `walletwise-backend/src/service/mail.service.js`
- **Database**

### Other components

- **User**

## Connections

- User → Client routes: navigates (evidence: `wallet-wise/src/routes/AppRoutes.tsx`)
- Client routes → Sign-in pages: routes to (evidence: `wallet-wise/src/routes/AppRoutes.tsx`)
- Client routes → Expense tracking: routes to (evidence: `wallet-wise/src/routes/AppRoutes.tsx`)
- Client routes → Income management: routes to (evidence: `wallet-wise/src/routes/AppRoutes.tsx`)
- Client routes → Budget planning: routes to (evidence: `wallet-wise/src/routes/AppRoutes.tsx`)
- Client routes → Reports: routes to (evidence: `wallet-wise/src/routes/AppRoutes.tsx`)
- Client routes → Dashboard: routes to (evidence: `wallet-wise/src/routes/AppRoutes.tsx`)
- Sign-in pages → Auth state: uses auth (evidence: `wallet-wise/src/pages/auth/Login.tsx`)
- Auth state → API client: calls API (evidence: `wallet-wise/src/context/AuthContext.tsx`)
- Auth state → Local mock data: falls back (evidence: `wallet-wise/src/context/AuthContext.tsx`)
- API client → Auth routes: requests auth
- Expense tracking → API client: uses client
- HTTP application → Auth routes: mounts (evidence: `walletwise-backend/src/app.js`)
- HTTP application → Expense routes: mounts (evidence: `walletwise-backend/src/app.js`)
- HTTP application → Finance routes: mounts (evidence: `walletwise-backend/src/app.js`)
- Auth routes → Auth controller: dispatches (evidence: `walletwise-backend/src/routes/auth.routes.js`)
- Expense routes → Expense controller: dispatches (evidence: `walletwise-backend/src/routes/expense.routes.js`)
- Auth controller → Auth service: calls (evidence: `walletwise-backend/src/controller/auth.controller.js`)
- Expense controller → Expense service: calls (evidence: `walletwise-backend/src/controller/expense.controller.js`)
- Auth service → Auth repository: reads and writes (evidence: `walletwise-backend/src/service/auth.service.js`)
- Auth service → JWT utilities: issues tokens (evidence: `walletwise-backend/src/service/auth.service.js`)
- Auth service → Email service: sends email (evidence: `walletwise-backend/src/service/auth.service.js`)
- Auth repository → Data models: uses models (evidence: `walletwise-backend/src/repository/auth.repository.js`)
- Data models → Database: persists to
