Skip to content

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽญ StoryForge AI - AI-Powered Story Generator

StoryForge AI Banner

Node.js React TypeScript Tailwind CSS Google AI

Generate captivating 5-scene stories with AI-powered illustrations

โœจ Live Demo โ€ข ๐Ÿš€ Quick Start โ€ข ๐Ÿ“– Documentation โ€ข ๐ŸŽฏ Features


๐ŸŒŸ What is StoryForge AI?

StoryForge AI is an innovative storytelling platform that leverages advanced AI to create immersive 5-scene narratives with automatically generated images. Perfect for writers, educators, content creators, and anyone who loves great stories!

๐ŸŽช Story Structure

graph LR
    A[Scene 1: Opening Hook] --> B[Scene 2: World Building]
    B --> C[Scene 3: Rising Action]
    C --> D[Scene 4: Climax]
    D --> E[Scene 5: Resolution]
    
    style A fill:#e1f5fe
    style B fill:#f3e5f5
    style C fill:#fff3e0
    style D fill:#ffebee
    style E fill:#e8f5e8
Loading

โœจ Demo

๐ŸŽฌ Click to see StoryForge AI in action!

Sample Generated Story

Idea: "A detective cat solves mysteries in a magical bakery"

Scene Content Preview AI-Generated Image
๐ŸŽญ Scene 1 Inspector Pounce stretched lazily in his sun-drenched office... Scene 1
๐Ÿฐ Scene 2 The enchanted bakery buzzed with worried energy... Scene 2
โšก Scene 3 Following glittering clues through the mystical garden... Scene 3
๐ŸŽฏ Scene 4 The confrontation with the mischievous Pixie-Squirrel... Scene 4
๐ŸŽŠ Scene 5 Peace restored, everyone enjoying magical treats together... Scene 5

User Interface

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                StoryForge AI                        โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ ๐Ÿ’ก Story Idea: [A magical cat opens a restaurant]   โ”‚
โ”‚ ๐ŸŽญ Genre:     [Fantasy โ–ผ]                          โ”‚
โ”‚ ๐ŸŽจ Tone:      [Whimsical โ–ผ]                        โ”‚
โ”‚ ๐Ÿ‘ฅ Audience:  [Children โ–ผ]                         โ”‚
โ”‚                                                     โ”‚
โ”‚           [โœจ Generate Story]                       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Google Gemini API Key (Get one here)

๐ŸŽฏ One-Command Setup

# Clone the repository
git clone https://github.com/your-username/story-generator.git
cd story-generator

# Install dependencies for both backend and frontend
npm run install:all

# Set up environment variables
cp backend/.env.example backend/.env
# Add your GEMINI_API_KEY to backend/.env

# Start the development servers
npm run dev

๐ŸŒ Manual Setup

Click for detailed setup instructions

Backend Setup

cd backend
npm install

# Create environment file
echo "GEMINI_API_KEY=your_api_key_here" > .env
echo "PORT=3000" >> .env

# Start backend server
npm start

Frontend Setup

cd frontend
npm install

# Start development server
npm run dev

๐ŸŽ‰ You're Ready!

Open your browser to http://localhost:5173 and start creating amazing stories!


๐ŸŽฏ Features

๐Ÿค– AI-Powered Story Generation

  • Gemini 2.5 Flash for intelligent narrative creation
  • 5-Scene Structure with perfect story arc
  • Genre-Specific writing (Fantasy, Sci-Fi, Mystery, Romance, etc.)
  • Tone Adaptation (Adventurous, Whimsical, Dark, Heartwarming)
  • Audience Targeting (Children, Young Adult, General, Adult)

๐ŸŽจ Automatic Image Generation

  • Scene-Specific Images generated for each scene
  • AI-Analyzed Prompts based on actual scene content
  • Multiple Services: Imagen-4, Pollinations.ai with smart fallbacks
  • High-Quality Output with professional styling

๐Ÿ’ป Interactive User Experience

  • Real-Time Generation with progress tracking
  • Full-Size Image Viewer with download capability
  • Smooth Scene Navigation - click scene numbers to jump
  • Edit & Regenerate individual scenes
  • Mobile Responsive design

๐Ÿ”ง Developer Features

  • TypeScript for type safety
  • Comprehensive Testing suite
  • Error Handling with graceful fallbacks
  • Modular Architecture for easy extension
  • API Documentation included

๐Ÿ—๏ธ Architecture

graph TB
    subgraph "Frontend (React + TypeScript)"
        A[Story Input Form] --> B[Loading Screen]
        B --> C[Story Display]
        C --> D[Scene Cards]
        D --> E[Image Modal]
    end
    
    subgraph "Backend (Node.js + Express)"
        F[Story Generation API] --> G[Image Generation API]
        G --> H[Fallback Services]
    end
    
    subgraph "AI Services"
        I[Google Gemini 2.5 Flash]
        J[Imagen-4]
        K[Pollinations.ai]
    end
    
    A --> F
    F --> I
    G --> J
    H --> K
    
    style A fill:#e3f2fd
    style F fill:#f3e5f5
    style I fill:#e8f5e8
Loading

๐Ÿ“– Documentation

๐Ÿ”Œ API Endpoints

POST /api/stories/generate-text - Generate 5-scene story
// Request
{
  "idea": "A robot chef discovers emotions through cooking",
  "settings": {
    "genre": "Science Fiction",
    "tone": "Heartwarming",
    "audience": "General"
  }
}

// Response
{
  "id": "1704123456789",
  "idea": "A robot chef discovers emotions through cooking",
  "settings": { ... },
  "scenes": [
    {
      "id": "1",
      "title": "Scene 1",
      "text": "In the sterile chrome kitchen of Neo-Tokyo...",
      "imagePrompt": "A sleek robot chef in a futuristic kitchen..."
    },
    // ... 4 more scenes
  ],
  "createdAt": "2024-01-01T12:00:00.000Z"
}
POST /api/stories/generate-image - Generate scene image
// Request
{
  "imagePrompt": "A sleek robot chef in a futuristic kitchen, discovering emotions through cooking",
  "sceneId": "1"
}

// Response
{
  "imageUrl": "https://image.pollinations.ai/prompt/...",
  "sceneId": "1",
  "generated": true,
  "service": "Pollinations",
  "fallback": false
}

๐Ÿงช Testing

# Run all tests
npm test

# Test story generation
npm run test:story

# Test image generation  
npm run test:images

# Test complete flow
npm run test:full

๐ŸŽ›๏ธ Configuration

Environment Variables
# Backend (.env)
GEMINI_API_KEY=your_gemini_api_key_here
PORT=3000
NODE_ENV=development

# Optional: Google Cloud credentials for Imagen-4
GOOGLE_APPLICATION_CREDENTIALS=/path/to/credentials.json

๐ŸŽจ Customization

๐ŸŽญ Adding New Genres

// In frontend/src/components/StoryInput.tsx
const genres = [
  'Fantasy', 'Science Fiction', 'Mystery', 'Romance',
  'Horror', 'Adventure', 'Historical Fiction',
  'Your Custom Genre' // Add here
];

๐ŸŽจ Adding New Tones

const tones = [
  'Adventurous', 'Whimsical', 'Dark', 'Heartwarming',
  'Epic', 'Humorous', 'Mysterious',
  'Your Custom Tone' // Add here
];

๐Ÿ–ผ๏ธ Image Service Configuration

Adding custom image generation services
// In backend/controllers/storyController.js
const fallbackServices = [
  {
    name: 'Your Custom Service',
    url: `https://your-api.com/generate?prompt=${encodeURIComponent(cleanPrompt)}`
  },
  // ... existing services
];

๐Ÿšง Development

๐Ÿ“‚ Project Structure

story-generator/
โ”œโ”€โ”€ ๐Ÿ“ backend/
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ controllers/     # API logic
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ routes/         # Express routes  
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ data/          # Data management
โ”‚   โ””โ”€โ”€ ๐Ÿ“„ server.js      # Main server
โ”œโ”€โ”€ ๐Ÿ“ frontend/
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ src/
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ components/ # React components
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ types/     # TypeScript types
โ”‚   โ”‚   โ””โ”€โ”€ ๐Ÿ“„ App.tsx    # Main app
โ”‚   โ””โ”€โ”€ ๐Ÿ“„ package.json
โ”œโ”€โ”€ ๐Ÿ“„ README.md
โ””โ”€โ”€ ๐Ÿ“„ package.json

๐Ÿ› ๏ธ Development Commands

# Start development servers
npm run dev              # Both frontend and backend
npm run dev:frontend     # Frontend only
npm run dev:backend      # Backend only

# Build for production
npm run build           # Build frontend
npm run build:all       # Build everything

# Testing
npm run test:story      # Test story generation
npm run test:images     # Test image generation
npm run test:ai         # Test AI integrations

# Utilities
npm run format          # Format code with Prettier
npm run lint           # Run ESLint
npm run type-check     # TypeScript type checking

๐Ÿค Contributing

We love contributions! Here's how to get started:

๐ŸŽฏ Quick Contribution Guide

Click to expand contribution steps
  1. Fork the repository

    gh repo fork your-username/story-generator
  2. Create a feature branch

    git checkout -b feature/amazing-feature
  3. Make your changes

    • Add new features
    • Fix bugs
    • Improve documentation
  4. Test your changes

    npm test
    npm run test:full
  5. Commit with conventional format

    git commit -m "feat: add amazing new feature"
  6. Push and create PR

    git push origin feature/amazing-feature

๐ŸŽจ Contribution Ideas

  • ๐ŸŒ Multi-language support
  • ๐ŸŽต Audio narration for stories
  • ๐Ÿ“ฑ Mobile app version
  • ๐ŸŽฎ Interactive story modes
  • ๐Ÿ“Š Story analytics dashboard
  • ๐Ÿค Collaborative editing
  • ๐Ÿ“š Story collections & sharing
  • ๐ŸŽจ Custom illustration styles

๐Ÿ“Š Performance & Stats

โšก Performance Metrics

Metric Average Excellent
๐Ÿ“ Story Generation 30-60s โœ…
๐ŸŽจ Image Generation 5-10s per image โœ…
๐Ÿ“ฑ App Load Time < 2s โœ…
๐Ÿ”„ Success Rate 99%+ โœ…

๐Ÿ“ˆ Capabilities

  • Languages Supported: English (more coming soon!)
  • Genres Available: 15+ genres
  • Image Styles: Professional digital artwork
  • Concurrent Users: Scales with your infrastructure
  • Story Length: 1000-2000 words (optimal range)

๐Ÿ”ง Troubleshooting

Common Issues & Solutions

โ“ Stories not generating

# Check API key
echo $GEMINI_API_KEY

# Test API connection
curl http://localhost:3000/api/stories/

โ“ Images not showing

# Test image generation
npm run test:images

# Check fallback services
curl "https://image.pollinations.ai/prompt/test"

โ“ Frontend not loading

# Clear cache and reinstall
rm -rf node_modules package-lock.json
npm install
npm run dev

โ“ Port conflicts

# Check what's using port 3000
lsof -i :3000

# Use different port
PORT=3001 npm start

๐Ÿ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT License - feel free to use this project for personal and commercial purposes!

๐Ÿ™ Acknowledgments

๐Ÿค– AI Services

  • Google Gemini for intelligent story generation
  • Imagen-4 for high-quality image generation
  • Pollinations.ai for reliable image fallbacks

๐Ÿ› ๏ธ Technologies

  • React & TypeScript for the frontend
  • Node.js & Express for the backend
  • Tailwind CSS for beautiful styling
  • Lucide React for icons

๐ŸŽจ Inspiration

Special thanks to the storytelling community and AI researchers making creative AI accessible to everyone.


๐Ÿ“ž Support & Contact

๐Ÿ’ฌ Get in Touch

GitHub Issues Email Discord

Found a bug? Create an issue
Have a feature idea? Start a discussion
Need help? Check our documentation or ask in Discord


โญ Enjoying StoryForge AI?

Give us a star! โญ It helps others discover this project.

Star History Chart

Made with โค๏ธ by developers who love great stories


๐Ÿ—บ๏ธ Roadmap

๐ŸŽฏ Version 2.0 (Coming Soon)

  • ๐ŸŒ Multi-language story generation
  • ๐ŸŽต Text-to-speech narration
  • ๐Ÿ“ฑ Progressive Web App (PWA)
  • ๐ŸŽฎ Interactive story choices
  • ๐Ÿ“Š Analytics dashboard

๐Ÿš€ Version 3.0 (Future)

  • ๐Ÿค Collaborative story editing
  • ๐Ÿ“š Story marketplace
  • ๐ŸŽจ Custom art styles
  • ๐Ÿ”— API for third-party integrations

Ready to create amazing stories? Get started now! ๐Ÿš€

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages