# ysoseri1224/sub-recorder architecture

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

- Interactive diagram: https://gitdiagram.com/ysoseri1224/sub-recorder
- Repository: https://github.com/ysoseri1224/sub-recorder

## Overview

Sub Recorder is a personal subscription and billing tracker. Users sign in, manage subscriptions and billing records, organize them by category or scene, and review costs and upcoming bills; settings and notification channels support the workflow. The frontend API client and Actix routes establish the client/server boundary, with handlers owning backend operations and SQLite persistence. README capabilities also include JSON import/export, currency conversion, calendar views, and several notification providers. Some frontend component wiring is inferred from product features; those links are marked unverified because their source was not shown.

Main entry points: [`frontend/src/lib/api.ts`](https://github.com/ysoseri1224/sub-recorder/blob/master/frontend/src/lib/api.ts) (API client), [`frontend/src/app/page.tsx`](https://github.com/ysoseri1224/sub-recorder/blob/master/frontend/src/app/page.tsx) (App shell), [`backend/src/handlers.rs`](https://github.com/ysoseri1224/sub-recorder/blob/master/backend/src/handlers.rs) (Request handlers), [`backend/src/db.rs`](https://github.com/ysoseri1224/sub-recorder/blob/master/backend/src/db.rs) (Database operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User interface"]
  node_app["App shell<br/>[page.tsx]"]
  node_sub_ui["Subscriptions<br/>[scene-page.tsx]"]
  node_billing_ui["Billing views"]
  node_scene_ui["Scenes<br/>[scene-page.tsx]"]
  node_category_ui["Categories<br/>[category-panel.tsx]"]
  node_calendar_ui["Bill calendar"]
  node_stats_ui["Statistics<br/>[page.tsx]"]
  node_settings_ui["Settings<br/>[settings-page.tsx]"]
  node_notify_ui["Notifications"]
  node_auth_ui["Login<br/>[login-page.tsx]"]
  node_i18n["Translations<br/>[i18n.ts]"]
end

subgraph group_api["Application API"]
  node_api_client["API client<br/>[api.ts]"]
  node_server["HTTP server<br/>[main.rs]"]
  node_handlers["Request handlers<br/>[handlers.rs]"]
  node_auth["Authentication<br/>[auth.rs]"]
end

subgraph group_domain["Subscription domain"]
  node_models["Domain models<br/>[models.rs]"]
  node_currency["Currency conversion<br/>[currency.ts]"]
end

subgraph group_storage["Persistence"]
  node_db_logic["Database operations<br/>[db.rs]"]
  node_sqlite[("SQLite database")]
end

subgraph group_integrations["External services"]
  node_providers["Notification providers"]
end

node_user(("User"))

node_user -.->|"uses"| node_app
node_app -.->|"presents"| node_sub_ui
node_app -.->|"presents"| node_stats_ui
node_app -.->|"presents"| node_auth_ui
node_app -.->|"requests"| node_api_client
node_sub_ui -.->|"manages subscriptions"| node_api_client
node_billing_ui -.->|"manages bills"| node_api_client
node_scene_ui -.->|"manages scenes"| node_api_client
node_category_ui -.->|"manages categories"| node_api_client
node_calendar_ui -.->|"loads bills"| node_api_client
node_stats_ui -.->|"loads statistics"| node_api_client
node_settings_ui -.->|"updates settings"| node_api_client
node_notify_ui -.->|"configures channels"| node_api_client
node_auth_ui -.->|"authenticates"| node_api_client
node_api_client -.->|"sends HTTP requests"| node_server
node_server -->|"routes requests"| node_handlers
node_server -->|"uses middleware"| node_auth
node_handlers -->|"calls operations"| node_db_logic
node_handlers -->|"uses types"| node_models
node_auth -->|"validates sessions"| node_db_logic
node_db_logic -->|"maps records"| node_models
node_db_logic -.->|"reads and writes"| node_sqlite
node_handlers -.->|"sends notifications"| node_providers
node_settings_ui -.->|"uses translations"| node_i18n
node_sub_ui -.->|"formats costs"| node_currency

click node_app "https://github.com/ysoseri1224/sub-recorder/blob/master/frontend/src/app/page.tsx"
click node_sub_ui "https://github.com/ysoseri1224/sub-recorder/blob/master/frontend/src/components/scene-page.tsx"
click node_billing_ui "https://github.com/ysoseri1224/sub-recorder/blob/master/frontend/src/components/subscription-detail-sheet.tsx"
click node_scene_ui "https://github.com/ysoseri1224/sub-recorder/blob/master/frontend/src/components/scene-page.tsx"
click node_category_ui "https://github.com/ysoseri1224/sub-recorder/blob/master/frontend/src/components/category-panel.tsx"
click node_calendar_ui "https://github.com/ysoseri1224/sub-recorder/blob/master/frontend/src/components/subscription-calendar.tsx"
click node_stats_ui "https://github.com/ysoseri1224/sub-recorder/blob/master/frontend/src/app/stats/page.tsx"
click node_settings_ui "https://github.com/ysoseri1224/sub-recorder/blob/master/frontend/src/components/settings-page.tsx"
click node_notify_ui "https://github.com/ysoseri1224/sub-recorder/blob/master/frontend/src/components/notifications-page.tsx"
click node_auth_ui "https://github.com/ysoseri1224/sub-recorder/blob/master/frontend/src/components/login-page.tsx"
click node_api_client "https://github.com/ysoseri1224/sub-recorder/blob/master/frontend/src/lib/api.ts"
click node_server "https://github.com/ysoseri1224/sub-recorder/blob/master/backend/src/main.rs"
click node_handlers "https://github.com/ysoseri1224/sub-recorder/blob/master/backend/src/handlers.rs"
click node_auth "https://github.com/ysoseri1224/sub-recorder/blob/master/backend/src/auth.rs"
click node_models "https://github.com/ysoseri1224/sub-recorder/blob/master/backend/src/models.rs"
click node_db_logic "https://github.com/ysoseri1224/sub-recorder/blob/master/backend/src/db.rs"
click node_i18n "https://github.com/ysoseri1224/sub-recorder/blob/master/frontend/src/lib/i18n.ts"
click node_currency "https://github.com/ysoseri1224/sub-recorder/blob/master/frontend/src/lib/currency.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_sub_ui,node_billing_ui,node_scene_ui,node_category_ui,node_calendar_ui,node_stats_ui,node_settings_ui,node_notify_ui,node_auth_ui,node_i18n,node_user toneBlue
class node_api_client,node_server,node_handlers,node_auth toneAmber
class node_models,node_currency toneMint
class node_db_logic,node_sqlite toneRose
class node_providers toneIndigo
```

## Components

### User interface

- [App shell](https://github.com/ysoseri1224/sub-recorder/blob/master/frontend/src/app/page.tsx): `frontend/src/app/page.tsx`
- [Subscriptions](https://github.com/ysoseri1224/sub-recorder/blob/master/frontend/src/components/scene-page.tsx): `frontend/src/components/scene-page.tsx`
- [Billing views](https://github.com/ysoseri1224/sub-recorder/blob/master/frontend/src/components/subscription-detail-sheet.tsx): `frontend/src/components/subscription-detail-sheet.tsx`
- [Scenes](https://github.com/ysoseri1224/sub-recorder/blob/master/frontend/src/components/scene-page.tsx): `frontend/src/components/scene-page.tsx`
- [Categories](https://github.com/ysoseri1224/sub-recorder/blob/master/frontend/src/components/category-panel.tsx): `frontend/src/components/category-panel.tsx`
- [Bill calendar](https://github.com/ysoseri1224/sub-recorder/blob/master/frontend/src/components/subscription-calendar.tsx): `frontend/src/components/subscription-calendar.tsx`
- [Statistics](https://github.com/ysoseri1224/sub-recorder/blob/master/frontend/src/app/stats/page.tsx): `frontend/src/app/stats/page.tsx`
- [Settings](https://github.com/ysoseri1224/sub-recorder/blob/master/frontend/src/components/settings-page.tsx): `frontend/src/components/settings-page.tsx`
- [Notifications](https://github.com/ysoseri1224/sub-recorder/blob/master/frontend/src/components/notifications-page.tsx): `frontend/src/components/notifications-page.tsx`
- [Login](https://github.com/ysoseri1224/sub-recorder/blob/master/frontend/src/components/login-page.tsx): `frontend/src/components/login-page.tsx`
- [Translations](https://github.com/ysoseri1224/sub-recorder/blob/master/frontend/src/lib/i18n.ts): `frontend/src/lib/i18n.ts`

### Application API

- [API client](https://github.com/ysoseri1224/sub-recorder/blob/master/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`
- [HTTP server](https://github.com/ysoseri1224/sub-recorder/blob/master/backend/src/main.rs): `backend/src/main.rs`
- [Request handlers](https://github.com/ysoseri1224/sub-recorder/blob/master/backend/src/handlers.rs): `backend/src/handlers.rs`
- [Authentication](https://github.com/ysoseri1224/sub-recorder/blob/master/backend/src/auth.rs): `backend/src/auth.rs`

### Subscription domain

- [Domain models](https://github.com/ysoseri1224/sub-recorder/blob/master/backend/src/models.rs): `backend/src/models.rs`
- [Currency conversion](https://github.com/ysoseri1224/sub-recorder/blob/master/frontend/src/lib/currency.ts): `frontend/src/lib/currency.ts`

### Persistence

- [Database operations](https://github.com/ysoseri1224/sub-recorder/blob/master/backend/src/db.rs): `backend/src/db.rs`
- **SQLite database**

### External services

- **Notification providers**

### Other components

- **User**

## Connections

- User → App shell: uses (evidence: `README.md`)
- App shell → Subscriptions: presents
- App shell → Statistics: presents
- App shell → Login: presents
- App shell → API client: requests
- Subscriptions → API client: manages subscriptions
- Billing views → API client: manages bills
- Scenes → API client: manages scenes
- Categories → API client: manages categories
- Bill calendar → API client: loads bills
- Statistics → API client: loads statistics
- Settings → API client: updates settings
- Notifications → API client: configures channels
- Login → API client: authenticates
- API client → HTTP server: sends HTTP requests
- HTTP server → Request handlers: routes requests (evidence: `backend/src/main.rs`)
- HTTP server → Authentication: uses middleware (evidence: `backend/src/main.rs`)
- Request handlers → Database operations: calls operations (evidence: `backend/src/handlers.rs`)
- Request handlers → Domain models: uses types (evidence: `backend/src/handlers.rs`)
- Authentication → Database operations: validates sessions (evidence: `backend/src/auth.rs`)
- Database operations → Domain models: maps records (evidence: `backend/src/db.rs`)
- Database operations → SQLite database: reads and writes
- Request handlers → Notification providers: sends notifications (evidence: `README.md`)
- Settings → Translations: uses translations
- Subscriptions → Currency conversion: formats costs
