# michaldabrowski-dentons/ourpantheon architecture

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

- Interactive diagram: https://gitdiagram.com/michaldabrowski-dentons/ourpantheon
- Repository: https://github.com/michaldabrowski-dentons/ourpantheon

## Overview

O BOGOWIE! is a Polish-language, multiplayer browser tabletop for the Our Pantheon game. Players authenticate, create or join a world, shape their gods, agree on a palette and world origins, then play repeated Logos, god-action and Chaos phases on a shared hex map. Supabase provides authentication, persistence, server-side game rules and realtime synchronization; the client store mirrors game state. The README documents these capabilities, while some screens and database details are not in the supplied excerpts, so their connections are shown only where documented.

Main entry points: [`src/features/game/GamePage.tsx`](https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/features/game/GamePage.tsx) (Game orchestration), [`src/lib/supabase.ts`](https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/lib/supabase.ts) (Supabase client), [`src/features/auth/AuthGate.tsx`](https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/features/auth/AuthGate.tsx) (Authentication), [`src/features/palette/PalettePage.tsx`](https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/features/palette/PalettePage.tsx) (Shared palette)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and rooms"]
  node_app["App routing<br/>[App.tsx]"]
  node_auth["Authentication<br/>[AuthGate.tsx]"]
  node_lobby["Lobby and rooms<br/>[LobbyPage.tsx]"]
end

subgraph group_setup["World setup"]
  node_creation["World creation"]
  node_pantheon["God creation<br/>[GodCreation.tsx]"]
  node_palette["Shared palette<br/>[PalettePage.tsx]"]
end

subgraph group_play["Gods and turns"]
  node_game["Game orchestration<br/>[GamePage.tsx]"]
  node_actions["God actions<br/>[ActionDialog.tsx]"]
  node_dice["Logos rolls<br/>[dice.ts]"]
  node_chaos["Chaos phase<br/>[ChaosOverlay.tsx]"]
end

subgraph group_world["World systems"]
  node_actiondata["Action rules<br/>[actions.ts]"]
  node_hexmap["Hex map<br/>[HexMap.tsx]"]
  node_worldview["World model<br/>[world.ts]"]
  node_hex["Hex geometry<br/>[hex.ts]"]
  node_chronicle["Chronicle<br/>[chronicle.ts]"]
end

subgraph group_infra["Shared services"]
  node_store["Game state store<br/>[useGameStore.ts]"]
  node_realtime["Realtime sync<br/>[useGameRealtime.ts]"]
  node_client["Supabase client<br/>[supabase.ts]"]
  node_ui["Shared UI primitives<br/>[Primitives.tsx]"]
  node_button["Stone buttons<br/>[StoneButton.tsx]"]
end

node_players(("Players"))
node_backend[("Supabase services")]

node_players -->|"enter"| node_app
node_app -->|"routes to"| node_auth
node_auth -->|"admits player"| node_lobby
node_lobby -->|"creates world"| node_creation
node_lobby -->|"opens room setup"| node_pantheon
node_pantheon -->|"continues setup"| node_palette
node_palette -->|"starts play"| node_game
node_game -->|"offers actions"| node_actions
node_game -->|"runs Logos rolls"| node_dice
node_game -->|"opens Chaos"| node_chaos
node_game -->|"shows map"| node_hexmap
node_actions -->|"uses definitions"| node_actiondata
node_actions -->|"reads world"| node_worldview
node_worldview -->|"uses geometry"| node_hex
node_hexmap -.->|"displays world"| node_worldview
node_game -.->|"records verses"| node_chronicle
node_creation -->|"uses backend"| node_client
node_palette -->|"reads and writes"| node_client
node_auth -->|"authenticates"| node_client
node_store -->|"loads game rows"| node_client
node_client -->|"queries and RPCs"| node_backend
node_realtime -->|"subscribes"| node_client
node_realtime -->|"applies changes"| node_store
node_creation -->|"uses state"| node_store
node_palette -->|"uses state"| node_store
node_auth -->|"renders"| node_ui
node_auth -->|"uses"| node_button

click node_app "https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/App.tsx"
click node_auth "https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/features/auth/AuthGate.tsx"
click node_lobby "https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/features/lobby/LobbyPage.tsx"
click node_creation "https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/features/creation/WorldCreationPage.tsx"
click node_pantheon "https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/features/pantheon/GodCreation.tsx"
click node_palette "https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/features/palette/PalettePage.tsx"
click node_game "https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/features/game/GamePage.tsx"
click node_actions "https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/features/game/actions/ActionDialog.tsx"
click node_actiondata "https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/data/actions.ts"
click node_dice "https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/data/dice.ts"
click node_chaos "https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/features/game/chaos/ChaosOverlay.tsx"
click node_hexmap "https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/features/game/map/HexMap.tsx"
click node_worldview "https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/lib/world.ts"
click node_hex "https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/lib/hex.ts"
click node_chronicle "https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/data/chronicle.ts"
click node_store "https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/store/useGameStore.ts"
click node_realtime "https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/hooks/useGameRealtime.ts"
click node_client "https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/lib/supabase.ts"
click node_ui "https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/components/ui/Primitives.tsx"
click node_button "https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/components/ui/StoneButton.tsx"

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_auth,node_lobby toneBlue
class node_creation,node_pantheon,node_palette,node_backend toneAmber
class node_game,node_actions,node_dice,node_chaos toneMint
class node_actiondata,node_hexmap,node_worldview,node_hex,node_chronicle toneRose
class node_store,node_realtime,node_client,node_ui,node_button,node_players toneIndigo
```

## Components

### Entry and rooms

- [App routing](https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/App.tsx): `src/App.tsx`
- [Authentication](https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/features/auth/AuthGate.tsx): `src/features/auth/AuthGate.tsx`
- [Lobby and rooms](https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/features/lobby/LobbyPage.tsx): `src/features/lobby/LobbyPage.tsx`

### World setup

- [World creation](https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/features/creation/WorldCreationPage.tsx): `src/features/creation/WorldCreationPage.tsx`
- [God creation](https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/features/pantheon/GodCreation.tsx): `src/features/pantheon/GodCreation.tsx`
- [Shared palette](https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/features/palette/PalettePage.tsx): `src/features/palette/PalettePage.tsx`

### Gods and turns

- [Game orchestration](https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/features/game/GamePage.tsx): `src/features/game/GamePage.tsx`
- [God actions](https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/features/game/actions/ActionDialog.tsx): `src/features/game/actions/ActionDialog.tsx`
- [Logos rolls](https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/data/dice.ts): `src/data/dice.ts`
- [Chaos phase](https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/features/game/chaos/ChaosOverlay.tsx): `src/features/game/chaos/ChaosOverlay.tsx`

### World systems

- [Action rules](https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/data/actions.ts): `src/data/actions.ts`
- [Hex map](https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/features/game/map/HexMap.tsx): `src/features/game/map/HexMap.tsx`
- [World model](https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/lib/world.ts): `src/lib/world.ts`
- [Hex geometry](https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/lib/hex.ts): `src/lib/hex.ts`
- [Chronicle](https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/data/chronicle.ts): `src/data/chronicle.ts`

### Shared services

- [Game state store](https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/store/useGameStore.ts): `src/store/useGameStore.ts`
- [Realtime sync](https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/hooks/useGameRealtime.ts): `src/hooks/useGameRealtime.ts`
- [Supabase client](https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- [Shared UI primitives](https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/components/ui/Primitives.tsx): `src/components/ui/Primitives.tsx`
- [Stone buttons](https://github.com/michaldabrowski-dentons/ourpantheon/blob/main/src/components/ui/StoneButton.tsx): `src/components/ui/StoneButton.tsx`

### Other components

- **Players**
- **Supabase services**

## Connections

- Players → App routing: enter
- App routing → Authentication: routes to (evidence: `src/App.tsx`)
- Authentication → Lobby and rooms: admits player (evidence: `src/features/lobby/LobbyPage.tsx`)
- Lobby and rooms → World creation: creates world
- Lobby and rooms → God creation: opens room setup
- God creation → Shared palette: continues setup
- Shared palette → Game orchestration: starts play
- Game orchestration → God actions: offers actions
- Game orchestration → Logos rolls: runs Logos rolls
- Game orchestration → Chaos phase: opens Chaos
- Game orchestration → Hex map: shows map
- God actions → Action rules: uses definitions (evidence: `src/features/game/actions/ActionDialog.tsx`)
- God actions → World model: reads world (evidence: `src/features/game/actions/ActionDialog.tsx`)
- World model → Hex geometry: uses geometry (evidence: `src/lib/world.ts`)
- Hex map → World model: displays world
- Game orchestration → Chronicle: records verses
- World creation → Supabase client: uses backend (evidence: `src/features/creation/WorldCreationPage.tsx`)
- Shared palette → Supabase client: reads and writes (evidence: `src/features/palette/PalettePage.tsx`)
- Authentication → Supabase client: authenticates (evidence: `src/features/auth/AuthGate.tsx`)
- Game state store → Supabase client: loads game rows (evidence: `src/store/useGameStore.ts`)
- Supabase client → Supabase services: queries and RPCs (evidence: `src/lib/supabase.ts`)
- Realtime sync → Supabase client: subscribes (evidence: `src/hooks/useGameRealtime.ts`)
- Realtime sync → Game state store: applies changes (evidence: `src/hooks/useGameRealtime.ts`)
- World creation → Game state store: uses state (evidence: `src/features/creation/WorldCreationPage.tsx`)
- Shared palette → Game state store: uses state (evidence: `src/features/palette/PalettePage.tsx`)
- Authentication → Shared UI primitives: renders (evidence: `src/features/auth/AuthGate.tsx`)
- Authentication → Stone buttons: uses
