# sarvan-2187/dog-food architecture

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

- Interactive diagram: https://gitdiagram.com/sarvan-2187/dog-food
- Repository: https://github.com/sarvan-2187/dog-food

## Overview

HackFlow is a self-hosted hackathon operations platform with a React client and FastAPI API. Its principal workflow runs from account registration and team formation through project submission, organizer eligibility decisions, judge assignment and scoring, normalized results, certificates, and archive retrieval. The README documents these domain-stage handoffs; sampled backend excerpts support key authorization and eligibility behavior, while the source index identifies major unsampled modules. Accordingly, some documented subsystem links use README evidence rather than implying that unsampled implementation details were inspected.

Main entry points: [`src/api/app/teams/router.py`](https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/teams/router.py) (Team formation), [`src/api/app/main.py`](https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/main.py) (HTTP application), [`src/web/src/App.tsx`](https://github.com/sarvan-2187/dog-food/blob/main/src/web/src/App.tsx) (Application routes), [`src/api/app/submissions/router.py`](https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/submissions/router.py) (Project submissions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_webapp["Application routes<br/>[App.tsx]"]
  node_authui["Session context<br/>[auth-context.tsx]"]
  node_apiclient["API client<br/>[api.ts]"]
end

subgraph group_identity["Identity and events"]
  node_auth["Accounts and recovery<br/>[router.py]"]
  node_events["Event management<br/>[router.py]"]
  node_archive["Event archive<br/>[router.py]"]
end

subgraph group_participation["Participation"]
  node_teams["Team formation<br/>[router.py]"]
  node_submissions["Project submissions<br/>[router.py]"]
  node_eligibility["Eligibility decisions<br/>[router.py]"]
  node_galleryvotes["Gallery and voting<br/>[router.py]"]
end

subgraph group_judging["Judging and results"]
  node_assignment["Judge assignment<br/>[router.py]"]
  node_scoring["Rubrics and scores<br/>[router.py]"]
  node_normalization["Score normalization<br/>[normalization.py]"]
  node_results["Results and exports<br/>[router.py]"]
  node_certificates["Verifiable certificates<br/>[certificate.py]"]
end

subgraph group_platform["Platform services"]
  node_api["HTTP application<br/>[main.py]"]
  node_storage["Uploaded media<br/>[router.py]"]
  node_webhooks["Webhook integrations<br/>[service.py]"]
  node_audit["Audit records<br/>[log.py]"]
  node_database[("Application database<br/>[db.py]")]
end

node_participants(("Participants"))
node_organizers(("Organizers"))
node_judges(("Judges"))
node_browser(("Browser users"))

node_browser -->|"uses"| node_webapp
node_webapp -->|"provides session"| node_authui
node_webapp -.->|"routes screens"| node_apiclient
node_authui -->|"calls"| node_apiclient
node_apiclient -.->|"sends API requests"| node_api
node_api -->|"mounts routes"| node_auth
node_api -->|"mounts routes"| node_events
node_participants -->|"registers"| node_auth
node_auth -.->|"enables membership"| node_teams
node_participants -->|"forms teams"| node_teams
node_teams -->|"submits projects"| node_submissions
node_organizers -->|"rules on entries"| node_eligibility
node_submissions -->|"provides entries"| node_eligibility
node_eligibility -->|"selects competing entries"| node_assignment
node_organizers -->|"assigns judges"| node_assignment
node_assignment -->|"enables judging"| node_scoring
node_judges -->|"submits scores"| node_scoring
node_scoring -->|"supplies raw scores"| node_normalization
node_normalization -->|"produces standings"| node_results
node_results -->|"provides revealed winners"| node_certificates
node_results -->|"feeds archive"| node_archive
node_certificates -->|"archives credentials"| node_archive
node_participants -->|"browses and votes"| node_galleryvotes
node_submissions -.->|"appears in gallery"| node_galleryvotes
node_teams -->|"uploads media"| node_storage
node_events -.->|"configures integrations"| node_webhooks
node_database -.->|"persists application state"| node_api

click node_webapp "https://github.com/sarvan-2187/dog-food/blob/main/src/web/src/App.tsx"
click node_authui "https://github.com/sarvan-2187/dog-food/blob/main/src/web/src/lib/auth-context.tsx"
click node_apiclient "https://github.com/sarvan-2187/dog-food/blob/main/src/web/src/lib/api.ts"
click node_api "https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/main.py"
click node_auth "https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/auth/router.py"
click node_events "https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/events/router.py"
click node_teams "https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/teams/router.py"
click node_submissions "https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/submissions/router.py"
click node_eligibility "https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/submissions/router.py"
click node_galleryvotes "https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/voting/router.py"
click node_storage "https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/storage/router.py"
click node_assignment "https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/judging/router.py"
click node_scoring "https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/scoring/router.py"
click node_normalization "https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/scoring/normalization.py"
click node_results "https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/scoring/router.py"
click node_certificates "https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/scoring/certificate.py"
click node_archive "https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/events/router.py"
click node_webhooks "https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/webhooks/service.py"
click node_audit "https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/audit/log.py"
click node_database "https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/db.py"

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_webapp,node_authui,node_apiclient,node_browser toneBlue
class node_auth,node_events,node_archive toneAmber
class node_teams,node_submissions,node_eligibility,node_galleryvotes toneMint
class node_assignment,node_scoring,node_normalization,node_results,node_certificates toneRose
class node_api,node_storage,node_webhooks,node_audit,node_database,node_participants,node_organizers,node_judges toneIndigo
```

## Components

### Web client

- [Application routes](https://github.com/sarvan-2187/dog-food/blob/main/src/web/src/App.tsx): `src/web/src/App.tsx`
- [Session context](https://github.com/sarvan-2187/dog-food/blob/main/src/web/src/lib/auth-context.tsx): `src/web/src/lib/auth-context.tsx`
- [API client](https://github.com/sarvan-2187/dog-food/blob/main/src/web/src/lib/api.ts): `src/web/src/lib/api.ts`

### Identity and events

- [Accounts and recovery](https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/auth/router.py): `src/api/app/auth/router.py`
- [Event management](https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/events/router.py): `src/api/app/events/router.py`
- [Event archive](https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/events/router.py): `src/api/app/events/router.py`

### Participation

- [Team formation](https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/teams/router.py): `src/api/app/teams/router.py`
- [Project submissions](https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/submissions/router.py): `src/api/app/submissions/router.py`
- [Eligibility decisions](https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/submissions/router.py): `src/api/app/submissions/router.py`
- [Gallery and voting](https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/voting/router.py): `src/api/app/voting/router.py`

### Judging and results

- [Judge assignment](https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/judging/router.py): `src/api/app/judging/router.py`
- [Rubrics and scores](https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/scoring/router.py): `src/api/app/scoring/router.py`
- [Score normalization](https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/scoring/normalization.py): `src/api/app/scoring/normalization.py`
- [Results and exports](https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/scoring/router.py): `src/api/app/scoring/router.py`
- [Verifiable certificates](https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/scoring/certificate.py): `src/api/app/scoring/certificate.py`

### Platform services

- [HTTP application](https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/main.py): `src/api/app/main.py`
- [Uploaded media](https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/storage/router.py): `src/api/app/storage/router.py`
- [Webhook integrations](https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/webhooks/service.py): `src/api/app/webhooks/service.py`
- [Audit records](https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/audit/log.py): `src/api/app/audit/log.py`
- [Application database](https://github.com/sarvan-2187/dog-food/blob/main/src/api/app/db.py): `src/api/app/db.py`

### Other components

- **Participants**
- **Organizers**
- **Judges**
- **Browser users**

## Connections

- Browser users → Application routes: uses (evidence: `src/web/src/App.tsx`)
- Application routes → Session context: provides session (evidence: `src/web/src/App.tsx`)
- Application routes → API client: routes screens
- Session context → API client: calls (evidence: `src/web/src/lib/auth-context.tsx`)
- API client → HTTP application: sends API requests
- HTTP application → Accounts and recovery: mounts routes (evidence: `src/api/app/main.py`)
- HTTP application → Event management: mounts routes (evidence: `src/api/app/main.py`)
- Participants → Accounts and recovery: registers (evidence: `src/api/app/auth/router.py`)
- Accounts and recovery → Team formation: enables membership
- Participants → Team formation: forms teams (evidence: `README.md`)
- Team formation → Project submissions: submits projects (evidence: `README.md`)
- Organizers → Eligibility decisions: rules on entries (evidence: `src/api/app/submissions/router.py`)
- Project submissions → Eligibility decisions: provides entries (evidence: `README.md`)
- Eligibility decisions → Judge assignment: selects competing entries (evidence: `README.md`)
- Organizers → Judge assignment: assigns judges (evidence: `README.md`)
- Judge assignment → Rubrics and scores: enables judging (evidence: `README.md`)
- Judges → Rubrics and scores: submits scores (evidence: `README.md`)
- Rubrics and scores → Score normalization: supplies raw scores (evidence: `README.md`)
- Score normalization → Results and exports: produces standings (evidence: `README.md`)
- Results and exports → Verifiable certificates: provides revealed winners (evidence: `README.md`)
- Results and exports → Event archive: feeds archive (evidence: `README.md`)
- Verifiable certificates → Event archive: archives credentials (evidence: `README.md`)
- Participants → Gallery and voting: browses and votes (evidence: `README.md`)
- Project submissions → Gallery and voting: appears in gallery
- Team formation → Uploaded media: uploads media (evidence: `src/api/app/storage/router.py`)
- Event management → Webhook integrations: configures integrations
- Application database → HTTP application: persists application state (evidence: `src/api/app/main.py`)
