# quantumsequrity/shadowcrypt architecture

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

- Interactive diagram: https://gitdiagram.com/quantumsequrity/shadowcrypt
- Repository: https://github.com/quantumsequrity/shadowcrypt

## Overview

ShadowCrypt is a terminal roguelike dungeon crawler. The visible root application combines terminal interaction and game logic, with supporting achievement, quest, NPC, crafting, and recipe modules. The repository also contains a separately structured core library for classes, combat, entities, items, magic, world generation, AI, and saves. The tree and excerpts show overlapping implementations, so treat these as parallel code paths rather than assume they form one runtime pipeline. The root app’s feature links are supported by its indexed references; unsampled wiring is omitted.

Main entry points: [`core/src/game.rs`](https://github.com/quantumsequrity/shadowcrypt/blob/main/core/src/game.rs) (Core Game State), [`src/main.rs`](https://github.com/quantumsequrity/shadowcrypt/blob/main/src/main.rs) (Terminal Game), [`src/achievements.rs`](https://github.com/quantumsequrity/shadowcrypt/blob/main/src/achievements.rs) (Achievements), [`src/crafting.rs`](https://github.com/quantumsequrity/shadowcrypt/blob/main/src/crafting.rs) (Crafting)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Terminal Game"]
  node_root_app["Terminal Game<br/>[main.rs]"]
end

subgraph group_features["Adventure Features"]
  node_achievements["Achievements<br/>[achievements.rs]"]
  node_crafting["Crafting<br/>[crafting.rs]"]
  node_npc["NPCs<br/>[npc.rs]"]
  node_quests["Quests<br/>[quest.rs]"]
  node_recipes["Recipes<br/>[recipes.rs]"]
end

subgraph group_core["Core Game Systems"]
  node_classes["Character Classes<br/>[classes.rs]"]
  node_entities["Player and Enemies<br/>[entities.rs]"]
  node_combat["Combat<br/>[combat.rs]"]
  node_items["Items and Gear<br/>[items.rs]"]
  node_magic["Magic<br/>[magic.rs]"]
  node_world["Dungeon World<br/>[world.rs]"]
  node_ai["Game AI<br/>[ai.rs]"]
  node_engine["Core Game State<br/>[game.rs]"]
end

subgraph group_persistence["Persistence"]
  node_saves[("Save and Load<br/>[save.rs]")]
end

node_player(("Player"))

node_player -.->|"plays"| node_root_app
node_root_app -->|"uses"| node_achievements
node_root_app -->|"uses"| node_crafting
node_root_app -->|"uses"| node_npc
node_root_app -->|"uses"| node_quests
node_root_app -->|"uses"| node_recipes
node_engine -->|"uses"| node_classes
node_engine -->|"uses"| node_entities
node_engine -->|"uses"| node_combat
node_engine -->|"uses"| node_items
node_engine -->|"uses"| node_magic
node_engine -->|"uses"| node_world
node_engine -->|"uses"| node_ai
node_engine -.->|"uses"| node_saves

click node_root_app "https://github.com/quantumsequrity/shadowcrypt/blob/main/src/main.rs"
click node_achievements "https://github.com/quantumsequrity/shadowcrypt/blob/main/src/achievements.rs"
click node_crafting "https://github.com/quantumsequrity/shadowcrypt/blob/main/src/crafting.rs"
click node_npc "https://github.com/quantumsequrity/shadowcrypt/blob/main/src/npc.rs"
click node_quests "https://github.com/quantumsequrity/shadowcrypt/blob/main/src/quest.rs"
click node_recipes "https://github.com/quantumsequrity/shadowcrypt/blob/main/src/recipes.rs"
click node_classes "https://github.com/quantumsequrity/shadowcrypt/blob/main/core/src/classes.rs"
click node_entities "https://github.com/quantumsequrity/shadowcrypt/blob/main/core/src/entities.rs"
click node_combat "https://github.com/quantumsequrity/shadowcrypt/blob/main/core/src/combat.rs"
click node_items "https://github.com/quantumsequrity/shadowcrypt/blob/main/core/src/items.rs"
click node_magic "https://github.com/quantumsequrity/shadowcrypt/blob/main/core/src/magic.rs"
click node_world "https://github.com/quantumsequrity/shadowcrypt/blob/main/core/src/world.rs"
click node_ai "https://github.com/quantumsequrity/shadowcrypt/blob/main/core/src/ai.rs"
click node_engine "https://github.com/quantumsequrity/shadowcrypt/blob/main/core/src/game.rs"
click node_saves "https://github.com/quantumsequrity/shadowcrypt/blob/main/core/src/save.rs"

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_root_app toneBlue
class node_achievements,node_crafting,node_npc,node_quests,node_recipes toneAmber
class node_classes,node_entities,node_combat,node_items,node_magic,node_world,node_ai,node_engine toneMint
class node_saves toneRose
class node_player toneIndigo
```

## Components

### Terminal Game

- [Terminal Game](https://github.com/quantumsequrity/shadowcrypt/blob/main/src/main.rs): `src/main.rs`

### Adventure Features

- [Achievements](https://github.com/quantumsequrity/shadowcrypt/blob/main/src/achievements.rs): `src/achievements.rs`
- [Crafting](https://github.com/quantumsequrity/shadowcrypt/blob/main/src/crafting.rs): `src/crafting.rs`
- [NPCs](https://github.com/quantumsequrity/shadowcrypt/blob/main/src/npc.rs): `src/npc.rs`
- [Quests](https://github.com/quantumsequrity/shadowcrypt/blob/main/src/quest.rs): `src/quest.rs`
- [Recipes](https://github.com/quantumsequrity/shadowcrypt/blob/main/src/recipes.rs): `src/recipes.rs`

### Core Game Systems

- [Character Classes](https://github.com/quantumsequrity/shadowcrypt/blob/main/core/src/classes.rs): `core/src/classes.rs`
- [Player and Enemies](https://github.com/quantumsequrity/shadowcrypt/blob/main/core/src/entities.rs): `core/src/entities.rs`
- [Combat](https://github.com/quantumsequrity/shadowcrypt/blob/main/core/src/combat.rs): `core/src/combat.rs`
- [Items and Gear](https://github.com/quantumsequrity/shadowcrypt/blob/main/core/src/items.rs): `core/src/items.rs`
- [Magic](https://github.com/quantumsequrity/shadowcrypt/blob/main/core/src/magic.rs): `core/src/magic.rs`
- [Dungeon World](https://github.com/quantumsequrity/shadowcrypt/blob/main/core/src/world.rs): `core/src/world.rs`
- [Game AI](https://github.com/quantumsequrity/shadowcrypt/blob/main/core/src/ai.rs): `core/src/ai.rs`
- [Core Game State](https://github.com/quantumsequrity/shadowcrypt/blob/main/core/src/game.rs): `core/src/game.rs`

### Persistence

- [Save and Load](https://github.com/quantumsequrity/shadowcrypt/blob/main/core/src/save.rs): `core/src/save.rs`

### Other components

- **Player**

## Connections

- Player → Terminal Game: plays
- Terminal Game → Achievements: uses (evidence: `src/main.rs`)
- Terminal Game → Crafting: uses (evidence: `src/main.rs`)
- Terminal Game → NPCs: uses (evidence: `src/main.rs`)
- Terminal Game → Quests: uses (evidence: `src/main.rs`)
- Terminal Game → Recipes: uses (evidence: `src/main.rs`)
- Core Game State → Character Classes: uses (evidence: `core/src/game.rs`)
- Core Game State → Player and Enemies: uses (evidence: `core/src/game.rs`)
- Core Game State → Combat: uses (evidence: `core/src/game.rs`)
- Core Game State → Items and Gear: uses (evidence: `core/src/game.rs`)
- Core Game State → Magic: uses (evidence: `core/src/game.rs`)
- Core Game State → Dungeon World: uses (evidence: `core/src/game.rs`)
- Core Game State → Game AI: uses (evidence: `core/src/game.rs`)
- Core Game State → Save and Load: uses (evidence: `core/src/save.rs`)
