# marcuschew2024/connectsphere architecture

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

- Interactive diagram: https://gitdiagram.com/marcuschew2024/connectsphere
- Repository: https://github.com/marcuschew2024/connectsphere

## Overview

ConnectSphere is a role-based event lifecycle app: organisers create and revise requests, coordinators review them, and venue staff handle catalogue and booking workflows. The Next.js frontend communicates with a Flask API, which applies identity and role checks, validates domain actions, and persists records in Supabase. The README also describes attendee registration and confirmation, but the supplied tree and excerpts do not establish a distinct implementation path for registration. Arrows reflect shown imports, calls, or documented architecture; unsampled subsystems are represented cautiously.

Main entry points: [`api/app/main.py`](https://github.com/marcuschew2024/connectsphere/blob/main/api/app/main.py) (Flask app and routes), [`frontend/src/app/page.tsx`](https://github.com/marcuschew2024/connectsphere/blob/main/frontend/src/app/page.tsx) (Role dashboard), [`api/app/events.py`](https://github.com/marcuschew2024/connectsphere/blob/main/api/app/events.py) (Event request API), [`api/app/bookings.py`](https://github.com/marcuschew2024/connectsphere/blob/main/api/app/bookings.py) (Booking API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_home["Role dashboard<br/>[page.tsx]"]
  node_dev_switcher["Demo role switcher"]
  node_event_request["Event request form"]
  node_draft_workspace["Draft workspace"]
  node_event_detail["Event review and detail<br/>[page.tsx]"]
  node_venue_workspace["Venue workspace"]
  node_venue_form["Venue form<br/>[venue-form.tsx]"]
  node_booking_ui["Booking workflow<br/>[page.tsx]"]
end

subgraph group_api["API and access"]
  node_api_app["Flask app and routes<br/>[main.py]"]
  node_identity["Identity and access<br/>[acting_user.py]"]
  node_auth["Login sessions<br/>[auth.py]"]
end

subgraph group_events["Event lifecycle"]
  node_event_api["Event request API<br/>[events.py]"]
  node_event_rules["Event decisions and status<br/>[event_decision.py]"]
  node_event_store["Event persistence"]
  node_notifications["Organiser notifications<br/>[notifications.py]"]
  node_attendee_flow["Registration and confirmation"]
end

subgraph group_venues["Venue operations"]
  node_venue_api["Venue API and suitability<br/>[venues.py]"]
  node_venue_store["Venue catalogue store"]
  node_booking_api["Booking API<br/>[bookings.py]"]
  node_booking_store["Booking persistence"]
end

subgraph group_data["Persistence"]
  node_supabase[("Supabase PostgreSQL")]
end

node_organiser(("Organiser"))
node_coordinator(("Coordinator"))
node_venue_staff(("Venue staff"))
node_attendee(("Attendee"))

node_organiser -->|"uses"| node_home
node_coordinator -->|"uses"| node_home
node_venue_staff -->|"uses"| node_home
node_attendee -.->|"registers"| node_attendee_flow
node_home -->|"renders"| node_dev_switcher
node_home -->|"links to"| node_event_request
node_home -->|"links to"| node_draft_workspace
node_home -->|"links to"| node_venue_workspace
node_draft_workspace -->|"reuses form"| node_event_request
node_venue_workspace -->|"links to"| node_venue_form
node_event_request -->|"calls API"| node_api_app
node_booking_ui -->|"calls API"| node_api_app
node_api_app -->|"registers routes"| node_event_api
node_api_app -->|"registers routes"| node_auth
node_api_app -->|"registers routes"| node_venue_api
node_api_app -->|"registers routes"| node_booking_api
node_api_app -->|"registers routes"| node_notifications
node_event_api -->|"resolves actor"| node_identity
node_event_api -->|"uses decisions"| node_event_rules
node_event_api -->|"reads and writes"| node_event_store
node_notifications -->|"checks actor"| node_identity
node_venue_api -->|"reads and writes"| node_venue_store
node_venue_api -->|"checks availability"| node_booking_store
node_booking_api -->|"resolves actor"| node_identity
node_booking_api -->|"reads and writes"| node_booking_store
node_booking_api -->|"checks event"| node_event_store
node_event_store -->|"queries"| node_supabase
node_venue_store -->|"queries"| node_supabase
node_booking_store -->|"queries"| node_supabase
node_auth -->|"looks up users"| node_supabase
node_dev_switcher -->|"switches demo session"| node_api_app
node_event_detail -.->|"loads event"| node_api_app
node_venue_form -.->|"submits venue"| node_api_app
node_attendee_flow -.->|"uses API"| node_api_app

click node_home "https://github.com/marcuschew2024/connectsphere/blob/main/frontend/src/app/page.tsx"
click node_dev_switcher "https://github.com/marcuschew2024/connectsphere/blob/main/frontend/src/app/dev-role-switcher.tsx"
click node_event_request "https://github.com/marcuschew2024/connectsphere/blob/main/frontend/src/app/events/new/event-request-form.tsx"
click node_draft_workspace "https://github.com/marcuschew2024/connectsphere/blob/main/frontend/src/app/events/drafts/draft-workspace.tsx"
click node_event_detail "https://github.com/marcuschew2024/connectsphere/blob/main/frontend/src/app/events/%5BeventId%5D/page.tsx"
click node_venue_workspace "https://github.com/marcuschew2024/connectsphere/blob/main/frontend/src/app/venues/venue-workspace.tsx"
click node_venue_form "https://github.com/marcuschew2024/connectsphere/blob/main/frontend/src/app/venues/new/venue-form.tsx"
click node_booking_ui "https://github.com/marcuschew2024/connectsphere/blob/main/frontend/src/app/venues/bookings/new/page.tsx"
click node_api_app "https://github.com/marcuschew2024/connectsphere/blob/main/api/app/main.py"
click node_identity "https://github.com/marcuschew2024/connectsphere/blob/main/api/app/acting_user.py"
click node_auth "https://github.com/marcuschew2024/connectsphere/blob/main/api/app/auth.py"
click node_event_api "https://github.com/marcuschew2024/connectsphere/blob/main/api/app/events.py"
click node_event_rules "https://github.com/marcuschew2024/connectsphere/blob/main/api/app/event_decision.py"
click node_event_store "https://github.com/marcuschew2024/connectsphere/blob/main/api/app/event_repository.py"
click node_notifications "https://github.com/marcuschew2024/connectsphere/blob/main/api/app/notifications.py"
click node_venue_api "https://github.com/marcuschew2024/connectsphere/blob/main/api/app/venues.py"
click node_venue_store "https://github.com/marcuschew2024/connectsphere/blob/main/api/app/venue_repository.py"
click node_booking_api "https://github.com/marcuschew2024/connectsphere/blob/main/api/app/bookings.py"
click node_booking_store "https://github.com/marcuschew2024/connectsphere/blob/main/api/app/booking_repository.py"
click node_attendee_flow "https://github.com/marcuschew2024/connectsphere/tree/main/api/app"

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_dev_switcher,node_event_request,node_draft_workspace,node_event_detail,node_venue_workspace,node_venue_form,node_booking_ui toneBlue
class node_api_app,node_identity,node_auth toneAmber
class node_event_api,node_event_rules,node_event_store,node_notifications,node_attendee_flow toneMint
class node_venue_api,node_venue_store,node_booking_api,node_booking_store toneRose
class node_supabase,node_organiser,node_coordinator,node_venue_staff,node_attendee toneIndigo
```

## Components

### Web application

- [Role dashboard](https://github.com/marcuschew2024/connectsphere/blob/main/frontend/src/app/page.tsx): `frontend/src/app/page.tsx`
- [Demo role switcher](https://github.com/marcuschew2024/connectsphere/blob/main/frontend/src/app/dev-role-switcher.tsx): `frontend/src/app/dev-role-switcher.tsx`
- [Event request form](https://github.com/marcuschew2024/connectsphere/blob/main/frontend/src/app/events/new/event-request-form.tsx): `frontend/src/app/events/new/event-request-form.tsx`
- [Draft workspace](https://github.com/marcuschew2024/connectsphere/blob/main/frontend/src/app/events/drafts/draft-workspace.tsx): `frontend/src/app/events/drafts/draft-workspace.tsx`
- [Event review and detail](https://github.com/marcuschew2024/connectsphere/blob/main/frontend/src/app/events/%5BeventId%5D/page.tsx): `frontend/src/app/events/[eventId]/page.tsx`
- [Venue workspace](https://github.com/marcuschew2024/connectsphere/blob/main/frontend/src/app/venues/venue-workspace.tsx): `frontend/src/app/venues/venue-workspace.tsx`
- [Venue form](https://github.com/marcuschew2024/connectsphere/blob/main/frontend/src/app/venues/new/venue-form.tsx): `frontend/src/app/venues/new/venue-form.tsx`
- [Booking workflow](https://github.com/marcuschew2024/connectsphere/blob/main/frontend/src/app/venues/bookings/new/page.tsx): `frontend/src/app/venues/bookings/new/page.tsx`

### API and access

- [Flask app and routes](https://github.com/marcuschew2024/connectsphere/blob/main/api/app/main.py): `api/app/main.py`
- [Identity and access](https://github.com/marcuschew2024/connectsphere/blob/main/api/app/acting_user.py): `api/app/acting_user.py`
- [Login sessions](https://github.com/marcuschew2024/connectsphere/blob/main/api/app/auth.py): `api/app/auth.py`

### Event lifecycle

- [Event request API](https://github.com/marcuschew2024/connectsphere/blob/main/api/app/events.py): `api/app/events.py`
- [Event decisions and status](https://github.com/marcuschew2024/connectsphere/blob/main/api/app/event_decision.py): `api/app/event_decision.py`
- [Event persistence](https://github.com/marcuschew2024/connectsphere/blob/main/api/app/event_repository.py): `api/app/event_repository.py`
- [Organiser notifications](https://github.com/marcuschew2024/connectsphere/blob/main/api/app/notifications.py): `api/app/notifications.py`
- [Registration and confirmation](https://github.com/marcuschew2024/connectsphere/tree/main/api/app): `api/app`

### Venue operations

- [Venue API and suitability](https://github.com/marcuschew2024/connectsphere/blob/main/api/app/venues.py): `api/app/venues.py`
- [Venue catalogue store](https://github.com/marcuschew2024/connectsphere/blob/main/api/app/venue_repository.py): `api/app/venue_repository.py`
- [Booking API](https://github.com/marcuschew2024/connectsphere/blob/main/api/app/bookings.py): `api/app/bookings.py`
- [Booking persistence](https://github.com/marcuschew2024/connectsphere/blob/main/api/app/booking_repository.py): `api/app/booking_repository.py`

### Persistence

- **Supabase PostgreSQL**

### Other components

- **Organiser**
- **Coordinator**
- **Venue staff**
- **Attendee**

## Connections

- Organiser → Role dashboard: uses (evidence: `README.md`)
- Coordinator → Role dashboard: uses (evidence: `README.md`)
- Venue staff → Role dashboard: uses (evidence: `README.md`)
- Attendee → Registration and confirmation: registers (evidence: `README.md`)
- Role dashboard → Demo role switcher: renders (evidence: `frontend/src/app/page.tsx`)
- Role dashboard → Event request form: links to (evidence: `frontend/src/app/page.tsx`)
- Role dashboard → Draft workspace: links to (evidence: `frontend/src/app/page.tsx`)
- Role dashboard → Venue workspace: links to (evidence: `frontend/src/app/page.tsx`)
- Draft workspace → Event request form: reuses form (evidence: `frontend/src/app/events/drafts/[eventId]/page.tsx`)
- Venue workspace → Venue form: links to (evidence: `frontend/src/app/venues/new/page.tsx`)
- Event request form → Flask app and routes: calls API (evidence: `README.md`)
- Booking workflow → Flask app and routes: calls API (evidence: `README.md`)
- Flask app and routes → Event request API: registers routes (evidence: `api/app/main.py`)
- Flask app and routes → Login sessions: registers routes (evidence: `api/app/main.py`)
- Flask app and routes → Venue API and suitability: registers routes (evidence: `api/app/main.py`)
- Flask app and routes → Booking API: registers routes (evidence: `api/app/main.py`)
- Flask app and routes → Organiser notifications: registers routes (evidence: `api/app/main.py`)
- Event request API → Identity and access: resolves actor (evidence: `api/app/events.py`)
- Event request API → Event decisions and status: uses decisions (evidence: `api/app/events.py`)
- Event request API → Event persistence: reads and writes (evidence: `api/app/events.py`)
- Organiser notifications → Identity and access: checks actor (evidence: `api/app/notifications.py`)
- Venue API and suitability → Venue catalogue store: reads and writes (evidence: `api/app/venues.py`)
- Venue API and suitability → Booking persistence: checks availability (evidence: `api/app/venues.py`)
- Booking API → Identity and access: resolves actor (evidence: `api/app/bookings.py`)
- Booking API → Booking persistence: reads and writes (evidence: `api/app/bookings.py`)
- Booking API → Event persistence: checks event (evidence: `api/app/bookings.py`)
- Event persistence → Supabase PostgreSQL: queries (evidence: `api/app/event_repository.py`)
- Venue catalogue store → Supabase PostgreSQL: queries (evidence: `api/app/venue_repository.py`)
- Booking persistence → Supabase PostgreSQL: queries (evidence: `api/app/booking_repository.py`)
- Login sessions → Supabase PostgreSQL: looks up users (evidence: `api/app/auth.py`)
- Demo role switcher → Flask app and routes: switches demo session (evidence: `frontend/src/app/dev-role-switcher.tsx`)
- Event review and detail → Flask app and routes: loads event
- Venue form → Flask app and routes: submits venue
- Registration and confirmation → Flask app and routes: uses API (evidence: `api/app/main.py`)
