Transform educational content into engaging, interactive stories for children in grades KG-1 through Grade 7.
This project enforces strict development discipline through automated global rules. All contributors must follow these guidelines:
.roo/rules/01-architectural-integrity.md- Architecture principles and component responsibilities.roo/rules-code/01-pro-coding.md- Coding standards and best practices.roo/rules/memory-sync.md- Memory management and task tracking
PROJECT_CONTEXT.md- Single source of truth for project architectureTASK_HISTORY.md- Complete task tracking and decision logscripts/validate_memory.py- Automated memory validationscripts/check_orphaned.py- Orphaned component detection
- Pre-commit hooks - Validate memory sync and code quality
- CI/CD integration - Automated checks on every commit
- Memory validation - Ensures consistency across all files
- Read memory files before starting any task
- Update memory immediately after changes
- Run validation before committing:
python scripts/validate_memory.py - Check for orphans:
python scripts/check_orphaned.py
For detailed rules, see the rule files in .roo/ directory.
- π Document Upload: Support for PDF and DOCX files
- π Character Selection: Choose from 5 unique AI guide characters
- π¨ Dynamic Scene Generation: AI-generated anime/cartoon-style illustrations
- ποΈ Expressive Voiceovers: Natural text-to-speech narration
- π Grade-Level Adaptation: Content automatically adjusted for age groups
- π¬ Interactive Playback: Visual novel-style presentation with controls
- π‘ Learning Points: Key concepts highlighted in each scene
- π Document Upload: Support for PDF and DOCX files
- π Character Selection: Choose from 5 unique AI guide characters
- π¨ Dynamic Scene Generation: AI-generated anime/cartoon-style illustrations
- ποΈ Expressive Voiceovers: Natural text-to-speech narration
- π Grade-Level Adaptation: Content automatically adjusted for age groups
- π¬ Interactive Playback: Visual novel-style presentation with controls
- π‘ Learning Points: Key concepts highlighted in each scene
- Document Processing: PDF/DOCX text extraction
- AI Orchestration: LangChain workflow management
- Script Generation: GPT-4 for educational screenplay creation
- Image Generation: Stable Diffusion/DALL-E for scene visuals
- Voice Synthesis: ElevenLabs for expressive narration
- Scene Assembly: Timeline synchronization
- File Upload Interface: Drag-and-drop document upload
- Avatar Selection: Interactive character chooser
- Story Player: Synchronized media playback
- Responsive Design: Works on desktop and mobile
- OpenAI GPT-4: Content adaptation and screenplay writing
- Stable Diffusion/DALL-E 3: Consistent character images
- ElevenLabs: High-quality voice generation
- Python 3.11+
- Node.js 18+
- Docker (optional, for containerized deployment)
- No API keys needed
- Completely offline
- Self-hosted models
- See FREE_SETUP_GUIDE.md for detailed instructions
Cost: $0/month | Setup Time: ~50 minutes
- Higher quality outputs
- Cloud-based processing
- API rate limits apply
- See instructions below
Cost: ~$160/month | Setup Time: 15 minutes
π Follow the FREE_SETUP_GUIDE.md
This guide includes:
- Installing Ollama for local LLM
- Setting up local Stable Diffusion
- Configuring Piper TTS
- Redis caching setup
- Clone the repository
cd EduSmart- Backend Setup
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
# Copy environment template and add your API keys
cp .env.example .env
# Edit .env with your API keys- Configure for API Mode
Edit backend/.env:
SERVICE_MODE=api
OPENAI_API_KEY=your_openai_api_key_here
STABILITY_API_KEY=your_stability_api_key_here
ELEVENLABS_API_KEY=your_elevenlabs_api_key_here- Frontend Setup
cd ../frontend
npm installStart Backend:
cd backend
python main.py
# Backend runs at http://localhost:8000Start Frontend (in new terminal):
cd frontend
npm run dev
# Frontend runs at http://localhost:3004 (VPS domain: https://edusmart.ign3el.com)# Build and run all services
docker-compose up --build
# Access the application
# Frontend: http://localhost:3004 (VPS domain: https://edusmart.ign3el.com)
# Backend API: http://localhost:8000-
Upload Document
- Drag and drop a PDF or DOCX file
- Select appropriate grade level (KG-1 to Grade 7)
- Click to proceed
-
Choose Your Guide
- Select from 5 character options:
- π§ββοΈ Wise Wizard
- π€ Friendly Robot
- πΏοΈ Smart Squirrel
- π¨βπ Space Explorer
- π¦ Dino Teacher
- Select from 5 character options:
-
Watch the Story
- AI generates 5-8 educational scenes
- Each scene includes:
- Visual illustration
- Character narration
- Key learning point
- Use playback controls to navigate
Upload educational document and initiate processing
- Body: Multipart form with file, grade_level, avatar_type
- Returns: Story ID and status
Generate complete story with AI
- Body: StoryRequest model
- Returns: Timeline with scenes, images, and audio
Retrieve generated story
- Returns: Complete story data
Get available character options
- Returns: List of avatar configurations
Edit backend/services/image_generator.py:
self.character_seeds = {
"new_character": "description with consistent visual details",
# ...
}Update frontend/src/components/AvatarSelector.jsx:
const avatars = [
{
id: 'new_character',
name: 'Character Name',
description: 'Character description',
emoji: 'π',
color: '#hexcolor'
},
// ...
]Modify backend/services/script_generator.py:
self.grade_prompts = {
8: "Explanation for grade 8...",
# Add more grades
}cd backend
pytest tests/ -vcd frontend
npm testEduSmart/
βββ backend/
β βββ main.py # FastAPI application
β βββ models/
β β βββ story.py # Data models
β βββ services/
β β βββ document_processor.py
β β βββ script_generator.py
β β βββ image_generator.py
β β βββ voice_generator.py
β β βββ scene_assembler.py
β βββ requirements.txt
β βββ .env.example
β βββ Dockerfile
βββ frontend/
β βββ src/
β β βββ components/
β β β βββ FileUpload.jsx
β β β βββ AvatarSelector.jsx
β β β βββ StoryPlayer.jsx
β β βββ App.jsx
β β βββ main.jsx
β βββ package.json
β βββ vite.config.js
β βββ Dockerfile
βββ docker-compose.yml
βββ .gitignore
βββ README.md
Backend:
- FastAPI - Modern Python web framework
- LangChain - AI workflow orchestration
- PyPDF2 - PDF text extraction
- python-docx - DOCX parsing
AI Services (Choose Your Path):
Free & Open-Source (Recommended):
- Ollama + Mistral/Llama 2 - Local LLM for screenplay
- Stable Diffusion + diffusers - Local image generation
- Piper TTS - Local voice synthesis
- Redis - Content caching
Or Premium APIs:
- OpenAI GPT-4 - Cloud-based screenplay
- Stability AI - Cloud-based image generation
- ElevenLabs - Cloud-based voice synthesis
Frontend:
- React 18 - UI library
- Vite - Build tool
- Framer Motion - Animations
- React Dropzone - File uploads
- Axios - HTTP client
Deployment:
- Docker - Containerization
- Docker Compose - Multi-container orchestration
- Nginx - Reverse proxy
- API keys stored in environment variables
- File upload size limits enforced
- Input validation on all endpoints
- CORS configured for production
- Rate limiting recommended for production
- Implement Redis caching for generated content β (Built-in)
- Use CDN for static assets
- Add database for story persistence (PostgreSQL recommended)
- Implement background task queue (Celery + Redis)
- Enable response compression
Free Path:
- Self-host all AI services (zero API costs)
- Cache generated assets locally
- Implement usage quotas per user
- Batch similar requests
API Path:
- Cache AI-generated assets
- Implement usage quotas per user
- Batch similar requests
- Use lower-cost models for initial drafts
Estimated Costs:
- Free Open-Source: $0/month (plus server hosting)
- API-Based: ~$160/month (for 1,000 stories)
Import errors in backend:
pip install -r requirements.txtFrontend won't start:
rm -rf node_modules package-lock.json
npm installAPI keys not working:
- Check
.envfile exists inbackend/ - Verify API keys are valid and have credits
- Ensure no spaces around
=in.env
Docker issues:
docker-compose down
docker-compose up --buildContributions welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.
- OpenAI for GPT-4 and DALL-E
- Stability AI for Stable Diffusion
- ElevenLabs for voice synthesis
- LangChain for orchestration framework
For issues and questions:
- Open a GitHub issue
- Check documentation at
/docsendpoint when backend is running
- Multi-language support
- Interactive quizzes after stories
- Teacher dashboard for classroom use
- Student progress tracking
- Mobile app (React Native)
- Offline mode
- Custom character creation
- Story editing tools
Built with β€οΈ for educators and students everywhere