# evlskyy/spas1-hybrid architecture

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

- Interactive diagram: https://gitdiagram.com/evlskyy/spas1-hybrid
- Repository: https://github.com/evlskyy/spas1-hybrid

## Overview

SPAS1 Hybrid is a static web application for multi-SPPG food-service operations. Users plan menus and nutrition, manage volunteers and attendance, run kitchen logistics and finance, and handle public-site content; operational data and authentication are backed by Supabase. The map preserves major README capabilities, including onboarding, account administration, media, PWA behavior, and reporting. Source excerpts are partial, so undocumented frontend-to-function wiring and unsampled modules are not asserted; dashed links mark documented integrations whose callers are not shown.

Main entry points: [`index.html`](https://github.com/evlskyy/spas1-hybrid/blob/main/index.html) (SPAS1 web app), [`supabase/functions/volunteer-registration/index.ts`](https://github.com/evlskyy/spas1-hybrid/blob/main/supabase/functions/volunteer-registration/index.ts) (Volunteer signup), [`accounting-features.js`](https://github.com/evlskyy/spas1-hybrid/blob/main/accounting-features.js) (Kitchen logistics), [`supabase/functions/module-account-admin/index.ts`](https://github.com/evlskyy/spas1-hybrid/blob/main/supabase/functions/module-account-admin/index.ts) (Module access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ops["Operations"]
  node_web["SPAS1 web app<br/>[index.html]"]
  node_menu["Menu planning<br/>[index.html]"]
  node_nutrition["Nutrition calculator<br/>[super-gizi.js]"]
  node_volunteer["Volunteer signup<br/>[index.ts]"]
  node_attendance["Volunteer attendance<br/>[index.html]"]
  node_logistics["Kitchen logistics"]
  node_finance["Finance &amp; obligations"]
  node_lpj["Accountability reports<br/>[lpj.js]"]
end

subgraph group_admin["Administration"]
  node_onboarding["SPPG onboarding<br/>[index.ts]"]
  node_module_accounts["Module access<br/>[index.ts]"]
  node_admin_auth["Admin authentication<br/>[index.ts]"]
  node_public_content["Public content<br/>[index.ts]"]
  node_archive["AboutSky archive<br/>[index.ts]"]
end

subgraph group_platform["Platform Services"]
  node_media_proxy["Media proxy<br/>[media.js]"]
  node_region_proxy["Region lookup<br/>[regions.js]"]
  node_middleware["Request middleware<br/>[_middleware.js]"]
  node_pwa["Offline shell<br/>[service-worker.js]"]
end

subgraph group_data["Supabase Data"]
  node_supabase[("Supabase services")]
end

node_user(("SPPG staff"))
node_wilayah["wilayah.id"]
node_browser(("User browser"))
node_storage[("Browser storage")]

node_user -->|"uses"| node_web
node_web -.->|"plans menus"| node_menu
node_menu -.->|"calculates nutrition"| node_nutrition
node_web -.->|"registers volunteers"| node_volunteer
node_web -.->|"records attendance"| node_attendance
node_web -.->|"manages stock"| node_logistics
node_web -.->|"manages finance"| node_finance
node_web -.->|"creates reports"| node_lpj
node_web -.->|"submits applications"| node_onboarding
node_web -.->|"administers access"| node_module_accounts
node_web -.->|"admin login"| node_admin_auth
node_web -.->|"sends contact"| node_public_content
node_web -.->|"accesses archive"| node_archive
node_web -.->|"requests media"| node_media_proxy
node_media_proxy -->|"proxies storage"| node_supabase
node_region_proxy -->|"fetches regions"| node_wilayah
node_web -.->|"loads regions"| node_region_proxy
node_middleware -->|"routes requests"| node_web
node_browser -->|"runs worker"| node_pwa
node_pwa -->|"caches assets"| node_storage
node_volunteer -->|"writes membership"| node_supabase
node_module_accounts -->|"checks membership"| node_supabase
node_admin_auth -->|"authenticates admin"| node_supabase
node_public_content -->|"rate limits"| node_supabase
node_archive -->|"authorizes archive"| node_supabase
node_logistics -.->|"stores operations"| node_supabase
node_finance -.->|"stores finance"| node_supabase

click node_web "https://github.com/evlskyy/spas1-hybrid/blob/main/index.html"
click node_menu "https://github.com/evlskyy/spas1-hybrid/blob/main/index.html"
click node_nutrition "https://github.com/evlskyy/spas1-hybrid/blob/main/super-gizi.js"
click node_volunteer "https://github.com/evlskyy/spas1-hybrid/blob/main/supabase/functions/volunteer-registration/index.ts"
click node_attendance "https://github.com/evlskyy/spas1-hybrid/blob/main/index.html"
click node_logistics "https://github.com/evlskyy/spas1-hybrid/blob/main/accounting-features.js"
click node_finance "https://github.com/evlskyy/spas1-hybrid/blob/main/accounting-features.js"
click node_lpj "https://github.com/evlskyy/spas1-hybrid/blob/main/lpj.js"
click node_onboarding "https://github.com/evlskyy/spas1-hybrid/blob/main/supabase/functions/volunteer-registration/index.ts"
click node_module_accounts "https://github.com/evlskyy/spas1-hybrid/blob/main/supabase/functions/module-account-admin/index.ts"
click node_admin_auth "https://github.com/evlskyy/spas1-hybrid/blob/main/supabase/functions/admin-account-auth/index.ts"
click node_public_content "https://github.com/evlskyy/spas1-hybrid/blob/main/supabase/functions/aboutsky-contact/index.ts"
click node_archive "https://github.com/evlskyy/spas1-hybrid/blob/main/supabase/functions/aboutsky-archive/index.ts"
click node_media_proxy "https://github.com/evlskyy/spas1-hybrid/blob/main/functions/api/media.js"
click node_region_proxy "https://github.com/evlskyy/spas1-hybrid/blob/main/functions/api/regions.js"
click node_middleware "https://github.com/evlskyy/spas1-hybrid/blob/main/functions/_middleware.js"
click node_pwa "https://github.com/evlskyy/spas1-hybrid/blob/main/service-worker.js"

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_web,node_menu,node_nutrition,node_volunteer,node_attendance,node_logistics,node_finance,node_lpj,node_browser toneBlue
class node_onboarding,node_module_accounts,node_admin_auth,node_public_content,node_archive,node_storage toneAmber
class node_media_proxy,node_region_proxy,node_middleware,node_pwa toneMint
class node_supabase toneRose
class node_user,node_wilayah toneIndigo
```

## Components

### Operations

- [SPAS1 web app](https://github.com/evlskyy/spas1-hybrid/blob/main/index.html): `index.html`
- [Menu planning](https://github.com/evlskyy/spas1-hybrid/blob/main/index.html): `index.html`
- [Nutrition calculator](https://github.com/evlskyy/spas1-hybrid/blob/main/super-gizi.js): `super-gizi.js`
- [Volunteer signup](https://github.com/evlskyy/spas1-hybrid/blob/main/supabase/functions/volunteer-registration/index.ts): `supabase/functions/volunteer-registration/index.ts`
- [Volunteer attendance](https://github.com/evlskyy/spas1-hybrid/blob/main/index.html): `index.html`
- [Kitchen logistics](https://github.com/evlskyy/spas1-hybrid/blob/main/accounting-features.js): `accounting-features.js`
- [Finance & obligations](https://github.com/evlskyy/spas1-hybrid/blob/main/accounting-features.js): `accounting-features.js`
- [Accountability reports](https://github.com/evlskyy/spas1-hybrid/blob/main/lpj.js): `lpj.js`

### Administration

- [SPPG onboarding](https://github.com/evlskyy/spas1-hybrid/blob/main/supabase/functions/volunteer-registration/index.ts): `supabase/functions/volunteer-registration/index.ts`
- [Module access](https://github.com/evlskyy/spas1-hybrid/blob/main/supabase/functions/module-account-admin/index.ts): `supabase/functions/module-account-admin/index.ts`
- [Admin authentication](https://github.com/evlskyy/spas1-hybrid/blob/main/supabase/functions/admin-account-auth/index.ts): `supabase/functions/admin-account-auth/index.ts`
- [Public content](https://github.com/evlskyy/spas1-hybrid/blob/main/supabase/functions/aboutsky-contact/index.ts): `supabase/functions/aboutsky-contact/index.ts`
- [AboutSky archive](https://github.com/evlskyy/spas1-hybrid/blob/main/supabase/functions/aboutsky-archive/index.ts): `supabase/functions/aboutsky-archive/index.ts`

### Platform Services

- [Media proxy](https://github.com/evlskyy/spas1-hybrid/blob/main/functions/api/media.js): `functions/api/media.js`
- [Region lookup](https://github.com/evlskyy/spas1-hybrid/blob/main/functions/api/regions.js): `functions/api/regions.js`
- [Request middleware](https://github.com/evlskyy/spas1-hybrid/blob/main/functions/_middleware.js): `functions/_middleware.js`
- [Offline shell](https://github.com/evlskyy/spas1-hybrid/blob/main/service-worker.js): `service-worker.js`

### Supabase Data

- **Supabase services**

### Other components

- **SPPG staff**
- **wilayah.id**
- **User browser**
- **Browser storage**

## Connections

- SPPG staff → SPAS1 web app: uses (evidence: `README.md`)
- SPAS1 web app → Menu planning: plans menus (evidence: `README.md`)
- Menu planning → Nutrition calculator: calculates nutrition (evidence: `README.md`)
- SPAS1 web app → Volunteer signup: registers volunteers (evidence: `README.md`)
- SPAS1 web app → Volunteer attendance: records attendance (evidence: `README.md`)
- SPAS1 web app → Kitchen logistics: manages stock (evidence: `README.md`)
- SPAS1 web app → Finance & obligations: manages finance (evidence: `README.md`)
- SPAS1 web app → Accountability reports: creates reports (evidence: `README.md`)
- SPAS1 web app → SPPG onboarding: submits applications (evidence: `README.md`)
- SPAS1 web app → Module access: administers access (evidence: `README.md`)
- SPAS1 web app → Admin authentication: admin login (evidence: `README.md`)
- SPAS1 web app → Public content: sends contact (evidence: `README.md`)
- SPAS1 web app → AboutSky archive: accesses archive (evidence: `README.md`)
- SPAS1 web app → Media proxy: requests media (evidence: `README.md`)
- Media proxy → Supabase services: proxies storage (evidence: `functions/api/media.js`)
- Region lookup → wilayah.id: fetches regions (evidence: `functions/api/regions.js`)
- SPAS1 web app → Region lookup: loads regions (evidence: `README.md`)
- Request middleware → SPAS1 web app: routes requests (evidence: `functions/_middleware.js`)
- User browser → Offline shell: runs worker (evidence: `service-worker.js`)
- Offline shell → Browser storage: caches assets (evidence: `service-worker.js`)
- Volunteer signup → Supabase services: writes membership (evidence: `supabase/functions/volunteer-registration/index.ts`)
- Module access → Supabase services: checks membership (evidence: `supabase/functions/module-account-admin/index.ts`)
- Admin authentication → Supabase services: authenticates admin (evidence: `supabase/functions/admin-account-auth/index.ts`)
- Public content → Supabase services: rate limits (evidence: `supabase/functions/aboutsky-contact/index.ts`)
- AboutSky archive → Supabase services: authorizes archive (evidence: `supabase/functions/aboutsky-archive/index.ts`)
- Kitchen logistics → Supabase services: stores operations (evidence: `README.md`)
- Finance & obligations → Supabase services: stores finance (evidence: `README.md`)
