Trivia Quizler is the first app build in this long, but fun 100 Days of Code journey I am embarking on!
This app idea came from the Random Project Generator I built! I decided to build this using Reactjs and Tailwindcss.
- Choose a topic for your trivia questions.
- Select the number of questions you'd like to answer.
- Start the quiz. Questions are presented one at a time.
- After answering each question, you'll receive instant feedback ('correct' or 'incorrect') and have 3 seconds before the next question.
- Once the quiz is complete, you'll have the option to play again.
Trivia questions are sourced from the OpenAI API, powered by ChatGPT. The API returns JSON data consisting of questions, answer options, and correct answers. This data is stored in the app's state and used to build the quiz logic and UI.
To contribute to this project or address issues:
- Fork and clone this repository to your local machine.
- Install dependencies by running
npm i
in your terminal. - Obtain your own OpenAI API key.
- Create a
.env.local
file in the root directory and add your API key asVITE_OPENAI_KEY
.VITE_OPENAI_KEY=`Bearer <your-api-key>` example: VITE_OPENAI_KEY=`Bearer 1234567890`
- Check out the issues to find tasks for contributing to this project.
- Submit a pull request for review. If you encounter any difficulties, don't hesitate to pop in our Discord to ask for some help!
Also, if you have a cool idea for a feature or want to update the look and feel, take the same steps to fork the repository and get it running on your machine. Submit any cool features you'd like to implement!
If your changes don't break the codebase, I'll merge them in :) Happy Hacking!