Skip to content

Bboy9090/Rainstorms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

131 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌧️ Rainstorms

Where Stories Pour Down

Turn a one-sentence story idea into a complete children's picture-book draft in a single session.

License: MIT Frontend Backend Version


🚀 New to Rainstorms?

→ Start here: GETTING_STARTED.md — Complete step-by-step guide to get the app running locally in ~10 minutes.

→ Verify your setup: bash verify-setup.sh — Check that all dependencies and configuration are correct.


What is Rainstorms?

Rainstorms is an AI-powered children's book creation tool. Give it an idea — "a brave little robot discovers emotions" — and it generates a full story blueprint, named characters with personalities and visual descriptions, page-by-page text, and illustration prompts ready for an artist or image-generation tool. Export everything as a polished PDF in under 30 minutes.


Screenshots

Home Idea Lab Story Blueprint
Home screen Idea Lab Blueprint
Page Builder Sign In
Page Builder Auth

Features

Feature Description
💡 Idea Lab Enter your story concept, tone, age range, and page count
📋 Story Blueprint AI generates title, one-line hook, summary, theme, and a page-by-page outline
🧑‍🤝‍🧑 Character Forge Editable character cards with personality, appearance, and special traits
📖 Page Builder Generate page text and illustration prompts per page; Improve with one-click modifiers (funnier, cozier, simpler…)
🧠 Story Memory Consistency tracker keeps characters, settings, and tone coherent across all pages
📤 Export Download your book as a story PDF, prompts PDF, plain text, or JSON
🚀 Demo Project Pre-loaded "Captain Blanket and the Midnight Brother" — try the full flow instantly, no account needed
🔐 Auth (optional) Register/login to save projects; or continue as a guest

Tech Stack

Layer Technology
Frontend React Native + Expo (web, iOS, Android)
Navigation Expo Router (file-based)
Backend FastAPI (Python 3.10+)
Database MongoDB (motor async driver)
AI (text) OpenAI GPT-4.1 or Google Gemini 2.0 Flash (your own API key)
AI (images) OpenAI DALL-E 3 (your own OpenAI API key)
PDF ReportLab
Auth JWT (72-hour tokens) + bcrypt

Quick Start (local, ~10 minutes)

Prerequisites

  • Python 3.10+ and pip
  • Node 18+ and npm
  • MongoDB — local instance (mongod) or a free MongoDB Atlas cluster
  • An OpenAI API key (for AI text + image generation) — get one at platform.openai.com/api-keys
    • Alternatively, a Google Gemini API key can be used for text generation — get one at aistudio.google.com

1 — Clone and configure

git clone https://github.com/Bboy9090/Rainstorms.git
cd Rainstorms

# Backend config
cp backend/.env.example backend/.env
# Edit backend/.env — set MONGO_URL and OPENAI_API_KEY (and optionally GEMINI_API_KEY)

# Frontend config (defaults to localhost:8001 — no changes needed for local dev)
cp frontend/.env.example frontend/.env

2 — One-command startup

bash start.sh

This script:

  1. Installs Python deps into backend/.venv
  2. Installs Node deps in frontend/
  3. Starts the FastAPI backend on http://localhost:8001
  4. Starts the Expo web frontend on http://localhost:8081

Then open http://localhost:8081 in your browser.

Want to try without AI keys? Click "Try Demo Project" on the home screen — the full demo story is pre-loaded from the backend and requires no API calls.


Manual Setup (step-by-step)

Click to expand

Backend

cd backend
python3 -m venv .venv
source .venv/bin/activate          # Windows: .venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env               # fill in MONGO_URL and OPENAI_API_KEY
uvicorn server:app --host 0.0.0.0 --port 8001 --reload

API docs available at http://localhost:8001/docs

Frontend

cd frontend
npm install --legacy-peer-deps
cp .env.example .env               # defaults are fine for local dev
npx expo start --web               # opens browser automatically

For mobile: scan the QR code with Expo Go (iOS/Android).


Demo User Journey

No account or API key required for the demo path.

  1. Open http://localhost:8081
  2. Click "Try Demo Project" → lands on the Story Blueprint
  3. Read the title, hook, summary, theme, and 10-page outline
  4. Click "Accept Blueprint" → Character Forge (view Oliver and Baby Max)
  5. Navigate to Page Builder → page text and illustration prompts are pre-filled
  6. Click "Export" → download the story PDF

Build & Test

Frontend lint + type-check

cd frontend
npm install --legacy-peer-deps
npx expo lint           # ESLint

Frontend static web build

cd frontend
npx expo export --platform web   # outputs to frontend/dist/

Backend API tests

# Requires a running backend (backend running on localhost:8001)
cd ..
python backend_test.py

All 22 tests should pass (health, auth, demo project, CRUD, AI generation, export, story memory).


Examples & Demo Media

Explore real outputs from Rainstorms to see what the platform can create:

📂 /examples — Sample book exports, illustration examples, and demo media

Resource Description
📚 Sample PDFs Complete storybook exports: Robot Emotions and Captain Blanket
🎨 Illustration Samples Character reference sheets and page spreads (examples/images)
🎬 Demo GIF Animated walkthrough of the full creation flow (demo-script.md)

These examples demonstrate Rainstorms' capabilities from concept to finished book, using the same AI-assisted pipeline available to all users.

Note: Placeholder files indicate where final assets will be placed. See examples/README.md for details on generating these samples.


Project Structure

Rainstorms/
├── backend/
│   ├── server.py          # FastAPI app — all endpoints
│   ├── requirements.txt   # Python dependencies
│   └── .env.example       # Environment variable template
├── frontend/
│   ├── app/               # Expo Router screens (index, idea-lab, blueprint, …)
│   ├── src/
│   │   ├── components/    # Button, Card, Input, Loading, …
│   │   ├── context/       # AuthContext, ProjectContext
│   │   └── utils/         # api.ts, autosave.ts, theme.ts
│   ├── assets/            # Icons, fonts, images
│   └── .env.example       # Frontend env template
├── demo/
│   ├── captain_blanket_demo.json    # Full structured export (matches API schema)
│   ├── captain_blanket_outline.md  # Story outline and character profiles
│   └── captain_blanket_pages.md    # All 10 pages with illustration prompts
├── examples/
│   ├── README.md              # Sample exports overview
│   ├── demo-script.md         # Demo GIF capture guide
│   ├── *.pdf.README.md        # PDF placeholders (robot-emotions, captain-blanket)
│   └── images/                # Illustration samples and character reference sheets
├── docs/
│   ├── APP_VISION.md      # Product philosophy
│   ├── DEMO_FLOW.md       # Captain Blanket walkthrough of the full pipeline
│   ├── DEMO_PROJECT.md    # Demo story background and series notes
│   ├── ROADMAP.md         # 5-phase product roadmap
│   └── STORY_ENGINE.md    # AI generation architecture and API endpoints
├── schemas/
│   ├── story_blueprint.schema.json    # Blueprint JSON schema
│   ├── character_profile.schema.json  # Character JSON schema
│   └── page_layout.schema.json        # Page JSON schema
├── screenshots/           # App store-style screenshots
├── scripts/
│   └── publish-release.sh # Post-merge release script (tag + GitHub release)
├── start.sh               # One-click local dev startup
└── backend_test.py        # Full API test suite

Known Limitations (v0.1.0)

  • No image generation — illustration prompts are created but actual images are not generated; bring your own image tool (Midjourney, DALL·E, etc.)
  • Guest sessions are not persisted — work as a guest is stored only in browser memory; closing the tab loses your project unless you're signed in
  • API key costsOPENAI_API_KEY is used server-side for all AI generation; production deployments should implement per-user key management or rate limiting to control costs
  • No real-time collaboration — one user edits a project at a time
  • PDF formatting — the story PDF uses a basic ReportLab layout; custom fonts and illustrations require additional work
  • Mobile app stores — not published to App Store or Google Play in this release; run via Expo Go or the web build

MVP Scope (v0.1.0)

What's in:

  • ✅ Full story generation pipeline (idea → blueprint → characters → pages → export)
  • ✅ Story Memory consistency tracking
  • ✅ "Improve This Page" modifiers (5 styles)
  • ✅ PDF and text export
  • ✅ Optional user accounts with JWT auth
  • ✅ Pre-loaded demo project (no API key needed to explore)

What's out (planned for future versions):

  • Series / sequel support
  • AI illustration generation
  • Voice narration export
  • Publishing marketplace
  • Real-time collaboration

Production Deployment

Ready to deploy Rainstorms to production? Follow the comprehensive deployment guide:

📖 docs/DEPLOYMENT.md — Complete production deployment guide

Quick Overview

Recommended Stack:

  • Frontend: Vercel (static web hosting)
  • Backend: Railway (FastAPI + Python)
  • Database: MongoDB Atlas M0 (free tier)
  • AI: OpenAI GPT-4.1 + DALL·E 3 (or Google Gemini for text)

Estimated Cost: ~$0–5/month (starter) to ~$40–100/month (at scale)

Key Deployment Steps

  1. Create MongoDB Atlas cluster and copy connection string
  2. Generate strong JWT_SECRET
  3. Deploy backend to Railway with environment variables
  4. Build and deploy frontend to Vercel
  5. Configure custom domains (optional but recommended)
  6. Harden CORS and add rate limiting for production

Mobile Apps (Optional): After web launch, publish to iOS/Android using Expo EAS Build — no code rewrite needed.

Troubleshooting Deployments

Stories not loading? See docs/RAILWAY_SETUP.md for Railway + Vercel-specific troubleshooting.


Contributing

  1. Fork the repo and create a feature branch
  2. Follow the existing code style (TypeScript strict mode on frontend, FastAPI patterns on backend)
  3. Run npx expo lint (frontend) and python backend_test.py (backend) before opening a PR
  4. Open a pull request against main with a clear description

License

MIT © 2024 Rainstorms

About

rainstorms is an AI-powered children's book creation tool. Give it an idea — "a brave little robot discovers emotions" — and it generates a full story blueprint, named characters with personalities and visual descriptions, page-by-page text, and illustration prompts ready for an artist or image-generation tool.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors