{"id":30986150,"url":"https://github.com/abdulbasit110/sovle-x-agent","last_synced_at":"2026-04-09T17:39:56.546Z","repository":{"id":312476518,"uuid":"1047627230","full_name":"Abdulbasit110/sovle-X-agent","owner":"Abdulbasit110","description":"AI Math Solver Agent 🤖✍️   Upload or snap math problems, get step-by-step solutions with LaTeX explanations.   Built with Next.js, Express.js, Tesseract.js OCR, and OpenAI Agents SDK (TypeScript).","archived":false,"fork":false,"pushed_at":"2025-08-30T21:03:29.000Z","size":16451,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-30T23:21:12.539Z","etag":null,"topics":["ai","expressjs","latex","math-problems","nextjs","nodejs","ocr","openai-agents-sdk","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Abdulbasit110.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-30T21:01:35.000Z","updated_at":"2025-08-30T21:22:47.000Z","dependencies_parsed_at":"2025-08-30T23:31:39.509Z","dependency_job_id":null,"html_url":"https://github.com/Abdulbasit110/sovle-X-agent","commit_stats":null,"previous_names":["abdulbasit110/sovle-x-agent"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Abdulbasit110/sovle-X-agent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abdulbasit110%2Fsovle-X-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abdulbasit110%2Fsovle-X-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abdulbasit110%2Fsovle-X-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abdulbasit110%2Fsovle-X-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Abdulbasit110","download_url":"https://codeload.github.com/Abdulbasit110/sovle-X-agent/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abdulbasit110%2Fsovle-X-agent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274824661,"owners_count":25356650,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-12T02:00:09.324Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","expressjs","latex","math-problems","nextjs","nodejs","ocr","openai-agents-sdk","typescript"],"created_at":"2025-09-12T14:36:47.413Z","updated_at":"2025-12-30T21:24:08.580Z","avatar_url":"https://github.com/Abdulbasit110.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Math Solver Agent\n\nAn AI-powered math problem solver that uses Tesseract.js OCR to extract text from images and provides step-by-step solutions with LaTeX output. Features a modern Next.js frontend and a robust Express.js backend API.\n\n## ✨ Features\n\n- 📸 **Image Upload \u0026 OCR**: Upload math problem images or take photos\n- 🤖 **AI-Powered Solving**: OpenAI Agents for intelligent math problem solving\n- 📝 **Step-by-Step Solutions**: Clear, educational explanations for each step\n- 🔢 **LaTeX Output**: Professional mathematical formatting\n- 🎨 **Modern UI**: Beautiful, responsive Next.js frontend\n- 🚀 **RESTful API**: Clean backend endpoints for integration\n- 📱 **Mobile Friendly**: Responsive design for all devices\n- 🔍 **Advanced OCR**: Tesseract.js for reliable text extraction\n\n## 🏗️ Architecture\n\n```\n┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐\n│   Next.js       │    │   Express.js    │    │   External      │\n│   Frontend      │◄──►│   Backend API   │◄──►│   AI Services   │\n│   (Port 3000)   │    │   (Port 3001)   │    │   (OpenAI)      │\n└─────────────────┘    └─────────────────┘    └─────────────────┘\n```\n\n## 🚀 Quick Start\n\n### Prerequisites\n\n- Node.js 18+ \n- npm or pnpm\n- OpenAI API key\n\n### 1. Clone \u0026 Setup\n\n```bash\ngit clone \u003cyour-repo\u003e\ncd math-solver-agent\n```\n\n### 2. Environment Variables\n\nCreate a `.env` file in the root directory:\n\n```env\n# OpenAI API Key for math solving\nOPENAI_API_KEY=your_openai_api_key_here\n\n# Backend server port (optional)\nPORT=3001\n```\n\n**Note**: Tesseract.js works offline and doesn't require API keys!\n\n### 3. Install Dependencies\n\n```bash\n# Install backend dependencies\nnpm install\n\n# Install frontend dependencies\ncd math-solver-app\nnpm install\n```\n\n### 4. Start the Application\n\n**Terminal 1 - Backend API:**\n```bash\n# From root directory\nnpm run dev\n# Server runs on http://localhost:3001\n```\n\n**Terminal 2 - Frontend:**\n```bash\n# From math-solver-app directory\nnpm run dev\n# Frontend runs on http://localhost:3000\n```\n\n### 5. Open Your Browser\n\nNavigate to `http://localhost:3000` and start solving math problems!\n\n## 📁 Project Structure\n\n```\nmath-solver-agent/\n├── 📁 Backend (Port 3001)\n│   ├── index.js          # Express server with routes\n│   ├── controller.js     # Request handlers \u0026 business logic\n│   ├── agent.js          # AI math solver using OpenAI Agents\n│   ├── ocr.js           # Image text extraction with Tesseract.js\n│   ├── package.json     # Backend dependencies\n│   └── README.md        # This file\n│\n└── 📁 Frontend (Port 3000)\n    ├── app/              # Next.js app directory\n    │   ├── page.tsx      # Main math solver interface\n    │   └── layout.tsx    # App layout\n    ├── components/       # UI components\n    ├── package.json      # Frontend dependencies\n    └── ...               # Next.js configuration files\n```\n\n## 🔌 API Endpoints\n\n### Backend API (Port 3001)\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| `GET` | `/health` | Health check endpoint |\n| `POST` | `/solve-math` | Upload image and get math solution |\n\n### Frontend (Port 3000)\n\n- **Main App**: `http://localhost:3000` - Math solver interface\n- **Image Upload**: Drag \u0026 drop or camera capture\n- **Real-time Processing**: Live feedback during solving\n\n## 📱 Usage\n\n### 1. Upload Math Problem\n- Take a photo using your device camera\n- Or upload an existing image file\n- Supported formats: JPG, PNG, GIF, etc.\n\n### 2. AI Processing\n- Tesseract.js OCR extracts text from the image\n- AI analyzes the math problem\n- Generates step-by-step solution\n\n### 3. View Results\n- **Extracted Text**: See what the OCR read from your image\n- **Step-by-Step Solution**: Understand each solving step\n- **Final Answer**: Get the numerical/symbolic result\n- **LaTeX Format**: Professional mathematical notation\n\n## 🛠️ Development\n\n### Backend Development\n\n```bash\n# Start with auto-reload\nnpm run dev\n\n# Start production\nnpm start\n```\n\n### Frontend Development\n\n```bash\ncd math-solver-app\n\n# Start with auto-reload\nnpm run dev\n\n# Build for production\nnpm run build\n\n# Start production\nnpm start\n```\n\n## 🔧 Configuration\n\n### Environment Variables\n\n| Variable | Description | Required |\n|----------|-------------|----------|\n| `OPENAI_API_KEY` | OpenAI API key for math solving | ✅ |\n| `PORT` | Backend server port | ❌ (default: 3001) |\n\n### OCR Configuration\n\nTesseract.js provides advanced OCR options:\n\n```javascript\n// Advanced OCR with custom settings\nconst options = {\n  lang: 'eng',           // Language (English)\n  oem: 1,               // OCR Engine Mode: LSTM neural nets\n  psm: 6,               // Page segmentation: uniform text block\n  dpi: 300              // Image DPI for better accuracy\n};\n```\n\n### File Upload Limits\n\n- **Maximum file size**: 10MB\n- **Supported formats**: All common image types\n- **Processing timeout**: Configurable\n\n## 🧪 Testing\n\n### Test Backend API\n\n```bash\n# Health check\ncurl http://localhost:3001/health\n\n# Test math solver (replace with actual image)\ncurl -X POST http://localhost:3001/solve-math \\\n  -F \"image=@math_problem.jpg\"\n```\n\n### Test Frontend\n\n1. Open `http://localhost:3000`\n2. Upload a math problem image\n3. Verify OCR text extraction\n4. Check AI solution generation\n\n## 🚀 Deployment\n\n### Backend Deployment\n\n```bash\n# Build and start\nnpm run build\nnpm start\n\n# Or use PM2\npm2 start index.js --name \"math-solver-api\"\n```\n\n### Frontend Deployment\n\n```bash\ncd math-solver-app\n\n# Build for production\nnpm run build\n\n# Deploy to Vercel, Netlify, or your preferred platform\n```\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Test thoroughly\n5. Submit a pull request\n\n## 📄 License\n\nThis project is licensed under the MIT License.\n\n## 🆘 Troubleshooting\n\n### Common Issues\n\n**Backend won't start:**\n- Check environment variables are set\n- Ensure ports are not in use\n- Verify all dependencies are installed\n\n**Frontend can't connect to API:**\n- Confirm backend is running on port 3001\n- Check CORS settings\n- Verify API endpoints are correct\n\n**OCR not working:**\n- Ensure image quality is good (clear, high contrast)\n- Check image format is supported\n- Verify image contains readable text\n- Try different OCR settings if needed\n\n**Math solving fails:**\n- Verify OpenAI API key\n- Check API quota and limits\n- Ensure problem text is clear\n\n### OCR Tips for Better Results\n\n- **Image Quality**: Use clear, high-resolution images\n- **Contrast**: Ensure good contrast between text and background\n- **Lighting**: Avoid shadows and glare\n- **Orientation**: Keep text horizontal and well-aligned\n- **Font Size**: Larger, clearer fonts work better\n\n## 📞 Support\n\nFor issues and questions:\n- Check the troubleshooting section\n- Review API documentation\n- Open an issue on GitHub\n\n---\n\n**Happy Math Solving! 🧮✨**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdulbasit110%2Fsovle-x-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabdulbasit110%2Fsovle-x-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdulbasit110%2Fsovle-x-agent/lists"}