Transform your PDF documents into interactive study materials with AI-powered tools!
- Overview
- Features
- Tech Stack
- Prerequisites
- Installation
- Configuration
- Usage
- API Documentation
- Project Structure
- Contributing
- License
SubRevision is an intelligent study companion that leverages AI to help students learn more effectively. Upload any PDF document and instantly generate:
- โ Q&A System - Ask questions and get context-aware answers
- ๐ Smart Search - Find relevant content quickly
- ๐ Auto Summaries - Get comprehensive document summaries
- ๐ฏ Interactive Quizzes - Test your knowledge with auto-generated questions
- ๐ 3D Flashcards - Flip-to-learn with beautiful card animations
- ๐ง Mind Maps - Visualize concepts hierarchically
- ๐ Study Plans - Get personalized day-by-day study schedules
| Feature | Description | Status |
|---|---|---|
| PDF Upload | Process and store PDF documents up to 50MB | โ Active |
| AI Q&A | Ask questions about your document content | โ Active |
| Semantic Search | Find relevant sections with vector search | โ Active |
| Auto Summary | Generate concise summaries of entire documents | โ Active |
| Quiz Generation | Create multiple-choice questions with answers | โ Active |
| Flashcards | Generate interactive flip cards for memorization | โ Active |
| Mind Mapping | Build hierarchical concept maps | โ Active |
| Study Plans | Get structured multi-day learning schedules | โ Active |
- ๐ฎ Pixel Art Theme - Retro-inspired, midnight study aesthetic
- ๐ Dark Mode - Easy on the eyes for late-night studying
- ๐ฑ Responsive Design - Works on desktop, tablet, and mobile
- โก Real-time Loading States - Visual feedback for all operations
- ๐ญ Interactive Components - Click-to-reveal answers, flip cards
- ๐จ Color-coded Content - Different colors for different content types
- FastAPI - High-performance Python web framework
- Groq API - Ultra-fast AI inference with Llama 3.3 70B
- PyPDF2 - PDF text extraction
- Python 3.12 - Modern Python runtime
- Uvicorn - ASGI server for production
- Next.js 16 - React framework with App Router
- React 19 - Latest React with concurrent features
- TypeScript 5 - Type-safe JavaScript
- Tailwind CSS 4 - Utility-first CSS framework
- Turbopack - Next-gen bundler (dev mode)
- Groq Cloud - Free AI API with 30 req/min, 14,400 req/day
- Llama 3.3 70B Versatile - State-of-the-art LLM
- JSON Vector Storage - Lightweight document storage
Before you begin, ensure you have:
- Python 3.12+ (Download)
- Node.js 20+ & npm (Download)
- Git (Download)
- Groq API Key (Free at console.groq.com)
git clone https://github.com/muskiteer/SubRevision.git
cd SubRevision# Navigate to backend directory
cd backend
# Create virtual environment
python3 -m venv .venv
# Activate virtual environment
# On Linux/Mac:
source .venv/bin/activate
# On Windows:
# .venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt# Navigate to frontend directory (from project root)
cd frontend
# Install dependencies
npm installCreate a .env file in the backend/ directory:
cd backend
touch .envAdd your Groq API key:
GROQ_API_KEY=your_groq_api_key_hereGet Your Free Groq API Key:
- Visit console.groq.com
- Sign up/Login
- Navigate to API Keys
- Create new key
- Copy and paste into
.env
The frontend is pre-configured to connect to http://localhost:8000 (backend).
If you need to change the API URL, edit frontend/app/page.tsx:
const API_BASE = 'http://localhost:8000'; // Change if neededTerminal 1 - Backend:
cd backend
source .venv/bin/activate # Activate virtual environment
uvicorn main:app --reload --host 0.0.0.0 --port 8000Terminal 2 - Frontend:
cd frontend
npm run dev# Start backend in background
cd backend && source .venv/bin/activate && uvicorn main:app --reload &
# Start frontend in background
cd frontend && npm run dev &- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/docs (Swagger UI)
- Alternative API Docs: http://localhost:8000/redoc (ReDoc)
| Endpoint | Method | Description |
|---|---|---|
/pdf/upload |
POST | Upload and process PDF file |
/query/ask |
POST | Ask questions about the document |
/query/search |
POST | Search for relevant sections |
/generate/summary |
POST | Generate document summary |
/generate/quiz |
POST | Generate quiz questions |
/generate/flashcards |
POST | Generate flashcards |
/generate/mindmap |
POST | Generate mind map structure |
/generate/studyplan |
POST | Generate study plan |
Full API Documentation: Visit http://localhost:8000/docs for interactive Swagger UI.
SubRevision/
โโโ backend/ # Python FastAPI backend
โ โโโ db/ # Database layer
โ โ โโโ db.py # Vector storage implementation
โ โ โโโ __init__.py
โ โโโ handlers/ # Business logic
โ โ โโโ handler.py # API request handlers
โ โ โโโ __init__.py
โ โโโ routes/ # API routes
โ โ โโโ routes.py # Endpoint definitions
โ โ โโโ __init__.py
โ โโโ utils/ # Utility functions
โ โ โโโ pdf_processor.py # PDF extraction logic
โ โ โโโ __init__.py
โ โโโ main.py # FastAPI application entry
โ โโโ requirements.txt # Python dependencies
โ โโโ .env # Environment variables (create this)
โ โโโ GROQ_SETUP.md # Groq API setup guide
โ
โโโ frontend/ # Next.js frontend
โ โโโ app/ # Next.js App Router
โ โ โโโ layout.tsx # Root layout
โ โ โโโ page.tsx # Main page component
โ โ โโโ globals.css # Global styles (pixel theme)
โ โโโ public/ # Static assets
โ โโโ package.json # Node dependencies
โ โโโ tsconfig.json # TypeScript config
โ โโโ next.config.ts # Next.js config
โ โโโ tailwind.config.ts # Tailwind config
โ โโโ postcss.config.mjs # PostCSS config
โ
โโโ README.md # This file
8 tabs for different features:
- ๐ Upload PDF
- โ Ask Query
- ๐ Search
- ๐ Summary
- ๐ฏ Quiz
- ๐ Flashcards
- ๐ง Mind Map
- ๐ Study Plan
Quiz Questions:
- Click "Show Answer" to reveal
- Color-coded: Question (cyan) โ Answer (green)
- Smooth fade-in animations
Flashcards:
- 3D flip animation on click
- Front: Cyan border (question)
- Back: Green border (answer)
- Responsive grid layout
Mind Map:
- Hierarchical tree structure
- Color-coded by depth level
- Expandable/collapsible nodes
Study Plan:
- Day-by-day cards
- Topics with cyan bullets
- Tasks with yellow checkboxes
- Duration indicators
# Backend tests (if available)
cd backend
pytest
# Frontend tests (if available)
cd frontend
npm testBackend:
cd backend
pip install -r requirements.txt
uvicorn main:app --host 0.0.0.0 --port 8000Frontend:
cd frontend
npm run build
npm startCreate Dockerfile in backend:
FROM python:3.12-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]Create Dockerfile in frontend:
FROM node:20-alpine
WORKDIR /app
COPY package*.json .
RUN npm install
COPY . .
RUN npm run build
CMD ["npm", "start"]1. "No PDF uploaded yet" error
- Make sure to upload a PDF before using other features
- Check if upload was successful (status message)
2. Backend connection refused
- Verify backend is running on port 8000
- Check CORS settings in
backend/main.py - Ensure firewall allows port 8000
3. Groq API errors
- Verify API key in
.envfile - Check API quota (30 req/min, 14,400 req/day)
- Ensure no extra spaces in API key
4. Frontend not connecting to backend
- Check
API_BASEURL infrontend/app/page.tsx - Verify backend is accessible at that URL
- Check browser console for CORS errors
5. PDF upload fails
- Ensure file is under 50MB
- Check file is valid PDF format
- Verify backend has write permissions
- Rate Limit: 30 requests/minute
- Daily Limit: 14,400 requests/day
- Model: llama-3.3-70b-versatile
- Speed: ~1000 tokens/second
- Cost: FREE โจ
- Handles PDFs up to 50MB
- Chunks text into 500-char segments
- Stores vectors in JSON (lightweight)
- CORS enabled for localhost:3000
- Next.js 16 with Turbopack (dev)
- React 19 concurrent rendering
- Client-side state management
- No external API calls except backend
We welcome contributions! Here's how:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow PEP 8 for Python code
- Use ESLint/Prettier for TypeScript
- Add comments for complex logic
- Update README for new features
- Test before submitting PR
- Groq for providing free, ultra-fast AI inference
- Meta for the Llama 3.3 model
- FastAPI for the excellent Python framework
- Vercel for Next.js and amazing developer experience
- Tailwind CSS for the utility-first CSS framework