calculator-app / README.md
NikhilSetiya
Add comprehensive README.md
9005dd0
|
raw
history blame
1.65 kB

Calculator Application

A modern calculator application built with FastAPI backend and Gradio frontend.

Features

  • Addition
  • Subtraction
  • Multiplication
  • Division
  • Clean and intuitive user interface
  • Error handling for invalid operations
  • Division by zero protection

Tech Stack

  • Backend: FastAPI
  • Frontend: Gradio
  • Data Validation: Pydantic
  • API Documentation: Swagger UI (automatically generated)

Setup

  1. Clone the repository:
git clone https://github.com/NikhilSetiya/calculator-app.git
cd calculator-app
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Start the backend server:
python backend.py
  1. In a new terminal, start the frontend:
python frontend.py
  1. Open your web browser and navigate to the URL shown in the Gradio output (typically http://localhost:7860)

API Documentation

Once the backend server is running, you can access the API documentation at:

Usage

  1. Enter two numbers in the input fields
  2. Select the operation you want to perform
  3. Click the "Calculate" button
  4. View the result in the output field

Error Handling

The application handles various error cases:

  • Division by zero
  • Invalid operations
  • Network errors
  • Input validation

Contributing

Feel free to submit issues and enhancement requests!

License

This project is licensed under the MIT License - see the LICENSE file for details.