How ronan-r-r/group2-public-tender-irregularity-detector works
This is a civic-tech tender-risk monitor: award data is ingested, enriched with company/director information, evaluated by red-flag rules and pricing anomaly analysis, then published as transparent scores and rule evidence for a static dashboard. The README and build script establish the batch pipeline; sampled frontend code shows routing, data loading and presentation. The API and database internals were not sampled, so their documented roles are shown without inferred implementation details.
Main entry points: build_dashboard_data.py Scoring job · App.tsx Dashboard routes · TenderDetail.tsx Tender assessment · useIndex.ts Index loading
Components 34
Data ingestion
- OCDS ingestion
src/ingestion/ocds.py - Registry loading
src/ingestion/cipc_registry_loader.py - Sample registry
src/ingestion/sample_registry.py - Supplier matching
src/ingestion/supplier_company_matcher.py - Name matching
src/ingestion/name_match.py - Enrichment context
src/ingestion/enrichment_context.py
Risk analysis
- Domain records
src/detection/models.py - Award history
src/detection/context.py - Twelve red flags
src/detection/rules - Rule evaluation
src/detection/engine.py - Composite score
src/detection/scorer.py - Price anomaly
src/detection/anomaly.py
Publishing and storage
- Scoring job
scripts/build_dashboard_data.py - Public data export
src/detection/export.py - PostgreSQL storage
src/db - Published JSON
- Local demo API
src/api
Public dashboard
- Dashboard routes
src/frontend/src/App.tsx - Route handling
src/frontend/src/router.tsx - Index loading
src/frontend/src/data/useIndex.ts - JSON data access
src/frontend/src/data/load.ts - Overview and lists
src/frontend/src/pages/Overview.tsx - Tender assessment
src/frontend/src/pages/TenderDetail.tsx - Buyer page
src/frontend/src/pages/Buyer.tsx - Tender list
src/frontend/src/pages/Tenders.tsx - Dashboard aggregates
src/frontend/src/lib/aggregate.ts - Rule explanations
src/frontend/src/lib/explain.ts - Price comparison
src/frontend/src/components/PriceChart.tsx - Anomaly details
src/frontend/src/components/AnomalyPanel.tsx - Score display
src/frontend/src/components/ScoreRing.tsx - Legal information
src/frontend/src/pages/Legal.tsx
Other components
- eTenders awards
- CIPC registry
- Auditor or public
Connections 36
- eTenders awards → OCDS ingestion: supplies awards
README.md - CIPC registry → Registry loading: supplies records
README.md - OCDS ingestion → Scoring job: provides tender data
scripts/build_dashboard_data.py - Sample registry → Scoring job: provides registry data
scripts/build_dashboard_data.py - Supplier matching → Name matching: uses matching
src/ingestion/supplier_company_matcher.py - Scoring job → Supplier matching: resolves suppliers
scripts/build_dashboard_data.py - Scoring job → Domain records: builds records
scripts/build_dashboard_data.py - Scoring job → Award history: loads award history
scripts/build_dashboard_data.py - Scoring job → Rule evaluation: evaluates awards
scripts/build_dashboard_data.py - Rule evaluation → Twelve red flags: dispatches rules
src/detection/engine.py - Twelve red flags → Award history: queries history
src/detection/rules/r04_director_concentration.py - Rule evaluation → Composite score: scores results
src/detection/engine.py - Scoring job → Price anomaly: computes pricing signal
scripts/build_dashboard_data.py - Scoring job → Public data export: exports results
scripts/build_dashboard_data.py - Scoring job → PostgreSQL storage: writes scores
README.md - Public data export → Published JSON: publishes JSON
README.md - Auditor or public → Dashboard routes: opens dashboard
README.md - Dashboard routes → Route handling: reads route
src/frontend/src/App.tsx - Dashboard routes → Overview and lists: renders overview
src/frontend/src/App.tsx - Dashboard routes → Tender list: renders list
src/frontend/src/App.tsx - Dashboard routes → Tender assessment: renders assessment
src/frontend/src/App.tsx - Dashboard routes → Buyer page: renders buyer
src/frontend/src/App.tsx - Dashboard routes → Legal information: renders legal pages
src/frontend/src/App.tsx - Index loading → JSON data access: loads index
src/frontend/src/data/useIndex.ts - Overview and lists → Index loading: reads index
src/frontend/src/pages/Overview.tsx - Tender list → Index loading: reads index
src/frontend/src/pages/Tenders.tsx - Buyer page → Index loading: reads index
src/frontend/src/pages/Buyer.tsx - Overview and lists → Dashboard aggregates: summarizes awards
src/frontend/src/pages/Overview.tsx - Tender list → Dashboard aggregates: filters awards
src/frontend/src/pages/Tenders.tsx - Buyer page → Dashboard aggregates: summarizes buyer
src/frontend/src/pages/Buyer.tsx - Tender assessment → JSON data access: loads detail
src/frontend/src/pages/TenderDetail.tsx - Tender assessment → Rule explanations: explains rules
src/frontend/src/pages/TenderDetail.tsx - Tender assessment → Score display: displays score
src/frontend/src/pages/TenderDetail.tsx - Tender assessment → Price comparison: shows comparison
src/frontend/src/pages/TenderDetail.tsx - Tender assessment → Anomaly details: shows anomaly
src/frontend/src/pages/TenderDetail.tsx - Published JSON → JSON data access: serves dashboard data
README.md