Skip to content

MLSAKIIT/professorpeter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

professorpeter

Professor Peter πŸŽ“πŸŽ¬

"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! πŸš€

What the heck is this thing? πŸ€”

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?

The Magic Behind the Madness ✨

  • 🧠 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

Why would anyone make this? πŸ€·β€β™‚οΈ

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?"

Quick Start (For the Impatient) ⚑

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! πŸŽͺ

Detailed Setup (For the Thorough) πŸ“š

Prerequisites πŸ“‹

  • Python 3.12+ (because we're fancy like that)
  • Node.js 18+ (for the frontend goodness)
  • uv (Python package manager - recommended)
  • Git (obviously)

🎞 FFmpeg Installation & Setup

FFmpeg is required to process and merge audio and video.

πŸͺŸ Windows

  1. Download FFmpeg from https://ffmpeg.org/download.html
    (or directly from gyan.dev builds)
  2. Extract the ZIP to a folder like C:\ffmpeg
  3. Add C:\ffmpeg\bin to your system PATH:
    • Open System Properties β†’ Environment Variables
    • Under System Variables, find Path, click Edit, and add:
      C:\ffmpeg\bin
  4. Verify installation:
    ffmpeg -version

🐧 Linux (Ubuntu/Debian)

sudo apt update
sudo apt install ffmpeg
ffmpeg -version

🍎 macOS (Homebrew)

brew install ffmpeg
ffmpeg -version

βœ… Ensure ffmpeg is accessible in your system PATH for video generation to work properly.

Backend Setup 🐍

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

Frontend Setup 🎨

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

Environment Configuration πŸ”§

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

Getting API Keys πŸ”‘

Google Gemini API (For Script Generation)

  1. Visit Google AI Studio
  2. Create a new API key
  3. Add it to your .env as GEMINI_API_KEY

ElevenLabs API (For Peter's Voice)

  1. Sign up at ElevenLabs
  2. Go to Profile β†’ API Keys
  3. Create a new API key
  4. Add it to your .env as TTS_API_KEY

Don't have API keys? No problem! The app works in demo mode with mock responses.

How to Use This Beast 🎯

For New Users (Complete Noobs Welcome!) πŸ‘Ά

  1. Clone the Repository

    git clone <your-repo-url>
    cd ProfessorPeters
  2. One-Command Setup (The lazy way)

    ./start-dev.sh

    This script handles everything automatically!

  3. 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
  4. 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!

For Developers πŸ› οΈ

# 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

Project Structure πŸ—οΈ

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!

API Endpoints πŸ”Œ

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?

Troubleshooting πŸ”§

Common Issues & Solutions

"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 run npm 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

Getting Help πŸ†˜

  1. Check the logs in your terminal
  2. Visit http://localhost:8000/docs for API documentation
  3. Try the /health endpoint to check system status
  4. When all else fails, ask yourself: "What would Peter do?"

Contributing 🀝

Want to make Professor Peter even more ridiculous? We welcome contributions!

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test everything works
  5. Submit a pull request

License πŸ“„

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.

Acknowledgments πŸ™

  • 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.

Team πŸ‘₯

Mentor:

  • Soham Roy

Members:

  • Kartikeya Trivedi
  • Vaibhav Deep Srivastava
  • Yash Raj Gupta
  • Vaibhav Raj
  • Aditya Shukla
  • Sidhi Kumari

About

He Explains

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5