Calci is a web-based application that allows users to draw handwritten complex equations on a canvas, upload the drawing to the server, and receive an AI-generated result that solves the equation within seconds. The AI processes the image, extracts the equation, and returns the solution on the page.
I was inspired by Apple's new calculator app for the iPad, which uses AI to interpret handwritten equations, offering suggestions and solving them. I thought I could replicate something similar on a website.
- User Input: The user draws their equations by hand on the canvas.
- Backend Processing: When the user clicks the "Calculate" button, the image on the canvas is converted into a Blob and sent to the backend.
- AI Integration: I used Google's generative AI to interpret the image, extract the equation, and provide the result.
- Result Display: The AI's response is then displayed in a separate answer box.
- Unlike Apple's app, which provides the solution immediately when the user writes the equals sign, I haven't figured out how to implement real-time equation solving yet.
- The Apple app displays the answer directly next to the question in the same line, whereas I currently show the result in a separate text box. I’m not sure how to make the display inline.
- Draw complex equations on a canvas.
- Upload the drawing as an image (
.png) to the server. - Server-side processing using Google Generative AI to solve equations.
- Displays the AI-generated solution on the webpage within seconds.
- Frontend: HTML5, CSS3, JavaScript (Canvas API)
- Backend: Node.js, Express.js
- AI Integration: Google Generative AI (Gemini model)
- File Upload: Multer (Node.js middleware)
-
Clone the repository:
git clone https://github.com/Osank31/Calci.git
-
Navigate to the project directory:
cd Calci -
Install dependencies:
npm install
-
Set up environment variables by creating a
.envfile in the root directory with the following content:GEMINI_API_KEY=your_google_generative_ai_key PORT=3000
-
Run the project:
npm run dev
-
Open your browser and go to
http://localhost:3000to access the app, or visit the live version at Calci.
- Write a complex equation on the canvas.
- Click the "Calculate" button.
- The drawing will be uploaded to the server.
- The AI will process the drawing and return a solution, which will be displayed on the page within seconds.