๐ Integration by Parts (Sample Problem):#
๐จ 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#
Physics Diagram Solving#
๐ง 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#
Component | Technology |
---|---|
Frontend | React + Tailwind CSS |
Build Tool | Vite |
Backend | Python (FastAPI) |
AI Integration | Google Gemini API |
Drawing Engine | HTML5 Canvas |
State Mgmt | React Hooks + Refs |
Extra UI | FontAwesome, 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.