# arrrvelt/sumada architecture

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

- Interactive diagram: https://gitdiagram.com/arrrvelt/sumada
- Repository: https://github.com/arrrvelt/sumada

## Overview

Sumada is a mobile-first event judging and tabulation app, with an online event workflow currently in development. Organizers create events, configure criteria and contestants, and add judges with individual claim codes; judges claim access, with scoring and organizer results still in progress. Event screens use the Supabase client, while the repository also defines a local SQLite schema and weighted ranking utilities. The main screen-to-backend relationships are supported by the source index and README; unshown scoring and results links are omitted rather than inferred.

Main entry points: [`src/lib/supabase.ts`](https://github.com/arrrvelt/sumada/blob/main/src/lib/supabase.ts) (Supabase client), [`src/app/create-event.tsx`](https://github.com/arrrvelt/sumada/blob/main/src/app/create-event.tsx) (Create event), [`src/app/event/[id].tsx`](https://github.com/arrrvelt/sumada/blob/main/src/app/event/%5Bid%5D.tsx) (Manage event), [`src/app/_layout.tsx`](https://github.com/arrrvelt/sumada/blob/main/src/app/_layout.tsx) (App shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_event_workflow["Event workflow"]
  node_app_shell["App shell<br/>[_layout.tsx]"]
  node_event_list["Event list<br/>[index.tsx]"]
  node_event_creation["Create event<br/>[create-event.tsx]"]
  node_event_management["Manage event<br/>[&#91;id&#93;.tsx]"]
  node_room_codes["Room codes<br/>[room-code.ts]"]
end

subgraph group_judge_workflow["Judge workflow"]
  node_judge_claim["Judge claim<br/>[judge.tsx]"]
  node_sign_in["Sign in<br/>[sign-in.tsx]"]
end

subgraph group_data_services["Data services"]
  node_supabase_client["Supabase client<br/>[supabase.ts]"]
  node_supabase_service[("Supabase")]
  node_local_database[("Local database<br/>[local.ts]")]
end

subgraph group_tabulation["Tabulation"]
  node_weighted_tabulation["Weighted tabulation<br/>[weighted.ts]"]
  node_scoring_results["Scoring and results"]
end

node_organizer(("Organizer"))
node_judge(("Judge"))

node_organizer -->|"views events"| node_event_list
node_organizer -->|"creates event"| node_event_creation
node_organizer -->|"configures event"| node_event_management
node_judge -.->|"signs in"| node_sign_in
node_judge -->|"claims code"| node_judge_claim
node_app_shell -->|"initializes"| node_local_database
node_app_shell -->|"uses"| node_supabase_client
node_event_list -->|"queries events"| node_supabase_client
node_event_creation -->|"creates event"| node_supabase_client
node_event_creation -->|"generates code"| node_room_codes
node_event_management -->|"manages event data"| node_supabase_client
node_event_management -->|"generates judge code"| node_room_codes
node_judge_claim -->|"claims judge access"| node_supabase_client
node_sign_in -->|"authenticates"| node_supabase_client
node_supabase_client -->|"connects to"| node_supabase_service
node_weighted_tabulation -.->|"supports ranking"| node_scoring_results

click node_app_shell "https://github.com/arrrvelt/sumada/blob/main/src/app/_layout.tsx"
click node_event_list "https://github.com/arrrvelt/sumada/blob/main/src/app/(app)/index.tsx"
click node_event_creation "https://github.com/arrrvelt/sumada/blob/main/src/app/create-event.tsx"
click node_event_management "https://github.com/arrrvelt/sumada/blob/main/src/app/event/%5Bid%5D.tsx"
click node_judge_claim "https://github.com/arrrvelt/sumada/blob/main/src/app/judge.tsx"
click node_sign_in "https://github.com/arrrvelt/sumada/blob/main/src/app/sign-in.tsx"
click node_room_codes "https://github.com/arrrvelt/sumada/blob/main/src/lib/room-code.ts"
click node_supabase_client "https://github.com/arrrvelt/sumada/blob/main/src/lib/supabase.ts"
click node_local_database "https://github.com/arrrvelt/sumada/blob/main/src/db/local.ts"
click node_weighted_tabulation "https://github.com/arrrvelt/sumada/blob/main/src/tabulation/weighted.ts"
click node_scoring_results "https://github.com/arrrvelt/sumada/tree/main/src"

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_shell,node_event_list,node_event_creation,node_event_management,node_room_codes toneBlue
class node_judge_claim,node_sign_in toneAmber
class node_supabase_client,node_supabase_service,node_local_database toneMint
class node_weighted_tabulation,node_scoring_results toneRose
class node_organizer,node_judge toneIndigo
```

## Components

### Event workflow

- [App shell](https://github.com/arrrvelt/sumada/blob/main/src/app/_layout.tsx): `src/app/_layout.tsx`
- [Event list](https://github.com/arrrvelt/sumada/blob/main/src/app/(app)/index.tsx): `src/app/(app)/index.tsx`
- [Create event](https://github.com/arrrvelt/sumada/blob/main/src/app/create-event.tsx): `src/app/create-event.tsx`
- [Manage event](https://github.com/arrrvelt/sumada/blob/main/src/app/event/%5Bid%5D.tsx): `src/app/event/[id].tsx`
- [Room codes](https://github.com/arrrvelt/sumada/blob/main/src/lib/room-code.ts): `src/lib/room-code.ts`

### Judge workflow

- [Judge claim](https://github.com/arrrvelt/sumada/blob/main/src/app/judge.tsx): `src/app/judge.tsx`
- [Sign in](https://github.com/arrrvelt/sumada/blob/main/src/app/sign-in.tsx): `src/app/sign-in.tsx`

### Data services

- [Supabase client](https://github.com/arrrvelt/sumada/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- **Supabase**
- [Local database](https://github.com/arrrvelt/sumada/blob/main/src/db/local.ts): `src/db/local.ts`

### Tabulation

- [Weighted tabulation](https://github.com/arrrvelt/sumada/blob/main/src/tabulation/weighted.ts): `src/tabulation/weighted.ts`
- [Scoring and results](https://github.com/arrrvelt/sumada/tree/main/src): `src`

### Other components

- **Organizer**
- **Judge**

## Connections

- Organizer → Event list: views events (evidence: `README.md`)
- Organizer → Create event: creates event (evidence: `README.md`)
- Organizer → Manage event: configures event (evidence: `README.md`)
- Judge → Sign in: signs in
- Judge → Judge claim: claims code (evidence: `README.md`)
- App shell → Local database: initializes (evidence: `src/app/_layout.tsx`)
- App shell → Supabase client: uses (evidence: `src/app/_layout.tsx`)
- Event list → Supabase client: queries events (evidence: `src/app/(app)/index.tsx`)
- Create event → Supabase client: creates event (evidence: `src/app/create-event.tsx`)
- Create event → Room codes: generates code (evidence: `src/app/create-event.tsx`)
- Manage event → Supabase client: manages event data (evidence: `src/app/event/[id].tsx`)
- Manage event → Room codes: generates judge code (evidence: `src/app/event/[id].tsx`)
- Judge claim → Supabase client: claims judge access (evidence: `src/app/judge.tsx`)
- Sign in → Supabase client: authenticates (evidence: `src/app/sign-in.tsx`)
- Supabase client → Supabase: connects to (evidence: `README.md`)
- Weighted tabulation → Scoring and results: supports ranking
