<<<<<<< HEAD
A real-time, immersive quiz application designed for team-based competitions. Features a sci-fi/cyberpunk aesthetic, live leaderboards, and secure admin controls.
- ** immersive UI:** Glassmorphism design, animated backgrounds, and responsive layouts.
- 🛡️ Team Authentication: Secure login for multiple teams with progress tracking.
- ⏱️ Real-time Synchronization: Global server-side timer ensures all participants are perfectly synced.
- 📊 Live Leaderboard: Admin panel with real-time score updates and team management.
- 🚫 Anti-Cheat & Security:
- Fullscreen enforcement.
- Tab-switch detection (warnings & disqualification).
- Secure API routes with JWT authentication.
- Prevent dev-tools inspection (right-click disable).
- 📱 Responsive: Fully functional on Desktops, Tablets, and Mobile devices.
- Framework: Next.js 15 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS, Framer Motion
- State: React Context API
- HTTP: Axios
- Runtime: Node.js
- Framework: Express.js
- Database: MongoDB (Mongoose)
- Authentication: JWT (JSON Web Tokens)
- Deployment: Vercel Serverless ready
- Node.js (v18+)
- MongoDB Database (Local or Atlas)
- Git
Clone the repository:
git clone <your-repo-url>
cd quiz-appcd server
npm installcd ../client
npm installCreate a .env file in the server directory:
PORT=5000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_super_secret_jwt_key
CLIENT_URL=http://localhost:3000Create a .env.local file in the client directory:
# For Local Development
NEXT_PUBLIC_API_URL=http://localhost:5000/api
# For Vercel Production (Example)
# NEXT_PUBLIC_API_URL=https://your-server-app.vercel.app/apiStart the Backend:
cd server
npm run dev
# Server runs on http://localhost:5000Start the Frontend:
cd client
npm run dev
# Client runs on http://localhost:3000This project is configured for easy deployment on Vercel.
- Push your code to GitHub.
- Import the
serverdirectory as a new project in Vercel. - Set Framework Preset to Other.
- Add Environment Variables (
MONGO_URI,JWT_SECRET, etc.). - Deploy.
- Import the
clientdirectory as a new project in Vercel. - Set Framework Preset to Next.js.
- Add Environment Variable:
NEXT_PUBLIC_API_URL: Your deployed server URL appended with/api(e.g.,https://my-server.vercel.app/api).
- Deploy.
Note: Ensure your MongoDB Atlas IP Access List allows access from Vercel (0.0.0.0/0).
quiz-app/
├── client/ # Next.js Frontend
│ ├── app/ # App Router Pages (Quiz, Admin, Login)
│ ├── components/ # Reusable UI Components (Modal, Toast)
│ ├── context/ # Auth Context
│ └── utils/ # API helpers
│
└── server/ # Express Backend
├── models/ # Mongoose Schemas (Team, Question, Settings)
├── routes/ # API Routes (Auth, Quiz, Admin)
└── vercel.json # Vercel Deployment Config
This is a Next.js project bootstrapped with create-next-app.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.
badffa158ebc381eb22dbc4575a99098db422ba3