A fun, interactive trivia game built with React, designed to test your knowledge on various topics! 🚀
- 🎮 Multiple categories (Science, Movies, History, etc.)
- ⏳ Timed questions for added challenge
- 🎯 Score tracking with a leaderboard
- 🎨 Responsive design for mobile and desktop
- 🔀 Randomized questions for replayability
- 🔒 Secure user authentication (optional, for saving scores)
Ensure you have the following installed:
- Node.js (v16 or later)
- npm or yarn package manager
-
Clone the repository:
git clone https://github.com/yourusername/trivia-game.git cd trivia-game
-
Install dependencies:
npm install # or yarn install
-
Start the development server:
npm start # or yarn start
-
Open the app in your browser at http://localhost:3000.
trivia-game/
├── public/ # Static assets
├── src/ # Source code
│ ├── components/ # React components
│ ├── pages/ # Page components
│ ├── utils/ # Helper functions
│ ├── App.js # Main app component
│ ├── index.js # App entry point
│ └── styles/ # CSS/SCSS files
└── package.json # Project configuration
- Select a trivia category from the homepage.
- Answer questions before the timer runs out.
- Earn points for correct answers and see how you rank on the leaderboard!
- React for UI development
- React Router for navigation
- Axios for fetching trivia questions from an API
- Open Trivia Database API (OTDB)
- CSS/SCSS for styling
- Optional: Firebase or Supabase for authentication and leaderboard storage
- Add support for multiplayer mode
- Include customizable difficulty levels
- Improve UI/UX with animations (e.g., using Framer Motion)
- Integrate more APIs for trivia questions
Contributions are welcome! To get started:
- Fork the repository.
- Create a new branch for your feature:
git checkout -b feature-name
. - Commit your changes:
git commit -m 'Add a new feature'
. - Push to your branch:
git push origin feature-name
. - Open a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Thanks to the Open Trivia Database for providing the trivia questions.
- Inspired by classic trivia games and pub quizzes!