This is the backend for the iPad Math Calculator project, built using Python with FastAPI. This backend handles requests from the frontend and performs necessary calculations.
You can try out the live demo of the iPad Math Calculator at the following link:
Check out the demo video showcasing the iPad Math Calculator functionality:
To set up the project locally, follow these steps:
-
Clone the repository:
https://github.com/Kishan-Patel-dev/iPad-Backend.git cd ipad-be
-
Create a virtual environment:
python3 -m venv venv
-
Activate the virtual environment:
For Fish shell:
source venv/bin/activate.fish
For Bash or Zsh:
source venv/bin/activate
-
Install the required packages:
pip install fastapi Pillow uvicorn pydantic google.generativeai python-dotenv
-
Create a
.env
file in the root directory to store your environment variables. You can do this by running:touch .env
Then, add your Gemini API key:
# Gemini API Credentials GEMINI_API_KEY=your_api_key_here
Note: The
.env
file is not included in the repository for security reasons. Make sure to add your credentials after creating the file.
To run the application locally, execute the following command:
uvicorn app.calculator.route:app --reload
Visit http://127.0.0.1:8000
in your browser to access the API.
During development, the following commands were used:
mkdir ipad-be
https://github.com/Kishan-Patel-dev/iPad-Backend.git
python3 -m venv venv
touch .env
pip install fastapi Pillow uvicorn pydantic google.generativeai python-dotenv
python3 main.py
ipad-be/
├── .gitignore
├── .env
├── .venv
├── __pycache__/
├── app/
│ └── calculator/
│ ├── __pycache__/
│ └── route.py
├── main.py
├── schema.py
└── constants.py
In the .env
file, add your Gemini API credentials as follows:
# Gemini API Credentials
GEMINI_API_KEY=your_api_key_here
This project is licensed under the MIT License. See the LICENSE file for details.