# fresco-haze/arenaos architecture

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

- Interactive diagram: https://gitdiagram.com/fresco-haze/arenaos
- Repository: https://github.com/fresco-haze/arenaos

## Overview

ArenaOS is a browser-based tournament management platform: users create accounts and tournaments, organizers manage registration and lifecycle, then generate brackets and record results while spectators follow public tournaments. The README documents single- and double-elimination, round-robin standings, team registration, dashboards, history, authorization, and audit capabilities; the tree identifies their backend modules. Sampled frontend code shows authentication, tournament loading, organizer actions, and bracket display. Backend wiring is not sampled, so links from the API entry point to application use cases are intentionally omitted.

Main entry points: [`Application/UseCases`](https://github.com/fresco-haze/arenaos/tree/main/Application/UseCases) (Tournament use cases), [`api/Main.hs`](https://github.com/fresco-haze/arenaos/blob/main/api/Main.hs) (HTTP API), [`web/src/App.tsx`](https://github.com/fresco-haze/arenaos/blob/main/web/src/App.tsx) (Web routes), [`web/src/hooks/useTournament.ts`](https://github.com/fresco-haze/arenaos/blob/main/web/src/hooks/useTournament.ts) (Tournament loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_webapp["Web routes<br/>[App.tsx]"]
  node_authui["Auth provider<br/>[AuthProvider.tsx]"]
  node_authactions["Registration action<br/>[authActions.ts]"]
  node_createui["Create tournament"]
  node_organizerui["Organizer controls<br/>[OrganizerPanel.tsx]"]
  node_tournamenthook["Tournament loader<br/>[useTournament.ts]"]
  node_bracketui["Bracket display<br/>[Bracket.tsx]"]
end

subgraph group_app["Application workflows"]
  node_usecases["Tournament use cases"]
  node_internal["Application helpers"]
end

subgraph group_competition["Competition domain"]
  node_domain["Tournament models<br/>[Tournament.hs]"]
  node_matchdomain["Match models<br/>[Match.hs]"]
  node_registration["Participant registration<br/>[Registration.hs]"]
  node_bracketengine["Bracket generation"]
  node_advancement["Winner advancement<br/>[Advancement.hs]"]
  node_standings["Standings<br/>[Standings.hs]"]
  node_validation["Competition validation"]
  node_history["Tournament history"]
end

subgraph group_infra["Persistence and services"]
  node_sqlite[("SQLite persistence")]
  node_repos["Persistence ports<br/>[Port.hs]"]
  node_session["Session handling<br/>[Session.hs]"]
  node_password["Password hashing<br/>[PasswordHasher.hs]"]
end

node_organizer(("Organizer"))
node_spectator(("Spectator"))
node_api["HTTP API<br/>[Main.hs]"]

node_organizer -->|"uses"| node_webapp
node_spectator -->|"browses"| node_webapp
node_webapp -->|"provides auth"| node_authui
node_authui -->|"login/logout"| node_api
node_authactions -->|"registers via"| node_api
node_createui -->|"creates via"| node_api
node_organizerui -->|"sends actions"| node_api
node_tournamenthook -->|"fetches data"| node_api
node_tournamenthook -->|"supplies bracket"| node_bracketui
node_api -->|"authenticates"| node_session
node_api -->|"dispatches"| node_usecases
node_usecases -->|"uses helpers"| node_internal
node_usecases -->|"applies rules"| node_domain
node_usecases -->|"registers participants"| node_registration
node_usecases -->|"records results"| node_matchdomain
node_usecases -->|"generates brackets"| node_bracketengine
node_usecases -->|"advances winners"| node_advancement
node_usecases -->|"computes standings"| node_standings
node_usecases -->|"validates changes"| node_validation
node_usecases -->|"records history"| node_history
node_usecases -->|"uses ports"| node_repos
node_repos -->|"reads/writes"| node_sqlite
node_usecases -->|"hashes passwords"| node_password

click node_webapp "https://github.com/fresco-haze/arenaos/blob/main/web/src/App.tsx"
click node_authui "https://github.com/fresco-haze/arenaos/blob/main/web/src/auth/AuthProvider.tsx"
click node_authactions "https://github.com/fresco-haze/arenaos/blob/main/web/src/auth/authActions.ts"
click node_createui "https://github.com/fresco-haze/arenaos/blob/main/web/src/pages/CreateTournamentPage.tsx"
click node_organizerui "https://github.com/fresco-haze/arenaos/blob/main/web/src/components/OrganizerPanel.tsx"
click node_tournamenthook "https://github.com/fresco-haze/arenaos/blob/main/web/src/hooks/useTournament.ts"
click node_bracketui "https://github.com/fresco-haze/arenaos/blob/main/web/src/components/Bracket.tsx"
click node_api "https://github.com/fresco-haze/arenaos/blob/main/api/Main.hs"
click node_usecases "https://github.com/fresco-haze/arenaos/tree/main/Application/UseCases"
click node_internal "https://github.com/fresco-haze/arenaos/tree/main/Application/Internal"
click node_domain "https://github.com/fresco-haze/arenaos/blob/main/Domain/Tournament.hs"
click node_matchdomain "https://github.com/fresco-haze/arenaos/blob/main/Domain/Match.hs"
click node_registration "https://github.com/fresco-haze/arenaos/blob/main/Domain/Registration.hs"
click node_bracketengine "https://github.com/fresco-haze/arenaos/blob/main/Engine/BracketGeneration.hs"
click node_advancement "https://github.com/fresco-haze/arenaos/blob/main/Engine/Advancement.hs"
click node_standings "https://github.com/fresco-haze/arenaos/blob/main/Engine/Standings.hs"
click node_validation "https://github.com/fresco-haze/arenaos/blob/main/Engine/TournamentValidation.hs"
click node_history "https://github.com/fresco-haze/arenaos/blob/main/Domain/TournamentHistory.hs"
click node_sqlite "https://github.com/fresco-haze/arenaos/tree/main/Shell/Persistence/SQLite"
click node_repos "https://github.com/fresco-haze/arenaos/blob/main/Shell/Persistence/Port.hs"
click node_session "https://github.com/fresco-haze/arenaos/blob/main/Shell/Auth/Session.hs"
click node_password "https://github.com/fresco-haze/arenaos/blob/main/Shell/Infrastructure/PasswordHasher.hs"

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_authactions,node_createui,node_organizerui,node_tournamenthook,node_bracketui toneBlue
class node_usecases,node_internal toneAmber
class node_domain,node_matchdomain,node_registration,node_bracketengine,node_advancement,node_standings,node_validation,node_history,node_api toneMint
class node_sqlite,node_repos,node_session,node_password toneRose
class node_organizer,node_spectator toneIndigo
```

## Components

### Web application

- [Web routes](https://github.com/fresco-haze/arenaos/blob/main/web/src/App.tsx): `web/src/App.tsx`
- [Auth provider](https://github.com/fresco-haze/arenaos/blob/main/web/src/auth/AuthProvider.tsx): `web/src/auth/AuthProvider.tsx`
- [Registration action](https://github.com/fresco-haze/arenaos/blob/main/web/src/auth/authActions.ts): `web/src/auth/authActions.ts`
- [Create tournament](https://github.com/fresco-haze/arenaos/blob/main/web/src/pages/CreateTournamentPage.tsx): `web/src/pages/CreateTournamentPage.tsx`
- [Organizer controls](https://github.com/fresco-haze/arenaos/blob/main/web/src/components/OrganizerPanel.tsx): `web/src/components/OrganizerPanel.tsx`
- [Tournament loader](https://github.com/fresco-haze/arenaos/blob/main/web/src/hooks/useTournament.ts): `web/src/hooks/useTournament.ts`
- [Bracket display](https://github.com/fresco-haze/arenaos/blob/main/web/src/components/Bracket.tsx): `web/src/components/Bracket.tsx`

### Application workflows

- [Tournament use cases](https://github.com/fresco-haze/arenaos/tree/main/Application/UseCases): `Application/UseCases`
- [Application helpers](https://github.com/fresco-haze/arenaos/tree/main/Application/Internal): `Application/Internal`

### Competition domain

- [Tournament models](https://github.com/fresco-haze/arenaos/blob/main/Domain/Tournament.hs): `Domain/Tournament.hs`
- [Match models](https://github.com/fresco-haze/arenaos/blob/main/Domain/Match.hs): `Domain/Match.hs`
- [Participant registration](https://github.com/fresco-haze/arenaos/blob/main/Domain/Registration.hs): `Domain/Registration.hs`
- [Bracket generation](https://github.com/fresco-haze/arenaos/blob/main/Engine/BracketGeneration.hs): `Engine/BracketGeneration.hs`
- [Winner advancement](https://github.com/fresco-haze/arenaos/blob/main/Engine/Advancement.hs): `Engine/Advancement.hs`
- [Standings](https://github.com/fresco-haze/arenaos/blob/main/Engine/Standings.hs): `Engine/Standings.hs`
- [Competition validation](https://github.com/fresco-haze/arenaos/blob/main/Engine/TournamentValidation.hs): `Engine/TournamentValidation.hs`
- [Tournament history](https://github.com/fresco-haze/arenaos/blob/main/Domain/TournamentHistory.hs): `Domain/TournamentHistory.hs`

### Persistence and services

- [SQLite persistence](https://github.com/fresco-haze/arenaos/tree/main/Shell/Persistence/SQLite): `Shell/Persistence/SQLite`
- [Persistence ports](https://github.com/fresco-haze/arenaos/blob/main/Shell/Persistence/Port.hs): `Shell/Persistence/Port.hs`
- [Session handling](https://github.com/fresco-haze/arenaos/blob/main/Shell/Auth/Session.hs): `Shell/Auth/Session.hs`
- [Password hashing](https://github.com/fresco-haze/arenaos/blob/main/Shell/Infrastructure/PasswordHasher.hs): `Shell/Infrastructure/PasswordHasher.hs`

### Other components

- **Organizer**
- **Spectator**
- [HTTP API](https://github.com/fresco-haze/arenaos/blob/main/api/Main.hs): `api/Main.hs`

## Connections

- Organizer → Web routes: uses
- Spectator → Web routes: browses
- Web routes → Auth provider: provides auth
- Auth provider → HTTP API: login/logout
- Registration action → HTTP API: registers via
- Create tournament → HTTP API: creates via
- Organizer controls → HTTP API: sends actions
- Tournament loader → HTTP API: fetches data
- Tournament loader → Bracket display: supplies bracket
- HTTP API → Session handling: authenticates
- HTTP API → Tournament use cases: dispatches
- Tournament use cases → Application helpers: uses helpers
- Tournament use cases → Tournament models: applies rules
- Tournament use cases → Participant registration: registers participants
- Tournament use cases → Match models: records results
- Tournament use cases → Bracket generation: generates brackets
- Tournament use cases → Winner advancement: advances winners
- Tournament use cases → Standings: computes standings
- Tournament use cases → Competition validation: validates changes
- Tournament use cases → Tournament history: records history
- Tournament use cases → Persistence ports: uses ports
- Persistence ports → SQLite persistence: reads/writes
- Tournament use cases → Password hashing: hashes passwords
