Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

105 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StoryPath

AI-Powered Choose-Your-Own-Adventure Story Game

An interactive storytelling experience where every choice writes your tale. Create stories across multiple genres, play through branching narratives, and compile completed stories into illustrated storybooks.

Features

  • AI-Powered Storytelling: Claude Sonnet 4.6 generates dynamic, branching narratives
  • Choose Your Own Adventure: Click-based choice system with meaningful consequences
  • Scene Illustrations: FLUX 1.1 Pro Ultra generates artwork for every scene
  • TTS Narration: gpt-4o-mini-tts reads stories aloud with dramatic expression
  • Bilingual: Full English and Japanese support (with furigana)
  • Book Compilation: Completed stories become illustrated storybooks
  • RAG Memory: ChromaDB + OpenAI embeddings track story context and ensure unique stories
  • Multiple Genres: Fantasy, Sci-Fi, Mystery, Adventure, Horror, Romance, Thriller
  • Difficulty Levels: Casual, Balanced, Hardcore (with real death in adult mode)
  • Password Protection: Secure your personal stories

How to Play

  1. Visit https://storypath.vodbase.net
  2. Create a new story — choose genre, difficulty, maturity level, language, protagonist
  3. Read the narrative and make choices to drive the story
  4. Stories save automatically and appear on the home shelf
  5. Completed stories can be compiled into illustrated storybooks

Architecture

Component Technology
Server Node.js + Express (port 3004)
Story AI Claude Sonnet 4.6 (Anthropic)
Images FLUX 1.1 Pro Ultra (Replicate)
Outpainting Gemini 2.0 Flash (Google)
TTS gpt-4o-mini-tts (OpenAI)
Embeddings text-embedding-3-small (OpenAI) + ChromaDB
Database SQLite (one DB per story)
Frontend Pure HTML/CSS/JS (no frameworks)
Process PM2

API Endpoints

Endpoint Method Description
/health GET Health check
/api/stories GET List all stories
/api/story/create POST Create new story
/api/story/:id GET Get story details
/api/story/:id/choice GET/POST Make a choice (SSE streaming)
/api/story/:id/image/:sceneNumber GET Check image status
/api/story/:id/history GET Get all scenes
/api/story/unlock POST Verify password
/api/story/:id/compile-book POST Start book compilation
/api/story/:id/book-status GET Check compilation progress
/api/tts POST Generate TTS audio

Environment Variables

Set in /home/admin/.env.secrets:

ANTHROPIC_API_KEY=...      # Claude API
REPLICATE_API_TOKEN=...    # FLUX image generation
OPENAI_API_KEY=...         # TTS + embeddings
GOOGLE_AI_API_KEY=...      # Gemini outpainting

Development

cd /opt/storypath
npm install
npm run dev    # nodemon auto-reload

Production

pm2 start ecosystem.config.js
pm2 reload storypath   # Zero-downtime restart
pm2 logs storypath     # View logs

Database Schema

Each story gets its own SQLite database in stories/:

  • stories — Metadata, protagonist, password hash, completion state
  • scenes — Narrative text, image prompts, scene progression
  • choices — Player options per scene
  • story_events — RAG memory (plot points, choices, discoveries)
  • inventory_items — Items collected/lost
  • relationships — NPC relationship tracking

Security

  • bcrypt password hashing
  • JWT session tokens
  • Input sanitization (sanitize-html)
  • Rate limiting (general, auth, creation)
  • CORS whitelist
  • UUID validation for all story IDs

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages