MathAI is a web application that leverages AI to provide solutions and explanations for math problems. Users can input text questions and upload images of math problems to receive detailed answers and explanations.
Check out the live version of this project here: MathAI Live
- Text-Based Questions: Enter math questions in text form and receive AI-generated solutions.
- Image-Based Questions: Upload images containing math problems to get AI-generated solutions and explanations.
- Responsive Design: Fully responsive layout for both desktop and mobile devices.
- Frontend: React
- Backend: Node.js with Express
- AI: Google Generative AI
- File Handling: Multer
- Styling: Tailwind CSS
/frontend
: Contains the React application./backend
: Contains the Express server and API integration.
- Node.js and npm installed
- Google Generative AI API Key
-
Clone the repository:
git clone https://github.com/yourusername/MathAI.git cd MathAI
-
Install Dependencies:
The project uses npm to manage dependencies.
npm install
This will install all the dependencies specified in package.json, including both regular dependencies and development dependencies.
-
Set Up Environment Variables:
Create a
.env
file in thebackend
directory with the following content:GEMINI_API_KEY=your_google_api_key
-
Start the Backend Server:
node Server.js
-
Start the Frontend Application:
npm run dev
This will open the application in your default web browser.
-
Entering Text Questions:
- Go to the homepage.
- Type your math question in the text input field and click "Solve."
-
Uploading Images:
- Go to the homepage.
- Click on the upload area to choose an image file with a math problem.
- Click "Solve" to get the solution and explanation for the uploaded image.
-
POST
/gemini
: Receives a text message or an image file and returns a generated solution.Request Body:
message
: A string containing the math question.image
(optional): A file upload containing the image of the math problem.
Response:
- The response contains the generated solution and explanation.