Mirora AI

← ALL CASE STUDIES
[ CASE STUDY: YOURGM ]

A Solo Narrative TTRPG, Built on the Mirora Platform

YourGM is a mobile-first, SRD-faithful tabletop RPG where an LLM is the game master. It runs as a three-repo stack: a game app on top, a rules platform in the middle, and the Mirora AI platform underneath.

3 REPOS / 2 GAME MODES / 1 TRUST BOUNDARY

Three Layers, Three Repos

Each layer has one job and a strict contract with the layer below. Game-specific code never leaks downward; platform code never knows it's powering a game.

YourGM-solo-narrative-mobile-game

The Game

Mobile-first Web PWA with a 3D tactical view, plus a Fastify backend that orchestrates every turn. The only layer that knows about characters, story arcs, and players.

Vite + React react-three-fiber Fastify PWA

YourGM (SRD Platform)

The Rules

Game-agnostic TypeScript workspace implementing the SRD ruleset faithfully: engine, character model, turn loop, contracts, runtime, and mobile UI primitives. A YAML golden-scenario suite keeps the engine honest.

@srd/engine @srd/contracts @srd/turn-loop @yourgm/mobile-* + 15 more packages

mirora-ai-microservices

The AI

The generic Mirora platform: one FastAPI deployable mounting six router-packages — Core AI (LLM gateway), Vector Store, RAG, Knowledge Graph, Image Generation, and Synthetic Data. It powers the narrative voice and the world's memory.

FastAPI core-ai knowledge-graph rag vector-store image-generation

Narrative Voice vs. Mechanical Truth

The core design split of YourGM: the LLM tells the story, the engine enforces the rules — and neither crosses into the other's lane.

LLM-Driven

Narrative Mode

  • Open-ended, free-text play — the LLM acts as game master.
  • Powered by Mirora Core AI through the Fastify backend.
  • A knowledge graph remembers people, places, and consequences across sessions.
  • The engine still validates anything mechanical the story implies.
Engine-Driven

Combat Mode

  • Pure SRD rules resolution — deterministic, auditable, no improvisation.
  • 3D tactical UI rendered with react-three-fiber.
  • Action-panel-only input: no free text can reach combat resolution.
  • Regression-tested against a golden-scenario suite.
Engine = mechanical truth. LLM = narrative voice. Neither crosses.

Where the Code Lives

mobile/

Vite + React + react-three-fiber web client. Installable PWA; native packaging deferred, not abandoned.

Vercel

backend/

Fastify orchestrator. Runs the turn loop, calls the SRD engine in-process, and is the only thing that talks to Mirora.

Render

shared/

Types and contracts shared between mobile and backend. No runtime logic — a pure boundary definition.

contracts

vendor/yourgm/

Committed, read-only snapshot of the SRD platform, refreshed by script. Tooling-enforced: direct edits are denied.

read-only

One Turn, Two Paths

Narrative Turn

Player free text → Fastify backend → SRD engine validates state → Mirora Core AI narrates → Knowledge graph updated → Story beat to PWA

The LLM writes the scene; the engine guarantees nothing impossible happened in it.

Combat Turn

Action panel tap → Fastify backend → @srd/engine resolves (dice, rules, state) → Result rendered in 3D tactical UI

No LLM in the loop — combat outcomes are pure rules engine, every time.

World Memory

Story events → Backend → Mirora Knowledge Graph + Vector Store → Retrieved as context on future turns

Long-term campaign memory, so the GM never forgets what your character did.

Hard Constraints, Enforced by Design

Client Holds No Keys

The mobile PWA never carries an API key. Only the backend authenticates to Mirora, over HTTPS.

Engine Stays Server-Side

Mobile never imports the SRD engine, runtime, or contracts. Rules resolution cannot be tampered with client-side.

SRD-Faithful Core

No house rules in the platform layer. Customization is an overlay pattern owned by the game, not the rules library.

No Free Text in Combat

Tactical UI is action-panel-only, so prompt injection can never reach mechanical resolution.

Trunk-Based, Auto-Deployed

All three repos ship from main. Every merge rolls forward automatically — no release trains, no staging queues.

ComponentPlatformStackTrigger
Mobile PWAVercelVite + React + R3FAuto-deploy on merge to main
Game BackendRenderFastify (Node)Auto-deploy on merge to main
Mirora PlatformRenderFastAPI (Python)Auto-deploy on merge to main
SRD PlatformTypeScript librariesVendored into the game by refresh script

Want an AI platform that can power experiences like this?

START A CONVERSATION