# dinhocss/carcasonne architecture

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

- Interactive diagram: https://gitdiagram.com/dinhocss/carcasonne
- Repository: https://github.com/dinhocss/carcasonne

## Overview

This is an early Carcassonne board prototype: it creates a fixed-size board, places sample tiles from a tile catalog, and displays the board with a static player sidebar and controls. The runtime is split between a vanilla-DOM entry point and a separate board-rendering helper; the supplied excerpts do not show the helper being called. `App.tsx` is still the default React/Vite starter screen. The catalog import in `main.ts` differs in filename casing from the tree; unsampled wiring and gameplay features cannot be established.

Main entry points: [`src/main.ts`](https://github.com/dinhocss/carcasonne/blob/main/src/main.ts) (Game Entry), [`src/models/Tabuleiro.ts`](https://github.com/dinhocss/carcasonne/blob/main/src/models/Tabuleiro.ts) (Board State), [`src/view/Render.ts`](https://github.com/dinhocss/carcasonne/blob/main/src/view/Render.ts) (Board Renderer), [`src/types/tile.ts`](https://github.com/dinhocss/carcasonne/blob/main/src/types/tile.ts) (Tile Types)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime UI"]
  node_entry["Game Entry<br/>[main.ts]"]
  node_board_ui["Board Display<br/>[main.ts]"]
  node_board_renderer["Board Renderer<br/>[Render.ts]"]
  node_starter_app["Starter Screen<br/>[App.tsx]"]
end

subgraph group_domain["Board Domain"]
  node_board["Board State<br/>[Tabuleiro.ts]"]
  node_tile_types["Tile Types<br/>[tile.ts]"]
end

subgraph group_catalog["Tile Catalog"]
  node_tile_catalog["Tile Catalog<br/>[tilesData.ts]"]
end

node_browser(("Browser"))

node_browser -->|"loads"| node_entry
node_entry -->|"creates and places"| node_board
node_entry -.->|"reads sample tiles"| node_tile_catalog
node_entry -->|"builds markup"| node_board_ui
node_board_renderer -->|"reads grid"| node_board
node_board -->|"uses tile shape"| node_tile_types

click node_entry "https://github.com/dinhocss/carcasonne/blob/main/src/main.ts"
click node_board_ui "https://github.com/dinhocss/carcasonne/blob/main/src/main.ts"
click node_board_renderer "https://github.com/dinhocss/carcasonne/blob/main/src/view/Render.ts"
click node_starter_app "https://github.com/dinhocss/carcasonne/blob/main/src/App.tsx"
click node_board "https://github.com/dinhocss/carcasonne/blob/main/src/models/Tabuleiro.ts"
click node_tile_types "https://github.com/dinhocss/carcasonne/blob/main/src/types/tile.ts"
click node_tile_catalog "https://github.com/dinhocss/carcasonne/blob/main/src/data/tilesData.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_entry,node_board_ui,node_board_renderer,node_starter_app,node_browser toneBlue
class node_board,node_tile_types toneAmber
class node_tile_catalog toneMint
```

## Components

### Runtime UI

- [Game Entry](https://github.com/dinhocss/carcasonne/blob/main/src/main.ts): `src/main.ts`
- [Board Display](https://github.com/dinhocss/carcasonne/blob/main/src/main.ts): `src/main.ts`
- [Board Renderer](https://github.com/dinhocss/carcasonne/blob/main/src/view/Render.ts): `src/view/Render.ts`
- [Starter Screen](https://github.com/dinhocss/carcasonne/blob/main/src/App.tsx): `src/App.tsx`

### Board Domain

- [Board State](https://github.com/dinhocss/carcasonne/blob/main/src/models/Tabuleiro.ts): `src/models/Tabuleiro.ts`
- [Tile Types](https://github.com/dinhocss/carcasonne/blob/main/src/types/tile.ts): `src/types/tile.ts`

### Tile Catalog

- [Tile Catalog](https://github.com/dinhocss/carcasonne/blob/main/src/data/tilesData.ts): `src/data/tilesData.ts`

### Other components

- **Browser**

## Connections

- Browser → Game Entry: loads
- Game Entry → Board State: creates and places (evidence: `src/main.ts`)
- Game Entry → Tile Catalog: reads sample tiles (evidence: `src/main.ts`)
- Game Entry → Board Display: builds markup (evidence: `src/main.ts`)
- Board Renderer → Board State: reads grid (evidence: `src/view/Render.ts`)
- Board State → Tile Types: uses tile shape (evidence: `src/models/Tabuleiro.ts`)
