# k4hav/splitsave architecture

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

## Overview

SplitSave is a browser-only UPI QR generator for collecting payments in manageable parts. The main workflow is entering payee and amount details, previewing an optional split, generating QR codes, and manually marking each payment done; completion saves the session to local history. The single page also supports sharing and history reuse, while the root layout bootstraps the remembered theme. The README documents capabilities beyond the sampled source, so those links are cited to the README rather than presented as inspected implementation details. No backend or payment-processing service is shown.

Main entry points: [`app/page.tsx`](https://github.com/k4hav/splitsave/blob/main/app/page.tsx) (Payment Form), [`app/layout.tsx`](https://github.com/k4hav/splitsave/blob/main/app/layout.tsx) (Theme Setup), [`app/globals.css`](https://github.com/k4hav/splitsave/blob/main/app/globals.css) (Theme Styles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and Setup"]
  node_payment_form["Payment Form<br/>[page.tsx]"]
  node_split_logic["Split Preview<br/>[page.tsx]"]
  node_theme_setup["Theme Setup<br/>[layout.tsx]"]
  node_theme_styles["Theme Styles<br/>[globals.css]"]
end

subgraph group_payment["Payment Flow"]
  node_payment_session["Session Control<br/>[page.tsx]"]
  node_upi_link["UPI Link<br/>[page.tsx]"]
  node_qr_display["QR Display<br/>[page.tsx]"]
  node_payment_progress["Payment Progress<br/>[page.tsx]"]
  node_completion["Completion Screen<br/>[page.tsx]"]
end

subgraph group_support["History and Sharing"]
  node_history["Payment History<br/>[page.tsx]"]
  node_browser_store[("Browser Storage")]
  node_share_menu["Share Menu<br/>[page.tsx]"]
end

node_collector(("Collector"))
node_share_targets["Share Targets"]
node_upi_apps["UPI Apps"]

node_collector -->|"enters payment"| node_payment_form
node_payment_form -->|"previews split"| node_split_logic
node_payment_form -->|"generates session"| node_payment_session
node_payment_session -->|"builds payment link"| node_upi_link
node_upi_link -->|"encodes link"| node_qr_display
node_qr_display -.->|"opens in"| node_upi_apps
node_collector -->|"marks payment done"| node_payment_progress
node_payment_progress -->|"advances session"| node_payment_session
node_payment_session -->|"finishes session"| node_completion
node_completion -->|"saves completed payment"| node_history
node_history -->|"persists entries"| node_browser_store
node_payment_form -->|"reuses amount"| node_history
node_payment_form -->|"offers sharing"| node_share_menu
node_qr_display -->|"offers sharing"| node_share_menu
node_completion -->|"offers sharing"| node_share_menu
node_share_menu -->|"shares payment details"| node_share_targets
node_theme_setup -->|"loads theme choice"| node_browser_store
node_theme_setup -->|"applies theme"| node_theme_styles

click node_payment_form "https://github.com/k4hav/splitsave/blob/main/app/page.tsx"
click node_split_logic "https://github.com/k4hav/splitsave/blob/main/app/page.tsx"
click node_payment_session "https://github.com/k4hav/splitsave/blob/main/app/page.tsx"
click node_upi_link "https://github.com/k4hav/splitsave/blob/main/app/page.tsx"
click node_qr_display "https://github.com/k4hav/splitsave/blob/main/app/page.tsx"
click node_payment_progress "https://github.com/k4hav/splitsave/blob/main/app/page.tsx"
click node_completion "https://github.com/k4hav/splitsave/blob/main/app/page.tsx"
click node_history "https://github.com/k4hav/splitsave/blob/main/app/page.tsx"
click node_share_menu "https://github.com/k4hav/splitsave/blob/main/app/page.tsx"
click node_theme_setup "https://github.com/k4hav/splitsave/blob/main/app/layout.tsx"
click node_theme_styles "https://github.com/k4hav/splitsave/blob/main/app/globals.css"

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_payment_form,node_split_logic,node_theme_setup,node_theme_styles toneBlue
class node_payment_session,node_upi_link,node_qr_display,node_payment_progress,node_completion toneAmber
class node_history,node_browser_store,node_share_menu toneMint
class node_collector,node_share_targets,node_upi_apps toneIndigo
```

## Components

### Entry and Setup

- [Payment Form](https://github.com/k4hav/splitsave/blob/main/app/page.tsx): `app/page.tsx`
- [Split Preview](https://github.com/k4hav/splitsave/blob/main/app/page.tsx): `app/page.tsx`
- [Theme Setup](https://github.com/k4hav/splitsave/blob/main/app/layout.tsx): `app/layout.tsx`
- [Theme Styles](https://github.com/k4hav/splitsave/blob/main/app/globals.css): `app/globals.css`

### Payment Flow

- [Session Control](https://github.com/k4hav/splitsave/blob/main/app/page.tsx): `app/page.tsx`
- [UPI Link](https://github.com/k4hav/splitsave/blob/main/app/page.tsx): `app/page.tsx`
- [QR Display](https://github.com/k4hav/splitsave/blob/main/app/page.tsx): `app/page.tsx`
- [Payment Progress](https://github.com/k4hav/splitsave/blob/main/app/page.tsx): `app/page.tsx`
- [Completion Screen](https://github.com/k4hav/splitsave/blob/main/app/page.tsx): `app/page.tsx`

### History and Sharing

- [Payment History](https://github.com/k4hav/splitsave/blob/main/app/page.tsx): `app/page.tsx`
- **Browser Storage**
- [Share Menu](https://github.com/k4hav/splitsave/blob/main/app/page.tsx): `app/page.tsx`

### Other components

- **Collector**
- **Share Targets**
- **UPI Apps**

## Connections

- Collector → Payment Form: enters payment (evidence: `README.md`)
- Payment Form → Split Preview: previews split (evidence: `README.md`)
- Payment Form → Session Control: generates session (evidence: `README.md`)
- Session Control → UPI Link: builds payment link (evidence: `README.md`)
- UPI Link → QR Display: encodes link (evidence: `README.md`)
- QR Display → UPI Apps: opens in (evidence: `README.md`)
- Collector → Payment Progress: marks payment done (evidence: `README.md`)
- Payment Progress → Session Control: advances session (evidence: `README.md`)
- Session Control → Completion Screen: finishes session (evidence: `README.md`)
- Completion Screen → Payment History: saves completed payment (evidence: `README.md`)
- Payment History → Browser Storage: persists entries (evidence: `README.md`)
- Payment Form → Payment History: reuses amount (evidence: `README.md`)
- Payment Form → Share Menu: offers sharing (evidence: `README.md`)
- QR Display → Share Menu: offers sharing (evidence: `README.md`)
- Completion Screen → Share Menu: offers sharing (evidence: `README.md`)
- Share Menu → Share Targets: shares payment details (evidence: `app/page.tsx`)
- Theme Setup → Browser Storage: loads theme choice (evidence: `README.md`)
- Theme Setup → Theme Styles: applies theme (evidence: `app/layout.tsx`)
