How norsaje/hr_docs works
This service takes applicant document uploads through validation and queued OCR/model extraction, then presents extracted fields and review actions to authenticated operators. The README also describes status polling, later uploads, history, work-queue monitoring, expiring documents, staff administration, email notifications, and private file access. The graph follows explicit calls and documented behavior; several public API and worker details are unsampled, so those links are omitted where caller evidence is unavailable.
Main entry points: run.py Document pipeline · verify.py Field verification · App.tsx Operator workspace · operator_extra.py Extra operator actions
Components 31
Applicant intake
- Upload experience
web/applicant/src/App.tsx - Applicant API client
web/applicant/src/api.ts - Public endpoints
backend/app/api/public.py - Intake service
backend/app/intake/service.py
Operator review
- Operator workspace
web/operator/src/App.tsx - Review pages
web/operator/src/pages - Operator API client
web/operator/src/api.ts - Operator endpoints
backend/app/api/operator.py - Extra operator actions
backend/app/api/operator_extra.py - Login and session
backend/app/auth/oidc.py
Document processing
- Job worker
backend/app/queue/worker.py - Document pipeline
backend/app/pipeline/run.py - Field verification
backend/app/pipeline/verify.py - Document registry
backend/app/registry/loader.py - Validation rules
backend/app/registry/rules.py - Checksum checks
backend/app/registry/checksums.py - MRZ parsing
backend/app/registry/mrz.py - Model gateway
backend/app/llm/gateway.py - Extraction schema
backend/app/llm/schema_builder.py - OCR vote
backend/app/pipeline/ocr_vote.py - Image quality
backend/app/pipeline/quality.py - Field confidence
backend/app/pipeline/confidence.py
Persistence and identity
- Audit trail
backend/app/audit/log.py - PostgreSQL
- S3 file storage
backend/app/storage/s3.py - Email notifications
backend/app/notify/email.py - User messages
backend/app/messages.py
Other components
- Applicant
- Operator
- Keycloak
- Mail service
Connections 38
- Applicant → Upload experience: submits documents
- Upload experience → Applicant API client: calls API
web/applicant/src/App.tsx - Applicant API client → Public endpoints: sends requests
- Public endpoints → Intake service: handles intake
- Intake service → S3 file storage: stores files
backend/app/intake/service.py - Intake service → Document registry: reads rules
backend/app/intake/service.py - Operator → Operator workspace: reviews cases
- Operator workspace → Review pages: renders pages
web/operator/src/App.tsx - Operator workspace → Operator API client: checks session
web/operator/src/App.tsx - Review pages → Operator API client: requests case data
web/operator/src/pages/Card.tsx - Operator API client → Operator endpoints: calls endpoints
- Operator API client → Extra operator actions: calls actions
- Operator endpoints → Audit trail: records actions
backend/app/api/operator.py - Extra operator actions → Audit trail: records actions
backend/app/api/operator_extra.py - Extra operator actions → Email notifications: sends notices
backend/app/api/operator_extra.py - Extra operator actions → Document pipeline: reruns parsing
backend/app/api/operator_extra.py - Operator workspace → Login and session: checks identity
- Login and session → Keycloak: authenticates with
- Job worker → Document pipeline: processes files
backend/app/queue/worker.py - Document pipeline → S3 file storage: reads and writes
backend/app/pipeline/run.py - Document pipeline → Model gateway: extracts fields
backend/app/pipeline/run.py - Document pipeline → OCR vote: gets OCR text
backend/app/pipeline/run.py - Document pipeline → Image quality: checks image
backend/app/pipeline/run.py - Document pipeline → Field verification: verifies extraction
backend/app/pipeline/run.py - Document pipeline → Document registry: loads document rules
backend/app/pipeline/run.py - Document pipeline → Field confidence: colors fields
backend/app/pipeline/run.py - Field verification → Extraction schema: uses field schema
backend/app/pipeline/verify.py - Field verification → Validation rules: applies checks
backend/app/pipeline/verify.py - Field verification → Checksum checks: checks identifiers
backend/app/pipeline/verify.py - Field verification → MRZ parsing: checks MRZ
backend/app/pipeline/verify.py - Validation rules → Checksum checks: calls checks
backend/app/registry/rules.py - Model gateway → Extraction schema: builds schema
backend/app/llm/gateway.py - Model gateway → Document registry: uses registry
backend/app/llm/gateway.py - Model gateway → Keycloak: calls model service
- Job worker → PostgreSQL: leases jobs
backend/app/queue/worker.py - Document pipeline → PostgreSQL: writes results
backend/app/pipeline/run.py - Email notifications → Mail service: sends email
- Operator endpoints → User messages: formats errors
backend/app/api/operator.py