This Project is a Simple ReactJS Project which demonstrates the following
- Applying Prompt Engineering in order to get detailed answer from one of Generative AI models using API
- Processing output from AI model into desired format
- Handling questions/options/answers and calculating result for user
This URL has the application deployed in
Refer to https://nodejs.org/en/ to install nodejs
Install create-react-app npm package globally. This will help to easily run the project and also build the source files easily. Use the following command to install create-react-app
npm install -g create-react-appClone the project into local
Install all the npm packages. Go into the project folder and type the following command to install all npm packages
npm installIn order to run the application Type the following command
npm startThe Application Runs on localhost:3000
-
ChatGPTDemo Component : This Component displays a input fields. This Component gets the data from inputs then makes API calls
-
LoadingScreen Component : This Component displays the loading spinner. This Component is used while waiting for response from ChatGPTDemo Component
-
Question Component : This Component displays the question. This Component is a child component of QuizContainer Component
-
QuizContainer Component : This Component displays the list questions. This Component handles user's option for every question
-
Result Component : This Component displays the result of the quiz. This Component calculates user's score and displays correct answers
-
Slider Component : This Component displays slider. This Component is a child component of ChatGPTDemo Component
-
processQuizData Component : This Component processes output from AI model into desired format:
{
'question': <QUIZ_QUESTION>,
'options': [QUIZ_OPTION_1, QUIZ_OPTION_2, QUIZ_OPTION_3, QUIZ_OPTION_4],
'answer': <QUIZ_ANSWER>
}
axios library is used to make HTTP Calls
/- ties to ChatGPTDemo Component/quiz- ties to QuizContainer Component/result- ties to Result Component
create-react-app : The following link has all the commands that can be used with create-react-app https://github.com/facebook/create-react-app
ReactJS : Refer to https://reactjs.org/ to understand the concepts of ReactJS
