Serperise frontend is built using React, with MainScreen.js
as the main JavaScript file that handles the display of topics, chat interaction with OpenAI for questions, error handling, and input field for user interaction.
To run the Serperise frontend on your local machine, follow these steps:
git clone https://github.com/Sar-thak-3/Serperise
cd serperise
npm install
cd backend
npm install
cd..
npm run start
The MainScreen.js
file is the main entry point for the Serperise frontend application. Here's an overview of its functionality:
The screen displays a list of topics entered, likely retrieved from the backend API.
The chat interface allows users to interact with OpenAI to ask questions. This likely involves sending user input to the backend API, which then communicates with OpenAI's API.
Errors encountered during the application's operation are displayed to the user, ensuring a smooth user experience even when issues arise.
An input field is provided to allow users to enter their questions or messages, initiating interaction with the chatbot (OpenAI).
Ensure that the backend server is running and accessible from the frontend for seamless communication between the frontend and backend components.
For any questions or issues, please refer to the project's documentation or contact the project maintainers.
Happy exploring Serperise!
Welcome to Serperise! This document provides details about the backend APIs for the Serperise project, built using Node.js.
https://serperise-backend.vercel.app/
- Endpoint:
/v1/api/trivia
- Method:
POST
- Description: This endpoint returns a list of trivia questions along with their answers.
- Input Format:
{ "topic": "topic_name", "index": 1 } # The index is handled already in frontend, if you want to try backend api, put index to any integer value
- Response Format:
[ { "question": "What is the capital of France?", "answer": "Paris", "role": "assistant" }, { "question": "Who wrote Romeo and Juliet?", "answer": "William Shakespeare", "role": "assistant" }, ... ]
-
The
role
field in the response indicates whether the answer is provided by an assistant (in this case, OpenAI's API). -
Ensure the backend server is running and accessible to the frontend for fetching data.
Backend server can start from frontend only, after executing npm run start
OR
To start the Serperise backend server, follow these steps:
git clone https://github.com/Sar-thak-3/Serperise
cd serperise/backend
npm install
Create a .env
file and specify any required environment variables.
nodemon index
Ensure the frontend application can communicate with the backend APIs by configuring CORS settings and verifying endpoint URLs.
For any questions or issues, please refer to the project's documentation or contact the project maintainers.
Enjoy using Serperise!