🌐 Live Demo — https://studyflow-ai-alpha.vercel.app/
Single & Multi-Document Workspaces. AI Chat with Source Citation. Concept Mindmaps. Flashcards & Quizzes.
A full-stack MERN application powered by Google Gemini AI that transforms static PDF documents and multi-document folders into interactive, intelligent learning experiences.
- 📂 Multi-Document Workspaces & Folders: Organize PDFs into themed folders with custom color tags. Conduct cross-document synthesis across multiple course PDFs or research papers simultaneously.
- 💬 Source-Attributed AI Chat: Ask questions across an entire folder. AI responses tag specific source files (e.g.
[Source: "Cell_Biology_Ch4.pdf"]). - 🧠 Cross-Document Mindmaps: Auto-generate interactive concept maps connecting themes across all PDFs in a workspace.
- 📤 Dual PDF Upload Workflows: Add existing PDFs from your library OR upload external PDFs directly into workspaces with live progress tracking and Cloudinary signed uploads.
- 🔍 Document & Workspace Search: Real-time keyword filtering across documents and folder collections.
- 🛡️ Cascading Cleanups & Validation: Deleting a document or workspace cleanly purges Cloudinary files, text chunks, flashcard decks, quizzes, and chat histories in parallel.
- PDF Direct Upload — Signed Cloudinary frontend uploads for PDFs up to 10MB with live reading, signing, uploading, and indexing progress bars.
- Smart Chunking — Automatic client-side PDF text extraction and backend semantic chunking (
500 tokens / 50 overlap) with Tier-2 server fallback. - 6-Tab Workspace Hub — Dedicated navigation tabs for Documents, Multi-Doc AI Chat, Executive Summary, Concept Mindmap, Flashcards, and Quizzes.
- Multi-Doc & Single-Doc Chat — Conversational assistant with message history persistence and document source tagging.
- Executive Summaries — Generate concise summaries for single PDFs or multi-document folders.
- Interactive Mindmaps — Auto-generated concept trees rendered via React Flow with zoom, pan, and minimap controls.
- Flashcards & Quizzes — Auto-generate Q&A study decks and practice exams for single PDFs or entire workspaces. Universal set-based lookup (
/flashcards/set/:setId).
- Analytics Dashboard — Track study activity, quiz performance, and recently opened learning materials.
- Auth System — Secure JWT authentication and Google OAuth 2.0 integration.
- Responsive Layout — Tailored desktop and mobile views with centered UI tiles and backdrop-blur modals.
- Frontend: React 19, Vite, TailwindCSS 4, React Router v7, React Flow,
pdfjs-dist, Axios, Lucide React. - Backend: Node.js, Express 5, Mongoose 9, JWT, Cloudinary SDK, Express Rate Limit.
- AI & DB: Google Gemini AI SDK (
@google/genai), MongoDB Atlas.
- Node.js 18+ and MongoDB Atlas Instance
- Cloudinary Account & Google Cloud Project (OAuth Client ID & Gemini API key)
-
Clone Repository
git clone https://github.com/iamalok123/studyflow-mern-fullstack.git cd studyflow-mern-fullstack -
Backend Setup
cd backend npm install npm run devCreate a
.envfile inbackend/with:PORT=5000 MONGO_URI=your_mongodb_uri JWT_SECRET=your_jwt_secret GEMINI_API_KEY=your_gemini_api_key CLOUDINARY_CLOUD_NAME=your_cloudinary_name CLOUDINARY_API_KEY=your_cloudinary_api_key CLOUDINARY_API_SECRET=your_cloudinary_api_secret GOOGLE_CLIENT_ID=your_google_client_id FRONTEND_URL=http://localhost:5173
-
Frontend Setup
cd ../frontend npm install npm run devCreate a
.envfile infrontend/with:VITE_API_URL=http://localhost:5000/api VITE_GOOGLE_CLIENT_ID=your_google_client_id
- Auth:
/api/auth/register,/api/auth/login,/api/auth/google,/api/auth/profile - Documents:
/api/documents/upload-signature,/api/documents/upload,/api/documents,/api/documents/:id - Workspaces:
/api/workspaces,/api/workspaces/:id,/api/workspaces/:id/documents - AI Suite:
/api/ai/chat,/api/ai/workspace-chat,/api/ai/generate-summary,/api/ai/workspace-summary,/api/ai/generate-mindmap,/api/ai/workspace-mindmap,/api/ai/generate-flashcards,/api/ai/generate-quiz - Study & Progress:
/api/flashcards/set/:setId,/api/quizzes/:id/submit,/api/progress/dashboard
- User: Authentication, profiles, OAuth IDs.
- Document: Cloudinary URLs, extracted text, semantic chunks (
500/50), status. - Workspace: Folder metadata, document ID array, embedded summary & mindmap JSON.
- Flashcard & Quiz: Generated study resources linked to
documentIdorworkspaceId. - ChatHistory: Multi-turn conversation logs for documents or workspaces.
Both frontend/ and backend/ contain pre-configured vercel.json rewrite settings:
- Frontend SPA Rewrite:
frontend/vercel.jsonroutes client routes to/index.html. - Backend API Serverless:
backend/vercel.jsonroutes server requests to/api/index.js.
Licensed under the ISC License.
