Skip to content

ShreyasReddy2401/revise-flow

Repository files navigation

🤿 ReviseFlow — Deep Dive into Learning

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.

Next.js TypeScript Tailwind CSS Groq Prisma


✨ Features

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

🖥 Demo

Landing — Day Mode Landing — Night Mode
Tropical fish, coral, sun rays Sharks, jellyfish, bioluminescence

🚀 Quick Start

# 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 dev

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


🔑 Environment Variables

Variable Required Description
GROQ_API_KEY Optional Free at console.groq.com. Without it, mock cards are used.

🏗 Tech Stack

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

📁 Project Structure

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

🎮 How the Credit System Works

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 Ocean Theme

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


🔮 What's Next

  • 📄 DOCX and image support
  • 📅 Spaced repetition scheduling across days
  • 👥 Multiplayer study rooms
  • 🎮 More mini-games tied to the credit system
  • 📱 Native mobile app

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors