How arsahadu/district_intelligence works
This repository is a District Intelligence Platform foundation. The documented user workflow is a dashboard checking backend health and displaying stored records; the README explicitly says database and intelligence features are out of scope for the current vertical slice. The tree also contains record/source APIs and an ingestion package with domain connectors, normalization, and raw storage. Those ingestion modules are represented, but their runtime orchestration is unclear from the available excerpts, so unsupported connections are omitted.
Main entry points: records.py Records API · Dashboard.jsx Dashboard · sources.py Sources API · main.py API application
Components 25
Collector dashboard
- App entry
frontend/src/App.jsx - Dashboard
frontend/src/pages/Dashboard.jsx - API client
frontend/src/services/api.js - Header
frontend/src/components/Header.jsx - Status card
frontend/src/components/StatusCard.jsx
FastAPI backend
- API application
backend/app/main.py - Health endpoint
backend/app/api/health.py - Records API
backend/app/api/records.py - Sources API
backend/app/api/sources.py - Record schema
backend/app/schemas/common_record.py - Source schema
backend/app/schemas/source.py - Record model
backend/app/models/common_record.py - Source model
backend/app/models/source.py - Record service
backend/app/services/record_service.py - Database session
backend/app/db/database.py
Data ingestion
- Dinamalar connector
ingestion/app/connectors/news/dinamalar.py - Source article
ingestion/app/models/source_article.py - News normalizer
ingestion/app/normalizers/news.py - Ingestion record
ingestion/app/models/common_record.py - Raw JSON storage
ingestion/app/storage/raw_storage.py - Agmarknet connector
ingestion/app/connectors/agriculture/agmarknet.py - Flood connector
ingestion/app/connectors/disaster/flood.py - Open-Meteo connector
ingestion/app/connectors/weather/open_meteo.py - Location normalizer
ingestion/app/normalizers/location.py
Other components
- Dashboard user
Connections 22
- Dashboard user → App entry: opens dashboard
README.md - App entry → Dashboard: renders
frontend/src/App.jsx - Dashboard → API client: requests health and records
frontend/src/pages/Dashboard.jsx - Dashboard → Header: renders
frontend/src/pages/Dashboard.jsx - Dashboard → Status card: renders
frontend/src/pages/Dashboard.jsx - API application → Health endpoint: registers route
backend/app/main.py - API application → Records API: registers route
backend/app/main.py - API application → Sources API: registers route
backend/app/main.py - Records API → Database session: gets session
backend/app/api/records.py - Records API → Record model: queries and writes
backend/app/api/records.py - Records API → Source model: queries and writes
backend/app/api/records.py - Records API → Record schema: validates and serializes
backend/app/api/records.py - Sources API → Database session: uses session
backend/app/api/sources.py - Sources API → Source schema: uses schema
backend/app/api/sources.py - Sources API → Record service: uses service
backend/app/api/sources.py - Record service → Record model: creates and queries
backend/app/services/record_service.py - Record service → Source model: creates and queries
backend/app/services/record_service.py - Dinamalar connector → Source article: produces articles
ingestion/app/connectors/news/dinamalar.py - Dinamalar connector → News normalizer: uses normalizer
ingestion/app/connectors/news/dinamalar.py - Dinamalar connector → Raw JSON storage: stores raw data
ingestion/app/connectors/news/dinamalar.py - News normalizer → Source article: converts article
ingestion/app/normalizers/news.py - News normalizer → Ingestion record: creates record
ingestion/app/normalizers/news.py