This is a web application that generates trivia questions using the OpenAI ChatGPT API. It allows users to select a category and difficulty level to generate a set of trivia questions with multiple-choice options.
To run the Trivia App locally, follow these steps:
-
Clone the repository:
git clone https://github.com/emalindahk/quizo.git
-
Navigate to the project directory:
cd trivia-app
-
Install the dependencies:
npm install
-
Set up the environment variables:
- Create a
.env
file in the project root directory. - Add the following environment variable with your Api url:
REACT_APP_PUBLIC_API=<chat_gpt_api_url>
- Create a
-
Start the server:
npm start
-
The Trivia App will be accessible at
http://localhost:3000
in your browser.
- Select a category and difficulty level from the provided options.
- Click the "Generate Questions" button.
- The Trivia App will send a request to the ChatGPT API (
https://gpt-questions.onrender.com/questions
) with the selected category and difficulty level. Link to repo (https://github.com/emalindahk/gpt-api
) - The API will generate a set of trivia questions using the ChatGPT model.
- The generated questions will be displayed on the Trivia App's interface, along with multiple-choice options.
- Answer the questions and check your responses.
Note: The Trivia App uses the ChatGPT API provided by OpenAI. Make sure you have a stable internet connection to successfully generate and display the trivia questions.