# alwipratama/financial-tracker architecture

> Architecture diagram of the GitHub repository alwipratama/financial-tracker, 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/alwipratama/financial-tracker
- Repository: https://github.com/alwipratama/financial-tracker

## Overview

FinaryApp is a personal-finance tracker: users sign in, record income and expenses, review balances and reports, and manage account settings. Authentication supports local accounts and Google OAuth; transactions are stored per account in browser localStorage. Reports can be downloaded as PDFs or uploaded to Google Drive. The graph follows relationships shown in excerpts and the SOURCE INDEX; unsampled implementation details are not inferred.

Main entry points: [`src/src/App.tsx`](https://github.com/alwipratama/financial-tracker/blob/main/src/src/App.tsx) (Finance interface), [`src/src/contexts/AuthContext.tsx`](https://github.com/alwipratama/financial-tracker/blob/main/src/src/contexts/AuthContext.tsx) (Authentication context), [`src/App.tsx`](https://github.com/alwipratama/financial-tracker/blob/main/src/App.tsx) (App shell), [`src/src/hooks/useTransactions.ts`](https://github.com/alwipratama/financial-tracker/blob/main/src/src/hooks/useTransactions.ts) (Transaction hook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App and access"]
  node_shell["App shell<br/>[App.tsx]"]
  node_background["Background visuals<br/>[Background.tsx]"]
  node_logo["Brand mark<br/>[Logo.tsx]"]
  node_install_prompt["Install prompt<br/>[InstallPrompt.tsx]"]
end

subgraph group_finance["Finance tracking"]
  node_dashboard["Finance interface<br/>[App.tsx]"]
  node_transactions["Transaction hook<br/>[useTransactions.ts]"]
  node_transaction_store[("Browser transaction storage")]
  node_formatters["Currency and dates<br/>[formatters.ts]"]
  node_categories["Categories and translations<br/>[index.ts]"]
end

subgraph group_account["Accounts and identity"]
  node_login["Login and registration<br/>[LoginPage.tsx]"]
  node_auth["Authentication context<br/>[AuthContext.tsx]"]
  node_account_store[("Browser account storage")]
  node_supabase_auth["Supabase Auth"]
  node_account_manager["Account settings<br/>[AccountManager.tsx]"]
end

subgraph group_reporting["Reports and export"]
  node_reports["Reports view<br/>[ReportsTab.tsx]"]
  node_report_export["PDF and Drive export<br/>[reportExport.ts]"]
end

node_user(("User"))
node_google_drive["Google Drive"]

node_user -->|"opens app"| node_shell
node_shell -->|"provides auth"| node_auth
node_shell -->|"renders"| node_dashboard
node_dashboard -->|"reads account"| node_auth
node_dashboard -->|"uses transactions"| node_transactions
node_dashboard -->|"renders when signed out"| node_login
node_dashboard -->|"renders settings"| node_account_manager
node_dashboard -->|"renders reports"| node_reports
node_dashboard -->|"renders"| node_background
node_dashboard -->|"renders"| node_install_prompt
node_dashboard -->|"formats amounts and dates"| node_formatters
node_dashboard -->|"uses labels"| node_categories
node_login -->|"uses auth actions"| node_auth
node_account_manager -->|"uses account actions"| node_auth
node_transactions -->|"reads current account"| node_auth
node_transactions -->|"reads and writes"| node_transaction_store
node_auth -->|"reads and writes"| node_account_store
node_auth -->|"checks session and OAuth"| node_supabase_auth
node_reports -->|"uses date and currency formatting"| node_formatters
node_reports -->|"uses export functions"| node_report_export
node_report_export -->|"gets session token"| node_supabase_auth
node_report_export -->|"uploads PDF"| node_google_drive
node_dashboard -->|"renders"| node_logo

click node_shell "https://github.com/alwipratama/financial-tracker/blob/main/src/App.tsx"
click node_dashboard "https://github.com/alwipratama/financial-tracker/blob/main/src/src/App.tsx"
click node_login "https://github.com/alwipratama/financial-tracker/blob/main/src/src/components/LoginPage.tsx"
click node_transactions "https://github.com/alwipratama/financial-tracker/blob/main/src/src/hooks/useTransactions.ts"
click node_formatters "https://github.com/alwipratama/financial-tracker/blob/main/src/src/utils/formatters.ts"
click node_categories "https://github.com/alwipratama/financial-tracker/blob/main/src/src/constants/index.ts"
click node_auth "https://github.com/alwipratama/financial-tracker/blob/main/src/src/contexts/AuthContext.tsx"
click node_account_manager "https://github.com/alwipratama/financial-tracker/blob/main/src/src/components/AccountManager.tsx"
click node_background "https://github.com/alwipratama/financial-tracker/blob/main/src/src/components/Background.tsx"
click node_logo "https://github.com/alwipratama/financial-tracker/blob/main/src/src/components/Logo.tsx"
click node_reports "https://github.com/alwipratama/financial-tracker/blob/main/src/src/components/ReportsTab.tsx"
click node_report_export "https://github.com/alwipratama/financial-tracker/blob/main/src/src/utils/reportExport.ts"
click node_install_prompt "https://github.com/alwipratama/financial-tracker/blob/main/src/src/components/InstallPrompt.tsx"

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_shell,node_background,node_logo,node_install_prompt,node_user toneBlue
class node_dashboard,node_transactions,node_transaction_store,node_formatters,node_categories toneAmber
class node_login,node_auth,node_account_store,node_supabase_auth,node_account_manager toneMint
class node_reports,node_report_export toneRose
class node_google_drive toneIndigo
```

## Components

### App and access

- [App shell](https://github.com/alwipratama/financial-tracker/blob/main/src/App.tsx): `src/App.tsx`
- [Background visuals](https://github.com/alwipratama/financial-tracker/blob/main/src/src/components/Background.tsx): `src/src/components/Background.tsx`
- [Brand mark](https://github.com/alwipratama/financial-tracker/blob/main/src/src/components/Logo.tsx): `src/src/components/Logo.tsx`
- [Install prompt](https://github.com/alwipratama/financial-tracker/blob/main/src/src/components/InstallPrompt.tsx): `src/src/components/InstallPrompt.tsx`

### Finance tracking

- [Finance interface](https://github.com/alwipratama/financial-tracker/blob/main/src/src/App.tsx): `src/src/App.tsx`
- [Transaction hook](https://github.com/alwipratama/financial-tracker/blob/main/src/src/hooks/useTransactions.ts): `src/src/hooks/useTransactions.ts`
- **Browser transaction storage**
- [Currency and dates](https://github.com/alwipratama/financial-tracker/blob/main/src/src/utils/formatters.ts): `src/src/utils/formatters.ts`
- [Categories and translations](https://github.com/alwipratama/financial-tracker/blob/main/src/src/constants/index.ts): `src/src/constants/index.ts`

### Accounts and identity

- [Login and registration](https://github.com/alwipratama/financial-tracker/blob/main/src/src/components/LoginPage.tsx): `src/src/components/LoginPage.tsx`
- [Authentication context](https://github.com/alwipratama/financial-tracker/blob/main/src/src/contexts/AuthContext.tsx): `src/src/contexts/AuthContext.tsx`
- **Browser account storage**
- **Supabase Auth**
- [Account settings](https://github.com/alwipratama/financial-tracker/blob/main/src/src/components/AccountManager.tsx): `src/src/components/AccountManager.tsx`

### Reports and export

- [Reports view](https://github.com/alwipratama/financial-tracker/blob/main/src/src/components/ReportsTab.tsx): `src/src/components/ReportsTab.tsx`
- [PDF and Drive export](https://github.com/alwipratama/financial-tracker/blob/main/src/src/utils/reportExport.ts): `src/src/utils/reportExport.ts`

### Other components

- **User**
- **Google Drive**

## Connections

- User → App shell: opens app
- App shell → Authentication context: provides auth (evidence: `src/App.tsx`)
- App shell → Finance interface: renders (evidence: `src/App.tsx`)
- Finance interface → Authentication context: reads account (evidence: `src/src/App.tsx`)
- Finance interface → Transaction hook: uses transactions (evidence: `src/src/App.tsx`)
- Finance interface → Login and registration: renders when signed out (evidence: `src/src/App.tsx`)
- Finance interface → Account settings: renders settings (evidence: `src/src/App.tsx`)
- Finance interface → Reports view: renders reports (evidence: `src/src/App.tsx`)
- Finance interface → Background visuals: renders (evidence: `src/src/App.tsx`)
- Finance interface → Install prompt: renders (evidence: `src/src/App.tsx`)
- Finance interface → Currency and dates: formats amounts and dates (evidence: `src/src/App.tsx`)
- Finance interface → Categories and translations: uses labels (evidence: `src/src/App.tsx`)
- Login and registration → Authentication context: uses auth actions (evidence: `src/src/components/LoginPage.tsx`)
- Account settings → Authentication context: uses account actions (evidence: `src/src/components/AccountManager.tsx`)
- Transaction hook → Authentication context: reads current account (evidence: `src/src/hooks/useTransactions.ts`)
- Transaction hook → Browser transaction storage: reads and writes (evidence: `src/src/hooks/useTransactions.ts`)
- Authentication context → Browser account storage: reads and writes (evidence: `src/src/contexts/AuthContext.tsx`)
- Authentication context → Supabase Auth: checks session and OAuth (evidence: `src/src/contexts/AuthContext.tsx`)
- Reports view → Currency and dates: uses date and currency formatting (evidence: `src/src/components/ReportsTab.tsx`)
- Reports view → PDF and Drive export: uses export functions (evidence: `src/src/components/ReportsTab.tsx`)
- PDF and Drive export → Supabase Auth: gets session token (evidence: `src/src/utils/reportExport.ts`)
- PDF and Drive export → Google Drive: uploads PDF (evidence: `src/src/utils/reportExport.ts`)
- Finance interface → Brand mark: renders (evidence: `src/src/App.tsx`)
