A production-grade, data-first platform for tracking, verifying, and publishing public infrastructure project data across India.
InfraSight/
├── backend/ # FastAPI Python backend
│ ├── app/
│ │ ├── main.py # Application entry point
│ │ ├── core/
│ │ │ ├── config.py # Settings via env vars
│ │ │ ├── database.py # Async SQLAlchemy engine
│ │ │ └── auth.py # JWT + RBAC
│ │ ├── models/ # SQLAlchemy ORM models
│ │ ├── schemas/ # Pydantic request/response schemas
│ │ ├── api/v1/ # REST API endpoints
│ │ │ └── endpoints/
│ │ │ ├── projects.py
│ │ │ ├── search.py
│ │ │ ├── complaints.py
│ │ │ ├── updates.py
│ │ │ ├── auth.py
│ │ │ └── admin.py
│ │ ├── ingestion/ # DATA INGESTION LAYER
│ │ │ ├── scrapers.py # PMGSY, Odisha e-Proc, manual seed
│ │ │ ├── pdf_parser.py # PDF → structured data
│ │ │ └── scheduler.py # Ingestion run orchestrator
│ │ ├── processing/ # DATA PROCESSING LAYER
│ │ │ └── normalizer.py # Fuzzy dedup, geocoding, delay flagging
│ │ └── workers/ # Celery background tasks
│ │ ├── celery_app.py # Celery + beat schedule
│ │ └── tasks.py # Task definitions
│ ├── db/
│ │ └── init.sql # Full PostgreSQL schema with PostGIS
│ ├── requirements.txt
│ └── Dockerfile
│
├── frontend/ # Next.js 14 frontend
│ ├── src/
│ │ ├── app/ # App Router pages
│ │ │ ├── page.tsx # Homepage
│ │ │ ├── projects/
│ │ │ │ ├── page.tsx # Project listing + search + map
│ │ │ │ └── [id]/page.tsx # Project detail
│ │ │ ├── globals.css # Design system CSS
│ │ │ └── layout.tsx # Root layout
│ │ ├── components/
│ │ │ ├── ui/Badges.tsx # StatusBadge, TrustBadge, ProgressBar
│ │ │ ├── layout/Navbar.tsx
│ │ │ ├── projects/ProjectCard.tsx
│ │ │ └── map/ProjectMap.tsx # Leaflet map
│ │ ├── lib/
│ │ │ ├── api.ts # Axios API client
│ │ │ └── utils.ts # Formatters, helpers
│ │ └── types/index.ts # Shared TypeScript types
│ ├── package.json
│ ├── tailwind.config.ts
│ └── Dockerfile
│
├── data/
│ └── seed/
│ └── bhubaneswar_phase1.json # 8 MVP seed projects
│
├── docker-compose.yml # Full stack orchestration
├── .env.example # Environment variable template
└── ARCHITECTURE.md # System architecture documentation
- Docker + Docker Compose
- Node.js 20+ (for frontend dev)
- Python 3.11+ (for backend dev)
cd InfraSight
cp .env.example .env
# Edit .env — set passwords and secret keysdocker-compose up -dServices:
| Service | URL |
|---|---|
| Frontend | http://localhost:3000 |
| Backend API | http://localhost:8000 |
| API Docs | http://localhost:8000/api/docs |
| PostgreSQL | localhost:5432 |
| Redis | localhost:6379 |
cd frontend
npm install
npm run devcd backend
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000| Method | Endpoint | Auth | Description |
|---|---|---|---|
| GET | /api/v1/projects |
Public | List + filter projects |
| GET | /api/v1/projects/{id} |
Public | Project detail |
| POST | /api/v1/projects |
Admin | Create project |
| PATCH | /api/v1/projects/{id} |
Admin | Update project |
| DELETE | /api/v1/projects/{id} |
Admin | Delete project |
| PATCH | /api/v1/projects/{id}/verify |
Verifier | Set verification status |
| GET | /api/v1/projects/{id}/updates |
Public | Update timeline |
| GET | /api/v1/projects/{id}/complaints |
Public | Citizen complaints |
| GET | /api/v1/projects/{id}/audit |
Admin | Full audit trail |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/search |
Full-text + faceted search |
| GET | /api/v1/search/map |
Lightweight geo pins for map |
| GET | /api/v1/search/suggest |
Autocomplete suggestions |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/auth/register |
User registration |
| POST | /api/v1/auth/login |
Login → JWT tokens |
| GET | /api/v1/auth/me |
Current user info |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/complaints |
Submit complaint |
| GET | /api/v1/complaints/{id} |
Get complaint |
| POST | /api/v1/complaints/{id}/upvote |
Upvote complaint |
| PATCH | /api/v1/complaints/{id}/moderate |
Moderate (admin) |
PostgreSQL 16 + PostGIS 3.4
Tables: projects, contractors, authorities, data_sources, documents,
complaints, users, project_updates, verification_logs, ingestion_runs
Key features:
- Full-text search via
tsvector+plainto_tsquery - Geospatial queries via PostGIS
GEOMETRY(Point, 4326) - Bounding box search with
ST_Within+ST_MakeEnvelope - Automatic
updated_attriggers - Full audit trail via
log_project_changes()trigger - Fuzzy text search via
pg_trgmextension
Every project carries a verification_status:
| Status | Meaning |
|---|---|
UNVERIFIED |
Data ingested but not checked by a human |
VERIFIED |
Manually reviewed by InfraSight staff |
COMMUNITY_VERIFIED |
Multiple citizen confirmations received |
DISPUTED |
Conflicting data found |
RETRACTED |
Data found to be incorrect |
All changes are logged in verification_logs with actor, timestamp, and notes.
| Source | Type | Coverage |
|---|---|---|
| PMGSY portal | Scraper | Rural roads (national) |
| Odisha e-Procurement portal | Scraper | State tenders |
| Manual seed JSON files | Manual | Phase 1 MVP data |
Phase 2+ sources:
- CPWD project monitoring
- NHAI project tracker
- State PWD websites
- PDF DPR parser
- CAG audit reports
- ✅ 8 seed projects manually curated
- ✅ Full backend API
- ✅ Search + filter + map UI
- ✅ Trust/verification system
- ✅ Complaint submission
- Automated PMGSY + Odisha eProcurement scrapers
- 50+ projects
- PDF document parser
- Email notifications
- Add Maharashtra, Karnataka, Delhi
- Elasticsearch for full-text (replace PG FTS)
- B2G API partnerships
- NGO/media data export tools
- All 28 states + UTs
- Real-time data feeds
- Mobile app (React Native)
- ML-based delay prediction
| Tier | Target | Model |
|---|---|---|
| Free | Citizens | Full public read access |
| B2G | Government | Data dashboards + API integrations |
| B2B | Construction firms, banks | Analytics API |
| NGO/Media | Watchdogs | Bulk data exports, RTI integration |
- All scraped data is from public government sources
- No personal data collected without consent
- Complaint evidence moderated before public display
- Rate limiting prevents abuse
- Data marked with source and timestamp — no unsourced claims
- Backend: Python 3.11 + FastAPI + async SQLAlchemy
- Frontend: TypeScript + Next.js 14 + Tailwind CSS
- Database: PostgreSQL migrations via Alembic (run
alembic revision --autogenerate) - Tests: pytest for backend, Jest/Playwright for frontend