# matteofolli45-dot/grest-organizator architecture

> Architecture diagram of the GitHub repository matteofolli45-dot/grest-organizator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/matteofolli45-dot/grest-organizator
- Repository: https://github.com/matteofolli45-dot/grest-organizator

## Overview

Grest Organizator is a browser-based organizer for a summer oratory program, with separate animator, administrator, attendance, and Saturday-oratory workflows. Users manage children and staff, record attendance, plan activities, and handle notices; the app also supports Sabor activities and push notifications. The central application logic lives in app.js and uses Supabase. Push subscription management has a browser client, an edge-function API, and a service worker. Several domain pages are represented by their filenames, but their implementation and links were not sampled; connections are shown only where the excerpts establish them.

Main entry points: [`push-notifications.js`](https://github.com/matteofolli45-dot/grest-organizator/blob/main/push-notifications.js) (Push preferences), [`supabase/functions/push-notifications/index.ts`](https://github.com/matteofolli45-dot/grest-organizator/blob/main/supabase/functions/push-notifications/index.ts) (Push API), [`service-worker.js`](https://github.com/matteofolli45-dot/grest-organizator/blob/main/service-worker.js) (Push worker), [`app.js`](https://github.com/matteofolli45-dot/grest-organizator/blob/main/app.js) (Application logic)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_grest["GREST management"]
  node_animator["Animators"]
  node_admin["GREST admin<br/>[admin_grest.html]"]
  node_children["Child registration"]
  node_enrollment["GREST enrollment"]
  node_attendance["Attendance<br/>[appello.html]"]
  node_activity_planning["Activity planning<br/>[grest-rush.html]"]
  node_grest_notices["GREST notices<br/>[avvisi_grest.html]"]
  node_accounts["Account selection"]
  node_settings["Settings<br/>[impostazioni.html]"]
end

subgraph group_sabor["Sabor activities"]
  node_sabor_admin["Sabor admin<br/>[admin_sabor.html]"]
  node_sabor_meetings["Saturday meetings"]
  node_sabor_counts["Food counts"]
  node_sabor_snacks["Snack planning<br/>[merenda_sabor.html]"]
  node_sabor_notices["Sabor notices<br/>[avvisi_sabor.html]"]
end

subgraph group_push["Push notifications"]
  node_push_client["Push preferences"]
  node_service_worker["Push worker<br/>[service-worker.js]"]
  node_push_api["Push API<br/>[index.ts]"]
end

subgraph group_platform["Browser and backend"]
  node_app_logic["Application logic<br/>[app.js]"]
  node_supabase[("Supabase")]
  node_push_services["Push services"]
end

node_browser_user(("Staff user"))

node_browser_user -.->|"uses"| node_app_logic
node_app_logic -->|"reads and writes"| node_supabase
node_push_client -->|"uses client"| node_app_logic
node_push_client -->|"invokes"| node_push_api
node_push_client -->|"registers"| node_service_worker
node_push_api -->|"stores subscriptions"| node_supabase
node_push_api -->|"sends notifications"| node_push_services
node_push_services -.->|"delivers push"| node_service_worker
node_service_worker -->|"shows notification"| node_browser_user

click node_animator "https://github.com/matteofolli45-dot/grest-organizator/blob/main/animatori_grest.html"
click node_admin "https://github.com/matteofolli45-dot/grest-organizator/blob/main/admin_grest.html"
click node_children "https://github.com/matteofolli45-dot/grest-organizator/blob/main/registrazione_bambini.html"
click node_enrollment "https://github.com/matteofolli45-dot/grest-organizator/blob/main/iscrizione_grest.html"
click node_attendance "https://github.com/matteofolli45-dot/grest-organizator/blob/main/appello.html"
click node_activity_planning "https://github.com/matteofolli45-dot/grest-organizator/blob/main/grest-rush.html"
click node_grest_notices "https://github.com/matteofolli45-dot/grest-organizator/blob/main/avvisi_grest.html"
click node_accounts "https://github.com/matteofolli45-dot/grest-organizator/blob/main/selezione_account.html"
click node_settings "https://github.com/matteofolli45-dot/grest-organizator/blob/main/impostazioni.html"
click node_sabor_admin "https://github.com/matteofolli45-dot/grest-organizator/blob/main/admin_sabor.html"
click node_sabor_meetings "https://github.com/matteofolli45-dot/grest-organizator/blob/main/sabato_oratorio.html"
click node_sabor_counts "https://github.com/matteofolli45-dot/grest-organizator/blob/main/conteggi_sabor.html"
click node_sabor_snacks "https://github.com/matteofolli45-dot/grest-organizator/blob/main/merenda_sabor.html"
click node_sabor_notices "https://github.com/matteofolli45-dot/grest-organizator/blob/main/avvisi_sabor.html"
click node_app_logic "https://github.com/matteofolli45-dot/grest-organizator/blob/main/app.js"
click node_push_client "https://github.com/matteofolli45-dot/grest-organizator/blob/main/push-notifications.js"
click node_service_worker "https://github.com/matteofolli45-dot/grest-organizator/blob/main/service-worker.js"
click node_push_api "https://github.com/matteofolli45-dot/grest-organizator/blob/main/supabase/functions/push-notifications/index.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_animator,node_admin,node_children,node_enrollment,node_attendance,node_activity_planning,node_grest_notices,node_accounts,node_settings,node_browser_user toneBlue
class node_sabor_admin,node_sabor_meetings,node_sabor_counts,node_sabor_snacks,node_sabor_notices toneAmber
class node_push_client,node_service_worker,node_push_api toneMint
class node_app_logic,node_supabase,node_push_services toneRose
```

## Components

### GREST management

- [Animators](https://github.com/matteofolli45-dot/grest-organizator/blob/main/animatori_grest.html): `animatori_grest.html`
- [GREST admin](https://github.com/matteofolli45-dot/grest-organizator/blob/main/admin_grest.html): `admin_grest.html`
- [Child registration](https://github.com/matteofolli45-dot/grest-organizator/blob/main/registrazione_bambini.html): `registrazione_bambini.html`
- [GREST enrollment](https://github.com/matteofolli45-dot/grest-organizator/blob/main/iscrizione_grest.html): `iscrizione_grest.html`
- [Attendance](https://github.com/matteofolli45-dot/grest-organizator/blob/main/appello.html): `appello.html`
- [Activity planning](https://github.com/matteofolli45-dot/grest-organizator/blob/main/grest-rush.html): `grest-rush.html`
- [GREST notices](https://github.com/matteofolli45-dot/grest-organizator/blob/main/avvisi_grest.html): `avvisi_grest.html`
- [Account selection](https://github.com/matteofolli45-dot/grest-organizator/blob/main/selezione_account.html): `selezione_account.html`
- [Settings](https://github.com/matteofolli45-dot/grest-organizator/blob/main/impostazioni.html): `impostazioni.html`

### Sabor activities

- [Sabor admin](https://github.com/matteofolli45-dot/grest-organizator/blob/main/admin_sabor.html): `admin_sabor.html`
- [Saturday meetings](https://github.com/matteofolli45-dot/grest-organizator/blob/main/sabato_oratorio.html): `sabato_oratorio.html`
- [Food counts](https://github.com/matteofolli45-dot/grest-organizator/blob/main/conteggi_sabor.html): `conteggi_sabor.html`
- [Snack planning](https://github.com/matteofolli45-dot/grest-organizator/blob/main/merenda_sabor.html): `merenda_sabor.html`
- [Sabor notices](https://github.com/matteofolli45-dot/grest-organizator/blob/main/avvisi_sabor.html): `avvisi_sabor.html`

### Push notifications

- [Push preferences](https://github.com/matteofolli45-dot/grest-organizator/blob/main/push-notifications.js): `push-notifications.js`
- [Push worker](https://github.com/matteofolli45-dot/grest-organizator/blob/main/service-worker.js): `service-worker.js`
- [Push API](https://github.com/matteofolli45-dot/grest-organizator/blob/main/supabase/functions/push-notifications/index.ts): `supabase/functions/push-notifications/index.ts`

### Browser and backend

- [Application logic](https://github.com/matteofolli45-dot/grest-organizator/blob/main/app.js): `app.js`
- **Supabase**
- **Push services**

### Other components

- **Staff user**

## Connections

- Staff user → Application logic: uses
- Application logic → Supabase: reads and writes (evidence: `app.js`)
- Push preferences → Application logic: uses client (evidence: `push-notifications.js`)
- Push preferences → Push API: invokes (evidence: `push-notifications.js`)
- Push preferences → Push worker: registers (evidence: `push-notifications.js`)
- Push API → Supabase: stores subscriptions (evidence: `supabase/functions/push-notifications/index.ts`)
- Push API → Push services: sends notifications (evidence: `supabase/functions/push-notifications/index.ts`)
- Push services → Push worker: delivers push
- Push worker → Staff user: shows notification (evidence: `service-worker.js`)
