Skip to content

GaureeshAnvekar/AiTutor

Repository files navigation

AI PDF Tutor

An intelligent PDF tutoring application that helps students understand documents through interactive AI-powered conversations. Built with Next.js 14, Prisma, OpenAI, and modern web technologies.

Vercel link: https://ai-tutor-1-fukhnuyaa-gaurishs-projects-ca8013fe.vercel.app/login

Video demo (with audio): Watch the demo video

Note: For large pdfs with multiple high-res images, the upload process can be further improved with parallel workers on the backend processing different pages of the pdf in parallel and initiating the "image verbalization LLM requests".

🚀 Features

✅ Implemented

  • Complete Authentication System - Email/password signup and login with NextAuth
  • PDF Upload & Management - Drag-and-drop upload with file validation
  • Split-Screen Interface - PDF viewer with real-time chat panel
  • AI-Powered Chat - OpenAI GPT-4 integration with PDF context
  • Page Navigation - AI can navigate to specific pages
  • Chat History - Persistent conversation storage
  • Responsive Design - Modern UI with Tailwind CSS
  • Voice Controls - UI ready for voice input/output implementation
  • PDF annotation and highlighting system
  • Advanced voice integration
  • Vector search within PDFs

🛠️ Tech Stack

  • Frontend: Next.js 14 (App Router), React, TypeScript, Tailwind CSS
  • Backend: Next.js API Routes, Prisma ORM
  • Database: PostgreSQL
  • AI: OpenAI GPT-4, Vercel AI SDK
  • Authentication: NextAuth.js
  • File Handling: PDF.js, React Dropzone
  • Deployment: Vercel-ready

📋 Prerequisites

  • Node.js 18+
  • PostgreSQL database
  • OpenAI API key
  • Gemini API key

🚀 Quick Start

1. Clone and Install

git clone <repository-url>
cd ai-pdf-tutor
npm install

2. Environment Setup

cp env.example .env.local

Fill in your .env.local:

DATABASE_URL=postgresql://user:pass@localhost:5432/ai_pdf_tutor
OPENAI_API_KEY=sk-your-openai-key
NEXTAUTH_SECRET=your-secret-key
NEXTAUTH_URL=http://localhost:3000

3. Database Setup

# Generate Prisma client
npx prisma generate

# Create and run migrations
npx prisma migrate dev --name init

# (Optional) Seed with test data
npm run db:seed

4. Start Development Server

npm run dev

Visit http://localhost:3000 🎉

🗄️ Database Schema

🚀 Deployment

Vercel (Recommended)

  1. Push code to GitHub
  2. Connect repository to Vercel
  3. Set environment variables in Vercel dashboard
  4. Deploy automatically

Environment Variables for Production

DATABASE_URL=your-production-postgres-url
OPENAI_API_KEY=your-production-openai-key
NEXTAUTH_SECRET=your-production-secret
NEXTAUTH_URL=https://your-domain.com

About

Helps students understand PDF documents through an interactive split-screen interface.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published