This is an advanced calculator powered by the Google Gemini API, designed to solve mathematical problems through an interactive drawing interface. Users can draw shapes or diagrams on the screen to visually represent math problems, such as finding the length of the hypotenuse in a right-angled triangle, and the calculator will compute the answer using the given values.
- Interactive Problem Solving: Solve mathematical problems by drawing on the screen, such as calculating the hypotenuse by sketching a triangle and inputting the side lengths.
- Google Gemini API Integration: Provides enhanced AI capabilities.
- Frontend and Backend Separation: Powered by TypeScript, Python, and JavaScript.
- Frontend: TypeScript, Vite, JavaScript
- Backend: Python
- Google Gemini API: Provides AI functionalities
- Node.js: Required to run the frontend.
- Python 3.x: Required to run the backend.
- Google Gemini API Key: You need to obtain an API key from Google.
-
Clone the repository:
git clone https://github.com/senulahesara/Apple-Calculator.git
-
Navigate to the frontend directory (
calc-fe-main
):cd Apple-Calculator/calc-fe-main
-
Install frontend dependencies:
npm install
-
Create a
.env.local
file in thecalc-fe-main
directory and add the following:VITE_API_URL=http://localhost:8900
-
Navigate to the backend directory (
calc-be-main
):cd ../calc-be-main
-
Install backend dependencies (use virtual environment if needed):
pip install -r requirements.txt
-
Create a
.env
file in thecalc-be-main
directory and add your Google Gemini API key:GEMINI_API_KEY=your_api_key_here
-
Run the backend:
python3 main.py
-
Run the frontend:
cd ../calc-fe-main npm run dev
-
Open the application in your browser at
http://localhost:3000
.
- Draw shapes and input values for solving mathematical problems.
- For example, to find the hypotenuse of a right-angled triangle, draw the triangle, input the lengths of the legs, and press the "Run" button.
- AI-powered features are available through integration with the Google Gemini API.
-
Backend (
.env
):GEMINI_API_KEY=your_api_key_here
-
Frontend (
.env.local
):VITE_API_URL=http://localhost:8900
You need to obtain an API key from the Google Gemini API and add it to your .env
file in the backend.
Contributions are welcome! Feel free to submit a pull request or open an issue for improvements or bug fixes.