# harmangit94/money-habits architecture

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

- Interactive diagram: https://gitdiagram.com/harmangit94/money-habits
- Repository: https://github.com/harmangit94/money-habits

## Overview

Money Habits is a personal-budgeting product with web and mobile clients. In the web workflow, a user opens the dashboard; the app checks the Supabase session, loads budget data into client state, and renders dashboard or account, card, bill, income, expense, and settings views. Bill actions can update budget state, and marking a linked bill paid creates an expense. The mobile tree exposes corresponding finance tabs and a local-persisted store. The README is empty; mobile screen-to-store wiring is not established by the sampled evidence.

Main entry points: [`apps/web/app/page.tsx`](https://github.com/harmangit94/money-habits/blob/main/apps/web/app/page.tsx) (Web dashboard shell), [`apps/web/lib/store.ts`](https://github.com/harmangit94/money-habits/blob/main/apps/web/lib/store.ts) (Web budget store), [`apps/web/lib/supabase.ts`](https://github.com/harmangit94/money-habits/blob/main/apps/web/lib/supabase.ts) (Web Supabase client), [`apps/web/components/BillCard.tsx`](https://github.com/harmangit94/money-habits/blob/main/apps/web/components/BillCard.tsx) (Bill manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_web_home["Web dashboard shell<br/>[page.tsx]"]
  node_web_auth["Web sign-in<br/>[page.tsx]"]
  node_auth_callback["Auth callback<br/>[route.ts]"]
  node_dashboard["Dashboard summary"]
  node_spending["Spending chart"]
  node_accounts["Account manager<br/>[AccountsPanel.tsx]"]
  node_cards["Credit cards"]
  node_bills["Bill manager<br/>[BillCard.tsx]"]
  node_bill_form["Bill editor<br/>[BillForm.tsx]"]
  node_income["Income summary<br/>[IncomeSummary.tsx]"]
  node_expenses["Transactions list"]
  node_settings["Budget settings<br/>[Settings.tsx]"]
end

subgraph group_mobile["Mobile application"]
  node_mobile_tabs["Mobile finance tabs"]
  node_mobile_auth["Mobile sign-in<br/>[auth.tsx]"]
end

subgraph group_state["Budget state"]
  node_web_store["Web budget store<br/>[store.ts]"]
  node_mobile_store["Mobile budget store<br/>[store.ts]"]
end

subgraph group_identity["Identity and data"]
  node_supabase_store[("Supabase data service")]
  node_web_client["Web Supabase client<br/>[supabase.ts]"]
  node_mobile_client["Mobile Supabase client<br/>[supabase.ts]"]
end

node_user(("Budget user"))

node_user -->|"opens"| node_web_home
node_web_home -->|"loads session data"| node_web_store
node_web_home -->|"checks session"| node_web_client
node_web_home -->|"renders"| node_dashboard
node_web_home -->|"renders"| node_cards
node_web_home -->|"renders"| node_accounts
node_web_home -->|"renders"| node_bills
node_web_home -->|"renders"| node_income
node_web_home -->|"renders"| node_expenses
node_web_home -->|"renders"| node_settings
node_dashboard -->|"renders"| node_spending
node_bills -->|"renders"| node_bill_form
node_web_store -->|"queries and updates"| node_web_client
node_web_client -->|"connects"| node_supabase_store
node_web_auth -.->|"authenticates"| node_web_client
node_user -->|"signs in"| node_web_auth
node_user -->|"returns from auth"| node_auth_callback
node_auth_callback -->|"exchanges session"| node_supabase_store
node_bills -->|"marks paid or removes"| node_web_store
node_web_store -->|"creates linked expense"| node_web_store
node_user -.->|"uses"| node_mobile_tabs
node_user -.->|"signs in"| node_mobile_auth
node_mobile_tabs -.->|"reads and updates"| node_mobile_store
node_mobile_store -->|"queries and updates"| node_mobile_client
node_mobile_client -->|"connects"| node_supabase_store

click node_web_home "https://github.com/harmangit94/money-habits/blob/main/apps/web/app/page.tsx"
click node_web_auth "https://github.com/harmangit94/money-habits/blob/main/apps/web/app/auth/page.tsx"
click node_auth_callback "https://github.com/harmangit94/money-habits/blob/main/apps/web/app/auth/callback/route.ts"
click node_dashboard "https://github.com/harmangit94/money-habits/blob/main/apps/web/components/DashboardSummary.tsx"
click node_spending "https://github.com/harmangit94/money-habits/blob/main/apps/web/components/SpendingPieChart.tsx"
click node_accounts "https://github.com/harmangit94/money-habits/blob/main/apps/web/components/AccountsPanel.tsx"
click node_cards "https://github.com/harmangit94/money-habits/blob/main/apps/web/components/CreditCardWidget.tsx"
click node_bills "https://github.com/harmangit94/money-habits/blob/main/apps/web/components/BillCard.tsx"
click node_bill_form "https://github.com/harmangit94/money-habits/blob/main/apps/web/components/BillForm.tsx"
click node_income "https://github.com/harmangit94/money-habits/blob/main/apps/web/components/IncomeSummary.tsx"
click node_expenses "https://github.com/harmangit94/money-habits/blob/main/apps/web/components/TransactionsList.tsx"
click node_settings "https://github.com/harmangit94/money-habits/blob/main/apps/web/components/Settings.tsx"
click node_mobile_tabs "https://github.com/harmangit94/money-habits/tree/main/apps/mobile/app/(tabs)"
click node_mobile_auth "https://github.com/harmangit94/money-habits/blob/main/apps/mobile/app/auth.tsx"
click node_web_store "https://github.com/harmangit94/money-habits/blob/main/apps/web/lib/store.ts"
click node_mobile_store "https://github.com/harmangit94/money-habits/blob/main/apps/mobile/lib/store.ts"
click node_web_client "https://github.com/harmangit94/money-habits/blob/main/apps/web/lib/supabase.ts"
click node_mobile_client "https://github.com/harmangit94/money-habits/blob/main/apps/mobile/lib/supabase.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_web_home,node_web_auth,node_auth_callback,node_dashboard,node_spending,node_accounts,node_cards,node_bills,node_bill_form,node_income,node_expenses,node_settings,node_user toneBlue
class node_mobile_tabs,node_mobile_auth toneAmber
class node_web_store,node_mobile_store toneMint
class node_supabase_store,node_web_client,node_mobile_client toneRose
```

## Components

### Web application

- [Web dashboard shell](https://github.com/harmangit94/money-habits/blob/main/apps/web/app/page.tsx): `apps/web/app/page.tsx`
- [Web sign-in](https://github.com/harmangit94/money-habits/blob/main/apps/web/app/auth/page.tsx): `apps/web/app/auth/page.tsx`
- [Auth callback](https://github.com/harmangit94/money-habits/blob/main/apps/web/app/auth/callback/route.ts): `apps/web/app/auth/callback/route.ts`
- [Dashboard summary](https://github.com/harmangit94/money-habits/blob/main/apps/web/components/DashboardSummary.tsx): `apps/web/components/DashboardSummary.tsx`
- [Spending chart](https://github.com/harmangit94/money-habits/blob/main/apps/web/components/SpendingPieChart.tsx): `apps/web/components/SpendingPieChart.tsx`
- [Account manager](https://github.com/harmangit94/money-habits/blob/main/apps/web/components/AccountsPanel.tsx): `apps/web/components/AccountsPanel.tsx`
- [Credit cards](https://github.com/harmangit94/money-habits/blob/main/apps/web/components/CreditCardWidget.tsx): `apps/web/components/CreditCardWidget.tsx`
- [Bill manager](https://github.com/harmangit94/money-habits/blob/main/apps/web/components/BillCard.tsx): `apps/web/components/BillCard.tsx`
- [Bill editor](https://github.com/harmangit94/money-habits/blob/main/apps/web/components/BillForm.tsx): `apps/web/components/BillForm.tsx`
- [Income summary](https://github.com/harmangit94/money-habits/blob/main/apps/web/components/IncomeSummary.tsx): `apps/web/components/IncomeSummary.tsx`
- [Transactions list](https://github.com/harmangit94/money-habits/blob/main/apps/web/components/TransactionsList.tsx): `apps/web/components/TransactionsList.tsx`
- [Budget settings](https://github.com/harmangit94/money-habits/blob/main/apps/web/components/Settings.tsx): `apps/web/components/Settings.tsx`

### Mobile application

- [Mobile finance tabs](https://github.com/harmangit94/money-habits/tree/main/apps/mobile/app/(tabs)): `apps/mobile/app/(tabs)`
- [Mobile sign-in](https://github.com/harmangit94/money-habits/blob/main/apps/mobile/app/auth.tsx): `apps/mobile/app/auth.tsx`

### Budget state

- [Web budget store](https://github.com/harmangit94/money-habits/blob/main/apps/web/lib/store.ts): `apps/web/lib/store.ts`
- [Mobile budget store](https://github.com/harmangit94/money-habits/blob/main/apps/mobile/lib/store.ts): `apps/mobile/lib/store.ts`

### Identity and data

- **Supabase data service**
- [Web Supabase client](https://github.com/harmangit94/money-habits/blob/main/apps/web/lib/supabase.ts): `apps/web/lib/supabase.ts`
- [Mobile Supabase client](https://github.com/harmangit94/money-habits/blob/main/apps/mobile/lib/supabase.ts): `apps/mobile/lib/supabase.ts`

### Other components

- **Budget user**

## Connections

- Budget user → Web dashboard shell: opens (evidence: `apps/web/app/page.tsx`)
- Web dashboard shell → Web budget store: loads session data (evidence: `apps/web/app/page.tsx`)
- Web dashboard shell → Web Supabase client: checks session (evidence: `apps/web/app/page.tsx`)
- Web dashboard shell → Dashboard summary: renders (evidence: `apps/web/app/page.tsx`)
- Web dashboard shell → Credit cards: renders (evidence: `apps/web/app/page.tsx`)
- Web dashboard shell → Account manager: renders (evidence: `apps/web/app/page.tsx`)
- Web dashboard shell → Bill manager: renders (evidence: `apps/web/app/page.tsx`)
- Web dashboard shell → Income summary: renders (evidence: `apps/web/app/page.tsx`)
- Web dashboard shell → Transactions list: renders (evidence: `apps/web/app/page.tsx`)
- Web dashboard shell → Budget settings: renders (evidence: `apps/web/app/page.tsx`)
- Dashboard summary → Spending chart: renders (evidence: `apps/web/components/DashboardSummary.tsx`)
- Bill manager → Bill editor: renders (evidence: `apps/web/components/BillCard.tsx`)
- Web budget store → Web Supabase client: queries and updates (evidence: `apps/web/lib/store.ts`)
- Web Supabase client → Supabase data service: connects (evidence: `apps/web/lib/supabase.ts`)
- Web sign-in → Web Supabase client: authenticates
- Budget user → Web sign-in: signs in
- Budget user → Auth callback: returns from auth (evidence: `apps/web/app/auth/callback/route.ts`)
- Auth callback → Supabase data service: exchanges session (evidence: `apps/web/app/auth/callback/route.ts`)
- Bill manager → Web budget store: marks paid or removes (evidence: `apps/web/components/BillCard.tsx`)
- Web budget store → Web budget store: creates linked expense (evidence: `apps/web/lib/store.ts`)
- Budget user → Mobile finance tabs: uses
- Budget user → Mobile sign-in: signs in
- Mobile finance tabs → Mobile budget store: reads and updates
- Mobile budget store → Mobile Supabase client: queries and updates (evidence: `apps/mobile/lib/store.ts`)
- Mobile Supabase client → Supabase data service: connects (evidence: `apps/mobile/lib/supabase.ts`)
