Skip to content

csprl1/eduforge

Repository files navigation

EduForge β€” AI-Powered Learning Management System

Next.js TypeScript PostgreSQL Tailwind CSS Groq AI


πŸš€ Live Demo

https://eduforge-3jkj-git-main-csprl1s-projects.vercel.app/

Demo Credentials

Role Email Password
Student student@eduforge.dev Student@123
Instructor instructor@eduforge.dev Instructor@123
Admin admin@eduforge.dev Admin@123

🧠 What is EduForge?

EduForge is a production-grade AI-powered Learning Management System (LMS) that goes far beyond basic CRUD. It solves a real edtech problem: learners need more than static content β€” they need interactive testing and rapid comprehension tools. EduForge delivers this through Groq-powered AI that generates contextually accurate quizzes and lesson summaries from actual course content.

Why this matters:

  • AI quiz generation β†’ eliminates hours of manual question writing for instructors
  • Instant summaries β†’ helps students absorb lessons faster
  • Role-based multi-tenancy β†’ students, instructors, and admins all have tailored experiences
  • Built on Next.js 15 App Router β†’ maximum SSR/SSG performance, SEO-ready

✨ Features

Core LMS

  • Course Management β€” Create, read, update, delete courses with rich metadata (category, level, tags, price)
  • Lesson Builder β€” Markdown-powered lesson editor with video embed support
  • Enrollment System β€” One-click enrollment with progress tracking
  • Progress Tracking β€” Per-course percentage progress with visual indicators

AI Features (Groq / Llama 3.1)

  • AI Quiz Generator β€” Generates 5 MCQs from lesson content with explanations
  • AI Lesson Summarizer β€” Produces key takeaways and TL;DR from any lesson
  • Graceful fallback β€” Works in demo mode without an API key

Auth & Authorization

  • Credential auth β€” bcrypt-hashed passwords, Zod-validated inputs
  • OAuth ready β€” Google & GitHub providers (add credentials to enable)
  • JWT sessions β€” Stateless, scalable
  • Role-based access β€” STUDENT / INSTRUCTOR / ADMIN with middleware enforcement
  • Route protection β€” middleware.ts guards all sensitive routes

Admin Panel

  • User management with role promotion/demotion
  • Platform-wide analytics (users, courses, enrollments)
  • Course oversight with quick edit/view links

πŸ—οΈ Architecture

eduforge/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ (auth)/login|register/     # Public auth pages
β”‚   β”œβ”€β”€ (dashboard)/               # Protected layout
β”‚   β”‚   β”œβ”€β”€ dashboard/             # Main dashboard (SSR)
β”‚   β”‚   β”œβ”€β”€ courses/               # Course catalog + detail + editor
β”‚   β”‚   β”‚   └── [id]/lesson/[lessonId]/  # Lesson viewer + AI tools
β”‚   β”‚   β”œβ”€β”€ profile/               # User profile
β”‚   β”‚   └── admin/                 # Admin panel
β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”œβ”€β”€ auth/[...nextauth]/    # NextAuth handler
β”‚   β”‚   β”œβ”€β”€ courses/               # Course CRUD + enroll
β”‚   β”‚   β”œβ”€β”€ lessons/               # Lesson CRUD
β”‚   β”‚   β”œβ”€β”€ enrollments/           # Enrollment queries
β”‚   β”‚   β”œβ”€β”€ users/                 # Register + profile update
β”‚   β”‚   β”œβ”€β”€ admin/                 # Admin-only actions
β”‚   β”‚   └── ai/generate-quiz|summarize/  # Groq AI endpoints
β”‚   └── page.tsx                   # Landing page
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ ui/                        # Design system primitives
β”‚   β”œβ”€β”€ courses/                   # Course cards, forms, lesson viewer
β”‚   β”œβ”€β”€ ai/                        # AI quiz + summary panels
β”‚   β”œβ”€β”€ admin/                     # Admin action components
β”‚   β”œβ”€β”€ dashboard/                 # Profile edit form
β”‚   └── layout/                    # Navbar, Footer
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ auth.ts                    # NextAuth config
β”‚   β”œβ”€β”€ db.ts                      # Prisma singleton
β”‚   β”œβ”€β”€ utils.ts                   # Helpers + constants
β”‚   └── validations.ts             # Zod schemas
β”œβ”€β”€ prisma/
β”‚   β”œβ”€β”€ schema.prisma              # Full data model
β”‚   └── seed.ts                    # Demo data seeder
└── middleware.ts                  # Route protection

πŸ› οΈ Tech Stack

Layer Technology
Framework Next.js 15 (App Router, TypeScript)
Database PostgreSQL via Neon / Railway
ORM Prisma 6
Auth NextAuth.js v4 (JWT + Credentials)
Styling Tailwind CSS 3 + Radix UI
AI Groq API (Llama 3.1-8b-instant)
Validation Zod
Deployment Vercel

πŸ” Security

  • Passwords hashed with bcrypt (12 rounds)
  • Zod validation on all API inputs (prevents injection)
  • Middleware-enforced route guards (not just client-side)
  • CSRF protection via NextAuth
  • Authorization checks on every mutation (owner/admin only)
  • Environment secrets never exposed to client

⚑ Performance

  • Server Components for all data-fetching pages (zero client JS for static content)
  • Parallel data fetching with Promise.all across dashboard queries
  • Prisma select β€” only fetch fields needed (no over-fetching)
  • next/font β€” Google Fonts loaded at build time, zero CLS
  • Streaming β€” Next.js suspense-ready architecture
  • Image optimization via next/image

πŸš€ Getting Started

1. Clone & Install

git clone https://github.com/yourusername/eduforge
cd eduforge
npm install

2. Environment Variables

cp .env.example .env.local

Fill in:

DATABASE_URL="postgresql://user:password@host:5432/eduforge"
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="$(openssl rand -base64 32)"
GROQ_API_KEY="your-key-from-console.groq.com"   # Free tier available

3. Database Setup

# Push schema (development)
npm run db:push

# Or run migrations (production)
npm run db:migrate

# Seed demo data
npm run db:seed

4. Run

npm run dev
# β†’ http://localhost:3000

5. Deploy to Vercel

npm i -g vercel
vercel
# Add environment variables in Vercel dashboard

Recommended DB providers:

  • Neon β€” Serverless PostgreSQL, free tier
  • Supabase β€” PostgreSQL with extras

πŸ“Š Data Model

User ─── Course (instructor creates many)
     ─── Enrollment (student enrolls in many)
     ─── QuizAttempt
     └── Review

Course ─── Lesson (ordered)
       ─── Quiz (AI-generated)
       ─── Enrollment
       └── Review

Lesson ─── LessonProgress
       └── Quiz

🎯 API Reference

Method Endpoint Auth Description
GET /api/courses Public List courses (filterable)
POST /api/courses Instructor+ Create course
GET /api/courses/:id Public Get course details
PATCH /api/courses/:id Owner/Admin Update course
DELETE /api/courses/:id Owner/Admin Delete course
POST /api/courses/:id/enroll Student Enroll in course
POST /api/lessons Instructor+ Create lesson
PATCH /api/lessons/:id Owner/Admin Update lesson
DELETE /api/lessons/:id Owner/Admin Delete lesson
POST /api/ai/generate-quiz Any auth Generate AI quiz
POST /api/ai/summarize Any auth Generate AI summary
POST /api/users/register Public Register new user
PATCH /api/users/:id Self/Admin Update profile
PATCH /api/admin/users/:id/role Admin only Change user role

πŸ‘€ Author

Prathamesh Ugale


πŸ“„ License

MIT β€” built for the House of Edtech Fullstack Assignment, Jan 2026.

About

Modern AI-powered learning platform built with Next.js, Prisma, Tailwind and NextAuth.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors