A gamepad-style interface for exploring branching narratives with AI text generation.
- 🎮 Gamepad-style interface with keyboard controls
- 🌳 Multiple story trees with branching narratives
- 🤖 AI-powered text generation
- 💾 Automatic local storage
- 🎯 Focus-driven navigation
- 📱 Progressive Web App (PWA) - Install to home screen, works offline
- Install dependencies:
bun i- Set up environment variables:
- Create a
.envfile - Add your OpenRouter API key:
OPENROUTER_API_KEY=your_key_here
- Start development server:
bun run devThe interface is designed around a gamepad metaphor:
┌───────────────────┐
│ Story Text │
│ │
│ [Navigation Dots]│
├───────┬─────┬────┤
│ D-Pad │ A B │ ···│
└───────┴─────┴────┘
- Arrow Keys/D-Pad: Navigate through story tree
- Up/Down: Move through story progression
- Left/Right: Switch between branches
- Enter/A Button: Generate new continuation
- Backspace/B Button: Edit current text
- ~/Select: Open settings menu
- Escape/Start: Switch between stories
Press Enter/Start to:
- Create new stories
- Switch between stories
- Delete stories
- All changes auto-save
Press Tab/Select to adjust:
- Model selection
- Temperature (randomness)
- Max tokens (length)
- Top P (variety)
- Use Up/Down to follow main thread
- Use Left/Right to explore alternatives
- Watch navigation dots for branch locations
client/- Frontend React codeinterface/- UI components and hooksassets/- Static resources
server/- Backend API and servicesapis/- HTTP and WebSocket endpoints
shared/- Common types and utilities
bun run dev- Start development server with hot reloadbun run build- Build for productionbun run prod- Run production serverbun run lint- Run ESLint
- Built with Bun + React + Vite
- TypeScript throughout
- OpenRouter API for text generation
- Local storage for persistence
- Server-side rendering enabled
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
LoomPad is now a full PWA with:
- Install to home screen on mobile/desktop
- Runs in standalone mode (no browser UI)
- Custom app icons and splash screen
- Works offline for reading saved stories
- Automatic service worker caching
- Network detection with graceful degradation
- Background updates download automatically
- Seamless version management
# Build and run production server
bun run build
bun run prod
# Open http://localhost:4000
# Look for install prompt in browser
# Test offline mode in DevToolsSee docs/PWA.md for detailed implementation guide.
MIT License - see LICENSE file for details