Developed by Hassan Khan
π§ Email: hassanaiengineer@gmail.com
π Phone: +923131569393
π LinkedIn: https://www.linkedin.com/in/hassan-khan-4961b722b/
π Upwork: https://www.upwork.com/freelancers/~016ca6a619d9683838
OmniDoc AI is an enterprise-grade OCR-first document intelligence platform that transforms messy scanned documents into clean, structured, AI-ready knowledge using Gemini 2.0 Flash and RAG (Retrieval-Augmented Generation).
- Column-aware extraction with layout preservation
- Auto-detect digital vs scanned pages
- Pre-processing: deskew, denoise, contrast normalization
- Support for PDF, PNG, JPG, JPEG, TIFF, BMP
- Page-level confidence scoring
- Simple Cleaner (Free): NLP-based preprocessing
- Unicode normalization
- OCR error correction
- Whitespace & punctuation fixes
- Broken word merging
- Advanced Cleaner (Gemini 2.0 Flash)
- Context-aware corrections
- Grammar & structure improvement
- No hallucination mode
- Document Q&A with citations
- OCR-aware chunking
- Semantic search with relevance scoring
- Multi-document support
- Source references
- User-owned API keys (secure, no platform cost)
- Document isolation per project
- Multiple output formats (TXT, Markdown, JSON)
- Batch processing support
- FastAPI (Python)
- PyMuPDF, OpenCV, Tesseract (OCR)
- Google Gemini 2.0 Flash (AI)
- ChromaDB (Vector Store)
- Next.js 14
- React 18
- TypeScript
- Tailwind CSS
- Framer Motion
- Python 3.10+
- Node.js 18+
- Tesseract OCR
- Poppler (for PDF processing)
cd backend
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Run the server
python -m uvicorn app.main:app --reload --port 8000Or use the provided script:
chmod +x run.sh
./run.shcd frontend
# Install dependencies
npm install
# Run development server
npm run devThe frontend will be available at http://localhost:3000
sudo apt-get update
sudo apt-get install tesseract-ocr poppler-utilsbrew install tesseract poppler- Download Tesseract from: https://github.com/UB-Mannheim/tesseract/wiki
- Download Poppler from: https://github.com/oschwartz10612/poppler-windows/releases
POST /api/documents/upload- Upload a documentPOST /api/documents/upload-multiple- Upload multiple documentsGET /api/documents/- List all documentsGET /api/documents/{id}- Get document detailsDELETE /api/documents/{id}- Delete a documentGET /api/documents/{id}/download- Download document text
POST /api/ocr/process/{id}- Process document with OCRPOST /api/ocr/process-batch- Batch OCR processingPOST /api/ocr/reprocess/{id}- Reprocess documentGET /api/ocr/status/{id}- Get OCR status
POST /api/cleaning/simple/{id}- Simple NLP cleaningPOST /api/cleaning/advanced/{id}- AI-powered cleaning (requires Gemini API key)GET /api/cleaning/preview/{id}- Preview cleaning results
POST /api/rag/index/{id}- Index document for RAGPOST /api/rag/index-batch- Batch indexingPOST /api/rag/query- Query documentsDELETE /api/rag/index/{id}- Remove from index
GET /api/settings/- Get settingsPOST /api/settings/- Update settingsPOST /api/settings/validate-gemini-key- Validate API key
Create a .env file in the backend directory:
# Optional: Set default API key (not recommended for production)
GEMINI_API_KEY=your_key_hereFor the frontend, create .env.local:
NEXT_PUBLIC_API_URL=http://localhost:8000omnidoc-ai/
βββ backend/
β βββ app/
β β βββ main.py # FastAPI application
β β βββ models/
β β β βββ schemas.py # Pydantic models
β β βββ services/
β β β βββ ocr_service.py
β β β βββ cleaning_service.py
β β β βββ gemini_service.py
β β β βββ rag_service.py
β β β βββ document_store.py
β β βββ routers/
β β β βββ documents.py
β β β βββ ocr.py
β β β βββ cleaning.py
β β β βββ rag.py
β β β βββ settings.py
β β βββ utils/
β βββ uploads/ # Uploaded files
β βββ outputs/ # Processed outputs
β βββ requirements.txt
β βββ run.sh
βββ frontend/
βββ src/
β βββ app/
β β βββ page.tsx # Main dashboard
β β βββ layout.tsx
β β βββ globals.css
β βββ components/
β β βββ Header.tsx
β β βββ FileUploader.tsx
β β βββ DocumentList.tsx
β β βββ DocumentViewer.tsx
β β βββ CleaningModal.tsx
β β βββ RAGChat.tsx
β β βββ SettingsModal.tsx
β β βββ ProcessingStatus.tsx
β β βββ StatsCard.tsx
β βββ lib/
β βββ api.ts # API client
βββ package.json
βββ tailwind.config.js
βββ next.config.js
- Upload Documents: Drag and drop or click to upload PDFs/images
- OCR Processing: Documents are automatically processed after upload
- Clean Text:
- Click "Clean" on any document
- Choose Simple (free) or Advanced (AI-powered)
- Download the cleaned text
- RAG Chat:
- Configure your Gemini API key in Settings
- Click "Index RAG" on documents
- Go to RAG Chat tab
- Ask questions about your documents
- API keys are stored locally in your browser
- Keys are sent directly to Google's servers
- No keys are stored on our backend
- Document data is stored locally during your session
MIT License - See LICENSE file for details
For support or feature requests, please contact:
- π§ Email: hassanaiengineer@gmail.com
- π Phone: +923131569393
Note - If you want frontend folder send email to me :)