# ghassenazzouz/finance architecture

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

- Interactive diagram: https://gitdiagram.com/ghassenazzouz/finance
- Repository: https://github.com/ghassenazzouz/finance

## Overview

Boussole is a French-language personal-finance planner. A user signs in, enters a budget and loans, reviews a long-range plan, records monthly check-ins, and can compare actuals with the plan or simulate changes without saving. The app also supports spreadsheet and bank imports, reports, and data export. Its main internal layers are the pure finance engine, domain rules, and a repository abstraction backed by Supabase. The README documents several links; source excerpts confirm repository persistence, authentication setup, and bank CSV parsing. Other links are omitted where sampled evidence does not establish them.

Main entry points: [`lib/data/supabase-repository.ts`](https://github.com/ghassenazzouz/finance/blob/main/lib/data/supabase-repository.ts) (Finance repository), [`lib/engine/simulate.ts`](https://github.com/ghassenazzouz/finance/blob/main/lib/engine/simulate.ts) (Simulation engine), [`components/app/finance-provider.tsx`](https://github.com/ghassenazzouz/finance/blob/main/components/app/finance-provider.tsx) (App shell), [`app/login/login-form.tsx`](https://github.com/ghassenazzouz/finance/blob/main/app/login/login-form.tsx) (Magic-link login)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_login["Magic-link login<br/>[login-form.tsx]"]
  node_app_shell["App shell"]
  node_dashboard["Dashboard<br/>[view.tsx]"]
end

subgraph group_planning["Budget and planning"]
  node_budget["Budget<br/>[view.tsx]"]
  node_credits["Loans<br/>[loans-manager.tsx]"]
  node_plan["Financial plan<br/>[view.tsx]"]
  node_engine["Simulation engine<br/>[simulate.ts]"]
  node_domain["Domain rules<br/>[plan.ts]"]
end

subgraph group_tracking["Tracking and analysis"]
  node_checkin["Monthly check-ins<br/>[view.tsx]"]
  node_simulator["What-if simulator<br/>[simulator.tsx]"]
  node_reports["Reports<br/>[reports-view.tsx]"]
end

subgraph group_data["Data services"]
  node_import["Spreadsheet import<br/>[import-view.tsx]"]
  node_bank_csv["Bank CSV parsing<br/>[bank-csv.ts]"]
  node_exports["Data export<br/>[backup.ts]"]
  node_repository["Finance repository"]
end

subgraph group_integrations["External services"]
  node_supabase_client["Supabase client<br/>[client.ts]"]
  node_database[("Supabase database")]
  node_billing["Subscription flows<br/>[index.ts]"]
end

node_user(("User"))
node_stripe["Stripe"]

node_user -->|"signs in"| node_login
node_login -->|"requests magic link"| node_supabase_client
node_user -->|"opens app"| node_app_shell
node_app_shell -->|"loads data"| node_repository
node_app_shell -->|"loads plan"| node_engine
node_user -->|"enters budget"| node_budget
node_user -->|"manages loans"| node_credits
node_user -->|"reviews plan"| node_plan
node_plan -->|"simulates plan"| node_engine
node_engine -.->|"uses rules"| node_domain
node_user -->|"records actuals"| node_checkin
node_user -->|"tests changes"| node_simulator
node_simulator -->|"compares scenarios"| node_engine
node_user -->|"views reports"| node_reports
node_user -->|"imports workbook"| node_import
node_import -->|"applies import"| node_repository
node_user -->|"selects bank CSV"| node_bank_csv
node_user -->|"exports data"| node_exports
node_exports -.->|"reads finance data"| node_repository
node_repository -->|"reads and writes"| node_database
node_repository -.->|"uses client"| node_supabase_client
node_billing -.->|"creates checkout"| node_stripe

click node_login "https://github.com/ghassenazzouz/finance/blob/main/app/login/login-form.tsx"
click node_app_shell "https://github.com/ghassenazzouz/finance/blob/main/components/app/finance-provider.tsx"
click node_dashboard "https://github.com/ghassenazzouz/finance/blob/main/app/(app)/view.tsx"
click node_budget "https://github.com/ghassenazzouz/finance/blob/main/app/(app)/budget/view.tsx"
click node_credits "https://github.com/ghassenazzouz/finance/blob/main/app/(app)/credits/loans-manager.tsx"
click node_plan "https://github.com/ghassenazzouz/finance/blob/main/app/(app)/plan/view.tsx"
click node_engine "https://github.com/ghassenazzouz/finance/blob/main/lib/engine/simulate.ts"
click node_domain "https://github.com/ghassenazzouz/finance/blob/main/lib/domain/plan.ts"
click node_checkin "https://github.com/ghassenazzouz/finance/blob/main/app/(app)/suivi/view.tsx"
click node_simulator "https://github.com/ghassenazzouz/finance/blob/main/app/(app)/simuler/simulator.tsx"
click node_reports "https://github.com/ghassenazzouz/finance/blob/main/app/(app)/rapports/reports-view.tsx"
click node_import "https://github.com/ghassenazzouz/finance/blob/main/app/(app)/import/import-view.tsx"
click node_bank_csv "https://github.com/ghassenazzouz/finance/blob/main/lib/import/bank-csv.ts"
click node_exports "https://github.com/ghassenazzouz/finance/blob/main/lib/export/backup.ts"
click node_repository "https://github.com/ghassenazzouz/finance/blob/main/lib/data/supabase-repository.ts"
click node_supabase_client "https://github.com/ghassenazzouz/finance/blob/main/lib/supabase/client.ts"
click node_billing "https://github.com/ghassenazzouz/finance/blob/main/supabase/functions/create-checkout/index.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_login,node_app_shell,node_dashboard,node_user toneBlue
class node_budget,node_credits,node_plan,node_engine,node_domain toneAmber
class node_checkin,node_simulator,node_reports toneMint
class node_import,node_bank_csv,node_exports,node_repository toneRose
class node_supabase_client,node_database,node_billing,node_stripe toneIndigo
```

## Components

### App experience

- [Magic-link login](https://github.com/ghassenazzouz/finance/blob/main/app/login/login-form.tsx): `app/login/login-form.tsx`
- [App shell](https://github.com/ghassenazzouz/finance/blob/main/components/app/finance-provider.tsx): `components/app/finance-provider.tsx`
- [Dashboard](https://github.com/ghassenazzouz/finance/blob/main/app/(app)/view.tsx): `app/(app)/view.tsx`

### Budget and planning

- [Budget](https://github.com/ghassenazzouz/finance/blob/main/app/(app)/budget/view.tsx): `app/(app)/budget/view.tsx`
- [Loans](https://github.com/ghassenazzouz/finance/blob/main/app/(app)/credits/loans-manager.tsx): `app/(app)/credits/loans-manager.tsx`
- [Financial plan](https://github.com/ghassenazzouz/finance/blob/main/app/(app)/plan/view.tsx): `app/(app)/plan/view.tsx`
- [Simulation engine](https://github.com/ghassenazzouz/finance/blob/main/lib/engine/simulate.ts): `lib/engine/simulate.ts`
- [Domain rules](https://github.com/ghassenazzouz/finance/blob/main/lib/domain/plan.ts): `lib/domain/plan.ts`

### Tracking and analysis

- [Monthly check-ins](https://github.com/ghassenazzouz/finance/blob/main/app/(app)/suivi/view.tsx): `app/(app)/suivi/view.tsx`
- [What-if simulator](https://github.com/ghassenazzouz/finance/blob/main/app/(app)/simuler/simulator.tsx): `app/(app)/simuler/simulator.tsx`
- [Reports](https://github.com/ghassenazzouz/finance/blob/main/app/(app)/rapports/reports-view.tsx): `app/(app)/rapports/reports-view.tsx`

### Data services

- [Spreadsheet import](https://github.com/ghassenazzouz/finance/blob/main/app/(app)/import/import-view.tsx): `app/(app)/import/import-view.tsx`
- [Bank CSV parsing](https://github.com/ghassenazzouz/finance/blob/main/lib/import/bank-csv.ts): `lib/import/bank-csv.ts`
- [Data export](https://github.com/ghassenazzouz/finance/blob/main/lib/export/backup.ts): `lib/export/backup.ts`
- [Finance repository](https://github.com/ghassenazzouz/finance/blob/main/lib/data/supabase-repository.ts): `lib/data/supabase-repository.ts`

### External services

- [Supabase client](https://github.com/ghassenazzouz/finance/blob/main/lib/supabase/client.ts): `lib/supabase/client.ts`
- **Supabase database**
- [Subscription flows](https://github.com/ghassenazzouz/finance/blob/main/supabase/functions/create-checkout/index.ts): `supabase/functions/create-checkout/index.ts`

### Other components

- **User**
- **Stripe**

## Connections

- User → Magic-link login: signs in
- Magic-link login → Supabase client: requests magic link (evidence: `app/login/login-form.tsx`)
- User → App shell: opens app
- App shell → Finance repository: loads data
- App shell → Simulation engine: loads plan
- User → Budget: enters budget
- User → Loans: manages loans
- User → Financial plan: reviews plan
- Financial plan → Simulation engine: simulates plan
- Simulation engine → Domain rules: uses rules
- User → Monthly check-ins: records actuals
- User → What-if simulator: tests changes
- What-if simulator → Simulation engine: compares scenarios
- User → Reports: views reports
- User → Spreadsheet import: imports workbook
- Spreadsheet import → Finance repository: applies import
- User → Bank CSV parsing: selects bank CSV (evidence: `lib/import/bank-csv.ts`)
- User → Data export: exports data
- Data export → Finance repository: reads finance data
- Finance repository → Supabase database: reads and writes (evidence: `lib/data/supabase-repository.ts`)
- Finance repository → Supabase client: uses client
- Subscription flows → Stripe: creates checkout
