# surendar-s290707/mic-event architecture

> Architecture diagram of the GitHub repository surendar-s290707/mic-event, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/surendar-s290707/mic-event
- Repository: https://github.com/surendar-s290707/mic-event

## Overview

MIC Event is a database-backed campus event registration and check-in app. Attendees create accounts, browse events, register for a seat, and show a QR ticket; organizers create events, scan tickets at the door, and review attendance and export event data. The README describes dashboard refresh and CSV export. It explicitly says offline sync, AI insights, and Socket.IO live updates are not built yet, so those are not represented as working capabilities. Route and API wiring is supported by the sampled files; unsampled feature internals are represented only at their existing paths.

Main entry points: [`client/src/App.tsx`](https://github.com/surendar-s290707/mic-event/blob/main/client/src/App.tsx) (Role-based screens), [`client/src/lib/api.ts`](https://github.com/surendar-s290707/mic-event/blob/main/client/src/lib/api.ts) (API client), [`server/src/app.ts`](https://github.com/surendar-s290707/mic-event/blob/main/server/src/app.ts) (HTTP API app), [`server/src/lib/prisma.ts`](https://github.com/surendar-s290707/mic-event/blob/main/server/src/lib/prisma.ts) (Application records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web app"]
  node_web["Role-based screens<br/>[App.tsx]"]
  node_session_ui["Session UI state"]
  node_api_client["API client<br/>[api.ts]"]
  node_events_ui["Event browsing<br/>[AttendeeEvents.tsx]"]
  node_registration_ui["Registration and ticket<br/>[Ticket.tsx]"]
  node_organizer_ui["Event management<br/>[NewEvent.tsx]"]
  node_scan_ui["QR scanner<br/>[ScanPage.tsx]"]
  node_dashboard_ui["Dashboard and export<br/>[EventDashboard.tsx]"]
end

subgraph group_server["API"]
  node_api_app["HTTP API app<br/>[app.ts]"]
  node_auth_routes["Account endpoints<br/>[auth.ts]"]
  node_event_routes["Event endpoints<br/>[events.ts]"]
  node_registration_routes["Registration endpoints<br/>[registrations.ts]"]
  node_auth_guard["Session and role guards<br/>[auth.ts]"]
end

subgraph group_domain["Event operations"]
  node_checkin["Check-in decisions<br/>[checkin.ts]"]
  node_insights["Attendance insights<br/>[insights.ts]"]
  node_csv["CSV export<br/>[csv.ts]"]
  node_qr_render["QR ticket rendering<br/>[Qr.tsx]"]
end

subgraph group_state["Identity and data"]
  node_auth_logic["Password and sessions<br/>[auth.ts]"]
  node_database[("Application records<br/>[prisma.ts]")]
  node_realtime["Realtime support<br/>[realtime.ts]"]
end

node_attendee(("Attendee"))
node_organizer(("Organizer"))
node_browser(("Web browser"))
node_postgres[("PostgreSQL")]

node_attendee -->|"uses"| node_web
node_organizer -->|"uses"| node_web
node_web -->|"renders"| node_session_ui
node_session_ui -->|"requests session"| node_api_client
node_browser -->|"sends API requests"| node_api_app
node_api_client -->|"calls"| node_api_app
node_web -->|"routes to"| node_events_ui
node_web -->|"routes to"| node_registration_ui
node_web -->|"routes to"| node_organizer_ui
node_web -->|"routes to"| node_scan_ui
node_web -->|"routes to"| node_dashboard_ui
node_events_ui -->|"loads events"| node_api_client
node_registration_ui -->|"registers"| node_api_client
node_registration_ui -->|"renders ticket"| node_qr_render
node_organizer_ui -->|"manages events"| node_api_client
node_scan_ui -->|"submits scans"| node_api_client
node_dashboard_ui -->|"loads dashboard"| node_api_client
node_api_app -->|"dispatches"| node_auth_routes
node_api_app -->|"dispatches"| node_event_routes
node_api_app -->|"dispatches"| node_registration_routes
node_auth_routes -->|"guards session check"| node_auth_guard
node_event_routes -->|"guards access"| node_auth_guard
node_registration_routes -->|"guards access"| node_auth_guard
node_auth_routes -->|"hashes and issues sessions"| node_auth_logic
node_auth_routes -->|"reads and writes users"| node_database
node_auth_guard -->|"verifies cookie"| node_auth_logic
node_auth_guard -->|"loads user"| node_database
node_event_routes -->|"reads and writes events"| node_database
node_registration_routes -->|"reads and writes registrations"| node_database
node_registration_routes -->|"checks tickets in"| node_checkin
node_checkin -->|"records check-in"| node_database
node_dashboard_ui -->|"displays attendance data"| node_insights
node_dashboard_ui -->|"downloads export"| node_csv
node_database -->|"persists records"| node_postgres
node_realtime -.->|"attaches to HTTP server"| node_api_app

click node_web "https://github.com/surendar-s290707/mic-event/blob/main/client/src/App.tsx"
click node_session_ui "https://github.com/surendar-s290707/mic-event/blob/main/client/src/store/SessionProvider.tsx"
click node_api_client "https://github.com/surendar-s290707/mic-event/blob/main/client/src/lib/api.ts"
click node_events_ui "https://github.com/surendar-s290707/mic-event/blob/main/client/src/routes/attendee/AttendeeEvents.tsx"
click node_registration_ui "https://github.com/surendar-s290707/mic-event/blob/main/client/src/routes/attendee/Ticket.tsx"
click node_organizer_ui "https://github.com/surendar-s290707/mic-event/blob/main/client/src/routes/organizer/NewEvent.tsx"
click node_scan_ui "https://github.com/surendar-s290707/mic-event/blob/main/client/src/routes/organizer/ScanPage.tsx"
click node_dashboard_ui "https://github.com/surendar-s290707/mic-event/blob/main/client/src/routes/organizer/EventDashboard.tsx"
click node_api_app "https://github.com/surendar-s290707/mic-event/blob/main/server/src/app.ts"
click node_auth_routes "https://github.com/surendar-s290707/mic-event/blob/main/server/src/routes/auth.ts"
click node_event_routes "https://github.com/surendar-s290707/mic-event/blob/main/server/src/routes/events.ts"
click node_registration_routes "https://github.com/surendar-s290707/mic-event/blob/main/server/src/routes/registrations.ts"
click node_auth_guard "https://github.com/surendar-s290707/mic-event/blob/main/server/src/middleware/auth.ts"
click node_checkin "https://github.com/surendar-s290707/mic-event/blob/main/server/src/lib/checkin.ts"
click node_insights "https://github.com/surendar-s290707/mic-event/blob/main/server/src/lib/insights.ts"
click node_csv "https://github.com/surendar-s290707/mic-event/blob/main/server/src/lib/csv.ts"
click node_qr_render "https://github.com/surendar-s290707/mic-event/blob/main/client/src/components/Qr.tsx"
click node_auth_logic "https://github.com/surendar-s290707/mic-event/blob/main/server/src/lib/auth.ts"
click node_database "https://github.com/surendar-s290707/mic-event/blob/main/server/src/lib/prisma.ts"
click node_realtime "https://github.com/surendar-s290707/mic-event/blob/main/server/src/lib/realtime.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_web,node_session_ui,node_api_client,node_events_ui,node_registration_ui,node_organizer_ui,node_scan_ui,node_dashboard_ui,node_browser toneBlue
class node_api_app,node_auth_routes,node_event_routes,node_registration_routes,node_auth_guard,node_postgres toneAmber
class node_checkin,node_insights,node_csv,node_qr_render toneMint
class node_auth_logic,node_database,node_realtime toneRose
class node_attendee,node_organizer toneIndigo
```

## Components

### Web app

- [Role-based screens](https://github.com/surendar-s290707/mic-event/blob/main/client/src/App.tsx): `client/src/App.tsx`
- [Session UI state](https://github.com/surendar-s290707/mic-event/blob/main/client/src/store/SessionProvider.tsx): `client/src/store/SessionProvider.tsx`
- [API client](https://github.com/surendar-s290707/mic-event/blob/main/client/src/lib/api.ts): `client/src/lib/api.ts`
- [Event browsing](https://github.com/surendar-s290707/mic-event/blob/main/client/src/routes/attendee/AttendeeEvents.tsx): `client/src/routes/attendee/AttendeeEvents.tsx`
- [Registration and ticket](https://github.com/surendar-s290707/mic-event/blob/main/client/src/routes/attendee/Ticket.tsx): `client/src/routes/attendee/Ticket.tsx`
- [Event management](https://github.com/surendar-s290707/mic-event/blob/main/client/src/routes/organizer/NewEvent.tsx): `client/src/routes/organizer/NewEvent.tsx`
- [QR scanner](https://github.com/surendar-s290707/mic-event/blob/main/client/src/routes/organizer/ScanPage.tsx): `client/src/routes/organizer/ScanPage.tsx`
- [Dashboard and export](https://github.com/surendar-s290707/mic-event/blob/main/client/src/routes/organizer/EventDashboard.tsx): `client/src/routes/organizer/EventDashboard.tsx`

### API

- [HTTP API app](https://github.com/surendar-s290707/mic-event/blob/main/server/src/app.ts): `server/src/app.ts`
- [Account endpoints](https://github.com/surendar-s290707/mic-event/blob/main/server/src/routes/auth.ts): `server/src/routes/auth.ts`
- [Event endpoints](https://github.com/surendar-s290707/mic-event/blob/main/server/src/routes/events.ts): `server/src/routes/events.ts`
- [Registration endpoints](https://github.com/surendar-s290707/mic-event/blob/main/server/src/routes/registrations.ts): `server/src/routes/registrations.ts`
- [Session and role guards](https://github.com/surendar-s290707/mic-event/blob/main/server/src/middleware/auth.ts): `server/src/middleware/auth.ts`

### Event operations

- [Check-in decisions](https://github.com/surendar-s290707/mic-event/blob/main/server/src/lib/checkin.ts): `server/src/lib/checkin.ts`
- [Attendance insights](https://github.com/surendar-s290707/mic-event/blob/main/server/src/lib/insights.ts): `server/src/lib/insights.ts`
- [CSV export](https://github.com/surendar-s290707/mic-event/blob/main/server/src/lib/csv.ts): `server/src/lib/csv.ts`
- [QR ticket rendering](https://github.com/surendar-s290707/mic-event/blob/main/client/src/components/Qr.tsx): `client/src/components/Qr.tsx`

### Identity and data

- [Password and sessions](https://github.com/surendar-s290707/mic-event/blob/main/server/src/lib/auth.ts): `server/src/lib/auth.ts`
- [Application records](https://github.com/surendar-s290707/mic-event/blob/main/server/src/lib/prisma.ts): `server/src/lib/prisma.ts`
- [Realtime support](https://github.com/surendar-s290707/mic-event/blob/main/server/src/lib/realtime.ts): `server/src/lib/realtime.ts`

### Other components

- **Attendee**
- **Organizer**
- **Web browser**
- **PostgreSQL**

## Connections

- Attendee → Role-based screens: uses
- Organizer → Role-based screens: uses
- Role-based screens → Session UI state: renders
- Session UI state → API client: requests session
- Web browser → HTTP API app: sends API requests
- API client → HTTP API app: calls
- Role-based screens → Event browsing: routes to
- Role-based screens → Registration and ticket: routes to
- Role-based screens → Event management: routes to
- Role-based screens → QR scanner: routes to
- Role-based screens → Dashboard and export: routes to
- Event browsing → API client: loads events
- Registration and ticket → API client: registers
- Registration and ticket → QR ticket rendering: renders ticket
- Event management → API client: manages events
- QR scanner → API client: submits scans
- Dashboard and export → API client: loads dashboard
- HTTP API app → Account endpoints: dispatches
- HTTP API app → Event endpoints: dispatches
- HTTP API app → Registration endpoints: dispatches
- Account endpoints → Session and role guards: guards session check
- Event endpoints → Session and role guards: guards access
- Registration endpoints → Session and role guards: guards access
- Account endpoints → Password and sessions: hashes and issues sessions
- Account endpoints → Application records: reads and writes users
- Session and role guards → Password and sessions: verifies cookie
- Session and role guards → Application records: loads user
- Event endpoints → Application records: reads and writes events
- Registration endpoints → Application records: reads and writes registrations
- Registration endpoints → Check-in decisions: checks tickets in
- Check-in decisions → Application records: records check-in
- Dashboard and export → Attendance insights: displays attendance data
- Dashboard and export → CSV export: downloads export
- Application records → PostgreSQL: persists records
- Realtime support → HTTP API app: attaches to HTTP server
