# robertave1727/expensetracker architecture

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

- Interactive diagram: https://gitdiagram.com/robertave1727/expensetracker
- Repository: https://github.com/robertave1727/expensetracker

## Overview

ZeroBalance is a personal expense-tracking application: users register or sign in, then manage transactions, categories and budgets, and review spending through dashboard, alerts and insight views. The sampled code shows the app routing, session handling, Supabase-backed authentication, and budget persistence; other capabilities are represented from the source tree and route declarations, but their internal wiring is not inferred. Supabase is the documented backend dependency in the sampled services.

Main entry points: [`src/App.tsx`](https://github.com/robertave1727/expensetracker/blob/main/src/App.tsx) (App Router), [`src/services/supabaseClient.ts`](https://github.com/robertave1727/expensetracker/blob/main/src/services/supabaseClient.ts) (Supabase Client), [`src/services/useAuth.ts`](https://github.com/robertave1727/expensetracker/blob/main/src/services/useAuth.ts) (Session and Auth), [`src/components/authWrapper.tsx`](https://github.com/robertave1727/expensetracker/blob/main/src/components/authWrapper.tsx) (Auth Screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_app["App Router<br/>[App.tsx]"]
  node_settings["Settings<br/>[settings.tsx]"]
  node_sidebar["Navigation<br/>[sidebar.tsx]"]
end

subgraph group_identity["Account Access"]
  node_authwrapper["Auth Screen<br/>[authWrapper.tsx]"]
  node_login["Login<br/>[login.tsx]"]
  node_register["Register<br/>[register.tsx]"]
  node_auth["Session and Auth<br/>[useAuth.ts]"]
  node_registration["Registration Hook<br/>[useRegister.ts]"]
end

subgraph group_finance["Financial Management"]
  node_transactions["Transactions<br/>[transaction.tsx]"]
  node_addtransaction["Add Transaction<br/>[addTransaction.tsx]"]
  node_deletetransaction["Delete Transaction"]
  node_categories["Categories<br/>[category.tsx]"]
  node_newcategory["New Category<br/>[newCategory.tsx]"]
  node_deletecategory["Delete Category<br/>[deleteCategory.tsx]"]
  node_budget["Budget Limits<br/>[budgetLimit.tsx]"]
end

subgraph group_review["Review and Support"]
  node_dashboard["Dashboard<br/>[dashboard.tsx]"]
  node_insights["Smart Insights<br/>[smartInsights.tsx]"]
  node_alerts["Alerts<br/>[alerts.tsx]"]
  node_support["Support<br/>[support.tsx]"]
end

subgraph group_data["Backend and Services"]
  node_transactionservice["Transaction Service"]
  node_budgetservice["Budget Service<br/>[budgetService.ts]"]
  node_supabaseclient["Supabase Client<br/>[supabaseClient.ts]"]
end

node_user(("User"))
node_supabase[("Supabase")]

node_user -->|"uses"| node_app
node_app -->|"routes"| node_authwrapper
node_authwrapper -->|"shows"| node_login
node_authwrapper -->|"shows"| node_register
node_login -->|"verifies credentials"| node_auth
node_register -->|"registers account"| node_registration
node_auth -->|"calls"| node_supabaseclient
node_registration -->|"calls"| node_supabaseclient
node_app -->|"checks session"| node_supabaseclient
node_supabaseclient -->|"connects"| node_supabase
node_app -->|"routes"| node_dashboard
node_app -->|"routes"| node_transactions
node_app -->|"routes"| node_categories
node_app -->|"routes"| node_budget
node_app -->|"routes"| node_insights
node_app -->|"routes"| node_alerts
node_app -->|"routes"| node_settings
node_app -->|"routes"| node_support
node_app -->|"renders"| node_sidebar
node_budget -->|"reads user"| node_auth
node_budget -->|"saves budget"| node_budgetservice
node_budgetservice -->|"calls"| node_supabaseclient
node_transactionservice -->|"calls"| node_supabaseclient
node_dashboard -->|"reads user"| node_auth
node_insights -->|"reads user"| node_auth

click node_app "https://github.com/robertave1727/expensetracker/blob/main/src/App.tsx"
click node_authwrapper "https://github.com/robertave1727/expensetracker/blob/main/src/components/authWrapper.tsx"
click node_login "https://github.com/robertave1727/expensetracker/blob/main/src/components/login.tsx"
click node_register "https://github.com/robertave1727/expensetracker/blob/main/src/components/register.tsx"
click node_auth "https://github.com/robertave1727/expensetracker/blob/main/src/services/useAuth.ts"
click node_registration "https://github.com/robertave1727/expensetracker/blob/main/src/services/useRegister.ts"
click node_dashboard "https://github.com/robertave1727/expensetracker/blob/main/src/components/dashboard.tsx"
click node_transactions "https://github.com/robertave1727/expensetracker/blob/main/src/components/transaction.tsx"
click node_addtransaction "https://github.com/robertave1727/expensetracker/blob/main/src/features/addTransaction.tsx"
click node_deletetransaction "https://github.com/robertave1727/expensetracker/blob/main/src/features/deleteTransaction.tsx"
click node_transactionservice "https://github.com/robertave1727/expensetracker/blob/main/src/services/transactionService.ts"
click node_categories "https://github.com/robertave1727/expensetracker/blob/main/src/components/category.tsx"
click node_newcategory "https://github.com/robertave1727/expensetracker/blob/main/src/features/newCategory.tsx"
click node_deletecategory "https://github.com/robertave1727/expensetracker/blob/main/src/features/deleteCategory.tsx"
click node_budget "https://github.com/robertave1727/expensetracker/blob/main/src/features/budgetLimit.tsx"
click node_budgetservice "https://github.com/robertave1727/expensetracker/blob/main/src/services/budgetService.ts"
click node_insights "https://github.com/robertave1727/expensetracker/blob/main/src/features/smartInsights.tsx"
click node_alerts "https://github.com/robertave1727/expensetracker/blob/main/src/features/alerts.tsx"
click node_settings "https://github.com/robertave1727/expensetracker/blob/main/src/components/settings.tsx"
click node_sidebar "https://github.com/robertave1727/expensetracker/blob/main/src/components/sidebar.tsx"
click node_support "https://github.com/robertave1727/expensetracker/blob/main/src/components/support.tsx"
click node_supabaseclient "https://github.com/robertave1727/expensetracker/blob/main/src/services/supabaseClient.ts"

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_settings,node_sidebar,node_user toneBlue
class node_authwrapper,node_login,node_register,node_auth,node_registration,node_supabase toneAmber
class node_transactions,node_addtransaction,node_deletetransaction,node_categories,node_newcategory,node_deletecategory,node_budget toneMint
class node_dashboard,node_insights,node_alerts,node_support toneRose
class node_transactionservice,node_budgetservice,node_supabaseclient toneIndigo
```

## Components

### Application

- [App Router](https://github.com/robertave1727/expensetracker/blob/main/src/App.tsx): `src/App.tsx`
- [Settings](https://github.com/robertave1727/expensetracker/blob/main/src/components/settings.tsx): `src/components/settings.tsx`
- [Navigation](https://github.com/robertave1727/expensetracker/blob/main/src/components/sidebar.tsx): `src/components/sidebar.tsx`

### Account Access

- [Auth Screen](https://github.com/robertave1727/expensetracker/blob/main/src/components/authWrapper.tsx): `src/components/authWrapper.tsx`
- [Login](https://github.com/robertave1727/expensetracker/blob/main/src/components/login.tsx): `src/components/login.tsx`
- [Register](https://github.com/robertave1727/expensetracker/blob/main/src/components/register.tsx): `src/components/register.tsx`
- [Session and Auth](https://github.com/robertave1727/expensetracker/blob/main/src/services/useAuth.ts): `src/services/useAuth.ts`
- [Registration Hook](https://github.com/robertave1727/expensetracker/blob/main/src/services/useRegister.ts): `src/services/useRegister.ts`

### Financial Management

- [Transactions](https://github.com/robertave1727/expensetracker/blob/main/src/components/transaction.tsx): `src/components/transaction.tsx`
- [Add Transaction](https://github.com/robertave1727/expensetracker/blob/main/src/features/addTransaction.tsx): `src/features/addTransaction.tsx`
- [Delete Transaction](https://github.com/robertave1727/expensetracker/blob/main/src/features/deleteTransaction.tsx): `src/features/deleteTransaction.tsx`
- [Categories](https://github.com/robertave1727/expensetracker/blob/main/src/components/category.tsx): `src/components/category.tsx`
- [New Category](https://github.com/robertave1727/expensetracker/blob/main/src/features/newCategory.tsx): `src/features/newCategory.tsx`
- [Delete Category](https://github.com/robertave1727/expensetracker/blob/main/src/features/deleteCategory.tsx): `src/features/deleteCategory.tsx`
- [Budget Limits](https://github.com/robertave1727/expensetracker/blob/main/src/features/budgetLimit.tsx): `src/features/budgetLimit.tsx`

### Review and Support

- [Dashboard](https://github.com/robertave1727/expensetracker/blob/main/src/components/dashboard.tsx): `src/components/dashboard.tsx`
- [Smart Insights](https://github.com/robertave1727/expensetracker/blob/main/src/features/smartInsights.tsx): `src/features/smartInsights.tsx`
- [Alerts](https://github.com/robertave1727/expensetracker/blob/main/src/features/alerts.tsx): `src/features/alerts.tsx`
- [Support](https://github.com/robertave1727/expensetracker/blob/main/src/components/support.tsx): `src/components/support.tsx`

### Backend and Services

- [Transaction Service](https://github.com/robertave1727/expensetracker/blob/main/src/services/transactionService.ts): `src/services/transactionService.ts`
- [Budget Service](https://github.com/robertave1727/expensetracker/blob/main/src/services/budgetService.ts): `src/services/budgetService.ts`
- [Supabase Client](https://github.com/robertave1727/expensetracker/blob/main/src/services/supabaseClient.ts): `src/services/supabaseClient.ts`

### Other components

- **User**
- **Supabase**

## Connections

- User → App Router: uses
- App Router → Auth Screen: routes
- Auth Screen → Login: shows
- Auth Screen → Register: shows
- Login → Session and Auth: verifies credentials
- Register → Registration Hook: registers account
- Session and Auth → Supabase Client: calls
- Registration Hook → Supabase Client: calls
- App Router → Supabase Client: checks session
- Supabase Client → Supabase: connects
- App Router → Dashboard: routes
- App Router → Transactions: routes
- App Router → Categories: routes
- App Router → Budget Limits: routes
- App Router → Smart Insights: routes
- App Router → Alerts: routes
- App Router → Settings: routes
- App Router → Support: routes
- App Router → Navigation: renders
- Budget Limits → Session and Auth: reads user
- Budget Limits → Budget Service: saves budget
- Budget Service → Supabase Client: calls
- Transaction Service → Supabase Client: calls
- Dashboard → Session and Auth: reads user
- Smart Insights → Session and Auth: reads user
