A web application for creating and participating in quizzes, allowing users to test their knowledge on various topics and track their progress.
- Features
- Tech Stack
- Project Structure
- Getting Started
- Docker & Deployment
- API Endpoints
- Contributing
- User Authentication: Secure signup and login functionality
- Quiz Creation: Create custom quizzes with multiple question types
- AI Quiz Generator: Generate quizzes instantly using Google Gemini 2.5 Flash API - specify topic, question count, and difficulty level, then customize before creating
- Quiz Participation: Take quizzes created by others
- Progress Tracking: Monitor performance and view scores
- Leaderboards: See where you stand compared to others
- Admin Panel: Manage quizzes and users (admin access only)
- React.js: JavaScript library for building user interfaces
- Vite: Next-generation frontend tooling
- React Router: For navigation and routing
- CSS3: For styling components
- Node.js: JavaScript runtime environment
- Express.js: Web application framework
- MongoDB: NoSQL database for storing user and quiz data
- JWT Authentication: For secure user sessions
- Git & GitHub: Version control and code hosting
- Vercel: Frontend deployment platform
- MongoDB Atlas: Cloud database service
- Google Gemini 2.5 Flash API: AI-powered quiz generation
- Proxmox: Self-hosted server infrastructure
quizzard/
├── backend/ # Backend server code
│ ├── controller/ # Request handlers
│ ├── middleware/ # Express middlewares
│ ├── models/ # Database models
│ ├── routes/ # API routes
│ └── index.js # Server entry point
│
├── frontend/ # Frontend React application
│ ├── public/ # Static assets
│ └── src/ # Source files
│ ├── api/ # API communication
│ ├── assets/ # Images and media
│ ├── Components/ # Reusable components
│ ├── context/ # React context providers
│ ├── utils/ # Utility functions
│ └── [features]/ # Feature-specific components
- Node.js (v14 or later)
- npm or yarn
- MongoDB instance (local or Atlas)
Follow the installation steps below to run locally.
# Navigate to backend directory
cd backend
# Install dependencies
npm install
# Create .env file with your environment variables
# Example:
# MONGODB_URI=mongodb://localhost:27017/quizzard
# JWT_SECRET=your_jwt_secret
# PORT=5000
# Start the server
npm start# Navigate to frontend directory
cd frontend
# Install dependencies
npm install
# Create .env file with your environment variables
# Example:
# VITE_API_URL=http://localhost:5000/api
# Start the development server
npm run devFor deploying on Proxmox using Coolify:
# See detailed guide in DOCKER_DEPLOYMENT.md
# Quick start with docker-compose for testing:
docker-compose up --buildSee DOCKER_DEPLOYMENT.md for complete Docker and Coolify setup instructions.
This project includes production-ready Docker configurations for deploying on Coolify (Proxmox).
# Clone and setup environment
cp .env.docker.example .env
# Edit .env with your configuration
# Build and run all services
docker-compose up --build
# Access the application
# Frontend: http://localhost
# Backend API: http://localhost:5000
# MongoDB: localhost:27017Build backend and frontend as separate containers:
# Backend
docker build -t quizzard-backend:latest ./backend
# Frontend
docker build -t quizzard-frontend:latest ./frontendThen deploy each separately in Coolify with appropriate environment variables.
POST /api/auth/register- Register a new userPOST /api/auth/login- Login userGET /api/auth/profile- Get user profile (authenticated)
GET /api/quizzes- Get all quizzesGET /api/quizzes/:id- Get a specific quizPOST /api/quizzes- Create a new quiz (authenticated)
POST /api/ai-quizzes/preview- Generate a quiz preview using Gemini AI (without saving)POST /api/ai-quizzes- Generate and save a quiz using Gemini AIPUT /api/quizzes/:id- Update a quiz (authenticated)DELETE /api/quizzes/:id- Delete a quiz (authenticated)
POST /api/quiz-attempts- Create a new quiz attemptGET /api/quiz-attempts/:quizId- Get attempts for a quizGET /api/quiz-attempts/user- Get user's quiz attempts (authenticated)
Contributions are welcome! Feel free to open an issue or submit a pull request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Made with ❤️ by Utkarsh Sharma