AI-Powered Mathematical Expression Solver
Transform handwritten mathematical expressions into digital solutions with advanced AI. From algebra to calculus, get instant answers with step-by-step explanations.
- ๐ Features
- ๐ ๏ธ Tech Stack
- ๐ฆ Installation
- ๐ Environment Setup
- ๐ Development
- ๐ฎ Usage
- ๐๏ธ Project Structure
- ๐ฎ AI Integration
- ๐จ Design System
- ๐ Deployment
- ๐ค Contributing
- ๐ Todo
- ๐ License
- ๐ Acknowledgments
- Infinite Canvas: Zoom and pan across unlimited workspace
- Smart Drawing Tools: Pen, eraser with pressure sensitivity
- Interactive Minimap: Navigate large canvases with ease
- Grid System: Precision drawing with intelligent grid overlay
- Undo/Redo: Complete drawing history management
- Handwriting Recognition: Convert drawn equations to digital format
- Step-by-Step Solutions: Detailed explanations for every calculation
- Multiple Expression Types:
- Basic arithmetic (
2 + 3 * 4) - Algebraic equations (
2x + 3 = 7) - Complex mathematical expressions
- Basic arithmetic (
- Variable Assignment: Track and solve for multiple variables
- Dynamic Toolbar: Context-aware tool switching
- Color System: Customizable drawing colors
- Keyboard Shortcuts: Efficient workflow navigation
- Real-time Results: Instant mathematical analysis
- MathJax Integration: Beautiful mathematical notation rendering
- Responsive Design: Works seamlessly on desktop and tablet
- Modern UI: Glass-morphism design with smooth animations
- Loading States: Visual feedback during AI processing
- Error Handling: Graceful failure management
- Next.js 15 - React framework with App Router
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first styling
- Framer Motion - Smooth animations
- Lucide React - Modern icon system
- React Draggable - Component for draggable elements
- Google Gemini AI - Mathematical expression analysis
- Canvas API - Advanced drawing capabilities
- Axios - HTTP client for API communication
- Radix UI - Accessible component primitives
- Custom Components - Purpose-built interface elements
- MathJax - Mathematical notation rendering
# Clone the repository
git clone https://github.com/yourusername/calcai.git
cd calcai
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env.localCreate a .env.local file with your API keys:
GEMINI_API_KEY=your_google_gemini_api_key_here- Google Gemini API:
- Visit Google AI Studio
- Create a new project and generate an API key
- Add the key to your environment variables
# Start development server
npm run dev
# Build for production
npm run build
# Start production server
npm start
# Run linting
npm run lintOpen http://localhost:3000 to access the application.
- Draw mathematical expressions on the infinite canvas
- Calculate using the AI-powered analysis button
- Review step-by-step solutions in the results panel
- Navigate using pan/zoom tools or minimap
Space + Drag- Pan the canvasCtrl/Cmd + Z- Undo last actionCtrl/Cmd + Y- Redo actionH- Hand tool (pan mode)D- Draw toolE- Eraser tool
- Pen Tool: Draw mathematical expressions
- Eraser Tool: Remove unwanted marks
- Hand Tool: Navigate the canvas
- Zoom Controls: Adjust viewport scale
src/
โโโ app/
โ โโโ api/calculate/ # AI processing endpoint
โ โโโ calculator/ # Main calculator page
โ โโโ landing/ # Landing page
โโโ components/
โ โโโ Dashboard/ # Main application interface
โ โโโ CanvasArea.tsx # Drawing canvas logic
โ โโโ ToolBar.tsx # Tool selection interface
โ โโโ Minimap.tsx # Canvas navigation
โ โโโ ResultDisplay.tsx # Solution presentation
โโโ lib/
โโโ types.ts # TypeScript definitions
โโโ analyzeImage.ts # AI integration utilities
CalcAI uses Google's Gemini AI model for mathematical expression analysis:
- Image Processing: Canvas drawings converted to base64 images
- Expression Recognition: AI identifies mathematical notation
- Solution Generation: Step-by-step problem solving
- Error Handling: Graceful fallbacks for unclear input
- Primary: Cyan (
#06B6D4) / Purple (#8B5CF6) gradients - Background: Deep black with subtle transparency
- Accents: White with various opacity levels
- Interface: System fonts with Tailwind defaults
- Mathematical: MathJax rendering for proper notation
# Deploy to Vercel
vercel --prod# Build the application
npm run build
# Start production server
npm start- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Mobile touch gesture support
- Collaborative drawing features
- Mathematical graph plotting
- Export to PDF/PNG
- Voice input for equations
- Offline mode capabilities
This project is licensed under the MIT License - see the LICENSE file for details.
- Google Gemini AI for mathematical processing
- Next.js Team for the excellent framework
- Vercel for deployment platform
- Tailwind CSS for styling system
Built with โค๏ธ by DIVYESH JAIN