# deeeland0ohio/sigma_games architecture

> Architecture diagram of the GitHub repository deeeland0ohio/sigma_games, 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/deeeland0ohio/sigma_games
- Repository: https://github.com/deeeland0ohio/sigma_games

## Overview

Sigma Games is a browser game hub with local and curated third-party game libraries, playable game views, favorites, themes, music, and chat/AI features. Users enter through the routed app, browse a catalog or source collection, then open a game; favorites and appearance settings persist locally. A separate Express server exposes content, chat, games, and AI route modules. The README provides no feature documentation, so capability coverage comes from the route table and source index; several page and server relationships are therefore left unconnected where their calls were not shown.

Main entry points: [`src/App.tsx`](https://github.com/deeeland0ohio/sigma_games/blob/main/src/App.tsx) (Routed application), [`server/routes/index.ts`](https://github.com/deeeland0ohio/sigma_games/blob/main/server/routes/index.ts) (API router), [`src/components/BackgroundManager.tsx`](https://github.com/deeeland0ohio/sigma_games/blob/main/src/components/BackgroundManager.tsx) (Background manager), [`src/components/PageLayout.tsx`](https://github.com/deeeland0ohio/sigma_games/blob/main/src/components/PageLayout.tsx) (Page layout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Web app"]
  node_app["Routed application<br/>[App.tsx]"]
  node_layout["Page layout<br/>[PageLayout.tsx]"]
end

subgraph group_games["Game discovery"]
  node_home["Home and catalog pages"]
  node_sourcepages["Source collections"]
  node_alexr["Alexr collection<br/>[AlexrGames.tsx]"]
  node_threekh["3kh0 collection<br/>[Threekh0Games.tsx]"]
  node_catalog[("Local game catalog<br/>[localCatalog.ts]")]
  node_sourcecatalogs[("Source game catalogs")]
  node_gamecards["Game cards<br/>[SourceGameCard.tsx]"]
  node_player["Game players<br/>[GamePlayer.tsx]"]
  node_contentframe["Embedded content frame<br/>[ContentFrame.tsx]"]
end

subgraph group_personal["Personalization"]
  node_bgmanager["Background manager"]
  node_backgrounds["Background effects"]
  node_theme["Theme settings<br/>[ThemeContext.tsx]"]
  node_favorites["Favorites state"]
  node_storage[("Browser storage<br/>[storage.ts]")]
  node_settings["Settings page<br/>[Settings.tsx]"]
end

subgraph group_conversations["Chat and AI"]
  node_chatpage["Chat page<br/>[ChatPage.tsx]"]
  node_aichat["AI chat interface<br/>[AiChat.tsx]"]
end

subgraph group_backend["Server APIs"]
  node_server["Express server<br/>[server.ts]"]
  node_api["API router<br/>[index.ts]"]
  node_contentapi["Content loader API<br/>[contentLoader.ts]"]
  node_chatapi["Chat API<br/>[chat.ts]"]
  node_gamesapi["Games API<br/>[games.ts]"]
  node_aiapi["AI API<br/>[ai.ts]"]
end

node_visitor(("Player"))

node_visitor -->|"opens"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_player
node_app -->|"routes to"| node_sourcepages
node_app -->|"routes to"| node_alexr
node_app -->|"routes to"| node_threekh
node_app -->|"routes to"| node_chatpage
node_app -->|"routes to"| node_aichat
node_app -->|"routes to"| node_settings
node_app -->|"renders"| node_bgmanager
node_bgmanager -->|"reads settings"| node_theme
node_bgmanager -->|"selects effect"| node_backgrounds
node_layout -->|"reads colors"| node_theme
node_favorites -->|"persists favorites"| node_storage
node_theme -->|"persists settings"| node_storage
node_home -.->|"uses catalog"| node_catalog
node_sourcepages -.->|"uses collections"| node_sourcecatalogs
node_alexr -->|"renders cards"| node_gamecards
node_threekh -.->|"renders cards"| node_gamecards
node_player -.->|"embeds content"| node_contentframe
node_chatpage -->|"renders within"| node_layout
node_settings -->|"renders within"| node_layout
node_server -->|"mounts router"| node_api
node_api -->|"registers"| node_contentapi
node_api -->|"registers"| node_chatapi
node_api -->|"registers"| node_gamesapi
node_api -->|"registers"| node_aiapi

click node_app "https://github.com/deeeland0ohio/sigma_games/blob/main/src/App.tsx"
click node_layout "https://github.com/deeeland0ohio/sigma_games/blob/main/src/components/PageLayout.tsx"
click node_bgmanager "https://github.com/deeeland0ohio/sigma_games/blob/main/src/components/BackgroundManager.tsx"
click node_backgrounds "https://github.com/deeeland0ohio/sigma_games/tree/main/src/components"
click node_theme "https://github.com/deeeland0ohio/sigma_games/blob/main/src/context/ThemeContext.tsx"
click node_favorites "https://github.com/deeeland0ohio/sigma_games/blob/main/src/context/FavoritesContext.tsx"
click node_storage "https://github.com/deeeland0ohio/sigma_games/blob/main/src/utils/storage.ts"
click node_home "https://github.com/deeeland0ohio/sigma_games/tree/main/src/pages"
click node_sourcepages "https://github.com/deeeland0ohio/sigma_games/tree/main/src/pages"
click node_alexr "https://github.com/deeeland0ohio/sigma_games/blob/main/src/pages/AlexrGames.tsx"
click node_threekh "https://github.com/deeeland0ohio/sigma_games/blob/main/src/pages/Threekh0Games.tsx"
click node_catalog "https://github.com/deeeland0ohio/sigma_games/blob/main/src/games/localCatalog.ts"
click node_sourcecatalogs "https://github.com/deeeland0ohio/sigma_games/tree/main/src/sources"
click node_gamecards "https://github.com/deeeland0ohio/sigma_games/blob/main/src/games/SourceGameCard.tsx"
click node_player "https://github.com/deeeland0ohio/sigma_games/blob/main/src/pages/GamePlayer.tsx"
click node_contentframe "https://github.com/deeeland0ohio/sigma_games/blob/main/src/components/ContentFrame.tsx"
click node_chatpage "https://github.com/deeeland0ohio/sigma_games/blob/main/src/pages/ChatPage.tsx"
click node_aichat "https://github.com/deeeland0ohio/sigma_games/blob/main/src/ai/AiChat.tsx"
click node_settings "https://github.com/deeeland0ohio/sigma_games/blob/main/src/pages/Settings.tsx"
click node_server "https://github.com/deeeland0ohio/sigma_games/blob/main/server.ts"
click node_api "https://github.com/deeeland0ohio/sigma_games/blob/main/server/routes/index.ts"
click node_contentapi "https://github.com/deeeland0ohio/sigma_games/blob/main/server/routes/contentLoader.ts"
click node_chatapi "https://github.com/deeeland0ohio/sigma_games/blob/main/server/routes/chat.ts"
click node_gamesapi "https://github.com/deeeland0ohio/sigma_games/blob/main/server/routes/games.ts"
click node_aiapi "https://github.com/deeeland0ohio/sigma_games/blob/main/server/routes/ai.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_layout toneBlue
class node_home,node_sourcepages,node_alexr,node_threekh,node_catalog,node_sourcecatalogs,node_gamecards,node_player,node_contentframe toneAmber
class node_bgmanager,node_backgrounds,node_theme,node_favorites,node_storage,node_settings toneMint
class node_chatpage,node_aichat toneRose
class node_server,node_api,node_contentapi,node_chatapi,node_gamesapi,node_aiapi,node_visitor toneIndigo
```

## Components

### Web app

- [Routed application](https://github.com/deeeland0ohio/sigma_games/blob/main/src/App.tsx): `src/App.tsx`
- [Page layout](https://github.com/deeeland0ohio/sigma_games/blob/main/src/components/PageLayout.tsx): `src/components/PageLayout.tsx`

### Game discovery

- [Home and catalog pages](https://github.com/deeeland0ohio/sigma_games/tree/main/src/pages): `src/pages`
- [Source collections](https://github.com/deeeland0ohio/sigma_games/tree/main/src/pages): `src/pages`
- [Alexr collection](https://github.com/deeeland0ohio/sigma_games/blob/main/src/pages/AlexrGames.tsx): `src/pages/AlexrGames.tsx`
- [3kh0 collection](https://github.com/deeeland0ohio/sigma_games/blob/main/src/pages/Threekh0Games.tsx): `src/pages/Threekh0Games.tsx`
- [Local game catalog](https://github.com/deeeland0ohio/sigma_games/blob/main/src/games/localCatalog.ts): `src/games/localCatalog.ts`
- [Source game catalogs](https://github.com/deeeland0ohio/sigma_games/tree/main/src/sources): `src/sources`
- [Game cards](https://github.com/deeeland0ohio/sigma_games/blob/main/src/games/SourceGameCard.tsx): `src/games/SourceGameCard.tsx`
- [Game players](https://github.com/deeeland0ohio/sigma_games/blob/main/src/pages/GamePlayer.tsx): `src/pages/GamePlayer.tsx`
- [Embedded content frame](https://github.com/deeeland0ohio/sigma_games/blob/main/src/components/ContentFrame.tsx): `src/components/ContentFrame.tsx`

### Personalization

- [Background manager](https://github.com/deeeland0ohio/sigma_games/blob/main/src/components/BackgroundManager.tsx): `src/components/BackgroundManager.tsx`
- [Background effects](https://github.com/deeeland0ohio/sigma_games/tree/main/src/components): `src/components`
- [Theme settings](https://github.com/deeeland0ohio/sigma_games/blob/main/src/context/ThemeContext.tsx): `src/context/ThemeContext.tsx`
- [Favorites state](https://github.com/deeeland0ohio/sigma_games/blob/main/src/context/FavoritesContext.tsx): `src/context/FavoritesContext.tsx`
- [Browser storage](https://github.com/deeeland0ohio/sigma_games/blob/main/src/utils/storage.ts): `src/utils/storage.ts`
- [Settings page](https://github.com/deeeland0ohio/sigma_games/blob/main/src/pages/Settings.tsx): `src/pages/Settings.tsx`

### Chat and AI

- [Chat page](https://github.com/deeeland0ohio/sigma_games/blob/main/src/pages/ChatPage.tsx): `src/pages/ChatPage.tsx`
- [AI chat interface](https://github.com/deeeland0ohio/sigma_games/blob/main/src/ai/AiChat.tsx): `src/ai/AiChat.tsx`

### Server APIs

- [Express server](https://github.com/deeeland0ohio/sigma_games/blob/main/server.ts): `server.ts`
- [API router](https://github.com/deeeland0ohio/sigma_games/blob/main/server/routes/index.ts): `server/routes/index.ts`
- [Content loader API](https://github.com/deeeland0ohio/sigma_games/blob/main/server/routes/contentLoader.ts): `server/routes/contentLoader.ts`
- [Chat API](https://github.com/deeeland0ohio/sigma_games/blob/main/server/routes/chat.ts): `server/routes/chat.ts`
- [Games API](https://github.com/deeeland0ohio/sigma_games/blob/main/server/routes/games.ts): `server/routes/games.ts`
- [AI API](https://github.com/deeeland0ohio/sigma_games/blob/main/server/routes/ai.ts): `server/routes/ai.ts`

### Other components

- **Player**

## Connections

- Player → Routed application: opens (evidence: `src/App.tsx`)
- Routed application → Home and catalog pages: routes to (evidence: `src/App.tsx`)
- Routed application → Game players: routes to (evidence: `src/App.tsx`)
- Routed application → Source collections: routes to (evidence: `src/App.tsx`)
- Routed application → Alexr collection: routes to (evidence: `src/App.tsx`)
- Routed application → 3kh0 collection: routes to (evidence: `src/App.tsx`)
- Routed application → Chat page: routes to (evidence: `src/App.tsx`)
- Routed application → AI chat interface: routes to (evidence: `src/App.tsx`)
- Routed application → Settings page: routes to (evidence: `src/App.tsx`)
- Routed application → Background manager: renders (evidence: `src/App.tsx`)
- Background manager → Theme settings: reads settings (evidence: `src/components/BackgroundManager.tsx`)
- Background manager → Background effects: selects effect (evidence: `src/components/BackgroundManager.tsx`)
- Page layout → Theme settings: reads colors (evidence: `src/components/PageLayout.tsx`)
- Favorites state → Browser storage: persists favorites (evidence: `src/context/FavoritesContext.tsx`)
- Theme settings → Browser storage: persists settings (evidence: `src/context/ThemeContext.tsx`)
- Home and catalog pages → Local game catalog: uses catalog
- Source collections → Source game catalogs: uses collections
- Alexr collection → Game cards: renders cards (evidence: `src/pages/AlexrGames.tsx`)
- 3kh0 collection → Game cards: renders cards
- Game players → Embedded content frame: embeds content
- Chat page → Page layout: renders within (evidence: `src/pages/ChatPage.tsx`)
- Settings page → Page layout: renders within (evidence: `src/pages/Settings.tsx`)
- Express server → API router: mounts router (evidence: `server.ts`)
- API router → Content loader API: registers (evidence: `server/routes/index.ts`)
- API router → Chat API: registers (evidence: `server/routes/index.ts`)
- API router → Games API: registers (evidence: `server/routes/index.ts`)
- API router → AI API: registers (evidence: `server/routes/index.ts`)
