AI-Powered Flashcard Generator - Transform any content into Anki-ready flashcards instantly
Live Demo β’ Documentation β’ Report Bug β’ Request Feature
- Multiple AI Models: Gemini 3 Pro, Gemini 3 Flash, Gemini 2.5 Series (Pro/Flash/Lite)
- Latest Tech: Powered by Gemini 2.0 Flash and 1.5 Pro
- Smart Extraction: Automatically identifies key concepts and creates Q&A pairs
- LaTeX Support: Perfect for math, science, and technical subjects
- Multimodal: Generate flashcards from text, PDFs, and images
- π Text Input: Paste notes, articles, or study materials
- π PDF Upload: Extract content from textbooks and papers
- πΌοΈ Image Upload: Generate from diagrams, charts, and screenshots
- π Multiple Files: Combine multiple sources in one deck
- Difficulty Levels: Beginner, Intermediate, Advanced
- Card Styles: Q&A, Cloze Deletion, Mixed
- Deck Size: 10-100 cards per generation
- Custom Instructions: Fine-tune generation with specific requirements
- Authentication: Secure sign-in with Supabase
- Daily Quota: 2 free decks per day (resets at 12 AM IST)
- Usage Tracking: Monitor your daily generation count
- Instant Download: Get
.apkgfiles ready for Anki
- 4-Layer Protection: Frontend validation, authentication, quota system, rate limiting
- Privacy First: No data stored, instant generation and download
- API Protection: Automatic error reporting and abuse prevention
- IST Timezone: Fair quota reset for all users
- Python 3.11+
- Node.js 18+
- Supabase account (for auth & quotas)
- Gemini API key (or OpenAI/Anthropic)
-
Clone the repository
git clone https://github.com/pranavsinghpatil/MeshCards.git cd MeshCards -
Backend Setup
# Create virtual environment python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate # Install dependencies pip install -r requirements.txt # Configure environment cp .env.example .env # Edit .env with your API keys
-
Frontend Setup
cd frontend npm install # Configure environment cp .env.example .env # Edit .env with your API URL
-
Run Development Servers
# Terminal 1 - Backend uvicorn backend.main:app --reload --port 8000 # Terminal 2 - Frontend cd frontend npm run dev
-
Open in Browser
http://localhost:8080
- Sign In - Authenticate with Google/Email
- Input Content - Paste text or upload files
- Configure - Choose model, difficulty, and style
- Generate - AI creates flashcards in seconds
- Download - Get
.apkgfile for Anki - Import - Open in Anki and start studying!
Input: "Photosynthesis is the process by which plants convert light energy into chemical energy..."
Output:
Q: What is photosynthesis?
A: The process by which plants convert light energy into chemical energy
Q: What are the main inputs of photosynthesis?
A: Light energy, water, and carbon dioxide
Q: What are the products of photosynthesis?
A: Glucose and oxygen
Upload a diagram β AI analyzes visual content β Creates flashcards about the diagram
Backend:
- FastAPI (Python web framework)
- Supabase (Authentication & database)
- Google Gemini AI (Primary LLM)
- Genanki (Anki deck generation)
- SlowAPI (Rate limiting)
Frontend:
- React 18 + TypeScript
- Vite (Build tool)
- TailwindCSS (Styling)
- Shadcn/ui (Components)
- React Router (Navigation)
Deployment:
- Backend: Leapcell
- Frontend: Vercel
- Database: Supabase
MeshCards/
βββ backend/
β βββ core/
β β βββ llm.py # LLM client management
β β βββ generator.py # Flashcard generation logic
β β βββ anki.py # Anki deck builder
β β βββ auth.py # Authentication & quota
β β βββ error_reporter.py # Automatic error reporting
β β βββ storage.py # File storage management
β βββ main.py # FastAPI application
βββ frontend/
β βββ src/
β β βββ components/ # React components
β β βββ pages/ # Page components
β β βββ hooks/ # Custom hooks
β β βββ lib/ # Utilities
β βββ public/ # Static assets
βββ docs/ # Documentation
βββ decks/ # Generated decks (local dev)
Backend (.env):
# Environment
ENV=development # or production
# AI Providers
GEMINI_API_KEY=your_gemini_key
OPENAI_API_KEY=your_openai_key # Optional
# Supabase (Required)
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key
# Rate Limiting
RATE_LIMIT_FREE=2/hour
# GitHub Integration (Optional)
GITHUB_TOKEN=ghp_your_token
GITHUB_REPO=username/repositoryFrontend (.env):
# API Configuration
VITE_API_URL=http://localhost:8000
# Maintenance Mode
VITE_MAINTENANCE_MODE=false- Limit: 2 decks per user per day
- Reset: 12:00 AM IST (India Standard Time)
- Tracking: Stored in Supabase profiles table
- Enforcement: Strict in production, lenient in development
- Limit: 2 requests per hour per IP address
- Purpose: Prevent abuse and bot attacks
- Independent: Works even without authentication
- Bypass: Difficult (requires IP change)
- Automatic: Creates GitHub issues for backend errors
- Privacy: Sanitizes API keys and sensitive data
- Context: Includes stack trace, user ID (anonymized), and request data
- Labels: Auto-categorized (bug, llm, quota, auth)
- File Upload: Attach screenshots and files
- GitHub Issues: Automatically creates issues
- Categories: Bug, Feature Request, Praise, Other
- Rating: 1-5 star rating system
- Create Project on Leapcell
- Connect Repository
- Set Environment Variables
- Configure Build:
- Build Command:
pip install -r requirements.txt - Start Command:
uvicorn backend.main:app --host 0.0.0.0 --port 8000
- Build Command:
- Deploy
- Create Project on Supabase
- Create
profilestable:CREATE TABLE profiles ( id UUID PRIMARY KEY, daily_count INTEGER DEFAULT 0, last_reset DATE NOT NULL, created_at TIMESTAMP DEFAULT NOW() );
- Enable RLS Policies (Guide)
- Get API Keys from Project Settings
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 some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow existing code style
- Add tests for new features
- Update documentation
- Keep commits atomic and descriptive
- Mission & Purpose: The problem we solve.
- Quick Start User Guide: Get generating in minutes.
- System Architecture: How it works under the hood.
- Auth & Quotas: Understanding limits and BYOK.
- Production Guide: Full deployment checklist.
- Developer Guide: Setup and debugging.
- LaTeX rendering may fail for complex equations (use
$$delimiters) - Large PDFs (>10MB) may timeout
- Image generation requires specific model selection
See Issues for full list.
- Add more AI models (Claude, Llama)
- Implement deck preview before download
- Add deck history and management
- Support for more file formats (DOCX, PPTX)
- Premium tier with higher quotas
- Collaborative deck creation
- Deck sharing and marketplace
- Mobile app (React Native)
- Spaced repetition algorithm integration
- Study analytics and insights
- Community features
- Offline mode
If you find MeshCards helpful, consider supporting the project:
- Star this repository
- Buy me a coffee
- Report bugs and suggest features
- Share with fellow students
This project is licensed under the MIT License - see the LICENSE file for details.
- Google Gemini - For powerful AI capabilities
- Anki - For the amazing spaced repetition system
- Supabase - For authentication and database
- FastAPI - For the excellent Python framework
- React - For the frontend framework
- All Contributors - For making this project better
Pranav Singh Patil
- Email: talktopranav@cc.cc
- GitHub: @pranavsinghpatil
- Project: MeshCards
- Daily Active Users: Growing!
- Decks Generated: Thousands
- Success Rate: 98%+
- Average Generation Time: 6-12 seconds
Made with β€οΈ for students worldwide