# necotan/milenote architecture

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

- Interactive diagram: https://gitdiagram.com/necotan/milenote
- Repository: https://github.com/necotan/milenote

## Overview

Milenote is a personal car-expense tracking web app. A user manages vehicles and records vehicle-related costs, including recurring payments; the app also provides maintenance alerts and monthly/yearly expense statistics. The sampled files show page-to-data-hook references and the Supabase browser client, while the README documents the broader capabilities and Supabase-backed persistence. Some subsystems are represented by their exact enclosing directory because their implementation was not sampled; relationships without direct evidence are omitted.

Main entry points: [`utils/supabase.ts`](https://github.com/necotan/milenote/blob/main/utils/supabase.ts) (Browser client), [`app/records/page.tsx`](https://github.com/necotan/milenote/blob/main/app/records/page.tsx) (Expense records), [`lib/hooks/useCars.ts`](https://github.com/necotan/milenote/blob/main/lib/hooks/useCars.ts) (Vehicle data hook), [`lib/hooks/useRecords.ts`](https://github.com/necotan/milenote/blob/main/lib/hooks/useRecords.ts) (Record data hook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_shell["App shell<br/>[AppShell.tsx]"]
  node_login["Login and signup<br/>[page.tsx]"]
  node_profile["Profile and export<br/>[page.tsx]"]
  node_i18n["Localization<br/>[index.tsx]"]
end

subgraph group_expenses["Expense management"]
  node_garage["Vehicle management<br/>[page.tsx]"]
  node_records["Expense records<br/>[page.tsx]"]
  node_recurring["Recurring costs<br/>[RecurringTab.tsx]"]
  node_recurring_processor["Recurring processing"]
end

subgraph group_insights["Maintenance and insights"]
  node_maintenance["Maintenance alerts<br/>[page.tsx]"]
  node_alert_logic["Alert rules"]
  node_stats["Expense statistics<br/>[page.tsx]"]
  node_yearly_stats["Yearly calculations<br/>[yearlyStats.ts]"]
end

subgraph group_platform["Identity and data"]
  node_auth_hook["Current user hook<br/>[useSupabaseUser.ts]"]
  node_cars_hook["Vehicle data hook<br/>[useCars.ts]"]
  node_records_hook["Record data hook<br/>[useRecords.ts]"]
  node_recurring_hook["Recurring data hook"]
  node_supabase_client["Browser client<br/>[supabase.ts]"]
end

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

node_user -->|"signs in"| node_login
node_user -->|"manages vehicles"| node_garage
node_user -->|"records expenses"| node_records
node_user -->|"views spending"| node_stats
node_records -->|"shows tab"| node_recurring
node_garage -->|"uses user"| node_auth_hook
node_garage -->|"loads vehicles"| node_cars_hook
node_garage -->|"loads records"| node_records_hook
node_records -->|"loads vehicles"| node_cars_hook
node_records -->|"loads records"| node_records_hook
node_records -->|"renders"| node_recurring
node_recurring -->|"uses data hook"| node_recurring_hook
node_maintenance -->|"uses alert rules"| node_alert_logic
node_maintenance -->|"loads vehicles"| node_cars_hook
node_maintenance -->|"loads records"| node_records_hook
node_stats -->|"loads vehicles"| node_cars_hook
node_stats -->|"loads records"| node_records_hook
node_stats -->|"uses calculations"| node_yearly_stats
node_auth_hook -->|"gets client"| node_supabase_client
node_cars_hook -->|"gets client"| node_supabase_client
node_records_hook -->|"uses client"| node_supabase_client
node_recurring_hook -.->|"uses client"| node_supabase_client
node_supabase_client -->|"connects"| node_supabase
node_shell -->|"renders processor"| node_recurring_processor
node_login -->|"uses client"| node_supabase_client
node_shell -->|"uses localization"| node_i18n

click node_shell "https://github.com/necotan/milenote/blob/main/components/AppShell.tsx"
click node_login "https://github.com/necotan/milenote/blob/main/app/login/page.tsx"
click node_garage "https://github.com/necotan/milenote/blob/main/app/garage/page.tsx"
click node_records "https://github.com/necotan/milenote/blob/main/app/records/page.tsx"
click node_recurring "https://github.com/necotan/milenote/blob/main/components/RecurringTab.tsx"
click node_recurring_processor "https://github.com/necotan/milenote/blob/main/components/RecurringCostProcessor.tsx"
click node_maintenance "https://github.com/necotan/milenote/blob/main/app/maintenance/page.tsx"
click node_alert_logic "https://github.com/necotan/milenote/blob/main/lib/maintenanceAlerts.ts"
click node_stats "https://github.com/necotan/milenote/blob/main/app/stats/page.tsx"
click node_yearly_stats "https://github.com/necotan/milenote/blob/main/lib/yearlyStats.ts"
click node_profile "https://github.com/necotan/milenote/blob/main/app/mypage/page.tsx"
click node_auth_hook "https://github.com/necotan/milenote/blob/main/lib/hooks/useSupabaseUser.ts"
click node_cars_hook "https://github.com/necotan/milenote/blob/main/lib/hooks/useCars.ts"
click node_records_hook "https://github.com/necotan/milenote/blob/main/lib/hooks/useRecords.ts"
click node_recurring_hook "https://github.com/necotan/milenote/blob/main/lib/hooks/useRecurringCosts.ts"
click node_supabase_client "https://github.com/necotan/milenote/blob/main/utils/supabase.ts"
click node_i18n "https://github.com/necotan/milenote/blob/main/lib/i18n/index.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_login,node_profile,node_i18n,node_user toneBlue
class node_garage,node_records,node_recurring,node_recurring_processor,node_supabase toneAmber
class node_maintenance,node_alert_logic,node_stats,node_yearly_stats toneMint
class node_auth_hook,node_cars_hook,node_records_hook,node_recurring_hook,node_supabase_client toneRose
```

## Components

### App experience

- [App shell](https://github.com/necotan/milenote/blob/main/components/AppShell.tsx): `components/AppShell.tsx`
- [Login and signup](https://github.com/necotan/milenote/blob/main/app/login/page.tsx): `app/login/page.tsx`
- [Profile and export](https://github.com/necotan/milenote/blob/main/app/mypage/page.tsx): `app/mypage/page.tsx`
- [Localization](https://github.com/necotan/milenote/blob/main/lib/i18n/index.tsx): `lib/i18n/index.tsx`

### Expense management

- [Vehicle management](https://github.com/necotan/milenote/blob/main/app/garage/page.tsx): `app/garage/page.tsx`
- [Expense records](https://github.com/necotan/milenote/blob/main/app/records/page.tsx): `app/records/page.tsx`
- [Recurring costs](https://github.com/necotan/milenote/blob/main/components/RecurringTab.tsx): `components/RecurringTab.tsx`
- [Recurring processing](https://github.com/necotan/milenote/blob/main/components/RecurringCostProcessor.tsx): `components/RecurringCostProcessor.tsx`

### Maintenance and insights

- [Maintenance alerts](https://github.com/necotan/milenote/blob/main/app/maintenance/page.tsx): `app/maintenance/page.tsx`
- [Alert rules](https://github.com/necotan/milenote/blob/main/lib/maintenanceAlerts.ts): `lib/maintenanceAlerts.ts`
- [Expense statistics](https://github.com/necotan/milenote/blob/main/app/stats/page.tsx): `app/stats/page.tsx`
- [Yearly calculations](https://github.com/necotan/milenote/blob/main/lib/yearlyStats.ts): `lib/yearlyStats.ts`

### Identity and data

- [Current user hook](https://github.com/necotan/milenote/blob/main/lib/hooks/useSupabaseUser.ts): `lib/hooks/useSupabaseUser.ts`
- [Vehicle data hook](https://github.com/necotan/milenote/blob/main/lib/hooks/useCars.ts): `lib/hooks/useCars.ts`
- [Record data hook](https://github.com/necotan/milenote/blob/main/lib/hooks/useRecords.ts): `lib/hooks/useRecords.ts`
- [Recurring data hook](https://github.com/necotan/milenote/blob/main/lib/hooks/useRecurringCosts.ts): `lib/hooks/useRecurringCosts.ts`
- [Browser client](https://github.com/necotan/milenote/blob/main/utils/supabase.ts): `utils/supabase.ts`

### Other components

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

## Connections

- User → Login and signup: signs in
- User → Vehicle management: manages vehicles
- User → Expense records: records expenses
- User → Expense statistics: views spending
- Expense records → Recurring costs: shows tab (evidence: `app/records/page.tsx`)
- Vehicle management → Current user hook: uses user (evidence: `app/garage/page.tsx`)
- Vehicle management → Vehicle data hook: loads vehicles (evidence: `app/garage/page.tsx`)
- Vehicle management → Record data hook: loads records (evidence: `app/garage/page.tsx`)
- Expense records → Vehicle data hook: loads vehicles (evidence: `app/records/page.tsx`)
- Expense records → Record data hook: loads records (evidence: `app/records/page.tsx`)
- Expense records → Recurring costs: renders (evidence: `app/records/page.tsx`)
- Recurring costs → Recurring data hook: uses data hook (evidence: `components/RecurringTab.tsx`)
- Maintenance alerts → Alert rules: uses alert rules (evidence: `app/maintenance/page.tsx`)
- Maintenance alerts → Vehicle data hook: loads vehicles (evidence: `app/maintenance/page.tsx`)
- Maintenance alerts → Record data hook: loads records (evidence: `app/maintenance/page.tsx`)
- Expense statistics → Vehicle data hook: loads vehicles (evidence: `app/stats/page.tsx`)
- Expense statistics → Record data hook: loads records (evidence: `app/stats/page.tsx`)
- Expense statistics → Yearly calculations: uses calculations (evidence: `app/stats/page.tsx`)
- Current user hook → Browser client: gets client (evidence: `lib/hooks/useSupabaseUser.ts`)
- Vehicle data hook → Browser client: gets client (evidence: `lib/hooks/useCars.ts`)
- Record data hook → Browser client: uses client (evidence: `lib/hooks/useRecords.ts`)
- Recurring data hook → Browser client: uses client
- Browser client → Supabase: connects
- App shell → Recurring processing: renders processor (evidence: `components/AppShell.tsx`)
- Login and signup → Browser client: uses client (evidence: `app/login/page.tsx`)
- App shell → Localization: uses localization (evidence: `components/AppShell.tsx`)
