An AI-powered study companion that transforms your course materials into interactive, personalized study plans β instantly.
- Overview
- Features
- Tech Stack
- Architecture
- Getting Started
- Environment Variables
- Usage Guide
- Project Structure
- AI Integration
- Performance Optimizations
- Team
- License
StudyFlow AI is a fully client-side React web application that leverages Google's Gemini AI to process study materials (PDFs, images, notes, YouTube videos) and generate comprehensive, interactive study plans. It features real-time AI streaming, interactive quizzes, concept mapping, study scheduling, progress tracking, and a Pomodoro timer β all wrapped in a premium dark-themed UI with 3D particle effects.
No backend required. Everything runs in the browser. Your data never leaves your device β API calls go directly from your browser to Google's Gemini API.
| Input Type | Description |
|---|---|
| π PDF Upload | Upload single or multiple PDFs. Text is extracted client-side using pdf.js. Multi-PDF files are sent as base64 inline data to Gemini for vision-based analysis. |
| πΌοΈ Image Upload | Upload lecture slides, whiteboard photos, or handwritten notes (PNG, JPG, WEBP). Images are processed via Gemini's multimodal vision capabilities. |
| π Paste Notes | Paste raw text, lecture transcripts, or code snippets directly. Processed through intelligent text chunking. |
| π¬ YouTube Video | Paste a YouTube URL. The app uses Google Search grounding to analyze the video's content and generate a study plan. |
Once content is processed, you get a full study dashboard with:
- π Executive Summary β A structured overview with an "In Simple Terms" ELI5 explanation and colorful Key Takeaway cards.
- π§ Knowledge Map β An interactive D3-powered concept graph showing relationships between topics. Nodes are resizable, draggable, and collapsible.
- π Deep Dive Notes β Detailed, topic-by-topic study material with markdown rendering, key points, and real-world examples.
- π― Interactive Quiz β Timed quiz mode with multiple difficulty levels, scoring, streak tracking, and performance analytics per topic.
- π Study Schedule β AI-generated study calendar with day-by-day plans. Drag-and-drop rescheduling. Integrates days-until-exam and hours-per-day inputs.
- π Progress Dashboard β Visual analytics with charts (Recharts) showing quiz performance trends, topic mastery, and study streaks.
- π₯ Flashcards β Review key concepts in a flashcard format with flip animations.
- Streaming Responses β Real-time token-by-token AI responses using Server-Sent Events (SSE).
- Context-Aware β The chatbot has full knowledge of your uploaded study material and can answer questions about it.
- Multimodal Support β If you uploaded images or multi-PDF files, the chat tutor can reference them.
- Customizable work/break intervals (25/5 default, Pomodoro technique).
- Session counter with visual progress ring.
- Settings for short breaks, long breaks, and session goals.
- Floating widget that stays accessible across the dashboard.
- Share your generated study plans via URL hash encoding.
- Recipients can view the full plan without needing an API key.
- All generated study sessions are saved to
localStoragewith timestamps. - Searchable sidebar with topic filtering.
- Click any past session to reload the full dashboard.
- Dark/Light Theme β Toggle via the navbar sun/moon icon. Persists across sessions.
- 3D Particle Background β Animated star field using Three.js with performance-adaptive particle counts.
- Glassmorphism Design β Frosted glass panels, gradients, and subtle neon glows.
- Smooth Animations β Page transitions, micro-interactions, and hover effects via Framer Motion and GSAP.
- Responsive Layout β Works across desktop and tablet viewports.
- Model Selector β Choose between Gemini 2.0 Flash, 2.5 Flash Lite, or 2.5 Flash.
- Auto-Fallback β If one model is rate-limited (429), the system automatically tries the next model.
- API Key Rotation β Support for multiple API keys with round-robin rotation.
- Health Check β Background service pings all models on app load to show live availability status.
| Technology | Purpose |
|---|---|
| React 19 | UI framework with hooks and functional components |
| Vite 7 | Build tool with Hot Module Replacement (HMR) and SWC |
| Zustand 5 | Lightweight state management with persist middleware (localStorage) |
| Tailwind CSS 4 | Utility-first CSS with custom dark/light theme tokens |
| Technology | Purpose |
|---|---|
| Google Gemini API | AI text generation, multimodal analysis, streaming responses |
| pdf.js | Client-side PDF text extraction |
| react-markdown | Markdown rendering for AI-generated content |
| Technology | Purpose |
|---|---|
| Three.js + React Three Fiber | 3D particle background with performance optimization |
| react-d3-tree | Interactive concept graph / knowledge map |
| Recharts | Charts and analytics for progress tracking |
| Framer Motion | Page transitions, layout animations, micro-interactions |
| GSAP | Advanced timeline animations and scroll effects |
| Technology | Purpose |
|---|---|
| Lucide React | Modern, consistent icon library |
| date-fns | Date formatting and manipulation |
| react-day-picker | Calendar UI component for study scheduling |
| maath | Math utilities for random point distribution in 3D space |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Browser (Client) β
β β
β ββββββββββββ ββββββββββββββββ ββββββββββββββββββββββββ β
β β InputHub ββββΆβ Processing ββββΆβ AI Service β β
β β (4 tabs) β β Service β β (Gemini API) β β
β ββββββββββββ β β’ PDF.js β β β’ Key rotation β β
β β β’ Text chunk β β β’ Model fallback β β
β β β’ Video proc β β β’ Streaming (SSE) β β
β ββββββββββββββββ β β’ Health checks β β
β ββββββββ¬ββββββββββββββββ β
β β β
β ββββββββββββββββββββββββββββββββββββββββββΌββββββββββββββββ β
β β Zustand Store β β
β β State: content, summary, topics, quiz, chat, history β β
β β Persisted to localStorage β β
β ββββββββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββ β
β β β
β ββββββββββββββββββββββββββββββββββββββββββΌββββββββββββββββ β
β β Dashboard Layout β β
β β βββββββββββ¬βββββββββββ¬ββββββββ¬βββββββββ¬ββββββββββββββ β β
β β βSummary βKnowledge βQuiz βScheduleβ Progress β β β
β β β βMap (D3) β β β Dashboard β β β
β β β β β β β (Recharts) β β β
β β βββββββββββ΄βββββββββββ΄ββββββββ΄βββββββββ΄ββββββββββββββ β β
β β + ChatPanel (Streaming) + PomodoroTimer + History β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Background3D (Three.js) β Adaptive particle star field β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Node.js v18+
- npm v9+
- A Google Gemini API Key (Get one free)
# 1. Clone the repository
git clone https://github.com/rishab11250/qBit-Coders.git
cd qBit-Coders
# 2. Install dependencies
npm install
# 3. Create environment file
# Create a .env file in the root directory (see Environment Variables below)
# 4. Start the development server
npm run devThe app will be running at http://localhost:5173.
npm run build
npm run preview # Preview the production build locallyCreate a .env file in the project root:
# Required: At least one Gemini API key
VITE_GEMINI_API_KEY=your_primary_api_key_here
# Optional: Additional keys for rotation (comma-separated)
VITE_GEMINI_API_KEY_2=your_second_key
VITE_GEMINI_API_KEY_3=your_third_keyNote: API keys are used client-side. For production deployments, consider proxying through a backend to protect your keys.
- Go to Google AI Studio
- Click "Create API Key"
- Copy the key and paste it into your
.envfile
Choose from 4 input methods:
- PDF β Drag and drop or click to upload (supports multiple files)
- Images β Upload lecture slides, photos, or screenshots
- Notes β Paste text content directly
- YouTube β Enter a video URL
Use the model selector to pick your preferred Gemini model. The health indicator shows real-time availability:
- π’ Available
- π‘ Rate Limited (auto-fallback active)
- π΄ Unavailable
Click "Generate Study Plan" and watch the premium loading animation while the AI processes your content.
Navigate between sections using the sidebar:
- π Summary β Overview with key takeaways
- π§ Knowledge Map β Interactive concept graph
- π Deep Dive β Detailed topic notes
- π― Quiz β Test your knowledge
- π Calendar β Study schedule
- π Progress β Performance analytics
Click the floating chat button (bottom-right) to ask questions about your material. Responses stream in real-time.
Use the Pomodoro timer (bottom-left) for focused study sessions with timed work/break intervals.
qBit-Coders/
βββ public/ # Static assets
βββ src/
β βββ main.jsx # React entry point
β βββ App.jsx # Root component and routing logic
β βββ index.css # Global styles and theme tokens
β β
β βββ store/
β β βββ useStudyStore.js # Zustand state management (persist to localStorage)
β β
β βββ services/
β β βββ aiService.js # Gemini API integration (streaming, fallback, health)
β β βββ processingService.js # Input processing router
β β βββ processing/
β β βββ textProcessor.js # Text chunking and cleanup
β β βββ videoProcessor.js # YouTube URL handling
β β
β βββ components/
β βββ InputHub.jsx # Multi-tab input interface
β βββ ConceptGraph.jsx # D3 knowledge map
β βββ QuizInteractive.jsx # Timed quiz with scoring
β βββ DashboardLayout.jsx # Main dashboard container
β β
β βββ features/
β β βββ ChatPanel.jsx # AI chat with streaming
β β βββ DashboardLayout.jsx # Dashboard sections and sidebar
β β βββ HistorySidebar.jsx # Past study sessions
β β βββ PomodoroTimer.jsx # Focus timer widget
β β βββ ProgressDashboard.jsx # Analytics and charts
β β βββ StudyMaterial.jsx # Deep dive notes viewer
β β βββ StudySchedule.jsx # Calendar and scheduling
β β
β βββ layout/
β β βββ Navbar.jsx # Top navigation bar
β β βββ SidebarNav.jsx # Dashboard sidebar navigation
β β
β βββ ui/
β βββ Background3D.jsx # Three.js particle starfield
β βββ Button.jsx # Reusable button component
β βββ ErrorMessage.jsx # Error display component
β βββ Loader.jsx # Loading spinner
β βββ Modal.jsx # Modal dialog
β βββ ModelSelector.jsx # AI model picker and health status
β βββ PremiumLoadingState.jsx # Animated loading overlay
β
βββ .env # API keys (not committed)
βββ index.html # HTML entry point
βββ package.json # Dependencies and scripts
βββ vite.config.js # Vite configuration
βββ tailwind.config.js # Tailwind theme configuration
βββ eslint.config.js # ESLint rules
| Feature | Implementation |
|---|---|
| Text Generation | generateContent endpoint for study plan generation |
| Streaming | streamGenerateContent with SSE (alt=sse) for real-time chat |
| Multimodal Vision | inlineData with base64 images/PDFs for visual content analysis |
| Google Search Grounding | tools: [{ google_search: {} }] for YouTube video content retrieval |
| Function | File | Description |
|---|---|---|
generateStudyContent() |
aiService.js |
Main study plan generation from text/images |
generateStudyContentWithSearch() |
aiService.js |
YouTube content via Google Search grounding |
streamChatMessage() |
aiService.js |
Streaming chat with SSE parsing |
sendChatMessage() |
aiService.js |
Legacy non-streaming chat (fallback) |
generateQuizOnly() |
aiService.js |
On-demand quiz regeneration |
generateSchedule() |
aiService.js |
AI-powered study schedule generation |
runHealthCheck() |
aiService.js |
Background model availability check |
- API Key Rotation β Multiple keys rotated on 429 errors
- Model Fallback β Automatic switch:
2.5 Flash β 2.0 Flash β 2.5 Flash Lite - Health Monitoring β Background pings on app load with visual status indicators
- Retry Logic β
fetchWithRetrywith exponential backoff
| Optimization | Details |
|---|---|
| Adaptive Particles | 3D background uses 2,000 particles (800 on low-end devices, was 6,000) |
| Reduced Motion | Respects prefers-reduced-motion OS setting β disables particle animation |
| DPR Capping | Canvas pixel ratio capped at 1.5x (prevents 3x rendering on Retina) |
| Low-Power GPU | Three.js requests powerPreference: 'low-power' |
| Device Detection | Checks navigator.hardwareConcurrency and navigator.deviceMemory |
| Lazy State | Zustand with persist β only serializes necessary state |
| SWC Compiler | Vite uses SWC instead of Babel for faster builds |
| Code Splitting | Dynamic imports for heavy components |
| Effects Kill Switch | reducedEffects setting to fully disable 3D background |
qBit Coders β Built with β€οΈ by:
| Member | Role |
|---|---|
| Rishab | AI Integration + Logic |
| Daksh | File Processing + DataFlow |
| Harshit | UI/UX |
This project is built for educational purposes as part of the qBit-Coders team project.
β‘ StudyFlow AI β Turning information overload into structured knowledge.
Made with React, Gemini AI, and a lot of caffeine β