Quizzard is a quiz-based learning platform that rewards users with magical powers as they grow their knowledge. Users earn mana and increase their "mage meter" by taking quizzes, competing with friends, and improving their scores over time.
- User Authentication: Secure login and registration system
- Interactive Quizzes: Engaging quiz interface with varied topics and difficulty levels
- Progress Tracking: Track your mana and mage meter as you complete quizzes
- Leaderboards: Compete with friends and see global rankings
- Friend System: Add and connect with friends to challenge each other
- Responsive Design: Works seamlessly on desktop and mobile devices
Experience Quizzard live:
- Frontend: https://quizzard-frontend.vercel.app
- Backend API: https://quizzard-backend.onrender.com
- React: UI framework built with functional components and hooks
- TypeScript: Type-safe code with better developer experience
- Vite: Fast build tool and development server
- CSS: Custom styling with a focus on user experience
- React Router: Client-side routing for single-page application
- Node.js: JavaScript runtime for the server
- Express: Lightweight web framework
- TypeScript: Type-safe server development
- MongoDB: NoSQL database for storing user data, quizzes, and scores
- Mongoose: MongoDB object modeling for Node.js
- JWT: JSON Web Tokens for secure authentication
/
├── frontend/ # React frontend application
│ ├── src/ # Source code
│ │ ├── api/ # API service functions
│ │ ├── components/# Reusable UI components
│ │ ├── pages/ # Application pages/views
│ │ └── utils/ # Utility functions
│ └── ... # Configuration files
│
├── backend/ # Node.js/Express backend API
│ ├── src/ # Source code
│ │ ├── config/ # Configuration settings
│ │ ├── controllers/ # Request handlers
│ │ ├── middleware/ # Express middleware
│ │ ├── models/ # Database models
│ │ ├── routes/ # API routes
│ │ └── __tests__/ # Test files
│ └── ... # Configuration files
└── ...
- Node.js (v16+)
- npm or yarn
- MongoDB account (or local MongoDB installation)
-
Clone the repository:
git clone https://github.com/yourusername/quizzard.git cd quizzard
-
Install backend dependencies:
cd backend npm install
-
Set up environment variables in backend/.env:
PORT=5005 MONGO_URI=mongodb+srv://yourusername:yourpassword@cluster.mongodb.net/quizzard JWT_SECRET=your_jwt_secret
-
Install frontend dependencies:
cd ../frontend npm install
-
Start the backend server:
cd ../backend npm run dev
-
Start the frontend development server:
cd ../frontend npm run dev
-
Open your browser and navigate to
http://localhost:5173
POST /api/auth/register
- Register a new userPOST /api/auth/login
- Login a user
GET /api/user/me
- Get current user infoPUT /api/user/me
- Update user profileDELETE /api/user/me
- Delete user accountPOST /api/user/change-password
- Change password
GET /api/quiz
- Get quiz questionsPOST /api/quiz/submit
- Submit quiz answers
GET /api/user/friends
- Get user's friendsPOST /api/user/friends
- Add a friendDELETE /api/user/friends
- Remove a friend
GET /api/leaderboard/global
- Get global leaderboardGET /api/leaderboard/friends
- Get friends leaderboard
Run backend tests:
cd backend
npm test
Quizzard is designed to be responsive and works on mobile browsers as well as desktop.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenTrivia Database - Quiz questions API
- React Documentation
- Express.js
- MongoDB Atlas