Samsara Coding Problem Generator is a React-based web application that leverages the OpenAI API to generate random coding problems, complete with solutions and explanations. The project is divided into two main parts: the backend for API calls and the frontend for data fetching and displaying.
Follow the instruction below to install and run the react app on your system:
- Clone the project into your system
git clone https://github.com/manishacharya60/samsara-coding-problems-generator.git - If you want to run the
backendlocally, go into thebackendfolder and create a file named.env - Add the following line in your
.envfile:OPENAI_API_KEY=<Your OpenAI API Key Here> - Then, run the following command.
By default, the backend runs on http://localhost:8080
$ node . - Then, go back to the
frontendfolder and run the following commands$ npm install - In the
fetchdata()function update your API URL withhttp://localhost:8080 - Finally, run the following command
By default, the frontend runs on http://localhost:3000
$ npm start
A few features I have implemented in this project are:
- Tabbed Interface: Separate tabs for questions and solutions for better organization.
- Comprehensive Content: Each question includes examples, solutions in Java, explanations, and complexities.
- Dynamic Generation: Fetches new and unique coding problems on each request.