Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QuizLive — Live MCQ Exam Platform

Live classroom quizzes: teachers create MCQs (manual or paste from ChatGPT), project a QR code, and run timed live exams with leaderboards.

Repository: github.com/NehalPatel/QuizLive

git clone https://github.com/NehalPatel/QuizLive.git
cd QuizLive

Architecture

Piece Tech Host
apps/web Next.js 15 + NextAuth (email/password) Vercel
apps/server Express + Socket.io Render
packages/shared Shared TypeScript types
Database MongoDB Atlas Atlas

Local development

Prerequisites

  • Node 20+
  • MongoDB (local or Atlas URI)

Setup

npm install
cp apps/server/.env.example apps/server/.env
cp apps/web/.env.example apps/web/.env.local

Fill in:

apps/server/.env

  • MONGODB_URI
  • JWT_SECRET (any long random string)
  • CORS_ORIGIN=http://localhost:3000
  • WEB_URL=http://localhost:3000

apps/web/.env.local

  • NEXTAUTH_SECRET
  • NEXTAUTH_URL=http://localhost:3000
  • NEXT_PUBLIC_API_URL=http://localhost:4000
  • NEXT_PUBLIC_WS_URL=http://localhost:4000

Teachers register and sign in with email + password at /register and /login.

Questions are added manually or pasted from ChatGPT using the documented format in the exam builder (no server-side AI / API keys required).

Run

# terminal 1
npm run dev:server

# terminal 2
npm run build --workspace=@quizlive/shared
npm run dev:web

Open http://localhost:3000

Deploy

1. MongoDB Atlas

  1. Create a free cluster and database user
  2. Network Access: allow Render IPs (or 0.0.0.0/0 for demos)
  3. Copy connection string → MONGODB_URI (database name QuizLive)

2. Render (API + WebSockets)

  1. New Web Service from this repo (or use render.yaml)
  2. Build: npm install && npm run build --workspace=@quizlive/shared && npm run build --workspace=@quizlive/server
  3. Start: npm run start --workspace=@quizlive/server
  4. Set env vars: MONGODB_URI, JWT_SECRET, CORS_ORIGIN (your Vercel URL), WEB_URL (same Vercel URL)

3. Vercel (frontend)

  1. Import the monorepo; set Root Directory to apps/web or use install/build from repo root with the vercel.json in apps/web
  2. Env vars:
    • NEXTAUTH_URL = Vercel URL
    • NEXTAUTH_SECRET
    • NEXT_PUBLIC_API_URL = Render URL (e.g. https://quizlive-api.onrender.com)
    • NEXT_PUBLIC_WS_URL = same Render URL

4. Smoke test

  1. Teacher: Register / login → New exam → paste ChatGPT MCQs or add manually → Save → Start live
  2. Student: scan QR / open join link → name + roll → wait in lobby
  3. Teacher: Start exam → answers sync → reveal on timeout → leaderboard every 5 questions → final results

Features

  • Email/password login for teachers
  • Manual MCQ builder + difficulty targets (easy / medium / hard)
  • Import MCQs from a pasted ChatGPT document (parsed into individual DB questions)
  • Live session: join code + QR
  • Students register with name + roll number only
  • Timed questions (10s or 20s); correct answer withheld until timeout
  • Leaderboard every 5 questions (correct count, then speed)
  • Teacher results: rankings, lagging students (<50%), per-question accuracy

License

Private / educational use.

About

MCQ Application built in MERN

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages