🚀 Enterprise-grade document processing pipeline built with TypeScript, Express, and Domain-Driven Design (DDD). Features robust file upload, OCR simulation, validation, and persistence with queue-based processing.
- 📄 Document Upload & Processing - Multi-format file upload with automatic processing
- 🔍 OCR Simulation - Text extraction simulation with configurable delays
- ✅ Document Validation - Comprehensive validation pipeline
- 💾 File Storage - Abstracted storage layer (Local/S3) with retry mechanisms
- 🔄 Queue Processing - Background job processing with BullMQ
- 📊 Real-time Status - Track document processing status in real-time
- 🚫 Cancellation Support - Cancel processing jobs at any stage
- 🔁 Retry Logic - Automatic retry for failed operations with exponential backoff
- 🏥 Health Monitoring - Comprehensive health checks and monitoring
- 🧪 100% Test Coverage - 180 passing tests with zero lint errors
- Node.js 18+ and npm 8+
- Docker and Docker Compose
git clone <repository-url>
cd <your_project_name>
npm installnpm run docker:services # Start MongoDB & Redisnpm run start:dev # Start with hot reload# Upload a document
curl -X POST http://localhost:3000/api/documents/upload \
-F "[email protected]"
# Check status
curl http://localhost:3000/api/documents/{documentId}
# List documents
curl http://localhost:3000/api/documentsPOST /api/documents/upload
Content-Type: multipart/form-dataUpload PDF, DOC, DOCX, PNG, JPG, TXT files (max 10MB)
GET /api/documents/{documentId}Get processing status and results
GET /api/documents?status=completed&limit=10List documents with optional filtering
POST /api/documents/{documentId}/cancelCancel document processing
POST /api/documents/{documentId}/retryRetry failed document processing
GET /healthSystem health and service status
npm test # All 180 tests
npm run test:watch # Watch modenpm run lint # Check linting
npm run type-check # TypeScript validationnpm run docker:services # Start MongoDB & Redis only
npm run docker:up # Full environment
npm run docker:down # Stop all services