How naveen-n-07/legal_lens works
METRIX-LM is a legal-metrology inspection system for assessing declarations on packaged goods. Inspectors submit package images through the web client; backend scanning runs image analysis and OCR, then compliance evaluation produces findings for review. Officers can verify inspections and view amendment history, while reporting, analytics, and administration support oversight. The graph includes the documented multilingual OCR and package-detection capabilities. README content was not provided, and several subsystems are represented at their enclosing paths where implementation details were not sampled.
Main entry points: api.js API services · pipeline.py OCR pipeline · database.py Application database · App.jsx Role-based app
Components 22
Inspection client
- Role-based app
frontend/src/App.jsx - Inspection screens
frontend/src/pages/InspectionUpload.jsx - Review screens
frontend/src/pages/OfficerReviewQueue.jsx - API services
frontend/src/services/api.js
Backend workflows
- Scanner routes
backend/app/api/scanner_routes.py - Inspection routes
backend/app/api/inspection_routes.py - OCR routes
backend/app/api/ocr_routes.py - Detection routes
backend/app/api/detection_routes.py - Authentication and roles
backend/app/auth/rbac.py
Image and compliance analysis
- OCR pipeline
backend/app/ocr/pipeline.py - Package detector
backend/app/package_detection - Image preprocessing
backend/app/ocr/image_preprocessor.py - OCR engines
backend/app/ocr/ocr_engine.py - Declaration extraction
backend/app/ocr/data_extractor.py - Compliance service
backend/app/rules/compliance_service.py - Statutory rule engine
backend/app/rules/engine.py - Rule repository
backend/app/rules/repository.py
Review and oversight
- Report routes
backend/app/api/report_routes.py - Analytics routes
backend/app/api/analytics_routes.py - Admin routes
backend/app/api/admin_routes.py - Application database
backend/app/database.py
Other components
- Inspector or officer
Connections 25
- Inspector or officer → Role-based app: uses
- Role-based app → Inspection screens: routes
- Role-based app → Review screens: routes
- Inspection screens → API services: requests
- Review screens → API services: requests
- API services → Scanner routes: calls
- API services → Inspection routes: calls
- API services → Report routes: calls
- API services → Analytics routes: calls
- API services → Admin routes: calls
- Scanner routes → OCR pipeline: processes images
- OCR pipeline → Package detector: detects regions
- OCR pipeline → Image preprocessing: preprocesses images
- OCR pipeline → OCR engines: recognizes text
- OCR pipeline → Declaration extraction: extracts fields
- Scanner routes → Compliance service: validates declarations
- OCR routes → OCR pipeline: runs OCR
- Detection routes → Package detector: runs detection
- Compliance service → Statutory rule engine: evaluates rules
- Compliance service → Rule repository: loads rules
- Inspection routes → Application database: reads and writes
- Report routes → Application database: reads records
- Analytics routes → Application database: reads records
- Admin routes → Application database: manages records
- Inspection routes → Authentication and roles: checks identity