Skip to content

Repository files navigation

StudySync

AI-powered personalized learning platform that helps students learn smarter through intelligent tutoring, document analysis, quiz generation, AI summaries, and performance analytics.


🌐 Live Demo

πŸ”— https://studysync-v2.onrender.com


✨ Features

  • πŸ€– AI Tutor with conversational learning and real-time concept explanations
  • πŸ“„ AI-powered PDF analysis with contextual document understanding
  • πŸ“ Automatic quiz generation supporting MCQ, SAQ, and LAQ formats
  • πŸ“š AI summaries, revision notes, and key concept extraction
  • πŸ” Semantic search powered by vector embeddings and RAG architecture
  • πŸ“Š Learning analytics with quiz tracking and performance insights
  • πŸŒ™ Modern responsive UI with dark/light mode support
  • πŸ” Secure authentication using Google OAuth and NextAuth
  • ⚑ Full-stack architecture powered by Next.js, Prisma, tRPC, Redis, and PostgreSQL
  • 🐳 Docker-ready deployment with Render + Supabase integration

πŸ“Έ Screenshots

πŸ” Authentication

Secure Google OAuth authentication with protected routes and session management.

Authentication


🏠 Dashboard

Centralized AI-powered learning dashboard with document management and analytics.

Dashboard

Dashboard


πŸ€– AI Tutor

Interactive AI-powered tutor capable of answering both document-based and general learning questions.

Dashboard

Dashboard


πŸ“ AI Quiz Generator

Generate intelligent quizzes with MCQ, SAQ, and LAQ support instantly from study materials.

Quiz 1

Quiz 2

Quiz- saq


πŸ“Š Quiz Results & Evaluation

Real-time quiz evaluation with scoring, explanations, and performance insights.

Quiz Results

Quiz Results


πŸ“„ PDF Viewer & Document Processing

Upload, preview, and interact with study materials seamlessly.

PDF Viewer

PDF Viewer


πŸ›  Tech Stack

Frontend

  • Next.js 15
  • React
  • TypeScript
  • Tailwind CSS
  • shadcn/ui
  • Framer Motion
  • Lucide Icons

Backend

  • tRPC
  • Prisma ORM
  • PostgreSQL
  • Redis
  • NextAuth.js

AI & Vector Technologies

  • Google Gemini AI
  • HuggingFace API
  • Qdrant Vector Database
  • RAG-based document retrieval

Infrastructure & Deployment

  • Render
  • Supabase
  • Docker

πŸ“‚ Project Structure

src/
β”œβ”€β”€ app/
β”œβ”€β”€ components/
β”œβ”€β”€ server/
β”œβ”€β”€ lib/
β”œβ”€β”€ hooks/
β”œβ”€β”€ styles/
β”œβ”€β”€ trpc/
β”œβ”€β”€ types/
└── prisma/

βš™οΈ Environment Variables

Create a .env file in the root directory (see .env.example for a fully commented template).

AUTH_SECRET=
AUTH_TRUST_HOST=

DATABASE_URL=
DIRECT_URL=

GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=

GOOGLE_GENERATIVE_AI_API_KEY=
HUGGINGFACE_API_KEY=

NEXT_PUBLIC_APP_URL=

NEXT_PUBLIC_SUPABASE_ANON_KEY=
NEXT_PUBLIC_SUPABASE_URL=
SUPABASE_STORAGE_BUCKET=

NEXTAUTH_SECRET=
NEXTAUTH_URL=

QDRANT_API_KEY=
QDRANT_URL=

REDIS_URL=

SUPABASE_SERVICE_ROLE_KEY=
SUPABASE_URL=

πŸš€ Getting Started

1️⃣ Clone Repository

git clone https://github.com/roshankodi/StudySync.git
cd StudySync

2️⃣ Install Dependencies

npm install

3️⃣ Generate Prisma Client

npx prisma generate

4️⃣ Push Database Schema

npx prisma db push

5️⃣ Start Development Server

npm run dev

Application will run on:

http://localhost:3000

🐳 Docker Support

Build Docker image:

docker build -t studysync .

Run container (make sure you have a filled-in .env file first):

docker run -p 3000:3000 --env-file .env studysync

Or run everything (app + optional local Redis/Qdrant) with Docker Compose:

docker compose up --build

🧠 AI Capabilities

StudySync uses Retrieval-Augmented Generation (RAG) architecture to:

  • Understand uploaded documents
  • Generate context-aware responses
  • Create intelligent quizzes
  • Summarize learning materials
  • Deliver personalized tutoring experiences

πŸ“ˆ Future Improvements

  • Voice AI tutor
  • Collaborative study rooms
  • Real-time multiplayer quizzes
  • Personalized learning recommendations
  • Advanced semantic evaluation
  • Multi-document reasoning

πŸ‘¨β€πŸ’» Author

Kodi Roshan

Computer Science Engineering Student β€’ Full-Stack Developer β€’ AI Enthusiast

GitHub: https://github.com/roshankodi


πŸ› οΈ Troubleshooting

EINVAL: invalid argument, readlink '...\.next\app-build-manifest.json' (Windows)

This happens when the project folder lives inside a OneDrive-synced directory (e.g. ...\OneDrive\Desktop\...). OneDrive's "Files On-Demand" feature creates special placeholder files using NTFS reparse points, and Node's filesystem calls (used internally by Next.js's build cache) misinterpret them as broken symlinks, causing the build/dev server to crash. This is a Windows + OneDrive limitation, not a bug in the project.

Fix (pick one):

  1. Move the project outside of OneDrive β€” e.g. to C:\Dev\StudySync β€” and run npm install again from there. This is the most reliable fix.
  2. If you must keep it inside OneDrive, right-click the project folder in File Explorer β†’ "Always keep on this device", so every file is fully downloaded locally instead of being an on-demand placeholder. Then delete the .next folder (npm run clean) and restart.

Either way, always clear the build cache after moving/fixing the folder:

npm run clean   # removes the .next folder
npm run dev

ERESOLVE peer dependency errors on npm install

This project ships a .npmrc with legacy-peer-deps=true, which resolves a known, intentional version mismatch between @langchain/community and pdf-parse. If you still see an ERESOLVE error, make sure .npmrc exists at the project root and re-run npm install.

Quiz/flashcard generation fails

Check the toast notification for the actual error β€” common causes are an invalid/expired GOOGLE_GENERATIVE_AI_API_KEY, or the uploaded PDF containing no extractable text (e.g. a scanned image with no OCR layer).

getaddrinfo ENOTFOUND <your-upstash-host>.upstash.io (worker)

This means DNS couldn't resolve your Redis hostname at all β€” it's not an application bug, it's telling you that host doesn't currently exist from your machine's perspective. Check, in order:

  1. Log into the Upstash console and confirm the Redis database in REDIS_URL still exists and isn't paused/deleted (free-tier databases can be deleted after long inactivity).
  2. Re-copy REDIS_URL fresh from the Upstash dashboard into .env β€” watch for a stray trailing space, missing rediss:// scheme, or an old value left over from before you rotated credentials.
  3. Confirm you have working internet/DNS locally (nslookup <your-host>.upstash.io from a terminal).

The app is designed to degrade gracefully if Redis is down: file uploads and chat still work, just without background re-embedding of that specific file until Redis is reachable again (use the "Retry" button on the Documents page once it's back).

Timed out fetching a new connection from the connection pool / Can't reach database server (Supabase)

  • If this happens consistently, check the Supabase dashboard β€” free-tier projects auto-pause after a week of inactivity and need to be manually resumed.
  • If it happens under load (e.g. several tabs/requests at once) rather than constantly, this is expected on a free-tier pooler combined with high network latency to the database region β€” the app now auto-tunes Prisma's connection pool (connection_limit=10&pool_timeout=20) to reduce this, but a slow/distant DB region will still be slower than a nearby one. For production, deploy your app server in (or near) the same region as your Supabase project.

This project is licensed under the MIT License.


⭐ Support

If you found this project useful:

  • Star the repository
  • Fork the project
  • Share feedback and suggestions

πŸ“¬ Contact

For collaborations, suggestions, or contributions, feel free to open an issue or connect through GitHub.

About

AI-powered personalized learning platform with intelligent tutoring, document analysis, quiz generation, AI summaries, and performance analytics.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages