Department-based document management system with OCR, AI classification, and semantic search. Built on Django with on-premises NAS storage, queue-based processing, and role-based access control.
Adds a small variant pipeline for codes that start with digit 1 (Eaton
internal catalog pattern). When exact match fails, tries in order:
1. O/o → 0 (OCR letter/digit confusion, cheapest fix)
2. . → - (punctuation swap, preserves length)
3. remove dashes (last resort, strips structure)
Least-destructive variant wins. Codes with 3+ alpha runs (e.g. 1BAR-500)
are excluded to avoid mangling named codes.
_verify_item_codes now returns dict {atom: canonical_erp_name} so callers
know which canonical form to link into the payload and whether a variant
was substituted. _find_matching_pair returns (asked, matched) so the
preflight modal can surface the substitution to the user before push.
Preflight modal:
- New yellow section for auto-corrected matches (icon, arrow, note)
- Title now context-aware: "Review ERP Item Codes" / "ERP Auto-Corrected
Some Codes" / "Some Rows Have No Item Code" / original wording
- Modal now opens even when everything matched IF any substitution
happened, so user reviews before Proceed
|
||
|---|---|---|
| core/services | ||
| webocr | ||
| .dockerignore | ||
| .gitignore | ||
| bulk_upload.py | ||
| CLAUDE.md | ||
| docker-compose.yml | ||
| Dockerfile | ||
| entrypoint.sh | ||
| input.css | ||
| logs.txt | ||
| README.md | ||
| requirements.txt | ||
| restart_gunicorn.sh | ||
| restart_gunicorn_basic.sh | ||
| start_gunicorn.sh | ||
| start_gunicorn_basic.sh | ||
| start_secadapro.sh | ||
| SYSTEM_DEPENDENCIES.md | ||
| tailwind.config.js | ||
| tailwind.input.css | ||
| VERSION | ||
SECADA
Document management system with OCR and AI-powered search.
Features
- OCR Processing - Qwen2-VL extracts text from PDFs and images
- AI Classification - Automatic document type detection with 40+ categories
- Three-Stage Search - Exact match → Fuzzy search → OCR content search
- Department RBAC - Users see only their department's documents
- Soft-Delete Trash - Configurable retention (1-30 days) with recovery
- Duplicate Detection - Pre-upload checks prevent duplicates
- Queue-Based Processing - Priority queue with lazy model loading
Supported Formats
PDF, PNG, JPG, JPEG, TIFF, BMP, WEBP, CSV
Tech Stack
- Django 4.x
- Qwen2-VL (OCR)
- MySQL
- Docker
- TailwindCSS
Quick Start
# Start services
docker compose up -d
# Run migrations
docker compose exec web python manage.py migrate
# Create admin user
docker compose exec web python manage.py createuser admin --email admin@example.com --admin
# Process documents
docker compose exec web python manage.py start --watch
Directory Structure
/mnt/nas/archive/ # Archived documents
/mnt/nas/queue/ # Processing queue
/app/upload/ # Upload directory
License
Proprietary