A modern, full-stack educational platform built with Next.js 14, TypeScript, MongoDB, LiveKit, Groq AI, and Pinecone. Enables teachers to create virtual classrooms with live video sessions, AI-powered chatbot with semantic search, smart attendance tracking, and gamification.
- Class Management - Create and manage multiple classes with grades and sections
- Subject Organization - Add subjects to classes with custom colors and icons
- Live Sessions - Schedule and host virtual classrooms with LiveKit video
- Smart Attendance - Automatic attendance tracking via LiveKit webhooks
- Material Upload - Share PDFs, videos, images, and links with students (auto-indexed in Pinecone)
- AI Quiz Generation - Generate quizzes using Groq AI from session content
- Analytics Dashboard - View student performance and engagement metrics
- Virtual Classroom - Join live sessions with video, audio, and screen sharing
- AI Chatbot - Get instant help from Groq-powered AI assistant with context from study materials
- Semantic Search - Find relevant study materials using natural language queries powered by Pinecone
- Study Materials - Access all shared resources organized by subject
- Performance Tracking - View quiz scores, attendance, and progress
- Gamification - Earn points, badges, and compete on leaderboards
- Multilingual Support - Interface available in English, Hindi, Spanish, French
- Next.js 14 with App Router and Server Components
- TypeScript for type safety
- MongoDB with Mongoose ODM
- LiveKit for real-time video communication
- Groq AI for chatbot and quiz generation
- Pinecone for vector database and semantic search
- Cloudinary for file uploads
- Tailwind CSS with custom design system
This project leverages Pinecone's vector database (free tier) to provide intelligent, semantic search capabilities:
- Automatic Indexing: When teachers upload study materials, they're automatically embedded and stored in Pinecone
- Smart Search: Students can search using natural language queries like "explain photosynthesis" instead of exact keywords
- Context-Aware AI: The AI chatbot retrieves relevant materials from Pinecone to provide accurate, contextual answers
- Free Tier: Uses Pinecone's free tier (1 index, 100K vectors, 2GB storage)
Key Features:
- Vector embeddings for all study materials (PDFs, videos, documents)
- Cosine similarity search for relevant content retrieval
- Real-time indexing when materials are uploaded
- Filters by class and subject for targeted search
- Node.js 18+ and npm
- MongoDB (local or Atlas)
- LiveKit account (free tier available)
- Groq API key (free tier available)
- Pinecone account (free tier available)
- Cloudinary account (optional for file uploads)
git clone <your-repo-url>
cd web-a-thon
npm installCreate a .env.local file in the root directory:
cp .env.example .env.localEdit .env.local with your credentials:
# Database - Use MongoDB Atlas or local instance
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/eduplatform?retryWrites=true&w=majority
# Authentication - Generate with: openssl rand -base64 32
JWT_SECRET=your-secure-jwt-secret-here
NEXTAUTH_SECRET=your-secure-nextauth-secret-here
NEXTAUTH_URL=http://localhost:3000
# LiveKit - Sign up at https://livekit.io
LIVEKIT_API_KEY=your-livekit-api-key
LIVEKIT_API_SECRET=your-livekit-api-secret
LIVEKIT_URL=wss://your-project.livekit.cloud
# Groq AI - Get free API key at https://console.groq.com
GROQ_API_KEY=your-groq-api-key
# Pinecone - Sign up at https://www.pinecone.io (Free tier: 1 index, 100K vectors)
PINECONE_API_KEY=your-pinecone-api-key
# Cloudinary - Sign up at https://cloudinary.com
CLOUDINARY_CLOUD_NAME=your-cloud-name
CLOUDINARY_API_KEY=your-api-key
CLOUDINARY_API_SECRET=your-api-secret
# App Configuration
NODE_ENV=development
NEXT_PUBLIC_APP_URL=http://localhost:3000npm run devOpen http://localhost:3000 in your browser.
-
Register as Teacher
- Go to http://localhost:3000/register
- Enter your details and select "Teacher" role
- Click "Create Account"
-
Login
- Go to http://localhost:3000/login
- Enter your credentials
- You'll be redirected to the teacher dashboard
-
Create a Class
- Navigate to "Classes" in the sidebar
- Click "Create Class"
- Enter class name, grade, and section
- Click "Create Class"
-
Add Subjects
- Navigate to "Subjects" in the sidebar
- Click "Add Subject"
- Select your class, enter subject name
- Choose a color for the subject
- Click "Create Subject"
-
Schedule a Session
- Navigate to "Sessions" in the sidebar
- Click "Schedule Session"
- Fill in session details (title, class, subject, time)
- Click "Schedule Session"
web-a-thon/
βββ src/
β βββ app/ # Next.js App Router
β β βββ api/ # API routes
β β β βββ auth/ # Authentication endpoints
β β β βββ classes/ # Class management
β β β βββ subjects/ # Subject management
β β β βββ sessions/ # Session management
β β β βββ livekit/ # LiveKit token generation
β β βββ teacher/ # Teacher pages
β β β βββ dashboard/ # Teacher dashboard
β β β βββ classes/ # Class management UI
β β β βββ subjects/ # Subject management UI
β β β βββ sessions/ # Session management UI
β β βββ student/ # Student pages
β β β βββ dashboard/ # Student dashboard
β β βββ login/ # Login page
β β βββ register/ # Registration page
β β βββ page.tsx # Landing page
β βββ components/
β β βββ ui/ # Reusable UI components
β βββ lib/
β β βββ mongodb.ts # Database connection
β β βββ utils.ts # Utility functions
β βββ models/ # MongoDB schemas
β β βββ User.ts
β β βββ Class.ts
β β βββ Subject.ts
β β βββ Session.ts
β β βββ Attendance.ts
β β βββ Material.ts
β β βββ Message.ts
β β βββ Quiz.ts
β β βββ Performance.ts
β β βββ Doubt.ts
β βββ types/ # TypeScript types
βββ docs/ # Documentation
βββ public/ # Static assets
βββ package.json
- Next.js 14 - React framework with App Router
- TypeScript - Type-safe JavaScript
- Tailwind CSS - Utility-first CSS framework
- Framer Motion - Animation library
- React Hook Form - Form handling
- Zod - Schema validation
- Zustand - State management
- Lucide React - Icon library
- Next.js API Routes - RESTful API endpoints
- MongoDB - NoSQL database
- Mongoose - ODM for MongoDB
- bcryptjs - Password hashing
- jsonwebtoken - JWT authentication
- LiveKit - WebRTC video infrastructure
- LiveKit Server SDK - Token generation
- LiveKit React Components - Pre-built UI components
- Groq SDK - AI API client
- Llama 3 / Mixtral - Language models
- Cloudinary - Cloud storage and CDN
- User registers with email/password (bcrypt hashed)
- User logs in β JWT token generated
- Token stored in HTTP-only cookie
- Protected routes verify JWT on server
- Role-based access control (teacher/student)
- Authentication (email, passwordHash)
- Profile (name, avatar, role)
- Preferences (language, notifications, theme)
- Gamification (points, badges, level)
- Basic info (name, grade, section)
- Teacher reference
- Student list
- Subject list
- Schedule array
- Session details (title, description)
- Class & subject references
- Schedule (start/end times)
- LiveKit room ID
- Status (scheduled β live β completed)
- Auto-tracked via LiveKit webhooks
- Join/leave timestamps
- Duration calculation
- Status (present/absent/late)
// Generate token for user
POST /api/livekit/token
Body: { roomName, participantName }
Response: { token, url }- Teachers: Full admin access, can mute, kick, end session
- Students: Publish audio/video, chat, raise hand
- Context-aware responses
- Subject-specific knowledge
- Multilingual support
- Code syntax highlighting
- Generate from session content
- Multiple choice questions
- Difficulty levels
- Explanations included
- Desktop: Full sidebar navigation
- Tablet: Collapsible sidebar
- Mobile: Bottom navigation bar
Supported languages:
- English (en)
- Hindi (hi)
- Spanish (es)
- French (fr)
# Run development server
npm run dev
# Build for production
npm run build
# Start production server
npm start
# Run linter
npm run lint- Push code to GitHub
- Import project in Vercel
- Add environment variables
- Deploy
- Password Hashing: bcrypt with salt rounds
- JWT Tokens: HTTP-only cookies, 7-day expiry
- CSRF Protection: SameSite cookie policy
- Input Validation: Zod schemas on forms
- MongoDB Injection: Mongoose sanitization
- Core authentication system (register, login, JWT)
- Teacher dashboard with stats
- Student dashboard with upcoming sessions
- Class management (create, list, view)
- Subject management (create, list)
- Session scheduling and listing
- LiveKit token generation API
- All 10 database models
- Responsive layouts for teacher/student
- UI component library (Button, Card, Input, Badge, Dialog, Table)
- Video room UI with LiveKit components
- Attendance webhook handler
- Material upload with Cloudinary
- Groq AI chatbot interface
- Quiz generation and taking
- Performance analytics
- Gamification system
This project is licensed under the MIT License.
Built with β€οΈ for better education