Transform tax confusion into clarity with AI-powered document analysis
DocuLens is an intelligent web application that scans uploaded tax documents (PDFs, photos, or scanned images), detects potential red flags like missing data or inconsistencies, and visually explains what's wrong in a simple, interactive format.
- π Smart Document Analysis: Uses Google Gemini AI to understand tax documents
- π Issue Detection: Identifies missing fields, inconsistencies, and formatting errors
- π‘ Plain English Explanations: Converts complex tax jargon into simple language
- π― Visual Feedback: Highlights problem areas directly on your document
- π Risk Assessment: Provides completeness scores and risk levels
- π± Multiple Formats: Supports PDFs and images (JPG, PNG)
- Understanding: Most people don't understand what's inside their W2, 1099, or 1040 forms
- Accuracy: They often file with missing data, misclassified deductions, or formatting issues
- Consequences: This leads to rejections, audits, or financial penalties
- Accessibility: Many can't afford a CPA or don't know what questions to ask
- Solution: DocuLens provides a visual, AI-guided walkthroughβlike having a tax assistant beside you
- π€ Upload: User uploads a scanned or photographed tax document
- π OCR: Tesseract.js extracts text and spatial layout from images
- ποΈ Parse: Text parser extracts key tax-relevant fields into structured JSON
β οΈ Validate: Rule-based engine identifies common issues (missing EIN, line mismatches)- π€ Analyze: Gemini API simplifies jargon, ranks red flags, and generates summaries
- π¨ Visualize: Fabric.js overlays colored boxes and tooltips on the original document
- π Report: User gets interactive visual experience and downloadable report
DocuLens/
βββ backend/ # Node.js + Express API
β βββ src/
β β βββ controllers/ # API endpoint handlers
β β βββ services/ # Business logic (OCR, AI, processing)
β β βββ middleware/ # Auth, validation, rate limiting
β β βββ models/ # Data schemas and types
β β βββ routes/ # API route definitions
β β βββ utils/ # Helper functions and utilities
β β βββ config/ # Firebase, Gemini, and app config
β βββ tests/ # Unit and integration tests
β βββ uploads/ # Temporary file storage
β βββ docs/ # API documentation
βββ frontend/ # React web application (future)
βββ shared/ # Shared types and constants
βββ docker/ # Container configuration
- Node.js 18+
- Firebase project with Firestore & Storage
- Google Gemini API key
# Navigate to backend
cd backend
# Install dependencies
npm install
# Configure environment
cp .env.example .env
# Edit .env with your Firebase and Gemini credentials
# Start development server
npm run dev# Health check
curl http://localhost:3000/api/health
# Upload document
curl -X POST -F "document=@your-tax-form.pdf" \
http://localhost:3000/api/documents/upload- Runtime: Node.js 18+ with Express.js
- Database: Firebase Firestore (document storage)
- File Storage: Firebase Storage (file persistence)
- AI/ML: Google Gemini 2.5 Flash API
- OCR: Tesseract.js (fallback text extraction)
- Processing: Bull.js + Redis (async job queues)
- Security: Helmet, CORS, rate limiting, input validation
- Framework: React 18 with TypeScript
- Styling: Tailwind CSS
- Document Viewer: PDF.js + Fabric.js for annotations
- State Management: Redux Toolkit or Zustand
- File Upload: react-dropzone
POST /api/documents/upload # Upload tax document
GET /api/documents/{id} # Get document details
GET /api/documents/{id}/status # Check processing status
GET /api/documents/{id}/results # Get analysis results
GET /api/documents/{id}/report # Download formatted report
DELETE /api/documents/{id} # Delete documentGET /api/health # Health check
GET /api/documents/supported-formats # Supported file typescd backend
# Run all tests
npm test
# Run with coverage
npm run test:coverage
# Run specific test
npm test -- documentService.test.js# Lint code
npm run lint
# Fix linting issues
npm run lint:fix
# Format code
npm run format# Build and run with Docker Compose
docker-compose -f docker/docker-compose.yml up --build
# Backend will be available at http://localhost:3000
# Redis will be available at localhost:6379- File Validation: Magic number checking, size limits, type restrictions
- Rate Limiting: Configurable per endpoint to prevent abuse
- Input Sanitization: XSS prevention and data validation
- Error Handling: Structured responses without sensitive data exposure
- API Security: CORS configuration, security headers
- Structured logging with Winston
- Separate log files for errors, HTTP requests, and general application events
- Log rotation and retention policies
- Processing performance tracking
- Gemini API usage monitoring
- Error rate analysis
- File upload statistics
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Write tests for new functionality
- Ensure all tests pass (
npm test) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow ESLint configuration
- Maintain test coverage above 80%
- Document new API endpoints
- Use conventional commit messages
- File upload and validation
- Gemini AI integration
- Basic OCR fallback
- Document processing pipeline
- API endpoints and documentation
- React application setup
- Document upload interface
- Processing status tracking
- Results visualization
- Issue highlighting with Fabric.js
- User authentication and accounts
- Document history and management
- Advanced tax form support
- Batch processing capabilities
- Mobile-responsive design
- Performance optimization
- Advanced monitoring
- Deployment automation
- User feedback system
- Analytics and insights
See backend/.env.example for all required configuration options.
- Create Firebase project
- Enable Firestore Database and Storage
- Generate service account key
- Configure security rules
- Get API key from Google AI Studio
- Configure rate limits and quotas
- Set up usage monitoring
- File Upload Errors: Check file size limits and supported formats
- Processing Failures: Verify Gemini API key and network connectivity
- Database Issues: Confirm Firebase credentials and permissions
- π Check the API Documentation
- π Report bugs via GitHub Issues
- π¬ Join discussions in GitHub Discussions
- π§ Contact support for critical issues
This project is licensed under the MIT License - see the LICENSE file for details.
- Google Gemini: For powerful document understanding capabilities
- Firebase: For reliable backend infrastructure
- Tesseract.js: For OCR functionality
- Open Source Community: For the amazing tools and libraries
Made with β€οΈ for taxpayers everywhere who deserve clarity in their financial documents.