# gtnethsara/innohack2026-team-draw architecture

> Architecture diagram of the GitHub repository gtnethsara/innohack2026-team-draw, 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/gtnethsara/innohack2026-team-draw
- Repository: https://github.com/gtnethsara/innohack2026-team-draw

## Overview

INNOHACK Team Leader Portal manages team authentication, FIFO draw admission, group allocation, and organizer oversight. Team leaders log in, join the queue, complete a group draw, and view allocation status; administrators monitor teams and queue state and control admissions. The React client uses a typed API service with the Express backend, whose store maintains portal state. MongoDB Atlas is the production persistence layer; local development can use JSON storage. The backend routing and storage details are based on the source index and README, not inspected excerpts.

Main entry points: [`src/services/localPortalService.ts`](https://github.com/gtnethsara/innohack2026-team-draw/blob/main/src/services/localPortalService.ts) (Portal API client), [`src/pages/DashboardPage.tsx`](https://github.com/gtnethsara/innohack2026-team-draw/blob/main/src/pages/DashboardPage.tsx) (Team dashboard), [`src/pages/AdminPage.tsx`](https://github.com/gtnethsara/innohack2026-team-draw/blob/main/src/pages/AdminPage.tsx) (Admin console), [`src/App.tsx`](https://github.com/gtnethsara/innohack2026-team-draw/blob/main/src/App.tsx) (Portal routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Portal client"]
  node_app["Portal routing<br/>[App.tsx]"]
  node_api["Portal API client"]
end

subgraph group_team["Team experience"]
  node_login["Team login<br/>[LoginPage.tsx]"]
  node_dashboard["Team dashboard<br/>[DashboardPage.tsx]"]
  node_wheel["Group draw wheel<br/>[SpinningWheel.tsx]"]
  node_certificate["Allocation certificate"]
  node_progress["Group capacity view"]
end

subgraph group_admin["Organizer operations"]
  node_adminpage["Admin console<br/>[AdminPage.tsx]"]
  node_csv["CSV exports<br/>[exportCsv.ts]"]
  node_pdf["PDF reports<br/>[exportPdf.ts]"]
end

subgraph group_backend["API and domain"]
  node_types["Portal data types<br/>[portal.ts]"]
  node_server["Express API<br/>[index.ts]"]
  node_auth["Auth and sessions<br/>[auth.ts]"]
  node_domain["Queue and allocation state<br/>[store.ts]"]
  node_events["Live event stream<br/>[index.ts]"]
end

subgraph group_persistence["Persistence"]
  node_store[("MongoDB / JSON store<br/>[store.ts]")]
end

node_leader(("Team leader"))
node_organizer(("Organizer"))

node_leader -->|"opens portal"| node_app
node_organizer -->|"opens portal"| node_app
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_adminpage
node_login -->|"authenticates through"| node_api
node_dashboard -->|"fetches portal state"| node_api
node_adminpage -->|"manages portal"| node_api
node_dashboard -->|"renders"| node_wheel
node_dashboard -->|"renders"| node_progress
node_adminpage -->|"renders"| node_progress
node_dashboard -->|"offers allocation proof"| node_certificate
node_adminpage -->|"exports snapshot"| node_csv
node_adminpage -->|"exports snapshot"| node_pdf
node_api -.->|"calls API routes"| node_server
node_server -->|"uses"| node_auth
node_server -->|"dispatches state operations"| node_domain
node_domain -->|"reads and writes"| node_store
node_api -->|"subscribes to stream"| node_events
node_server -->|"serves live updates"| node_events
node_api -->|"uses typed contracts"| node_types
node_domain -->|"uses domain types"| node_types

click node_app "https://github.com/gtnethsara/innohack2026-team-draw/blob/main/src/App.tsx"
click node_login "https://github.com/gtnethsara/innohack2026-team-draw/blob/main/src/pages/LoginPage.tsx"
click node_dashboard "https://github.com/gtnethsara/innohack2026-team-draw/blob/main/src/pages/DashboardPage.tsx"
click node_wheel "https://github.com/gtnethsara/innohack2026-team-draw/blob/main/src/components/SpinningWheel.tsx"
click node_certificate "https://github.com/gtnethsara/innohack2026-team-draw/blob/main/src/components/AllocationCertificate.tsx"
click node_progress "https://github.com/gtnethsara/innohack2026-team-draw/blob/main/src/components/GroupProgressPanel.tsx"
click node_adminpage "https://github.com/gtnethsara/innohack2026-team-draw/blob/main/src/pages/AdminPage.tsx"
click node_csv "https://github.com/gtnethsara/innohack2026-team-draw/blob/main/src/utils/exportCsv.ts"
click node_pdf "https://github.com/gtnethsara/innohack2026-team-draw/blob/main/src/utils/exportPdf.ts"
click node_api "https://github.com/gtnethsara/innohack2026-team-draw/blob/main/src/services/localPortalService.ts"
click node_types "https://github.com/gtnethsara/innohack2026-team-draw/blob/main/src/types/portal.ts"
click node_server "https://github.com/gtnethsara/innohack2026-team-draw/blob/main/server/index.ts"
click node_auth "https://github.com/gtnethsara/innohack2026-team-draw/blob/main/server/auth.ts"
click node_domain "https://github.com/gtnethsara/innohack2026-team-draw/blob/main/server/store.ts"
click node_store "https://github.com/gtnethsara/innohack2026-team-draw/blob/main/server/store.ts"
click node_events "https://github.com/gtnethsara/innohack2026-team-draw/blob/main/server/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_app,node_api toneBlue
class node_login,node_dashboard,node_wheel,node_certificate,node_progress toneAmber
class node_adminpage,node_csv,node_pdf toneMint
class node_types,node_server,node_auth,node_domain,node_events toneRose
class node_store,node_leader,node_organizer toneIndigo
```

## Components

### Portal client

- [Portal routing](https://github.com/gtnethsara/innohack2026-team-draw/blob/main/src/App.tsx): `src/App.tsx`
- [Portal API client](https://github.com/gtnethsara/innohack2026-team-draw/blob/main/src/services/localPortalService.ts): `src/services/localPortalService.ts`

### Team experience

- [Team login](https://github.com/gtnethsara/innohack2026-team-draw/blob/main/src/pages/LoginPage.tsx): `src/pages/LoginPage.tsx`
- [Team dashboard](https://github.com/gtnethsara/innohack2026-team-draw/blob/main/src/pages/DashboardPage.tsx): `src/pages/DashboardPage.tsx`
- [Group draw wheel](https://github.com/gtnethsara/innohack2026-team-draw/blob/main/src/components/SpinningWheel.tsx): `src/components/SpinningWheel.tsx`
- [Allocation certificate](https://github.com/gtnethsara/innohack2026-team-draw/blob/main/src/components/AllocationCertificate.tsx): `src/components/AllocationCertificate.tsx`
- [Group capacity view](https://github.com/gtnethsara/innohack2026-team-draw/blob/main/src/components/GroupProgressPanel.tsx): `src/components/GroupProgressPanel.tsx`

### Organizer operations

- [Admin console](https://github.com/gtnethsara/innohack2026-team-draw/blob/main/src/pages/AdminPage.tsx): `src/pages/AdminPage.tsx`
- [CSV exports](https://github.com/gtnethsara/innohack2026-team-draw/blob/main/src/utils/exportCsv.ts): `src/utils/exportCsv.ts`
- [PDF reports](https://github.com/gtnethsara/innohack2026-team-draw/blob/main/src/utils/exportPdf.ts): `src/utils/exportPdf.ts`

### API and domain

- [Portal data types](https://github.com/gtnethsara/innohack2026-team-draw/blob/main/src/types/portal.ts): `src/types/portal.ts`
- [Express API](https://github.com/gtnethsara/innohack2026-team-draw/blob/main/server/index.ts): `server/index.ts`
- [Auth and sessions](https://github.com/gtnethsara/innohack2026-team-draw/blob/main/server/auth.ts): `server/auth.ts`
- [Queue and allocation state](https://github.com/gtnethsara/innohack2026-team-draw/blob/main/server/store.ts): `server/store.ts`
- [Live event stream](https://github.com/gtnethsara/innohack2026-team-draw/blob/main/server/index.ts): `server/index.ts`

### Persistence

- [MongoDB / JSON store](https://github.com/gtnethsara/innohack2026-team-draw/blob/main/server/store.ts): `server/store.ts`

### Other components

- **Team leader**
- **Organizer**

## Connections

- Team leader → Portal routing: opens portal (evidence: `README.md`)
- Organizer → Portal routing: opens portal (evidence: `README.md`)
- Portal routing → Team login: routes to (evidence: `src/App.tsx`)
- Portal routing → Team dashboard: routes to (evidence: `src/App.tsx`)
- Portal routing → Admin console: routes to (evidence: `src/App.tsx`)
- Team login → Portal API client: authenticates through (evidence: `src/pages/LoginPage.tsx`)
- Team dashboard → Portal API client: fetches portal state (evidence: `src/pages/DashboardPage.tsx`)
- Admin console → Portal API client: manages portal (evidence: `src/pages/AdminPage.tsx`)
- Team dashboard → Group draw wheel: renders (evidence: `src/pages/DashboardPage.tsx`)
- Team dashboard → Group capacity view: renders (evidence: `src/pages/DashboardPage.tsx`)
- Admin console → Group capacity view: renders (evidence: `src/pages/AdminPage.tsx`)
- Team dashboard → Allocation certificate: offers allocation proof (evidence: `src/pages/DashboardPage.tsx`)
- Admin console → CSV exports: exports snapshot (evidence: `src/pages/AdminPage.tsx`)
- Admin console → PDF reports: exports snapshot (evidence: `src/pages/AdminPage.tsx`)
- Portal API client → Express API: calls API routes
- Express API → Auth and sessions: uses (evidence: `server/index.ts`)
- Express API → Queue and allocation state: dispatches state operations (evidence: `server/index.ts`)
- Queue and allocation state → MongoDB / JSON store: reads and writes (evidence: `README.md`)
- Portal API client → Live event stream: subscribes to stream (evidence: `src/services/localPortalService.ts`)
- Express API → Live event stream: serves live updates (evidence: `README.md`)
- Portal API client → Portal data types: uses typed contracts (evidence: `src/services/localPortalService.ts`)
- Queue and allocation state → Portal data types: uses domain types (evidence: `server/store.ts`)
