Skip to content

lguibr/daicer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

183 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Daicer Logo

Daicer Backend

The Brain, The Heart, and The Soul.

Backend CI codecov Strapi [TypeScript

Cocov Unified
Lines Statements Functions Branches
Diff Lines Diff Statements Diff Functions Diff Branches

](https://www.typescriptlang.org/)

"The Database IS the State."


🏛 The Monolithic Architecture

As of Phase 2 Complete (Jan 2026), the backend operates on the V5 Monolithic Server model.

1. The Schematic Truth

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.

👉 See Schema Architecture Map

2. The Game Loop ("The Sandwich")

  1. Intent (GraphQL Mutation): User calls submitAction.
  2. Resolution (Pure Logic): ActionEngine calculates the outcome (e.g., Hit/Miss, Pathfinding).
  3. Persistence (Transactional): The Database is updated, and Events are logged.
  4. Narration (Async): The LLM reads the event log and generates a story summary (Turn.summary).
  5. Memory (RAG): The summary is auto-embedded into KnowledgeSnippets.

👉 See Mutation Catalog

3. Reliability & Visibility

  • Determinism: World Generation is strictly seeded.
  • Fog of War: Server-side VisibilityService prevents cheating.
  • Memory: Automated RAG ingestion via Turn Lifecycles.

🛠 The CLI (Command Line Interface)

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.

🗺 Documentation Map

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

🧪 Developer Cheatsheet

🏃‍♂️ Running the Server

yarn develop

⚡️ Development / Testing

# Verify Logic Determinism (Zero-DB)
yarn vitest api/game/services/__tests__/logic-determinism.test.ts

# Integration Test (Transaction Verification)
yarn test

🧹 Clean Build

yarn build

About

Multiplayer tabletop RPG powered by an AI Dungeon Master. Daicer fuses deterministic dice mechanics, LangGraph orchestration, and a modern React client to deliver cooperative storytelling that stays faithful to D&D 5e.

Topics

Resources

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors