Step-by-Step Problem Solving Analysis Helper
ForMath is an educational tool that helps students analyze their math homework by identifying calculation errors, conceptual mistakes, and providing detailed feedback on their solutions. The application uses advanced OCR, OpenAI's GPT-4, and Wolfram Alpha to provide comprehensive mathematical analysis and tutoring help.
- Multi-format Input Support: Upload images (JPG, PNG, GIF, BMP) or PDF files of math homework
- Camera Integration: Capture math problems directly using your device's camera
- Text Input: Enter problems manually or paste from other sources
- Advanced OCR: Extract text from images and scanned PDFs using Tesseract.js
- PDF Processing: Direct text extraction from digital PDFs with OCR fallback for scanned documents
- Problem Parsing: Automatically separates original problems from student solutions
- Error Detection: Identifies conceptual errors, computational mistakes, or confirms correct solutions
- Solution Verification: Uses Wolfram Alpha to provide correct solutions for comparison
- Detailed Feedback: GPT-4 powered analysis with explanations, hints, and improvement suggestions
- Topic Classification: Categorizes problems by mathematical topic and difficulty level
- React 18 - Modern UI framework
- React Router - Client-side routing
- Axios - HTTP client for API communication
- Tesseract.js - Client-side OCR processing
- PDF.js - PDF rendering and text extraction
- React Webcam - Camera integration
- React Dropzone - File upload interface
- Recharts - Data visualization
- KaTeX - Mathematical notation rendering
- Node.js with Express - RESTful API server
- PostgreSQL (CockroachDB) - Database for user data and analytics
- OpenAI GPT-4 - Problem analysis
- Wolfram Alpha API - Mathematical computation and verification
- Multer - File upload handling
- PDF-Parse - Server-side PDF text extraction
- Vercel - Frontend hosting and deployment
- Docker - Containerized backend deployment
- Environment Variables - Secure configuration management
- Node.js 16+ and npm
- PostgreSQL database (or CockroachDB)
- OpenAI API key
- Wolfram Alpha App ID
- Google OAuth 2.0 credentials
-
Clone the repository
git clone https://github.com/darthvader58/biryani.git cd biryani -
Install frontend dependencies
npm install
-
Install backend dependencies
cd backend npm install cd ..
-
Configure environment variables
Create
.envin the root directory:REACT_APP_GOOGLE_CLIENT_ID=your_google_client_id
Create
backend/.env:DATABASE_URL=your_postgresql_connection_string OPENAI_API_KEY=your_openai_api_key WOLFRAM_APP_ID=your_wolfram_alpha_app_id PORT=8080 NODE_ENV=development
-
Set up the database The application will automatically create the required tables on first run.
-
Start the development servers
Backend server:
cd backend npm startFrontend development server:
npm start
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the Google+ API
- Create OAuth 2.0 credentials
- Add authorized redirect URIs:
http://localhost:3000(development)- Your production domain (e.g.,
https://your-app.vercel.app)
- Sign in with your Google account
- Upload your homework using one of three methods:
- File Upload: Drag and drop images or PDF files
- Camera: Take a photo of your math work
- Text Input: Type or paste the problem directly
- Review extracted text and edit if necessary
- Click "Analyze Problem" to get AI feedback
- View detailed results including:
- Original problem identification
- Your solution analysis
- Correct solution from Wolfram Alpha
- Error classification and explanations
- Hints for improvement
- Performance Overview: Total problems, accuracy rates, error distribution
- Progress Charts: Visual tracking of improvement over time
- Topic Analysis: Performance breakdown by mathematical topics
- Problem History: Complete record of analyzed problems
POST /api/analyze-problem- Analyze a math problemGET /api/dashboard/:email- Get user dashboard dataPOST /api/upload-file- Upload and process filesPOST /api/feedback- Submit user feedback
The application uses Google OAuth for authentication. Users must be signed in to access analysis features and dashboard.
- Images: JPG, PNG, GIF, BMP (processed with OCR)
- PDFs: Digital PDFs (direct text extraction) and scanned PDFs (OCR fallback)
- File Upload: Secure file handling with size limits (10MB)
- Text Extraction: OCR for images, direct extraction for digital PDFs
- Content Parsing: AI separation of problems from solutions
- Analysis: Multi-step AI analysis with external verification
- Storage: Secure database storage with user analytics
npm run build
vercel --prodcd backend
docker build -t formath-backend .
docker run -p 8080:8080 formath-backend- 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
This project is licensed under the MIT License - see the LICENSE file for details.
Made with <3 by Shashwat Raj, Vaibhav Urs, Sahaj Rastogi, Ananya Bhargava
Because everyone deserves to look good without the stress
π Star this repo β’ π Report Bug β’ π‘ Request Feature