Skip to content

rishab11250/qBit-Coders

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

134 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

⚑ StudyFlow AI

Master any subject in Minutes, not Hours.

An AI-powered study companion that transforms your course materials into interactive, personalized study plans β€” instantly.

React Vite Gemini TailwindCSS Three.js


πŸ“‹ Table of Contents


🌟 Overview

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.


✨ Features

πŸ“₯ Multi-Format Input

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.

πŸ“Š AI-Powered Dashboard

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.

πŸ’¬ AI Chat Tutor

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

⏱️ Pomodoro Timer

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

πŸ”— Shareable Study Plans

  • Share your generated study plans via URL hash encoding.
  • Recipients can view the full plan without needing an API key.

πŸ“‚ Study History

  • All generated study sessions are saved to localStorage with timestamps.
  • Searchable sidebar with topic filtering.
  • Click any past session to reload the full dashboard.

🎨 Premium UI/UX

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

πŸ€– AI Model Management

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

πŸ› οΈ Tech Stack

Core

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

AI and Data

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

Visualization

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

Utilities

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

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        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 β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Getting Started

Prerequisites

  • Node.js v18+
  • npm v9+
  • A Google Gemini API Key (Get one free)

Installation

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

The app will be running at http://localhost:5173.

Build for Production

npm run build
npm run preview   # Preview the production build locally

πŸ”‘ Environment Variables

Create 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_key

Note: API keys are used client-side. For production deployments, consider proxying through a backend to protect your keys.

Getting an API Key

  1. Go to Google AI Studio
  2. Click "Create API Key"
  3. Copy the key and paste it into your .env file

πŸ“– Usage Guide

1. Upload Your Material

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

2. Select AI Model

Use the model selector to pick your preferred Gemini model. The health indicator shows real-time availability:

  • 🟒 Available
  • 🟑 Rate Limited (auto-fallback active)
  • πŸ”΄ Unavailable

3. Generate Study Plan

Click "Generate Study Plan" and watch the premium loading animation while the AI processes your content.

4. Explore Your Dashboard

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

5. Chat with AI Tutor

Click the floating chat button (bottom-right) to ask questions about your material. Responses stream in real-time.

6. Focus with Pomodoro

Use the Pomodoro timer (bottom-left) for focused study sessions with timed work/break intervals.


πŸ“ Project Structure

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

πŸ€– AI Integration

Gemini API Features Used

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

Key AI Functions

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

Resilience Features

  • 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 β€” fetchWithRetry with exponential backoff

⚑ Performance Optimizations

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

πŸ‘₯ Team

qBit Coders β€” Built with ❀️ by:

Member Role
Rishab AI Integration + Logic
Daksh File Processing + DataFlow
Harshit UI/UX

πŸ“„ License

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 β˜•

About

StudyFlow AI - An AI-powered study companion that transforms course materials into interactive study plans with quizzes, concept maps, and progress tracking.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors