# szumaol/skener architecture

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

- Interactive diagram: https://gitdiagram.com/szumaol/skener
- Repository: https://github.com/szumaol/skener

## Overview

This is a receipt-tracking web app: users register or sign in, then manage receipt data in a dashboard; the dashboard also offers manual entry and a PRO-gated AI scan, while subscription checkout unlocks the scan. The graph reflects only relationships visible in the sampled source or README. Several API routes and pages are indexed but not excerpted, so their internal behavior and connections are omitted rather than inferred.

Main entry points: [`app/page.tsx`](https://github.com/szumaol/skener/blob/main/app/page.tsx) (Receipt dashboard), [`app/api/auth`](https://github.com/szumaol/skener/tree/main/app/api/auth) (Auth endpoints), [`lib/auth.ts`](https://github.com/szumaol/skener/blob/main/lib/auth.ts) (Session service), [`app/api/receipts/save/route.ts`](https://github.com/szumaol/skener/blob/main/app/api/receipts/save/route.ts) (Receipt save endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Web interface"]
  node_dashboard["Receipt dashboard<br/>[page.tsx]"]
  node_login_page["Login page<br/>[page.tsx]"]
  node_register_page["Registration page<br/>[page.tsx]"]
  node_logout_button["Logout control<br/>[LogoutButton.tsx]"]
  node_lock_screen["PRO lock screen<br/>[LockScreen.tsx]"]
  node_subscribe_button["Subscribe control"]
end

subgraph group_identity["Identity and access"]
  node_auth_api["Auth endpoints"]
  node_session["Session service<br/>[auth.ts]"]
end

subgraph group_receipts["Receipt processing"]
  node_receipt_scan["AI receipt scan<br/>[route.ts]"]
  node_receipt_save["Receipt save endpoint<br/>[route.ts]"]
  node_receipt_list["Receipt listing endpoint<br/>[route.ts]"]
  node_receipt_store[("Neon receipt data")]
end

subgraph group_billing["Subscriptions"]
  node_stripe_checkout["Checkout endpoint<br/>[route.ts]"]
  node_stripe_webhook["Subscription webhook<br/>[route.ts]"]
  node_stripe_service["Stripe client<br/>[stripe.ts]"]
end

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

node_user -->|"uses"| node_dashboard
node_dashboard -->|"fetches receipts"| node_receipt_list
node_dashboard -.->|"submits scan"| node_receipt_scan
node_dashboard -.->|"saves receipt"| node_receipt_save
node_dashboard -->|"renders"| node_logout_button
node_dashboard -->|"renders"| node_lock_screen
node_lock_screen -->|"renders"| node_subscribe_button
node_user -->|"signs in"| node_login_page
node_user -->|"registers"| node_register_page
node_login_page -.->|"submits credentials"| node_auth_api
node_register_page -.->|"submits registration"| node_auth_api
node_logout_button -->|"requests logout"| node_auth_api
node_auth_api -->|"creates session"| node_session
node_receipt_list -->|"checks session"| node_session
node_receipt_save -->|"checks session"| node_session
node_receipt_list -->|"reads"| node_receipt_store
node_receipt_save -->|"writes"| node_receipt_store
node_receipt_scan -.->|"persists scan"| node_receipt_store
node_subscribe_button -->|"starts checkout"| node_stripe_checkout
node_stripe_checkout -->|"checks session"| node_session
node_stripe_checkout -->|"creates checkout"| node_stripe_service
node_stripe_webhook -->|"verifies event"| node_stripe_service
node_stripe_service -.->|"connects"| node_stripe
node_stripe_webhook -->|"updates plan"| node_receipt_store

click node_dashboard "https://github.com/szumaol/skener/blob/main/app/page.tsx"
click node_login_page "https://github.com/szumaol/skener/blob/main/app/login/page.tsx"
click node_register_page "https://github.com/szumaol/skener/blob/main/app/register/page.tsx"
click node_logout_button "https://github.com/szumaol/skener/blob/main/components/LogoutButton.tsx"
click node_lock_screen "https://github.com/szumaol/skener/blob/main/components/LockScreen.tsx"
click node_subscribe_button "https://github.com/szumaol/skener/blob/main/components/SubscribeButton.tsx"
click node_auth_api "https://github.com/szumaol/skener/tree/main/app/api/auth"
click node_session "https://github.com/szumaol/skener/blob/main/lib/auth.ts"
click node_receipt_scan "https://github.com/szumaol/skener/blob/main/app/api/scan/route.ts"
click node_receipt_save "https://github.com/szumaol/skener/blob/main/app/api/receipts/save/route.ts"
click node_receipt_list "https://github.com/szumaol/skener/blob/main/app/api/receipts/route.ts"
click node_stripe_checkout "https://github.com/szumaol/skener/blob/main/app/api/stripe/checkout/route.ts"
click node_stripe_webhook "https://github.com/szumaol/skener/blob/main/app/api/webhooks/stripe/route.ts"
click node_stripe_service "https://github.com/szumaol/skener/blob/main/lib/stripe.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_dashboard,node_login_page,node_register_page,node_logout_button,node_lock_screen,node_subscribe_button,node_user toneBlue
class node_auth_api,node_session toneAmber
class node_receipt_scan,node_receipt_save,node_receipt_list,node_receipt_store toneMint
class node_stripe_checkout,node_stripe_webhook,node_stripe_service toneRose
class node_stripe toneIndigo
```

## Components

### Web interface

- [Receipt dashboard](https://github.com/szumaol/skener/blob/main/app/page.tsx): `app/page.tsx`
- [Login page](https://github.com/szumaol/skener/blob/main/app/login/page.tsx): `app/login/page.tsx`
- [Registration page](https://github.com/szumaol/skener/blob/main/app/register/page.tsx): `app/register/page.tsx`
- [Logout control](https://github.com/szumaol/skener/blob/main/components/LogoutButton.tsx): `components/LogoutButton.tsx`
- [PRO lock screen](https://github.com/szumaol/skener/blob/main/components/LockScreen.tsx): `components/LockScreen.tsx`
- [Subscribe control](https://github.com/szumaol/skener/blob/main/components/SubscribeButton.tsx): `components/SubscribeButton.tsx`

### Identity and access

- [Auth endpoints](https://github.com/szumaol/skener/tree/main/app/api/auth): `app/api/auth`
- [Session service](https://github.com/szumaol/skener/blob/main/lib/auth.ts): `lib/auth.ts`

### Receipt processing

- [AI receipt scan](https://github.com/szumaol/skener/blob/main/app/api/scan/route.ts): `app/api/scan/route.ts`
- [Receipt save endpoint](https://github.com/szumaol/skener/blob/main/app/api/receipts/save/route.ts): `app/api/receipts/save/route.ts`
- [Receipt listing endpoint](https://github.com/szumaol/skener/blob/main/app/api/receipts/route.ts): `app/api/receipts/route.ts`
- **Neon receipt data**

### Subscriptions

- [Checkout endpoint](https://github.com/szumaol/skener/blob/main/app/api/stripe/checkout/route.ts): `app/api/stripe/checkout/route.ts`
- [Subscription webhook](https://github.com/szumaol/skener/blob/main/app/api/webhooks/stripe/route.ts): `app/api/webhooks/stripe/route.ts`
- [Stripe client](https://github.com/szumaol/skener/blob/main/lib/stripe.ts): `lib/stripe.ts`

### Other components

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

## Connections

- User → Receipt dashboard: uses
- Receipt dashboard → Receipt listing endpoint: fetches receipts (evidence: `app/page.tsx`)
- Receipt dashboard → AI receipt scan: submits scan
- Receipt dashboard → Receipt save endpoint: saves receipt
- Receipt dashboard → Logout control: renders (evidence: `app/page.tsx`)
- Receipt dashboard → PRO lock screen: renders (evidence: `app/page.tsx`)
- PRO lock screen → Subscribe control: renders (evidence: `components/LockScreen.tsx`)
- User → Login page: signs in
- User → Registration page: registers
- Login page → Auth endpoints: submits credentials
- Registration page → Auth endpoints: submits registration
- Logout control → Auth endpoints: requests logout (evidence: `components/LogoutButton.tsx`)
- Auth endpoints → Session service: creates session (evidence: `app/api/auth/login/route.ts`)
- Receipt listing endpoint → Session service: checks session (evidence: `app/api/receipts/route.ts`)
- Receipt save endpoint → Session service: checks session (evidence: `app/api/receipts/save/route.ts`)
- Receipt listing endpoint → Neon receipt data: reads (evidence: `app/api/receipts/route.ts`)
- Receipt save endpoint → Neon receipt data: writes (evidence: `app/api/receipts/save/route.ts`)
- AI receipt scan → Neon receipt data: persists scan
- Subscribe control → Checkout endpoint: starts checkout (evidence: `components/SubscribeButton.tsx`)
- Checkout endpoint → Session service: checks session (evidence: `app/api/stripe/checkout/route.ts`)
- Checkout endpoint → Stripe client: creates checkout (evidence: `app/api/stripe/checkout/route.ts`)
- Subscription webhook → Stripe client: verifies event (evidence: `app/api/webhooks/stripe/route.ts`)
- Stripe client → Stripe: connects
- Subscription webhook → Neon receipt data: updates plan (evidence: `app/api/webhooks/stripe/route.ts`)
