Skip to main content

AI Paint Calculator

·3 mins· loading · loading · ·
Projects Projects JavaScript React AI TailwindCSS Vite Gemini Canvas Python FastAPI

๐Ÿ“ Integration by Parts (Sample Problem):
#

AI Paint Calculator Demo

GitHub: https://github.com/dandee77/AI-Paint-Calculator


๐ŸŽจ Project Overview
#

AI Paint Calculator is a fully functional web app that lets users draw math, geometry, calculus, or physics problems directly on a digital canvasโ€”and get instant AI-powered answers. Built using ReactJS, TailwindCSS, and a Python FastAPI backend, this app turns freehand problem-solving into an intuitive and creative experience.

This project showcases how canvas-based drawing, FastAPI inference serving, and responsive frontend design can come together into a powerful educational tool.


โœจ Key Features
#

  • ๐Ÿ–Œ๏ธ Brush & Eraser Tools
  • ๐ŸŽ›๏ธ Size & Color Selection
  • ๐Ÿชฃ Background Color Fill
  • ๐Ÿ”„ Undo / Redo Stack
  • ๐Ÿ’พ Save / Load from Local Storage
  • ๐Ÿ–ผ๏ธ Download Drawing as Image
  • ๐Ÿค– Send to Gemini AI via Python FastAPI backend
  • ๐Ÿง  Solves Math, Geometry, Calculus, Physics Problems
  • ๐Ÿ“ฑ Responsive Layout with Burger Menu for Small Screens

๐Ÿ“ท Screenshots
#

Math Expression Recognition
#

Math Input
Math Result

Physics Diagram Solving
#

Physics Input
Physics Result


๐Ÿง  What It Can Solve
#

  • Algebra & Arithmetic: Variable assignment, equations, PEMDAS
  • Geometry: Labeled diagrams, area, perimeter, angles
  • Calculus: Derivatives, integrals, limits
  • Physics: Force diagrams, motion, vectors

๐Ÿ› ๏ธ Tech Stack
#

ComponentTechnology
FrontendReact + Tailwind CSS
Build ToolVite
BackendPython (FastAPI)
AI IntegrationGoogle Gemini API
Drawing EngineHTML5 Canvas
State MgmtReact Hooks + Refs
Extra UIFontAwesome, Color Pickers

๐Ÿงฉ File Structure
#

AI-Paint-Calculator/
โ”œโ”€โ”€ api/
โ”‚   โ”œโ”€โ”€ main.py
โ”‚   โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ public/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ assets/
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”œโ”€โ”€ TopBar.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ CanvasArea.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ ColorPickerPopover.jsx
โ”‚   โ”‚   โ””โ”€โ”€ Modal.jsx
โ”‚   โ””โ”€โ”€ App.jsx
โ”œโ”€โ”€ index.html
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ tailwind.config.js

๐Ÿš€ Getting Started
#

1. ๐Ÿง  Start the AI Backend (Python FastAPI)
#

Make sure you have Python 3.10+ installed. Then:

cd api
pip install -r requirements.txt
python main.py

This runs the FastAPI server on http://localhost:8000, using uvicorn.

โš ๏ธ Keep the server running โ€” the React frontend will communicate with it.

2. ๐ŸŽจ Start the React App
#

Open a new terminal in the root project directory:

npm install
npm run dev

Then visit http://localhost:5173 in your browser.

3. ๐Ÿ”ง Build for Production
#

npm run build

๐Ÿ”ฎ Future Enhancements
#

  • โœ๏ธ Improved handwriting recognition model
  • ๐Ÿ“ฑ Mobile-friendly drawing interactions
  • ๐Ÿงพ Math history & export to PDF
  • ๐ŸŒ Language selection (multilingual)
  • ๐ŸŽ“ Learning mode with hints and steps

๐Ÿ’ฌ Final Thoughts
#

This project merges art, AI, and educationโ€”allowing anyone to interact with math in a fun and intuitive way. Whether itโ€™s for students, teachers, or curious learners, the AI Paint Calculator is a demonstration of whatโ€™s possible with modern web technologies and AI integration.

๐Ÿ“š References & Tools Used