As of Phase 2 Complete (Jan 2026), the backend operates on the V5 Monolithic Server model.
The Strapi Database is the Single Source of Truth. We have removed the EntityAdapter layer.
EntitySheet: The primary gameplay object. What you see in the DB is what is in the game.TurnPipeline: A transactional orchestrator. All changes (Move, Attack, Event Log) happen in One Atomic Transaction.
- Intent (GraphQL Mutation): User calls
submitAction. - Resolution (Pure Logic):
ActionEnginecalculates the outcome (e.g., Hit/Miss, Pathfinding). - Persistence (Transactional): The Database is updated, and Events are logged.
- Narration (Async): The LLM reads the event log and generates a story summary (
Turn.summary). - Memory (RAG): The summary is auto-embedded into
KnowledgeSnippets.
- Determinism: World Generation is strictly seeded.
- Fog of War: Server-side
VisibilityServiceprevents cheating. - Memory: Automated RAG ingestion via Turn Lifecycles.
The Daicer CLI is a developer's best friend.
yarn cli <command>| Command | Usage | Description |
|---|---|---|
explore |
yarn cli explore |
Interactive Browser. View Mobs, Items, and Spells with full JSON inspection. |
knowledge |
yarn cli knowledge -q "Lich" |
Vector Search. Query the RAG database for lore and rules. |
status |
yarn cli status |
Health Check. View active rooms, memory usage, and worker status. |
| Module | Description | Key Tech |
|---|---|---|
🔌 API (src/api) |
Strapi Content Types & Game Logic. | game-ledger, turn-pipeline |
⚙️ Engine (src/engine) |
Pure Logic Core. Dependency-free Math, Rules, and Entropy. | voxel-math, dnd-5e-srd |
♻️ Lifecycle (src/lifecycle) |
Server Bootstrapping & GQL Resolvers. | graphql |
📚 Docs (docs/) |
System Documentation. | mutation_catalog, schema_map |
yarn develop# Verify Logic Determinism (Zero-DB)
yarn vitest api/game/services/__tests__/logic-determinism.test.ts
# Integration Test (Transaction Verification)
yarn testyarn build