A modern web application that combines the power of Optical Character Recognition (OCR) with mathematical expression evaluation. Built using React, TypeScript, and Tailwind CSS, it allows users to draw mathematical expressions on a canvas, extracts those expressions using Tesseract.js, evaluates them with mathjs, and displays the result.
Smart Calculator is designed to simplify mathematical calculations by allowing users to draw expressions directly on a canvas. This intuitive approach makes it easier for users to perform calculations without typing complex expressions.
Frontend:
Development Tools:
To set up and run the Smart Calculator locally:
Clone the Repository:
git clone https://github.com/ajit421/Smart_calculator.git
Navigate to the Project Directory:
cd Smart_calculator
Create a .env file
mkdir .env
cd .env
Paste your google gemini api key
VITE_GEMINI_API_KEY=Abc12*******************************b4
Install Dependencies:
npm install
Start the Application:
npm run dev
View in Browser:
Open http://localhost:3000
in your browser.
Smart_calculator/
āāā node_modules/ # Node.js dependencies
āāā public/ # Public assets
ā āāā index.html
āāā src/ # Source code
ā āāā components/ # Reusable components
ā ā āāā Canvas.tsx # Canvas for drawing
ā āāā App.tsx # Main App component
ā āāā index.tsx # Entry point
ā āāā ...
āāā .gitignore # Ignored files
āāā package.json # Project metadata and scripts
āāā tsconfig.json # TypeScript config
āāā tailwind.config.js # Tailwind CSS config
āāā README.md # This file
tailwind.config.js
.Contributions are welcome! Feel free to fork and enhance the project.
Fork the Repository on GitHub.
Clone Your Fork:
git clone https://github.com/your-username/Smart_calculator.git
Create a Branch:
git checkout -b feature/your-feature
Make Changes & Commit:
git commit -m "Add: your feature"
Push and Submit a Pull Request:
git push origin feature/your-feature