# elitealmas/grecybersec architecture

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

- Interactive diagram: https://gitdiagram.com/elitealmas/grecybersec
- Repository: https://github.com/elitealmas/grecybersec

## Overview

GreCyberSec is a public university cybersecurity-society site with a member learning area and an event-registration flow. The main user workflow is member sign-in, access to published courses, lesson/progress activity, and quiz attempts/results; separate public workflows cover event registration and private contact. The graph preserves the major documented public, learning, authentication, and event capabilities. Some page/action implementations were not sampled, so uncertain relationships are omitted rather than inferred.

Main entry points: [`lib/event-registration-server.ts`](https://github.com/elitealmas/grecybersec/blob/main/lib/event-registration-server.ts) (Registration Service), [`lib/supabase/server.ts`](https://github.com/elitealmas/grecybersec/blob/main/lib/supabase/server.ts) (Supabase Server Client), [`lib/courses.ts`](https://github.com/elitealmas/grecybersec/blob/main/lib/courses.ts) (Learning Data), [`lib/contact-server.ts`](https://github.com/elitealmas/grecybersec/blob/main/lib/contact-server.ts) (Contact Delivery)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public Society Site"]
  node_home["Society Home<br/>[page.tsx]"]
  node_public_pages["Society Pages"]
  node_site_data["Society Content<br/>[site-data.ts]"]
  node_events_listing["Events Listing<br/>[page.tsx]"]
  node_contact_page["Contact Page<br/>[page.tsx]"]
  node_contact_form["Private Contact"]
  node_contact_service["Contact Delivery<br/>[contact-server.ts]"]
end

subgraph group_identity["Member Identity"]
  node_login_register["Sign In / Register<br/>[page.tsx]"]
  node_auth_actions["Auth Actions<br/>[actions.ts]"]
  node_confirm["Email Confirmation<br/>[actions.ts]"]
  node_auth_callback["Callback Validation<br/>[auth-callback.ts]"]
end

subgraph group_learning["Member Learning"]
  node_dashboard["Member Dashboard<br/>[page.tsx]"]
  node_course_catalog["Course Catalog<br/>[page.tsx]"]
  node_course_detail["Course Detail<br/>[page.tsx]"]
  node_lesson["Course Lessons<br/>[page.tsx]"]
  node_quiz["Quiz Attempts<br/>[page.tsx]"]
  node_quiz_results["Quiz Results<br/>[page.tsx]"]
  node_course_service["Learning Data<br/>[courses.ts]"]
  node_course_actions["Learning Actions<br/>[actions.ts]"]
end

subgraph group_event["Event Operations"]
  node_event_page["Event Detail<br/>[page.tsx]"]
  node_event_registration["Registration Flow<br/>[actions.ts]"]
  node_event_verification["Attendee Verification<br/>[page.tsx]"]
  node_event_calendar["Calendar Export<br/>[route.ts]"]
  node_event_maintenance["Event Maintenance<br/>[route.ts]"]
  node_event_service["Registration Service"]
  node_event_domain["Event Rules<br/>[beyond-firewall.ts]"]
end

subgraph group_shared["Shared Services"]
  node_supabase_server["Supabase Server Client<br/>[server.ts]"]
  node_supabase_config["Supabase Configuration<br/>[config.ts]"]
end

node_visitor(("Visitor"))
node_supabase[("Supabase")]
node_turnstile{{"Cloudflare Turnstile"}}
node_resend{{"Resend Mail"}}

node_visitor -->|"opens"| node_home
node_home -->|"reads"| node_site_data
node_visitor -.->|"visits"| node_public_pages
node_visitor -->|"views"| node_events_listing
node_visitor -->|"opens"| node_contact_page
node_contact_page -->|"renders"| node_contact_form
node_contact_page -->|"checks readiness"| node_contact_service
node_contact_form -.->|"submits"| node_contact_service
node_contact_service -.->|"verifies"| node_turnstile
node_contact_service -.->|"emails"| node_resend
node_visitor -->|"authenticates"| node_login_register
node_login_register -->|"checks claims"| node_supabase_server
node_auth_actions -->|"uses"| node_supabase_server
node_auth_actions -.->|"verifies"| node_turnstile
node_confirm -->|"validates"| node_auth_callback
node_confirm -->|"consumes token"| node_supabase_server
node_supabase_server -->|"loads settings"| node_supabase_config
node_supabase_server -->|"connects"| node_supabase
node_visitor -->|"opens"| node_dashboard
node_dashboard -->|"validates claims"| node_supabase_server
node_dashboard -->|"loads progress"| node_course_service
node_visitor -->|"browses"| node_course_catalog
node_course_catalog -->|"loads courses"| node_course_service
node_visitor -->|"opens course"| node_course_detail
node_course_detail -->|"loads course"| node_course_service
node_visitor -.->|"studies"| node_lesson
node_visitor -.->|"attempts quiz"| node_quiz
node_visitor -.->|"views result"| node_quiz_results
node_course_actions -.->|"updates learning"| node_course_service
node_course_service -->|"queries"| node_supabase_server
node_visitor -.->|"views"| node_event_page
node_event_page -.->|"registers"| node_event_registration
node_event_registration -.->|"processes registration"| node_event_service
node_event_verification -.->|"verifies attendee"| node_event_service
node_event_calendar -->|"formats calendar"| node_event_domain
node_event_calendar -->|"loads event settings"| node_event_service
node_event_maintenance -->|"uses event ID"| node_event_domain
node_event_maintenance -->|"cleans and sends"| node_event_service
node_event_service -->|"uses rules"| node_event_domain
node_event_service -.->|"stores registrations"| node_supabase
node_event_service -.->|"verifies challenges"| node_turnstile
node_event_service -.->|"sends confirmations"| node_resend

click node_home "https://github.com/elitealmas/grecybersec/blob/main/app/page.tsx"
click node_public_pages "https://github.com/elitealmas/grecybersec/tree/main/app"
click node_site_data "https://github.com/elitealmas/grecybersec/blob/main/lib/site-data.ts"
click node_events_listing "https://github.com/elitealmas/grecybersec/blob/main/app/events/page.tsx"
click node_contact_page "https://github.com/elitealmas/grecybersec/blob/main/app/contact/page.tsx"
click node_contact_form "https://github.com/elitealmas/grecybersec/blob/main/components/private-contact-form.tsx"
click node_contact_service "https://github.com/elitealmas/grecybersec/blob/main/lib/contact-server.ts"
click node_login_register "https://github.com/elitealmas/grecybersec/blob/main/app/login/page.tsx"
click node_auth_actions "https://github.com/elitealmas/grecybersec/blob/main/app/auth/actions.ts"
click node_confirm "https://github.com/elitealmas/grecybersec/blob/main/app/auth/confirm/actions.ts"
click node_auth_callback "https://github.com/elitealmas/grecybersec/blob/main/lib/auth-callback.ts"
click node_dashboard "https://github.com/elitealmas/grecybersec/blob/main/app/dashboard/page.tsx"
click node_course_catalog "https://github.com/elitealmas/grecybersec/blob/main/app/courses/page.tsx"
click node_course_detail "https://github.com/elitealmas/grecybersec/blob/main/app/courses/%5BcourseSlug%5D/page.tsx"
click node_lesson "https://github.com/elitealmas/grecybersec/blob/main/app/courses/%5BcourseSlug%5D/lessons/%5BlessonSlug%5D/page.tsx"
click node_quiz "https://github.com/elitealmas/grecybersec/blob/main/app/courses/%5BcourseSlug%5D/quiz/page.tsx"
click node_quiz_results "https://github.com/elitealmas/grecybersec/blob/main/app/courses/%5BcourseSlug%5D/quiz/results/%5BattemptId%5D/page.tsx"
click node_course_service "https://github.com/elitealmas/grecybersec/blob/main/lib/courses.ts"
click node_course_actions "https://github.com/elitealmas/grecybersec/blob/main/app/courses/actions.ts"
click node_event_page "https://github.com/elitealmas/grecybersec/blob/main/app/events/beyond-the-firewall/page.tsx"
click node_event_registration "https://github.com/elitealmas/grecybersec/blob/main/app/events/beyond-the-firewall/actions.ts"
click node_event_verification "https://github.com/elitealmas/grecybersec/blob/main/app/events/beyond-the-firewall/verify/page.tsx"
click node_event_calendar "https://github.com/elitealmas/grecybersec/blob/main/app/events/beyond-the-firewall/calendar/route.ts"
click node_event_maintenance "https://github.com/elitealmas/grecybersec/blob/main/app/api/cron/event-maintenance/route.ts"
click node_event_service "https://github.com/elitealmas/grecybersec/blob/main/lib/event-registration-server.ts"
click node_event_domain "https://github.com/elitealmas/grecybersec/blob/main/lib/beyond-firewall.ts"
click node_supabase_server "https://github.com/elitealmas/grecybersec/blob/main/lib/supabase/server.ts"
click node_supabase_config "https://github.com/elitealmas/grecybersec/blob/main/lib/supabase/config.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_home,node_public_pages,node_site_data,node_events_listing,node_contact_page,node_contact_form,node_contact_service toneBlue
class node_login_register,node_auth_actions,node_confirm,node_auth_callback,node_supabase toneAmber
class node_dashboard,node_course_catalog,node_course_detail,node_lesson,node_quiz,node_quiz_results,node_course_service,node_course_actions toneMint
class node_event_page,node_event_registration,node_event_verification,node_event_calendar,node_event_maintenance,node_event_service,node_event_domain toneRose
class node_supabase_server,node_supabase_config,node_visitor,node_turnstile,node_resend toneIndigo
```

## Components

### Public Society Site

- [Society Home](https://github.com/elitealmas/grecybersec/blob/main/app/page.tsx): `app/page.tsx`
- [Society Pages](https://github.com/elitealmas/grecybersec/tree/main/app): `app`
- [Society Content](https://github.com/elitealmas/grecybersec/blob/main/lib/site-data.ts): `lib/site-data.ts`
- [Events Listing](https://github.com/elitealmas/grecybersec/blob/main/app/events/page.tsx): `app/events/page.tsx`
- [Contact Page](https://github.com/elitealmas/grecybersec/blob/main/app/contact/page.tsx): `app/contact/page.tsx`
- [Private Contact](https://github.com/elitealmas/grecybersec/blob/main/components/private-contact-form.tsx): `components/private-contact-form.tsx`
- [Contact Delivery](https://github.com/elitealmas/grecybersec/blob/main/lib/contact-server.ts): `lib/contact-server.ts`

### Member Identity

- [Sign In / Register](https://github.com/elitealmas/grecybersec/blob/main/app/login/page.tsx): `app/login/page.tsx`
- [Auth Actions](https://github.com/elitealmas/grecybersec/blob/main/app/auth/actions.ts): `app/auth/actions.ts`
- [Email Confirmation](https://github.com/elitealmas/grecybersec/blob/main/app/auth/confirm/actions.ts): `app/auth/confirm/actions.ts`
- [Callback Validation](https://github.com/elitealmas/grecybersec/blob/main/lib/auth-callback.ts): `lib/auth-callback.ts`

### Member Learning

- [Member Dashboard](https://github.com/elitealmas/grecybersec/blob/main/app/dashboard/page.tsx): `app/dashboard/page.tsx`
- [Course Catalog](https://github.com/elitealmas/grecybersec/blob/main/app/courses/page.tsx): `app/courses/page.tsx`
- [Course Detail](https://github.com/elitealmas/grecybersec/blob/main/app/courses/%5BcourseSlug%5D/page.tsx): `app/courses/[courseSlug]/page.tsx`
- [Course Lessons](https://github.com/elitealmas/grecybersec/blob/main/app/courses/%5BcourseSlug%5D/lessons/%5BlessonSlug%5D/page.tsx): `app/courses/[courseSlug]/lessons/[lessonSlug]/page.tsx`
- [Quiz Attempts](https://github.com/elitealmas/grecybersec/blob/main/app/courses/%5BcourseSlug%5D/quiz/page.tsx): `app/courses/[courseSlug]/quiz/page.tsx`
- [Quiz Results](https://github.com/elitealmas/grecybersec/blob/main/app/courses/%5BcourseSlug%5D/quiz/results/%5BattemptId%5D/page.tsx): `app/courses/[courseSlug]/quiz/results/[attemptId]/page.tsx`
- [Learning Data](https://github.com/elitealmas/grecybersec/blob/main/lib/courses.ts): `lib/courses.ts`
- [Learning Actions](https://github.com/elitealmas/grecybersec/blob/main/app/courses/actions.ts): `app/courses/actions.ts`

### Event Operations

- [Event Detail](https://github.com/elitealmas/grecybersec/blob/main/app/events/beyond-the-firewall/page.tsx): `app/events/beyond-the-firewall/page.tsx`
- [Registration Flow](https://github.com/elitealmas/grecybersec/blob/main/app/events/beyond-the-firewall/actions.ts): `app/events/beyond-the-firewall/actions.ts`
- [Attendee Verification](https://github.com/elitealmas/grecybersec/blob/main/app/events/beyond-the-firewall/verify/page.tsx): `app/events/beyond-the-firewall/verify/page.tsx`
- [Calendar Export](https://github.com/elitealmas/grecybersec/blob/main/app/events/beyond-the-firewall/calendar/route.ts): `app/events/beyond-the-firewall/calendar/route.ts`
- [Event Maintenance](https://github.com/elitealmas/grecybersec/blob/main/app/api/cron/event-maintenance/route.ts): `app/api/cron/event-maintenance/route.ts`
- [Registration Service](https://github.com/elitealmas/grecybersec/blob/main/lib/event-registration-server.ts): `lib/event-registration-server.ts`
- [Event Rules](https://github.com/elitealmas/grecybersec/blob/main/lib/beyond-firewall.ts): `lib/beyond-firewall.ts`

### Shared Services

- [Supabase Server Client](https://github.com/elitealmas/grecybersec/blob/main/lib/supabase/server.ts): `lib/supabase/server.ts`
- [Supabase Configuration](https://github.com/elitealmas/grecybersec/blob/main/lib/supabase/config.ts): `lib/supabase/config.ts`

### Other components

- **Visitor**
- **Supabase**
- **Cloudflare Turnstile**
- **Resend Mail**

## Connections

- Visitor → Society Home: opens (evidence: `app/page.tsx`)
- Society Home → Society Content: reads (evidence: `app/page.tsx`)
- Visitor → Society Pages: visits
- Visitor → Events Listing: views (evidence: `app/events/page.tsx`)
- Visitor → Contact Page: opens (evidence: `app/contact/page.tsx`)
- Contact Page → Private Contact: renders (evidence: `app/contact/page.tsx`)
- Contact Page → Contact Delivery: checks readiness (evidence: `app/contact/page.tsx`)
- Private Contact → Contact Delivery: submits
- Contact Delivery → Cloudflare Turnstile: verifies
- Contact Delivery → Resend Mail: emails
- Visitor → Sign In / Register: authenticates (evidence: `app/login/page.tsx`)
- Sign In / Register → Supabase Server Client: checks claims (evidence: `app/login/page.tsx`)
- Auth Actions → Supabase Server Client: uses (evidence: `app/auth/actions.ts`)
- Auth Actions → Cloudflare Turnstile: verifies
- Email Confirmation → Callback Validation: validates (evidence: `app/auth/confirm/actions.ts`)
- Email Confirmation → Supabase Server Client: consumes token (evidence: `app/auth/confirm/actions.ts`)
- Supabase Server Client → Supabase Configuration: loads settings (evidence: `lib/supabase/server.ts`)
- Supabase Server Client → Supabase: connects (evidence: `lib/supabase/server.ts`)
- Visitor → Member Dashboard: opens (evidence: `app/dashboard/page.tsx`)
- Member Dashboard → Supabase Server Client: validates claims (evidence: `app/dashboard/page.tsx`)
- Member Dashboard → Learning Data: loads progress (evidence: `app/dashboard/page.tsx`)
- Visitor → Course Catalog: browses (evidence: `app/courses/page.tsx`)
- Course Catalog → Learning Data: loads courses (evidence: `app/courses/page.tsx`)
- Visitor → Course Detail: opens course (evidence: `app/courses/[courseSlug]/page.tsx`)
- Course Detail → Learning Data: loads course (evidence: `app/courses/[courseSlug]/page.tsx`)
- Visitor → Course Lessons: studies
- Visitor → Quiz Attempts: attempts quiz
- Visitor → Quiz Results: views result
- Learning Actions → Learning Data: updates learning
- Learning Data → Supabase Server Client: queries (evidence: `lib/courses.ts`)
- Visitor → Event Detail: views
- Event Detail → Registration Flow: registers
- Registration Flow → Registration Service: processes registration
- Attendee Verification → Registration Service: verifies attendee
- Calendar Export → Event Rules: formats calendar (evidence: `app/events/beyond-the-firewall/calendar/route.ts`)
- Calendar Export → Registration Service: loads event settings (evidence: `app/events/beyond-the-firewall/calendar/route.ts`)
- Event Maintenance → Event Rules: uses event ID (evidence: `app/api/cron/event-maintenance/route.ts`)
- Event Maintenance → Registration Service: cleans and sends (evidence: `app/api/cron/event-maintenance/route.ts`)
- Registration Service → Event Rules: uses rules (evidence: `lib/event-registration-server.ts`)
- Registration Service → Supabase: stores registrations
- Registration Service → Cloudflare Turnstile: verifies challenges
- Registration Service → Resend Mail: sends confirmations
