How rudra-7910/sih works
SHI is a Legal Metrology inspection assistant: an officer submits package views, the server processes text into statutory declaration findings, and the officer reviews and completes the inspection. The graph preserves the documented OCR choices, multi-view workflow, audit/history, demo scenarios, offline queue, and PDF dossier. Some frontend and route behavior is represented from README documentation and the SOURCE INDEX; unsampled links are omitted where their caller is not shown.
Main entry points: InspectionDashboard.tsx Inspection Dashboard · inspection.ts Inspection Routes · inspectionSession.ts Session and Audit Manager · server.ts REST API
Components 23
Inspection Interface
- Inspection Dashboard
client/src/pages/InspectionDashboard.tsx - Image Upload
client/src/components/ImageUpload.tsx - Multi-View Tracker
client/src/components/MultiViewTracker.tsx - Findings Review UI
client/src/components/DeclarationTable.tsx - Rule Results Panel
client/src/components/RuleResultsPanel.tsx - Officer Review Panel
client/src/components/OfficerReviewPanel.tsx - Inspection History
client/src/components/InspectionHistory.tsx - PDF Dossier
client/src/utils/pdfGenerator.ts - Offline Upload Queue
client/src/pages/InspectionDashboard.tsx
Evidence Processing
- REST API
server/src/server.ts - Inspection Routes
server/src/routes/inspection.ts - Image Preprocessing
server/src/preprocessing/imagePreprocessor.ts - OCR Adapters
server/src/ocr/IOcrAdapter.ts - Mock OCR
server/src/ocr/MockOcrAdapter.ts - Tesseract OCR
server/src/ocr/TesseractOcrAdapter.ts - PaddleOCR
server/src/ocr/PaddleOcrAdapter.ts
Compliance Assessment
- Field Extraction
server/src/extraction/fieldExtractor.ts - Deterministic Rule Engine
server/src/rules/ruleEngine.ts - Rule Repository
server/src/rules/ruleRepository.ts - Demo Scenarios
server/src/routes/demo.ts
Inspection Records
- Session and Audit Manager
server/src/session/inspectionSession.ts - SQLite Inspection Store
server/src/db/sqliteDatabase.ts
Other components
- Inspection Officer
Connections 26
- Inspection Officer → Inspection Dashboard: uses
README.md - Inspection Dashboard → Image Upload: renders
client/src/pages/InspectionDashboard.tsx - Inspection Dashboard → Multi-View Tracker: renders
client/src/pages/InspectionDashboard.tsx - Inspection Dashboard → Findings Review UI: renders
client/src/pages/InspectionDashboard.tsx - Inspection Dashboard → Rule Results Panel: renders
client/src/pages/InspectionDashboard.tsx - Inspection Dashboard → Officer Review Panel: renders
client/src/pages/InspectionDashboard.tsx - Inspection Dashboard → Inspection History: renders
client/src/pages/InspectionDashboard.tsx - Inspection Dashboard → PDF Dossier: requests export
- Inspection Dashboard → Offline Upload Queue: queues uploads
client/src/pages/InspectionDashboard.tsx - Inspection Dashboard → REST API: calls API
client/src/pages/InspectionDashboard.tsx - REST API → Inspection Routes: mounts routes
server/src/server.ts - REST API → Demo Scenarios: mounts routes
server/src/server.ts - Inspection Routes → Image Preprocessing: preprocesses images
server/src/routes/inspection.ts - Inspection Routes → OCR Adapters: selects adapter
server/src/routes/inspection.ts - Inspection Routes → Mock OCR: runs OCR
server/src/routes/inspection.ts - Inspection Routes → Tesseract OCR: runs OCR
server/src/routes/inspection.ts - Inspection Routes → PaddleOCR: runs OCR
server/src/routes/inspection.ts - Inspection Routes → Field Extraction: extracts fields
server/src/routes/inspection.ts - Inspection Routes → Session and Audit Manager: manages sessions
server/src/routes/inspection.ts - Session and Audit Manager → Deterministic Rule Engine: checks fields
server/src/session/inspectionSession.ts - Deterministic Rule Engine → Rule Repository: loads rules
server/src/rules/ruleEngine.ts - Session and Audit Manager → SQLite Inspection Store: reads and writes
server/src/session/inspectionSession.ts - Inspection Officer → Officer Review Panel: reviews findings
README.md - Inspection Officer → Image Upload: submits views
README.md - Inspection Dashboard → Demo Scenarios: selects scenario
README.md - Session and Audit Manager → Inspection History: provides history
README.md