Turn long notes into fast flashcards. Study smart. Take a brain break. Repeat.
ReviseFlow is an AI-powered last-minute revision app with a fully animated deep-sea theme. Drop your PDF, get flashcards in seconds, and earn game credits for every 3 correct answers.
- 📄 PDF → Flashcards — Upload any PDF, Groq AI (Llama 3.1) extracts the key concepts and generates 8–15 focused study cards instantly
- 🔁 Spaced Repetition — Wrong answers automatically re-queue so you keep drilling weak spots, not what you already know
- ⏱ Session Timer — 10-minute focused sessions with a live countdown
- 🎮 Credit Reward System — Every 3 correct answers earns a game credit to spend on the Water Sort puzzle
- 💾 Full Persistence — Sessions, streaks, credits, and game progress all survive page reloads and tab closes
- 🌊 Day / Night Ocean Theme — Tropical fish, coral, and manta rays by day. Sharks, jellyfish, anglerfish, and bioluminescent particles by night
- 🤿 Diver Mascot — An animated deep-sea diver with contextual speech bubbles on every page
- 📊 Profile Stats — Track sessions, accuracy, streaks, and credit balance
| Landing — Day Mode | Landing — Night Mode |
|---|---|
| Tropical fish, coral, sun rays | Sharks, jellyfish, bioluminescence |
# 1. Install dependencies
npm install
# 2. Set up environment variables
cp .env.example .env.local
# Add your GROQ_API_KEY (free at console.groq.com)
# 3. Push database schema
npx prisma db push
# 4. Start dev server
npm run devOpen http://localhost:3000 and drop a PDF.
No API key? The app falls back to 8 built-in mock flashcards so you can still explore everything.
| Variable | Required | Description |
|---|---|---|
GROQ_API_KEY |
Optional | Free at console.groq.com. Without it, mock cards are used. |
| Layer | Tech |
|---|---|
| Framework | Next.js 15 — App Router |
| Language | TypeScript |
| Styling | Tailwind CSS v4 |
| AI | Groq API — Llama 3.1 8B Instant |
| Database | Prisma v7 + SQLite (libsql adapter) |
| PDF parsing | pdf-parse v1.1.1 |
| Client state | localStorage |
| Animations | Pure CSS keyframes + hand-crafted SVGs |
app/
page.tsx # Landing page (day/night scene, theme toggle)
upload/page.tsx # PDF upload
session/[id]/page.tsx # Revision session
play/page.tsx # Water sort mini-game
profile/page.tsx # Stats and progress
api/
upload/route.ts # PDF → AI flashcard pipeline
sessions/[id]/route.ts # Session data endpoint
components/
DiverMascot.tsx # Animated SVG diver with speech bubbles
DayScene.tsx # Tropical fish, coral, manta ray, sun rays
NightScene.tsx # Sharks, jellyfish, anglerfish, bioluminescence
FlashCard.tsx # CSS 3D flip card
SessionClient.tsx # Full revision session logic + credit system
UploadDropzone.tsx # Drag-and-drop PDF upload with progress
WaterSortGame.tsx # Playable water sort puzzle with credit gate
ResumeSessionBanner.tsx # Resume in-progress session prompt
ProfileStats.tsx # Stats dashboard from localStorage
TopBar.tsx # Header with back button, score, streak
BottomNav.tsx # Tab navigation
lib/
themeContext.tsx # Day/night theme context + localStorage
db.ts # Prisma singleton (libsql adapter)
llm.ts # Groq AI integration + mock fallback
pdf.ts # pdf-parse wrapper (Turbopack-safe)
store.ts # localStorage helpers for all client state
types.ts # Shared TypeScript types
Study → Answer correctly → correctSinceLastCredit++
↓ (at 3)
Credit earned! 🎮
↓
Spend on Water Sort game
Credits and progress persist in localStorage so they carry across sessions.
The day/night toggle auto-detects your local time on first load (night = 19:00–06:00) and can be toggled at any time. Every creature is a hand-crafted SVG animated purely with CSS keyframes — no Three.js, no canvas, no game engine.
Day creatures: ClownFish · BlueTang · YellowFish · PurpleFish · SchoolOfFish · MantaRay · Seaweed · Coral
Night creatures: Shark · Jellyfish · Anglerfish · Bioluminescent particles · Glow orbs
- 📄 DOCX and image support
- 📅 Spaced repetition scheduling across days
- 👥 Multiplayer study rooms
- 🎮 More mini-games tied to the credit system
- 📱 Native mobile app