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.
- 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
- Visit https://storypath.vodbase.net
- Create a new story — choose genre, difficulty, maturity level, language, protagonist
- Read the narrative and make choices to drive the story
- Stories save automatically and appear on the home shelf
- Completed stories can be compiled into illustrated storybooks
| 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 |
| 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 |
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 outpaintingcd /opt/storypath
npm install
npm run dev # nodemon auto-reloadpm2 start ecosystem.config.js
pm2 reload storypath # Zero-downtime restart
pm2 logs storypath # View logsEach 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
- bcrypt password hashing
- JWT session tokens
- Input sanitization (sanitize-html)
- Rate limiting (general, auth, creation)
- CORS whitelist
- UUID validation for all story IDs
MIT