# xand0dev/eden-zero architecture

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

- Interactive diagram: https://gitdiagram.com/xand0dev/eden-zero
- Repository: https://github.com/xand0dev/eden-zero

## Overview

EDEN//0 is an artificial-life simulation observatory and emergent-world game. The main workflow is to configure a world, run its simulation in a worker, and inspect the resulting settlement, individuals, brains, and history. The graph also preserves the documented campaign, crisis, atlas, and metaprogression branches. Some game subsystems are represented at directory level because their implementation files were not sampled; their links are limited to references shown in the SOURCE INDEX or README.

Main entry points: [`src/simulation/world.ts`](https://github.com/xand0dev/eden-zero/blob/main/src/simulation/world.ts) (World engine), [`src/components/WorldScreen.tsx`](https://github.com/xand0dev/eden-zero/blob/main/src/components/WorldScreen.tsx) (World screen), [`src/ui/game.ts`](https://github.com/xand0dev/eden-zero/blob/main/src/ui/game.ts) (Game progression), [`src/worker/client.ts`](https://github.com/xand0dev/eden-zero/blob/main/src/worker/client.ts) (Simulation client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Player experience"]
  node_app["App shell<br/>[App.tsx]"]
  node_genesis["World setup<br/>[Genesis.tsx]"]
  node_worldscreen["World screen<br/>[WorldScreen.tsx]"]
end

subgraph group_runtime["Simulation runtime"]
  node_client["Simulation client<br/>[client.ts]"]
  node_worker["Simulation worker<br/>[sim.worker.ts]"]
  node_world["World engine<br/>[world.ts]"]
  node_server["Shared server<br/>[index.ts]"]
end

subgraph group_domain["World and life"]
  node_terrain["Terrain generation<br/>[terrain.ts]"]
  node_humans["Human entities<br/>[human.ts]"]
  node_brain["Spiking brain<br/>[network.ts]"]
  node_genome["Genome and evolution<br/>[genome.ts]"]
end

subgraph group_game["Game systems"]
  node_gameworld["World game systems"]
  node_atlas["Behavior atlas<br/>[atlas.ts]"]
  node_gameui["Game progression<br/>[game.ts]"]
end

subgraph group_insight["Observation and records"]
  node_renderer["World renderer<br/>[renderer.ts]"]
  node_journal["Journal<br/>[Journal.tsx]"]
  node_profile["Player profile<br/>[profile.ts]"]
  node_save["World saves<br/>[save.ts]"]
end

node_player(("Player"))

node_player -->|"opens"| node_app
node_app -->|"shows setup"| node_genesis
node_app -->|"shows world"| node_worldscreen
node_genesis -->|"configures simulation"| node_client
node_worldscreen -->|"controls simulation"| node_client
node_client -->|"sends messages"| node_worker
node_worker -->|"runs world"| node_world
node_worker -->|"applies commands"| node_world
node_world -->|"generates terrain"| node_terrain
node_world -->|"uses game systems"| node_gameworld
node_world -->|"updates entities"| node_humans
node_humans -->|"runs neural activity"| node_brain
node_humans -->|"uses inherited traits"| node_genome
node_world -.->|"publishes snapshots"| node_client
node_worldscreen -->|"renders world"| node_renderer
node_worldscreen -->|"saves and restores"| node_save
node_gameworld -->|"classifies behaviors"| node_atlas
node_worldscreen -->|"shows game state"| node_gameui
node_gameui -->|"tracks discoveries"| node_atlas
node_gameui -->|"updates progress"| node_profile
node_journal -->|"reads game state"| node_gameui
node_journal -->|"shows atlas"| node_atlas
node_player -.->|"may join shared play"| node_server

click node_app "https://github.com/xand0dev/eden-zero/blob/main/src/app/App.tsx"
click node_genesis "https://github.com/xand0dev/eden-zero/blob/main/src/components/Genesis.tsx"
click node_worldscreen "https://github.com/xand0dev/eden-zero/blob/main/src/components/WorldScreen.tsx"
click node_client "https://github.com/xand0dev/eden-zero/blob/main/src/worker/client.ts"
click node_worker "https://github.com/xand0dev/eden-zero/blob/main/src/worker/sim.worker.ts"
click node_world "https://github.com/xand0dev/eden-zero/blob/main/src/simulation/world.ts"
click node_terrain "https://github.com/xand0dev/eden-zero/blob/main/src/simulation/environment/terrain.ts"
click node_humans "https://github.com/xand0dev/eden-zero/blob/main/src/simulation/entities/human.ts"
click node_brain "https://github.com/xand0dev/eden-zero/blob/main/src/simulation/brain/network.ts"
click node_genome "https://github.com/xand0dev/eden-zero/blob/main/src/simulation/genetics/genome.ts"
click node_gameworld "https://github.com/xand0dev/eden-zero/tree/main/src/simulation/game"
click node_atlas "https://github.com/xand0dev/eden-zero/blob/main/src/simulation/game/atlas.ts"
click node_gameui "https://github.com/xand0dev/eden-zero/blob/main/src/ui/game.ts"
click node_renderer "https://github.com/xand0dev/eden-zero/blob/main/src/render/renderer.ts"
click node_journal "https://github.com/xand0dev/eden-zero/blob/main/src/components/game/Journal.tsx"
click node_profile "https://github.com/xand0dev/eden-zero/blob/main/src/meta/profile.ts"
click node_save "https://github.com/xand0dev/eden-zero/blob/main/src/simulation/persistence/save.ts"
click node_server "https://github.com/xand0dev/eden-zero/blob/main/server/index.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_genesis,node_worldscreen toneBlue
class node_client,node_worker,node_world,node_server toneAmber
class node_terrain,node_humans,node_brain,node_genome toneMint
class node_gameworld,node_atlas,node_gameui toneRose
class node_renderer,node_journal,node_profile,node_save,node_player toneIndigo
```

## Components

### Player experience

- [App shell](https://github.com/xand0dev/eden-zero/blob/main/src/app/App.tsx): `src/app/App.tsx`
- [World setup](https://github.com/xand0dev/eden-zero/blob/main/src/components/Genesis.tsx): `src/components/Genesis.tsx`
- [World screen](https://github.com/xand0dev/eden-zero/blob/main/src/components/WorldScreen.tsx): `src/components/WorldScreen.tsx`

### Simulation runtime

- [Simulation client](https://github.com/xand0dev/eden-zero/blob/main/src/worker/client.ts): `src/worker/client.ts`
- [Simulation worker](https://github.com/xand0dev/eden-zero/blob/main/src/worker/sim.worker.ts): `src/worker/sim.worker.ts`
- [World engine](https://github.com/xand0dev/eden-zero/blob/main/src/simulation/world.ts): `src/simulation/world.ts`
- [Shared server](https://github.com/xand0dev/eden-zero/blob/main/server/index.ts): `server/index.ts`

### World and life

- [Terrain generation](https://github.com/xand0dev/eden-zero/blob/main/src/simulation/environment/terrain.ts): `src/simulation/environment/terrain.ts`
- [Human entities](https://github.com/xand0dev/eden-zero/blob/main/src/simulation/entities/human.ts): `src/simulation/entities/human.ts`
- [Spiking brain](https://github.com/xand0dev/eden-zero/blob/main/src/simulation/brain/network.ts): `src/simulation/brain/network.ts`
- [Genome and evolution](https://github.com/xand0dev/eden-zero/blob/main/src/simulation/genetics/genome.ts): `src/simulation/genetics/genome.ts`

### Game systems

- [World game systems](https://github.com/xand0dev/eden-zero/tree/main/src/simulation/game): `src/simulation/game`
- [Behavior atlas](https://github.com/xand0dev/eden-zero/blob/main/src/simulation/game/atlas.ts): `src/simulation/game/atlas.ts`
- [Game progression](https://github.com/xand0dev/eden-zero/blob/main/src/ui/game.ts): `src/ui/game.ts`

### Observation and records

- [World renderer](https://github.com/xand0dev/eden-zero/blob/main/src/render/renderer.ts): `src/render/renderer.ts`
- [Journal](https://github.com/xand0dev/eden-zero/blob/main/src/components/game/Journal.tsx): `src/components/game/Journal.tsx`
- [Player profile](https://github.com/xand0dev/eden-zero/blob/main/src/meta/profile.ts): `src/meta/profile.ts`
- [World saves](https://github.com/xand0dev/eden-zero/blob/main/src/simulation/persistence/save.ts): `src/simulation/persistence/save.ts`

### Other components

- **Player**

## Connections

- Player → App shell: opens
- App shell → World setup: shows setup (evidence: `src/app/App.tsx`)
- App shell → World screen: shows world (evidence: `src/app/App.tsx`)
- World setup → Simulation client: configures simulation
- World screen → Simulation client: controls simulation (evidence: `src/components/WorldScreen.tsx`)
- Simulation client → Simulation worker: sends messages (evidence: `src/worker/client.ts`)
- Simulation worker → World engine: runs world (evidence: `src/worker/sim.worker.ts`)
- Simulation worker → World engine: applies commands (evidence: `src/worker/sim.worker.ts`)
- World engine → Terrain generation: generates terrain (evidence: `src/simulation/world.ts`)
- World engine → World game systems: uses game systems (evidence: `src/simulation/world.ts`)
- World engine → Human entities: updates entities (evidence: `src/simulation/world.ts`)
- Human entities → Spiking brain: runs neural activity (evidence: `src/simulation/entities/human.ts`)
- Human entities → Genome and evolution: uses inherited traits (evidence: `src/simulation/entities/human.ts`)
- World engine → Simulation client: publishes snapshots
- World screen → World renderer: renders world (evidence: `src/components/WorldScreen.tsx`)
- World screen → World saves: saves and restores (evidence: `src/components/WorldScreen.tsx`)
- World game systems → Behavior atlas: classifies behaviors (evidence: `src/simulation/game/atlas.ts`)
- World screen → Game progression: shows game state (evidence: `src/components/WorldScreen.tsx`)
- Game progression → Behavior atlas: tracks discoveries (evidence: `src/ui/game.ts`)
- Game progression → Player profile: updates progress (evidence: `src/ui/game.ts`)
- Journal → Game progression: reads game state (evidence: `src/components/game/Journal.tsx`)
- Journal → Behavior atlas: shows atlas (evidence: `src/components/game/Journal.tsx`)
- Player → Shared server: may join shared play
