How ashindian-coder/mira works
MIRA is a CPSE material-identity harmonization application: users upload source material masters, MIRA parses and standardizes records, generates and scores cross-CPSE match candidates, and sends uncertain or high-confidence recommendations to people for review. Approved groups can be mapped to traceable Common National Material Codes, with audit and analytics available afterward. The graph combines documented workflow capabilities with source-index evidence; several route implementations are unsampled, so their internal calls are shown only where the README documents them.
Main entry points: main.py FastAPI application · matching.py Matching API · store.py Persistent application stores · api.ts API client
Components 24
User interface
- Web application
frontend/src/app/App.tsx - Authentication context
frontend/src/context/AuthContext.tsx - API client
frontend/src/lib/api.ts - Materials workspace
frontend/src/pages/Materials/Materials.tsx - Match review
frontend/src/pages/MatchReview/MatchReview.tsx - Mappings workspace
frontend/src/pages/Mappings/Mappings.tsx - Analytics and audit
frontend/src/pages/Analytics/Analytics.tsx
API and access
- FastAPI application
backend/app/main.py - Materials API
backend/app/api/v1/materials.py - Matching API
backend/app/api/v1/matching.py - Review API
backend/app/api/v1/review.py - Mappings API
backend/app/api/v1/mappings.py - Audit and analytics APIs
backend/app/api/v1/audit.py
Material ingestion
- Ingestion pipeline
backend/app/services/ingestion/pipeline.py - Specification parser
backend/app/services/parsing/service.py - Material normalization
backend/app/services/normalization/service.py
Matching and resolution
- Candidate blocking
backend/app/services/blocking/service.py - Vector search
backend/app/services/matching/milvus_client.py - Hybrid scoring and gates
backend/app/services/matching/classifier.py - Canonical harmonization
backend/app/services/harmonization/service.py - CNMC registry service
backend/app/services/cnmc/service.py
Persistence and governance
- Persistent application stores
backend/app/store.py - PostgreSQL
backend/app/core/database.py
Other components
- MIRA user
Connections 28
- MIRA user → Web application: uses
- Web application → Authentication context: provides auth
frontend/src/app/App.tsx - Authentication context → API client: calls auth APIs
frontend/src/context/AuthContext.tsx - Materials workspace → API client: uploads materials
frontend/src/lib/api.ts - Match review → API client: requests review
frontend/src/pages/MatchReview/MatchReview.tsx - Mappings workspace → API client: manages mappings
frontend/src/pages/Mappings/Mappings.tsx - Analytics and audit → API client: requests reports
- Web application → FastAPI application: API requests
- FastAPI application → Materials API: routes requests
- FastAPI application → Matching API: routes requests
- FastAPI application → Review API: routes requests
- FastAPI application → Mappings API: routes requests
- FastAPI application → Audit and analytics APIs: routes requests
- Materials API → Ingestion pipeline: ingests uploads
- Ingestion pipeline → Specification parser: extracts specifications
- Ingestion pipeline → Material normalization: normalizes records
- Materials API → Persistent application stores: persists materials
- Matching API → Candidate blocking: generates candidates
- Matching API → Vector search: adds vector candidates
- Matching API → Hybrid scoring and gates: scores candidates
- Matching API → Persistent application stores: persists candidates
- Review API → Persistent application stores: records decisions
backend/app/api/v1/review.py - Mappings API → Canonical harmonization: builds canonical records
backend/app/api/v1/mappings.py - Mappings API → CNMC registry service: generates codes
backend/app/api/v1/mappings.py - Canonical harmonization → CNMC registry service: registers identity
- Mappings API → Audit and analytics APIs: records mapping events
backend/app/api/v1/mappings.py - Audit and analytics APIs → Persistent application stores: reads audit data
- Persistent application stores → PostgreSQL: persists records
backend/app/store.py