Skip to content

Build AI-powered flashcard study app with spaced repetition#2

Draft
Copilot wants to merge 6 commits into
Copilotfrom
copilot/build-flashcard-web-app
Draft

Build AI-powered flashcard study app with spaced repetition#2
Copilot wants to merge 6 commits into
Copilotfrom
copilot/build-flashcard-web-app

Conversation

Copilot AI commented Nov 8, 2025

Copy link
Copy Markdown

Implements a full-stack flashcard application with AI-generated cards and SM-2 spaced repetition, similar to Gizmo AI Flashcards.

Backend (FastAPI + SQLAlchemy)

  • Authentication: JWT-based email/password auth with bcrypt hashing
  • File parsing: PDF (PyPDF2), PowerPoint (python-pptx), and text extraction
  • Flashcard generation: LLM API integration (OpenAI/Claude/local) with text-splitting fallback
  • Spaced repetition: SM-2 simplified (interval *= 2 on success, interval = 1 on failure)
  • API: 15+ RESTful endpoints for auth, decks, flashcards, reviews, and uploads
  • Database: SQLAlchemy ORM with SQLite default, PostgreSQL-ready

Frontend (React + TailwindCSS)

  • Pages: Login, Signup, Dashboard, Upload, Deck Editor, Practice
  • Practice mode: Card flip UI with "Remembered"/"Forgot" buttons
  • State: Context API for auth, Axios for API calls
  • Routing: React Router v6 with protected routes

Architecture

study/
├── backend/
│   ├── app/
│   │   ├── api/           # Route handlers (auth, decks, flashcards, reviews, upload)
│   │   ├── core/          # Config, database, security (JWT)
│   │   ├── models/        # User, Deck, Flashcard, Review
│   │   ├── schemas/       # Pydantic request/response models
│   │   └── services/      # Parser, LLM client, spaced repetition logic
│   └── main.py
└── frontend/
    └── src/
        ├── components/    # Navbar
        ├── contexts/      # AuthContext
        ├── pages/         # 6 page components
        └── services/      # API client

Key Implementation Details

Spaced Repetition Algorithm:

def calculate_next_review(remembered: bool, current_interval: float = 1.0):
    new_interval = current_interval * 2 if remembered else 1.0
    next_review = datetime.utcnow() + timedelta(days=new_interval)
    return new_interval, next_review

LLM Flashcard Generation:

  • Sends study material to configurable LLM endpoint
  • Parses JSON response into question/answer pairs
  • Falls back to sentence splitting if API unavailable

File Upload Flow:

  1. User uploads file → extract text → preview
  2. Name deck → call LLM/fallback to generate cards
  3. Store deck + flashcards → redirect to deck view

Configuration

No LLM API key required (fallback mode works). To enable AI generation:

LLM_API_URL=https://api.openai.com/v1/chat/completions
LLM_API_KEY=sk-xxx
LLM_MODEL=gpt-3.5-turbo

Documentation

  • QUICKSTART.md: 5-minute setup guide
  • SETUP.md: Deployment and configuration
  • TESTING.md: Manual test checklist
  • PROJECT_SUMMARY.md: Technical overview

Running

# Backend
cd backend && pip install -r requirements.txt
uvicorn main:app --reload

# Frontend
cd frontend && npm install && npm run dev

Access at http://localhost:5173 (frontend) and http://localhost:8000/docs (API docs).

Original prompt

Build a web app similar to Gizmo AI Flashcards.

Core Purpose:

  • Users upload study materials (PDF, text, PowerPoint, YouTube link, or pasted notes)
  • The app extracts key concepts and auto-generates flashcards
  • Flashcards are stored in decks
  • Users practice decks using spaced repetition and active recall

Tech Stack:

  • Backend: Python + FastAPI
  • Frontend: React + shadcn/ui + TailwindCSS
  • DB: PostgreSQL or Supabase
  • AI Model Interface: Use any open LLM endpoint (Claude / GPT / Mistral) via API
  • File Parsing: Use PyPDF2 for PDFs, python-pptx for PPT, yt-dlp + Whisper or any subtitles for YouTube

Key Features:

  1. Login / Signup with email + password
  2. Upload study materials
  3. Extract text from uploaded content
  4. Summarize content into key points
  5. Convert key points into Q/A flashcards
  6. Store flashcards into named decks
  7. Practice mode:
    • Show question first
    • User attempts recall
    • Show answer
    • User marks "Remembered" or "Forgot"
  8. Spaced repetition logic:
    • Remembered → next review in longer interval
    • Forgot → next review sooner
    • Store next review timestamps in DB

Frontend Requirements:

  • Clean, minimal UI
  • Dashboard: shows decks + review reminders
  • Flashcard practice view: card flips
  • Upload page with progress indicator
  • Deck builder editor (add/edit/delete cards)

Backend Requirements:

  • Endpoint to upload + parse files
  • Endpoint to generate flashcards from extracted text
  • Endpoint to schedule spaced repetition intervals
  • Endpoint to fetch today's cards to review

Spaced Repetition System:

  • Use SM-2 simplified algorithm:
    If user marks "Remembered":
    interval *= 2
    If user marks "Forgot":
    interval = 1 day

Focus on:

  • Clean code structure
  • Reusable components
  • Clear API routes
  • No vendor lock-in

Finally:

  • Generate full project folder structure
  • Create backend + frontend code
  • Include instructions to run locally using:
    • pip install -r requirements.txt
    • npm install
    • npm run dev

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@coderabbitai

coderabbitai Bot commented Nov 8, 2025

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI and others added 5 commits November 8, 2025 11:19
Co-authored-by: qwertystars <62981066+qwertystars@users.noreply.github.com>
Co-authored-by: qwertystars <62981066+qwertystars@users.noreply.github.com>
Co-authored-by: qwertystars <62981066+qwertystars@users.noreply.github.com>
Co-authored-by: qwertystars <62981066+qwertystars@users.noreply.github.com>
Co-authored-by: qwertystars <62981066+qwertystars@users.noreply.github.com>
Copilot AI changed the title [WIP] Build web app similar to Gizmo AI Flashcards Build AI-powered flashcard study app with spaced repetition Nov 8, 2025
Copilot AI requested a review from qwertystars November 8, 2025 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants