"Hey Lois, remember when I became an AI-powered educational content creator? Nyehehehe!"
Welcome to Professor Peter - the most ridiculous yet surprisingly effective educational video generator on the internet! π
Professor Peter is an AI-powered educational video generator that creates hilarious yet informative content using Peter Griffin's voice and personality. Because nothing says "quality education" quite like having a cartoon dad from Rhode Island explain quantum physics, right?
- π§ AI Script Generation: Uses Google's Gemini AI to create Peter Griffin-style educational scripts
- π€ Voice Synthesis: Converts scripts to audio using ElevenLabs TTS (with Peter's unmistakable voice)
- π¬ Video Compilation: Merges everything with video templates and subtitles
- π¨ Beautiful UI: A sleek Next.js frontend that doesn't look like it was designed by Peter himself
- π Full-Stack Magic: FastAPI backend + Next.js frontend = Chef's kiss
Great question! Sometimes the best way to learn complex topics is through humor and memorable characters. Plus, who doesn't want to hear Peter Griffin explain the intricacies of machine learning or the fundamentals of calculus?
"Hey Brian, did you know that neural networks are like my brain, but actually functional?"
Want to get this thing running ASAP? We got you covered:
git clone <your-repo-url>
cd ProfessorPeters
chmod +x start-dev.sh
./start-dev.sh
Then visit http://localhost:3000
and watch the magic happen! πͺ
- Python 3.12+ (because we're fancy like that)
- Node.js 18+ (for the frontend goodness)
- uv (Python package manager - recommended)
- Git (obviously)
FFmpeg is required to process and merge audio and video.
- Download FFmpeg from https://ffmpeg.org/download.html
(or directly from gyan.dev builds) - Extract the ZIP to a folder like
C:\ffmpeg
- Add
C:\ffmpeg\bin
to your systemPATH
:- Open System Properties β Environment Variables
- Under System Variables, find
Path
, click Edit, and add:
C:\ffmpeg\bin
- Verify installation:
ffmpeg -version
sudo apt update
sudo apt install ffmpeg
ffmpeg -version
brew install ffmpeg
ffmpeg -version
β Ensure
ffmpeg
is accessible in your system PATH for video generation to work properly.
The backend is where all the Peter Griffin magic happens!
# Navigate to the backend directory
cd backend
# Install uv if you haven't already (highly recommended!)
# On macOS/Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh
# On Windows:
# powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
# Add dependencies to your project
uv add fastapi uvicorn python-dotenv httpx google-generativeai elevenlabs
# Sync your environment (installs all dependencies)
uv sync
# Create your environment file
cp env.example .env
# Run the backend
uv run start.py
Backend will be available at:
- π API Server:
http://localhost:8000
- π Interactive Docs:
http://localhost:8000/docs
- π Alternative Docs:
http://localhost:8000/redoc
The frontend is where users interact with our Peter Griffin professor!
# Navigate to the frontend directory
cd client
# Install dependencies
npm install
# Start the development server
npm run dev
Frontend will be available at:
- π¨ Web App:
http://localhost:3000
Edit backend/.env
with your API keys (optional for demo mode):
# AI Magic (Optional - works in demo mode without these)
GEMINI_API_KEY=your_google_gemini_api_key_here
TTS_API_KEY=your_elevenlabs_api_key_here
# Server Settings
HOST=0.0.0.0
PORT=8000
DEBUG=true
FRONTEND_URL=http://localhost:3000
# Video Settings
MAX_VIDEO_DURATION=60
- Visit Google AI Studio
- Create a new API key
- Add it to your
.env
asGEMINI_API_KEY
- Sign up at ElevenLabs
- Go to Profile β API Keys
- Create a new API key
- Add it to your
.env
asTTS_API_KEY
Don't have API keys? No problem! The app works in demo mode with mock responses.
-
Clone the Repository
git clone <your-repo-url> cd ProfessorPeters
-
One-Command Setup (The lazy way)
./start-dev.sh
This script handles everything automatically!
-
Manual Setup (The control-freak way)
# Backend cd backend uv sync uv run start.py & # Frontend (in another terminal) cd client npm install npm run dev
-
Start Creating!
- Open
http://localhost:3000
- Enter a topic (e.g., "quantum physics" or "how to make a sandwich")
- Watch Peter Griffin explain it like only he can!
- Open
# Install everything
uv add <package-name> # Add Python packages
uv sync # Install all dependencies
uv run <script> # Run Python scripts
# Development commands
cd backend && uv run start.py # Start backend
cd client && npm run dev # Start frontend
cd client && npm run build # Build for production
ProfessorPeters/
βββ π backend/ # FastAPI backend
β βββ π main.py # API routes & magic
β βββ π models.py # Pydantic models
β βββ βοΈ config.py # Configuration
β βββ π script.py # AI script generation
β βββ π¬ video_compiler.py # Video processing
β βββ π€ audio.py # TTS generation
β βββ π¦ pyproject.toml # Python dependencies
β βββ π§ requirements.txt # Backup dependencies
βββ π client/ # Next.js frontend
β βββ π src/app/ # App router pages
β βββ π src/components/ # React components
β βββ π¨ globals.css # Global styles
β βββ π¦ package.json # Node dependencies
βββ π start-dev.sh # Development startup script
βββ π README.md # You are here!
The backend provides a comprehensive REST API:
Method | Endpoint | Description |
---|---|---|
POST |
/api/generate-video |
Create a Peter Griffin educational video |
GET |
/api/video/{id}/status |
Check video generation progress |
GET |
/api/video/{id}/download |
Download your masterpiece |
POST |
/api/generate-script |
Just the script, please |
GET |
/api/templates |
Available video templates |
GET |
/health |
Is this thing working? |
"The backend won't start!"
- Check if port 8000 is already in use
- Make sure you're in the
backend
directory - Try
uv sync
to reinstall dependencies
"The frontend is broken!"
- Delete
node_modules
and runnpm install
again - Check if port 3000 is available
- Make sure you're in the
client
directory
"My videos are terrible!"
- That's not a bug, that's Peter Griffin being Peter Griffin
- Try different prompts for better results
- Check your API keys are working
"I don't have API keys!"
- No worries! The app works in demo mode
- You'll get mock responses that are still entertaining
- Check the logs in your terminal
- Visit
http://localhost:8000/docs
for API documentation - Try the
/health
endpoint to check system status - When all else fails, ask yourself: "What would Peter do?"
Want to make Professor Peter even more ridiculous? We welcome contributions!
- Fork the repository
- Create a feature branch
- Make your changes
- Test everything works
- Submit a pull request
This project is licensed under the "Please Don't Sue Us, We're Just Having Fun" license.
Actually, check the LICENSE file for real legal stuff.
- Peter Griffin - For being the inspiration (and hopefully not suing us)
- Google Gemini - For making AI script generation possible
- ElevenLabs - For incredible voice synthesis technology
- FastAPI & Next.js - For making web development not completely terrible
- The Internet - For being weird enough that this project makes sense
"Hey Lois, I think I just revolutionized education! Nyehehehe!" π
Made with β€οΈ and way too much caffeine by Team Prof. Peters Students for MLSA Internal Hackathon 2025.
Mentor:
- Soham Roy
Members:
- Kartikeya Trivedi
- Vaibhav Deep Srivastava
- Yash Raj Gupta
- Vaibhav Raj
- Aditya Shukla
- Sidhi Kumari