170 lines
4.4 KiB
Markdown
170 lines
4.4 KiB
Markdown
<div align="center">
|
|
<img src="/backend/static/logo.png" alt="DocuLens Logo" width="250">
|
|
</div>
|
|
|
|
# DocuLens 🤖
|
|
|
|
DocuLens is a unified web application that combines Optical Character Recognition (OCR) and Artificial Intelligence (AI) to process and translate documents, offering a simple, intuitive interface with real-time feedback.
|
|
|
|
## Key Features
|
|
|
|
### Document Processing 📄
|
|
|
|
- **Multiple Processing Modes** 🔍
|
|
- **OCR Mode:** Uses Tesseract for text extraction
|
|
- **OCR + AI Mode:** Combines Tesseract with AI correction
|
|
- **Full AI OCR Mode:** Complete AI-powered processing
|
|
- Real-time progress tracking with visual feedback
|
|
|
|
- **File Management** 📤
|
|
- Support for PDF and image uploads
|
|
- Automatic file naming to prevent overwrites
|
|
- Bulk file management capabilities
|
|
- Secure file handling and sanitization
|
|
|
|
- **Translation System** 🌐
|
|
- Page-by-page translation
|
|
- Support for processed or new files
|
|
- Multiple language support
|
|
- Progress tracking per page
|
|
- Translation file generation with page markers
|
|
|
|
### Configuration & Customization ⚙️
|
|
|
|
- **AI Integration**
|
|
- Support for multiple AI providers:
|
|
- OpenAI
|
|
- Google Gemini
|
|
- Mistral
|
|
- Custom model management
|
|
- Configurable prompts system
|
|
|
|
- **System Settings**
|
|
- Language configuration
|
|
- Import/export functionality
|
|
- Runtime model updates
|
|
- Custom prompt management
|
|
|
|
### Security & Authentication 🔒
|
|
|
|
- **User Authentication**
|
|
- JSON file-based user management
|
|
- Secure password hashing with bcrypt
|
|
- Session-based authentication
|
|
- Protected API routes
|
|
- Remember me functionality
|
|
- Password change capability
|
|
|
|
### User Interface 🎨
|
|
|
|
- **Real-time Feedback**
|
|
- Progress tracking with emoji indicators
|
|
- Job status notifications
|
|
- Error handling and display
|
|
- Responsive design
|
|
|
|
## Technical Architecture
|
|
|
|
### Frontend (React)
|
|
- Single Page Application (SPA) architecture
|
|
- Component-based structure:
|
|
- Login & Authentication
|
|
- File Upload & Processing
|
|
- File Management
|
|
- Model Selection
|
|
- Configuration Management
|
|
- Progress Tracking
|
|
- Notifications System
|
|
- Password Management
|
|
|
|
### Backend (Flask)
|
|
- RESTful API architecture
|
|
- Modular design:
|
|
- Authentication system
|
|
- File processing
|
|
- OCR integration
|
|
- AI model management
|
|
- Translation services
|
|
- Configuration handling
|
|
|
|
### Key Technical Features
|
|
- Asynchronous job processing
|
|
- Real-time progress updates
|
|
- Multiple processing modes
|
|
- Secure file handling
|
|
- Comprehensive error handling
|
|
- Session management
|
|
- API route protection
|
|
|
|
## Setup & Installation
|
|
|
|
### Prerequisites
|
|
- Docker
|
|
- Docker Compose
|
|
|
|
### Environment Setup
|
|
1. Clone the repository
|
|
2. Configure environment variables for AI providers
|
|
3. Build and run with Docker Compose:
|
|
```bash
|
|
docker-compose up --build
|
|
```
|
|
4. Access the application at http://localhost:5015
|
|
|
|
### Initial Login
|
|
- Default users: chaulmark, ekragh
|
|
- Default password: changeme123
|
|
- **Important:** Change your password after first login using the "Change Password" button in the header
|
|
|
|
## Security Considerations
|
|
|
|
### Authentication
|
|
- Secure password hashing with bcrypt
|
|
- Session-based authentication
|
|
- Protected API routes
|
|
- Remember me functionality
|
|
- Password change capability
|
|
- Session management and protection
|
|
|
|
### File Security
|
|
- Secure file uploads with sanitization
|
|
- Unique file naming
|
|
- Separate upload and output directories
|
|
|
|
### API Security
|
|
- CORS configuration with credentials
|
|
- Environment-based configuration
|
|
- API route protection
|
|
- Session state persistence
|
|
- Secure cookie handling
|
|
|
|
## Development Status
|
|
|
|
### Complete Features
|
|
- Core document processing functionality
|
|
- Authentication system
|
|
- File management
|
|
- Translation system
|
|
- Configuration management
|
|
- User interface
|
|
- Docker containerization
|
|
|
|
### Planned Enhancements
|
|
- Batch processing for multiple files
|
|
- Additional AI model integrations
|
|
- Advanced error recovery
|
|
- API rate limiting
|
|
- Enhanced progress visualization
|
|
- PDF preview functionality
|
|
- Custom language model training
|
|
|
|
## Technologies Used
|
|
- **Frontend:** React 18.2.0, axios 0.27.2
|
|
- **Backend:** Flask, Python
|
|
- **OCR:** Tesseract, OCRmyPDF, pdf2image
|
|
- **AI Integration:** OpenAI, Google Gemini, Mistral
|
|
- **Authentication:** Flask-Login, bcrypt
|
|
- **Containerization:** Docker, Docker Compose
|
|
|
|
## Contributing
|
|
Contributions are welcome! Please ensure you follow the existing code structure and patterns. All new features should include appropriate error handling and user feedback mechanisms.
|