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| 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 |
- Node 20+
- MongoDB (local or Atlas URI)
npm install
cp apps/server/.env.example apps/server/.env
cp apps/web/.env.example apps/web/.env.localFill in:
apps/server/.env
MONGODB_URIJWT_SECRET(any long random string)CORS_ORIGIN=http://localhost:3000WEB_URL=http://localhost:3000
apps/web/.env.local
NEXTAUTH_SECRETNEXTAUTH_URL=http://localhost:3000NEXT_PUBLIC_API_URL=http://localhost:4000NEXT_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).
# terminal 1
npm run dev:server
# terminal 2
npm run build --workspace=@quizlive/shared
npm run dev:web- Create a free cluster and database user
- Network Access: allow Render IPs (or
0.0.0.0/0for demos) - Copy connection string →
MONGODB_URI(database nameQuizLive)
- New Web Service from this repo (or use
render.yaml) - Build:
npm install && npm run build --workspace=@quizlive/shared && npm run build --workspace=@quizlive/server - Start:
npm run start --workspace=@quizlive/server - Set env vars:
MONGODB_URI,JWT_SECRET,CORS_ORIGIN(your Vercel URL),WEB_URL(same Vercel URL)
- Import the monorepo; set Root Directory to
apps/webor use install/build from repo root with thevercel.jsoninapps/web - Env vars:
NEXTAUTH_URL= Vercel URLNEXTAUTH_SECRETNEXT_PUBLIC_API_URL= Render URL (e.g.https://quizlive-api.onrender.com)NEXT_PUBLIC_WS_URL= same Render URL
- Teacher: Register / login → New exam → paste ChatGPT MCQs or add manually → Save → Start live
- Student: scan QR / open join link → name + roll → wait in lobby
- Teacher: Start exam → answers sync → reveal on timeout → leaderboard every 5 questions → final results
- 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
Private / educational use.