~/work/infinity-talesLive
Infinity Tales
AI role-playing game with branching storylines, character progression, and AI-generated scene art. Rewritten from Firebase + React to Go + PostgreSQL + Svelte for full data ownership. Multi-provider LLM integration via OpenRouter.
What it does
Originally a React PWA on Firebase. Full rewrite to Go backend + PostgreSQL for complete data ownership and control over the LLM trust boundary. Svelte SSR frontend. Multi-provider LLM integration via OpenRouter with prompt engineering to maintain inventory, quest state, and character arcs consistently across unlimited story branches. AI image generation per scene, character customization, XP progression, multi-language support across 5 locales.
Problem
A branching story has to keep quests, inventory, characters, and prior choices coherent across model turns.
The original Firebase and React implementation limited control over persistence and the model boundary.
Constraints
- Model output is non-deterministic while game state must remain durable and queryable.
- The same narrative system serves five locales and multiple models through OpenRouter.
How it's built
- Players interact with a Svelte SSR frontend.
- The frontend talks to a Go API that tracks quests, inventory, and story state.
- PostgreSQL persists game and character data.
- The API branches out to LLM providers via OpenRouter and image generation for scene art.
Engineering decisions
Rewrite around Go and PostgreSQL
Own the API, persistence model, and LLM trust boundary.
Trade-off A full rewrite delayed product work and replaced managed Firebase services.
Keep state outside the model context
Quests, inventory, and character progression need durable application state.
Trade-off The backend must reconcile structured state with generative output.
Use OpenRouter as the provider boundary
The story engine can work across models without provider-specific frontend logic.
Trade-off The application depends on a third-party routing API.
Evidence
- Locales
- 5
- Owned backend
- Go · PostgreSQL
- Model boundary
- OpenRouter
Supported by the current product content
Replaced Firebase persistence
Multi-provider integration
Highlights
- Full stack rewrite Migrated from Firebase + React to Go + PostgreSQL + Svelte for full data ownership, server-side rendering, and control over the LLM integration layer.
- AI-driven game engine Multi-provider LLM integration via OpenRouter tracks inventory, quests, and character arcs across unlimited story branches with AI-generated artwork per scene.