Skip to content

Ker102/StoryForge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

105 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

StoryForge

StoryForge

πŸŽ™οΈ Talk to create. ✨ Watch it come alive.

A real-time, voice-driven storybook generator powered by Google Gemini.
Speak your ideas. Get illustrated pages. Download your book.

Live Demo

Gemini Live API Gemini 2.5 Flash Imagen 3 React FastAPI Firebase

CI CodeQL Dependabot License


🎯 What is StoryForge?

StoryForge lets anyone β€” especially kids β€” talk their stories into existence. You speak to Quill, a friendly AI creative companion, who listens to your ideas, asks follow-up questions, and generates a fully illustrated storybook page by page.

"I want a brave little fox who finds a magical forest…"

Quill responds, asks about the fox's name, what the forest looks like, and then β€” boom β€” a watercolor-illustrated page appears on screen with narration.


✨ Key Features

πŸŽ™οΈ Voice-First Storytelling

Talk naturally with Quill via the Gemini Live API. No typing required β€” just speak your ideas and watch them become pages.

🎨 AI Illustrations

Every page gets a unique illustration generated by Imagen 3, locked to your chosen visual style (watercolor, line art, retro pixel, etc.).

πŸ“– One-Click PDF Export

Download your completed storybook as a beautifully formatted PDF with illustrations, page numbers, and a title page.

πŸ›‘οΈ Child-Safe by Design

Built-in content safety checks ensure all generated text and images are appropriate for the selected age group (5-8, 9-12, 13-17).

πŸ”Š Story Narration

Each page is narrated aloud by a warm storybook narrator voice (separate from Quill's conversational voice), powered by Gemini TTS.

⚑ Real-Time Pipeline

Text, illustration, and narration generate in parallel β€” pages appear in seconds, not minutes.


πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     Frontend (React)                    β”‚
β”‚              Voice Input  ←→  Story Display             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚ WebSocket + REST APIs
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   FastAPI Backend                        β”‚
β”‚                                                         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚  Gemini Live  │───▢│ Orchestrator │──▢│   State    β”‚ β”‚
β”‚  β”‚  (Quill πŸ¦‰)  β”‚    β”‚  (Pipeline)  β”‚   β”‚  Manager   β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                             β”‚                           β”‚
β”‚              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”            β”‚
β”‚              β–Ό              β–Ό              β–Ό            β”‚
β”‚     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”‚
β”‚     β”‚ Story Writer  β”‚ β”‚  Imagen   β”‚ β”‚ Narration  β”‚      β”‚
β”‚     β”‚ (Gemini 2.5)  β”‚ β”‚  (Art 🎨) β”‚ β”‚  (TTS πŸ”Š)  β”‚      β”‚
β”‚     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Quick Start

Prerequisites

  • Node.js 20+
  • Python 3.11+
  • A Google AI API key
  • A Firebase Project (for Authentication, Firestore, and Storage)

Setup

# Clone the repo
git clone https://github.com/Ker102/StoryForge.git
cd StoryForge

# Install frontend dependencies
cd client
npm install

# Install backend dependencies
cd ../backend
python -m venv .venv
source .venv/bin/activate  # or .venv\Scripts\activate on Windows
pip install -e ".[dev]"

# Configure environment
cp .env.example .env.storyforge
# Edit .env.storyforge and add your API keys + Firebase config

# Run the stack
# Terminal 1 (Backend)
uvicorn app.main:app --reload --port 8000

# Terminal 2 (Frontend)
cd ../client
npm run dev

πŸ“ Project Structure

StoryForge/
β”œβ”€β”€ client/                  # React + Vite frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/      # UI components (StoryReader, loading screens)
β”‚   β”‚   β”œβ”€β”€ hooks/           # custom audio processing, WebSocket hooks
β”‚   β”‚   └── lib/             # Firebase init
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ main.py              # FastAPI app + static routing
β”‚   β”‚   β”œβ”€β”€ models/              # StoryState, Page, Character
β”‚   β”‚   β”œβ”€β”€ services/            # Pipeline coordinators & agents
β”‚   β”‚   β”‚   β”œβ”€β”€ orchestrator.py  # Page generation pipeline
β”‚   β”‚   β”‚   β”œβ”€β”€ live_session.py  # Gemini Live API (Quill)
β”‚   β”‚   β”‚   β”œβ”€β”€ story_writer.py  # Gemini 2.5 Flash text gen
β”‚   β”‚   β”‚   β”œβ”€β”€ firestore_service.py # Firebase Persistence
β”‚   β”‚   β”‚   └── export_service.py    # PDF generation
β”‚   β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”‚   β”œβ”€β”€ ws.py            # Real-time WebSockets
β”‚   β”‚   β”‚   └── api.py           # REST endpoints
β”‚   β”œβ”€β”€ pyproject.toml
β”‚   └── ruff.toml

πŸ€– AI Models Used

Role Model Purpose
πŸ¦‰ Creative Companion gemini-2.5-flash System instructed with FunctionTools to intercept story triggers and converse using Live WebSockets
⚑ Story Writer gemini-2.5-flash Structured story text generation following user prompts
🎨 Illustrator imagen-3.0-generate-002 Page illustrations
πŸ”Š Narrator gemini-2.5-flash-tts-preview Story narration audio

πŸ›‘οΈ Security & Dependability

  • CodeQL scanning on every PR and weekly
  • Dependabot for automated dependency updates
  • pip-audit for Python dependency vulnerability scanning
  • Ruff with bandit security rules enforced in CI
  • Firebase Auth securing REST API endpoints via token verification
  • See SECURITY.md for vulnerability reporting

πŸ—ΊοΈ Roadmap

  • Backend scaffold with FastAPI
  • AI service integration (Live, Writer, Imagen, TTS)
  • WebSocket real-time communication
  • CI/CD pipeline + security scanning
  • Modern React/Vite Frontend
  • Google Login + Firebase Persistence
  • Cloud Run Serverless Deployment
  • Multi-language story support
  • Collaborative storytelling (multiplayer)

πŸ“„ License

MIT β€” see LICENSE for details.



Built with ❀️ for the Gemini Live Hackathon

About

No description, website, or topics provided.

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors