# arbaj-k/college-event-site architecture

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

- Interactive diagram: https://gitdiagram.com/arbaj-k/college-event-site
- Repository: https://github.com/arbaj-k/college-event-site

## Overview

Hapn is a college community web platform: its documented core lets students browse published events and register via external Google Forms, while administrators authenticate and manage event listings. The repository also contains multi-college administration, festivals, event submissions, campus-board and chat features, plus push-notification handlers. The README documents the core event workflow; sampled source confirms event reads, admin checks, and push/function behavior. Several newer product areas are represented by tree paths but were not sampled, so their internal connections are intentionally omitted.

Main entry points: [`js/events.js`](https://github.com/arbaj-k/college-event-site/blob/main/js/events.js) (Event Browsing), [`supabase/functions/send-campus-post-push/index.ts`](https://github.com/arbaj-k/college-event-site/blob/main/supabase/functions/send-campus-post-push/index.ts) (Board Push Handler), [`supabase/functions/send-event-push/index.ts`](https://github.com/arbaj-k/college-event-site/blob/main/supabase/functions/send-event-push/index.ts) (Event Push Handler), [`events.html`](https://github.com/arbaj-k/college-event-site/blob/main/events.html) (Event Pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public Discovery"]
  node_event_pages["Event Pages<br/>[events.html]"]
  node_event_runtime["Event Browsing<br/>[events.js]"]
  node_event_detail["Event Details<br/>[event.html]"]
  node_fest_browsing["Festival Browsing<br/>[fests.js]"]
end

subgraph group_admin["Administration"]
  node_admin_login["Admin Login<br/>[login.html]"]
  node_admin_auth["Admin Authentication<br/>[auth.js]"]
  node_event_admin["Event Management<br/>[admin.js]"]
  node_submission_admin["Submission Review"]
  node_super_admin["Platform Management<br/>[super-admin.js]"]
  node_fest_admin["Festival Management"]
end

subgraph group_community["Campus Community"]
  node_campus_board["Campus Board<br/>[index.html]"]
  node_campus_notifications["Board Notifications<br/>[index.html]"]
  node_chat["Anonymous Chat"]
  node_chat_v2["Chat Runtime V2"]
  node_chat_legacy["Chat Runtime<br/>[anonymous-chat.js]"]
end

subgraph group_backend["Supabase Services"]
  node_super_admin_api["Admin API<br/>[index.ts]"]
  node_campus_push["Board Push Handler<br/>[index.ts]"]
  node_event_push["Event Push Handler<br/>[index.ts]"]
  node_supabase[("Supabase")]
end

subgraph group_delivery["Platform Delivery"]
  node_pwa_worker["Offline Service Worker<br/>[sw.js]"]
  node_security_worker["Security Headers Worker"]
end

node_student(("Student"))
node_admin_user(("Administrator"))
node_google_forms["Google Forms"]
node_onesignal["OneSignal"]

node_student -->|"browses"| node_event_pages
node_event_pages -->|"uses"| node_event_runtime
node_event_runtime -->|"reads events"| node_supabase
node_event_runtime -->|"opens details"| node_event_detail
node_student -->|"registers via"| node_google_forms
node_admin_user -->|"signs in"| node_admin_login
node_admin_login -->|"uses"| node_admin_auth
node_admin_auth -->|"checks identity"| node_supabase
node_admin_user -->|"manages events"| node_event_admin
node_event_admin -->|"reads and writes"| node_supabase
node_admin_user -.->|"reviews submissions"| node_submission_admin
node_admin_user -.->|"manages platform"| node_super_admin
node_super_admin -->|"invokes"| node_super_admin_api
node_super_admin_api -->|"manages records"| node_supabase
node_admin_user -.->|"manages festivals"| node_fest_admin
node_student -.->|"browses festivals"| node_fest_browsing
node_student -.->|"posts and browses"| node_campus_board
node_campus_board -.->|"receives updates"| node_campus_notifications
node_campus_notifications -.->|"requests push"| node_campus_push
node_campus_push -->|"checks and records"| node_supabase
node_campus_push -.->|"sends push"| node_onesignal
node_student -.->|"chats anonymously"| node_chat
node_student -.->|"uses chat"| node_chat_v2
node_student -.->|"uses chat"| node_chat_legacy
node_event_push -->|"authenticates and reads"| node_supabase
node_event_push -->|"sends push"| node_onesignal
node_student -->|"loads offline shell"| node_pwa_worker
node_security_worker -->|"allows API connections"| node_supabase

click node_event_pages "https://github.com/arbaj-k/college-event-site/blob/main/events.html"
click node_event_runtime "https://github.com/arbaj-k/college-event-site/blob/main/js/events.js"
click node_event_detail "https://github.com/arbaj-k/college-event-site/blob/main/event.html"
click node_admin_login "https://github.com/arbaj-k/college-event-site/blob/main/admin/login.html"
click node_admin_auth "https://github.com/arbaj-k/college-event-site/blob/main/js/auth.js"
click node_event_admin "https://github.com/arbaj-k/college-event-site/blob/main/js/admin.js"
click node_submission_admin "https://github.com/arbaj-k/college-event-site/blob/main/js/submissions-admin.js"
click node_super_admin "https://github.com/arbaj-k/college-event-site/blob/main/js/super-admin.js"
click node_super_admin_api "https://github.com/arbaj-k/college-event-site/blob/main/supabase/functions/super-admin-api/index.ts"
click node_fest_admin "https://github.com/arbaj-k/college-event-site/blob/main/js/admin-fest-activities.js"
click node_fest_browsing "https://github.com/arbaj-k/college-event-site/blob/main/js/fests.js"
click node_campus_board "https://github.com/arbaj-k/college-event-site/blob/main/connect/board/index.html"
click node_campus_notifications "https://github.com/arbaj-k/college-event-site/blob/main/connect/notifications/index.html"
click node_campus_push "https://github.com/arbaj-k/college-event-site/blob/main/supabase/functions/send-campus-post-push/index.ts"
click node_chat "https://github.com/arbaj-k/college-event-site/blob/main/js/anonymous-chat-v3.js"
click node_chat_v2 "https://github.com/arbaj-k/college-event-site/blob/main/js/anonymous-chat-v2.js"
click node_chat_legacy "https://github.com/arbaj-k/college-event-site/blob/main/js/anonymous-chat.js"
click node_event_push "https://github.com/arbaj-k/college-event-site/blob/main/supabase/functions/send-event-push/index.ts"
click node_pwa_worker "https://github.com/arbaj-k/college-event-site/blob/main/sw.js"
click node_security_worker "https://github.com/arbaj-k/college-event-site/blob/main/cloudflare/production-headers-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_event_pages,node_event_runtime,node_event_detail,node_fest_browsing toneBlue
class node_admin_login,node_admin_auth,node_event_admin,node_submission_admin,node_super_admin,node_fest_admin toneAmber
class node_campus_board,node_campus_notifications,node_chat,node_chat_v2,node_chat_legacy toneMint
class node_super_admin_api,node_campus_push,node_event_push,node_supabase toneRose
class node_pwa_worker,node_security_worker,node_student,node_admin_user,node_google_forms,node_onesignal toneIndigo
```

## Components

### Public Discovery

- [Event Pages](https://github.com/arbaj-k/college-event-site/blob/main/events.html): `events.html`
- [Event Browsing](https://github.com/arbaj-k/college-event-site/blob/main/js/events.js): `js/events.js`
- [Event Details](https://github.com/arbaj-k/college-event-site/blob/main/event.html): `event.html`
- [Festival Browsing](https://github.com/arbaj-k/college-event-site/blob/main/js/fests.js): `js/fests.js`

### Administration

- [Admin Login](https://github.com/arbaj-k/college-event-site/blob/main/admin/login.html): `admin/login.html`
- [Admin Authentication](https://github.com/arbaj-k/college-event-site/blob/main/js/auth.js): `js/auth.js`
- [Event Management](https://github.com/arbaj-k/college-event-site/blob/main/js/admin.js): `js/admin.js`
- [Submission Review](https://github.com/arbaj-k/college-event-site/blob/main/js/submissions-admin.js): `js/submissions-admin.js`
- [Platform Management](https://github.com/arbaj-k/college-event-site/blob/main/js/super-admin.js): `js/super-admin.js`
- [Festival Management](https://github.com/arbaj-k/college-event-site/blob/main/js/admin-fest-activities.js): `js/admin-fest-activities.js`

### Campus Community

- [Campus Board](https://github.com/arbaj-k/college-event-site/blob/main/connect/board/index.html): `connect/board/index.html`
- [Board Notifications](https://github.com/arbaj-k/college-event-site/blob/main/connect/notifications/index.html): `connect/notifications/index.html`
- [Anonymous Chat](https://github.com/arbaj-k/college-event-site/blob/main/js/anonymous-chat-v3.js): `js/anonymous-chat-v3.js`
- [Chat Runtime V2](https://github.com/arbaj-k/college-event-site/blob/main/js/anonymous-chat-v2.js): `js/anonymous-chat-v2.js`
- [Chat Runtime](https://github.com/arbaj-k/college-event-site/blob/main/js/anonymous-chat.js): `js/anonymous-chat.js`

### Supabase Services

- [Admin API](https://github.com/arbaj-k/college-event-site/blob/main/supabase/functions/super-admin-api/index.ts): `supabase/functions/super-admin-api/index.ts`
- [Board Push Handler](https://github.com/arbaj-k/college-event-site/blob/main/supabase/functions/send-campus-post-push/index.ts): `supabase/functions/send-campus-post-push/index.ts`
- [Event Push Handler](https://github.com/arbaj-k/college-event-site/blob/main/supabase/functions/send-event-push/index.ts): `supabase/functions/send-event-push/index.ts`
- **Supabase**

### Platform Delivery

- [Offline Service Worker](https://github.com/arbaj-k/college-event-site/blob/main/sw.js): `sw.js`
- [Security Headers Worker](https://github.com/arbaj-k/college-event-site/blob/main/cloudflare/production-headers-worker.js): `cloudflare/production-headers-worker.js`

### Other components

- **Student**
- **Administrator**
- **Google Forms**
- **OneSignal**

## Connections

- Student → Event Pages: browses (evidence: `README.md`)
- Event Pages → Event Browsing: uses (evidence: `README.md`)
- Event Browsing → Supabase: reads events (evidence: `js/events.js`)
- Event Browsing → Event Details: opens details (evidence: `js/events.js`)
- Student → Google Forms: registers via (evidence: `README.md`)
- Administrator → Admin Login: signs in (evidence: `README.md`)
- Admin Login → Admin Authentication: uses (evidence: `README.md`)
- Admin Authentication → Supabase: checks identity (evidence: `js/auth.js`)
- Administrator → Event Management: manages events (evidence: `README.md`)
- Event Management → Supabase: reads and writes (evidence: `README.md`)
- Administrator → Submission Review: reviews submissions
- Administrator → Platform Management: manages platform
- Platform Management → Admin API: invokes (evidence: `js/super-admin.js`)
- Admin API → Supabase: manages records (evidence: `supabase/functions/super-admin-api/index.ts`)
- Administrator → Festival Management: manages festivals
- Student → Festival Browsing: browses festivals
- Student → Campus Board: posts and browses
- Campus Board → Board Notifications: receives updates
- Board Notifications → Board Push Handler: requests push
- Board Push Handler → Supabase: checks and records (evidence: `supabase/functions/send-campus-post-push/index.ts`)
- Board Push Handler → OneSignal: sends push
- Student → Anonymous Chat: chats anonymously
- Student → Chat Runtime V2: uses chat
- Student → Chat Runtime: uses chat
- Event Push Handler → Supabase: authenticates and reads (evidence: `supabase/functions/send-event-push/index.ts`)
- Event Push Handler → OneSignal: sends push (evidence: `supabase/functions/send-event-push/index.ts`)
- Student → Offline Service Worker: loads offline shell (evidence: `sw.js`)
- Security Headers Worker → Supabase: allows API connections (evidence: `cloudflare/production-headers-worker.js`)
