# subha-0306/walletwise architecture

> Architecture diagram of the GitHub repository subha-0306/walletwise, 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/subha-0306/walletwise
- Repository: https://github.com/subha-0306/walletwise

## Overview

WalletWise is a mobile-first personal-finance app. A user signs in, records or edits transactions, and views resulting wallet balances, history, and reports; separate planning and loan workflows manage budgets, goals, recurring items, and borrowing/lending. The frontend centralizes authenticated REST calls, while Express routes requests through validation and authentication to domain controllers and Supabase. The README documents the major capabilities; sampled source confirms representative transaction, loan, authentication, and recurring behavior. Some feature-level links rely on README or SOURCE INDEX references rather than inspected implementation.

Main entry points: [`backend/src/config/supabase.js`](https://github.com/subha-0306/walletwise/blob/main/backend/src/config/supabase.js) (Supabase database and auth), [`frontend/src/App.jsx`](https://github.com/subha-0306/walletwise/blob/main/frontend/src/App.jsx) (App navigation), [`frontend/src/services/api.js`](https://github.com/subha-0306/walletwise/blob/main/frontend/src/services/api.js) (REST client), [`backend/src/server.js`](https://github.com/subha-0306/walletwise/blob/main/backend/src/server.js) (Express server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Finance interface"]
  node_app["App navigation<br/>[App.jsx]"]
  node_authui["Auth state<br/>[AuthContext.jsx]"]
  node_authpage["Sign in<br/>[AuthPage.jsx]"]
  node_entry["Transaction entry"]
  node_dashboard["Dashboard<br/>[DashboardPage.jsx]"]
  node_timeline["Timeline and reports<br/>[TimelinePage.jsx]"]
  node_loansui["Borrow and lend<br/>[LoansPage.jsx]"]
  node_planningui["Planning hub<br/>[PlanningPage.jsx]"]
end

subgraph group_api["API and security"]
  node_apiclient["REST client<br/>[api.js]"]
  node_server["Express server<br/>[server.js]"]
  node_authroutes["Auth routes<br/>[authRoutes.js]"]
  node_txroutes["Transaction routes"]
  node_loansroutes["Loan routes<br/>[loanRoutes.js]"]
  node_planningroutes["Planning routes"]
  node_authmw["Token authentication<br/>[auth.js]"]
  node_validation["Request validation<br/>[validate.js]"]
end

subgraph group_domains["Finance workflows"]
  node_authlogic["Account operations<br/>[authController.js]"]
  node_transactions["Transactions"]
  node_wallets["Wallet balances"]
  node_reports["Spending reports"]
  node_loans["Loan lifecycle<br/>[loanController.js]"]
  node_planning["Budgets and goals<br/>[goalController.js]"]
  node_budgetlogic["Budget operations"]
  node_recurring["Recurring transactions"]
  node_generator["Due-item generator"]
end

subgraph group_storage["Data services"]
  node_supabase[("Supabase database and auth<br/>[supabase.js]")]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"provides auth"| node_authui
node_app -->|"shows when signed out"| node_authpage
node_app -->|"opens entry"| node_entry
node_app -->|"selects view"| node_dashboard
node_app -->|"selects view"| node_timeline
node_app -->|"selects view"| node_loansui
node_app -->|"selects view"| node_planningui
node_authui -->|"calls auth"| node_apiclient
node_authpage -->|"uses auth"| node_authui
node_entry -->|"sends transactions"| node_apiclient
node_dashboard -.->|"loads finance data"| node_apiclient
node_timeline -->|"loads history"| node_apiclient
node_loansui -->|"manages loans"| node_apiclient
node_planningui -->|"manages plans"| node_apiclient
node_apiclient -->|"sends REST requests"| node_server
node_server -->|"mounts routes"| node_authroutes
node_server -->|"mounts routes"| node_txroutes
node_server -->|"mounts routes"| node_loansroutes
node_server -.->|"mounts planning routes"| node_planningroutes
node_txroutes -->|"dispatches"| node_transactions
node_txroutes -->|"authenticates"| node_authmw
node_txroutes -->|"validates writes"| node_validation
node_authroutes -->|"dispatches"| node_authlogic
node_loansroutes -->|"dispatches"| node_loans
node_loansroutes -->|"authenticates"| node_authmw
node_loansroutes -->|"validates writes"| node_validation
node_planningroutes -.->|"dispatches"| node_planning
node_planningroutes -.->|"dispatches"| node_budgetlogic
node_planningroutes -.->|"dispatches"| node_recurring
node_planningroutes -.->|"authenticates"| node_authmw
node_transactions -->|"processes due items"| node_generator
node_transactions -->|"reads and writes"| node_supabase
node_loans -->|"reads and writes"| node_supabase
node_authmw -->|"verifies token"| node_supabase
node_authlogic -->|"uses auth service"| node_supabase
node_generator -->|"processes records"| node_supabase
node_wallets -.->|"queries balances"| node_supabase
node_reports -.->|"queries summaries"| node_supabase
node_planning -.->|"reads and writes"| node_supabase
node_budgetlogic -.->|"reads and writes"| node_supabase
node_recurring -.->|"reads and writes"| node_supabase

click node_app "https://github.com/subha-0306/walletwise/blob/main/frontend/src/App.jsx"
click node_authui "https://github.com/subha-0306/walletwise/blob/main/frontend/src/context/AuthContext.jsx"
click node_authpage "https://github.com/subha-0306/walletwise/blob/main/frontend/src/pages/AuthPage.jsx"
click node_entry "https://github.com/subha-0306/walletwise/blob/main/frontend/src/pages/AddTransactionPage.jsx"
click node_dashboard "https://github.com/subha-0306/walletwise/blob/main/frontend/src/pages/DashboardPage.jsx"
click node_timeline "https://github.com/subha-0306/walletwise/blob/main/frontend/src/pages/TimelinePage.jsx"
click node_loansui "https://github.com/subha-0306/walletwise/blob/main/frontend/src/pages/LoansPage.jsx"
click node_planningui "https://github.com/subha-0306/walletwise/blob/main/frontend/src/pages/PlanningPage.jsx"
click node_apiclient "https://github.com/subha-0306/walletwise/blob/main/frontend/src/services/api.js"
click node_server "https://github.com/subha-0306/walletwise/blob/main/backend/src/server.js"
click node_authroutes "https://github.com/subha-0306/walletwise/blob/main/backend/src/routes/authRoutes.js"
click node_txroutes "https://github.com/subha-0306/walletwise/blob/main/backend/src/routes/transactionRoutes.js"
click node_loansroutes "https://github.com/subha-0306/walletwise/blob/main/backend/src/routes/loanRoutes.js"
click node_authmw "https://github.com/subha-0306/walletwise/blob/main/backend/src/middleware/auth.js"
click node_validation "https://github.com/subha-0306/walletwise/blob/main/backend/src/middleware/validate.js"
click node_authlogic "https://github.com/subha-0306/walletwise/blob/main/backend/src/controllers/authController.js"
click node_transactions "https://github.com/subha-0306/walletwise/blob/main/backend/src/controllers/transactionController.js"
click node_wallets "https://github.com/subha-0306/walletwise/blob/main/backend/src/controllers/walletController.js"
click node_reports "https://github.com/subha-0306/walletwise/blob/main/backend/src/controllers/reportController.js"
click node_loans "https://github.com/subha-0306/walletwise/blob/main/backend/src/controllers/loanController.js"
click node_planning "https://github.com/subha-0306/walletwise/blob/main/backend/src/controllers/goalController.js"
click node_budgetlogic "https://github.com/subha-0306/walletwise/blob/main/backend/src/controllers/budgetController.js"
click node_recurring "https://github.com/subha-0306/walletwise/blob/main/backend/src/controllers/recurringController.js"
click node_generator "https://github.com/subha-0306/walletwise/blob/main/backend/src/utils/recurringGenerator.js"
click node_supabase "https://github.com/subha-0306/walletwise/blob/main/backend/src/config/supabase.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_authui,node_authpage,node_entry,node_dashboard,node_timeline,node_loansui,node_planningui,node_user toneBlue
class node_apiclient,node_server,node_authroutes,node_txroutes,node_loansroutes,node_planningroutes,node_authmw,node_validation toneAmber
class node_authlogic,node_transactions,node_wallets,node_reports,node_loans,node_planning,node_budgetlogic,node_recurring,node_generator toneMint
class node_supabase toneRose
```

## Components

### Finance interface

- [App navigation](https://github.com/subha-0306/walletwise/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Auth state](https://github.com/subha-0306/walletwise/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Sign in](https://github.com/subha-0306/walletwise/blob/main/frontend/src/pages/AuthPage.jsx): `frontend/src/pages/AuthPage.jsx`
- [Transaction entry](https://github.com/subha-0306/walletwise/blob/main/frontend/src/pages/AddTransactionPage.jsx): `frontend/src/pages/AddTransactionPage.jsx`
- [Dashboard](https://github.com/subha-0306/walletwise/blob/main/frontend/src/pages/DashboardPage.jsx): `frontend/src/pages/DashboardPage.jsx`
- [Timeline and reports](https://github.com/subha-0306/walletwise/blob/main/frontend/src/pages/TimelinePage.jsx): `frontend/src/pages/TimelinePage.jsx`
- [Borrow and lend](https://github.com/subha-0306/walletwise/blob/main/frontend/src/pages/LoansPage.jsx): `frontend/src/pages/LoansPage.jsx`
- [Planning hub](https://github.com/subha-0306/walletwise/blob/main/frontend/src/pages/PlanningPage.jsx): `frontend/src/pages/PlanningPage.jsx`

### API and security

- [REST client](https://github.com/subha-0306/walletwise/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`
- [Express server](https://github.com/subha-0306/walletwise/blob/main/backend/src/server.js): `backend/src/server.js`
- [Auth routes](https://github.com/subha-0306/walletwise/blob/main/backend/src/routes/authRoutes.js): `backend/src/routes/authRoutes.js`
- [Transaction routes](https://github.com/subha-0306/walletwise/blob/main/backend/src/routes/transactionRoutes.js): `backend/src/routes/transactionRoutes.js`
- [Loan routes](https://github.com/subha-0306/walletwise/blob/main/backend/src/routes/loanRoutes.js): `backend/src/routes/loanRoutes.js`
- **Planning routes**
- [Token authentication](https://github.com/subha-0306/walletwise/blob/main/backend/src/middleware/auth.js): `backend/src/middleware/auth.js`
- [Request validation](https://github.com/subha-0306/walletwise/blob/main/backend/src/middleware/validate.js): `backend/src/middleware/validate.js`

### Finance workflows

- [Account operations](https://github.com/subha-0306/walletwise/blob/main/backend/src/controllers/authController.js): `backend/src/controllers/authController.js`
- [Transactions](https://github.com/subha-0306/walletwise/blob/main/backend/src/controllers/transactionController.js): `backend/src/controllers/transactionController.js`
- [Wallet balances](https://github.com/subha-0306/walletwise/blob/main/backend/src/controllers/walletController.js): `backend/src/controllers/walletController.js`
- [Spending reports](https://github.com/subha-0306/walletwise/blob/main/backend/src/controllers/reportController.js): `backend/src/controllers/reportController.js`
- [Loan lifecycle](https://github.com/subha-0306/walletwise/blob/main/backend/src/controllers/loanController.js): `backend/src/controllers/loanController.js`
- [Budgets and goals](https://github.com/subha-0306/walletwise/blob/main/backend/src/controllers/goalController.js): `backend/src/controllers/goalController.js`
- [Budget operations](https://github.com/subha-0306/walletwise/blob/main/backend/src/controllers/budgetController.js): `backend/src/controllers/budgetController.js`
- [Recurring transactions](https://github.com/subha-0306/walletwise/blob/main/backend/src/controllers/recurringController.js): `backend/src/controllers/recurringController.js`
- [Due-item generator](https://github.com/subha-0306/walletwise/blob/main/backend/src/utils/recurringGenerator.js): `backend/src/utils/recurringGenerator.js`

### Data services

- [Supabase database and auth](https://github.com/subha-0306/walletwise/blob/main/backend/src/config/supabase.js): `backend/src/config/supabase.js`

### Other components

- **User**

## Connections

- User → App navigation: uses (evidence: `README.md`)
- App navigation → Auth state: provides auth (evidence: `frontend/src/App.jsx`)
- App navigation → Sign in: shows when signed out (evidence: `frontend/src/App.jsx`)
- App navigation → Transaction entry: opens entry (evidence: `frontend/src/App.jsx`)
- App navigation → Dashboard: selects view (evidence: `frontend/src/App.jsx`)
- App navigation → Timeline and reports: selects view (evidence: `frontend/src/App.jsx`)
- App navigation → Borrow and lend: selects view (evidence: `frontend/src/App.jsx`)
- App navigation → Planning hub: selects view (evidence: `frontend/src/App.jsx`)
- Auth state → REST client: calls auth (evidence: `frontend/src/context/AuthContext.jsx`)
- Sign in → Auth state: uses auth (evidence: `frontend/src/pages/AuthPage.jsx`)
- Transaction entry → REST client: sends transactions (evidence: `frontend/src/pages/AddTransactionPage.jsx`)
- Dashboard → REST client: loads finance data
- Timeline and reports → REST client: loads history (evidence: `frontend/src/pages/TimelinePage.jsx`)
- Borrow and lend → REST client: manages loans (evidence: `frontend/src/pages/LoansPage.jsx`)
- Planning hub → REST client: manages plans (evidence: `frontend/src/pages/PlanningPage.jsx`)
- REST client → Express server: sends REST requests (evidence: `README.md`)
- Express server → Auth routes: mounts routes (evidence: `backend/src/server.js`)
- Express server → Transaction routes: mounts routes (evidence: `backend/src/server.js`)
- Express server → Loan routes: mounts routes (evidence: `backend/src/server.js`)
- Express server → Planning routes: mounts planning routes
- Transaction routes → Transactions: dispatches (evidence: `backend/src/routes/transactionRoutes.js`)
- Transaction routes → Token authentication: authenticates (evidence: `backend/src/routes/transactionRoutes.js`)
- Transaction routes → Request validation: validates writes (evidence: `backend/src/routes/transactionRoutes.js`)
- Auth routes → Account operations: dispatches (evidence: `backend/src/routes/authRoutes.js`)
- Loan routes → Loan lifecycle: dispatches (evidence: `backend/src/routes/loanRoutes.js`)
- Loan routes → Token authentication: authenticates (evidence: `backend/src/routes/loanRoutes.js`)
- Loan routes → Request validation: validates writes (evidence: `backend/src/routes/loanRoutes.js`)
- Planning routes → Budgets and goals: dispatches
- Planning routes → Budget operations: dispatches
- Planning routes → Recurring transactions: dispatches
- Planning routes → Token authentication: authenticates
- Transactions → Due-item generator: processes due items (evidence: `backend/src/controllers/transactionController.js`)
- Transactions → Supabase database and auth: reads and writes (evidence: `backend/src/controllers/transactionController.js`)
- Loan lifecycle → Supabase database and auth: reads and writes (evidence: `backend/src/controllers/loanController.js`)
- Token authentication → Supabase database and auth: verifies token (evidence: `backend/src/middleware/auth.js`)
- Account operations → Supabase database and auth: uses auth service (evidence: `backend/src/controllers/authController.js`)
- Due-item generator → Supabase database and auth: processes records (evidence: `backend/src/utils/recurringGenerator.js`)
- Wallet balances → Supabase database and auth: queries balances
- Spending reports → Supabase database and auth: queries summaries
- Budgets and goals → Supabase database and auth: reads and writes (evidence: `backend/src/controllers/goalController.js`)
- Budget operations → Supabase database and auth: reads and writes (evidence: `backend/src/controllers/budgetController.js`)
- Recurring transactions → Supabase database and auth: reads and writes (evidence: `backend/src/controllers/recurringController.js`)
