How gallikattip-pixel/sih26103 works
INFRAPLUS is an infrastructure-project monitoring and risk-analysis platform. Officers authenticate, then explore executive dashboard metrics and project listings or inspect a project’s 360° details; the risk audit exposes the deterministic scoring, while the assistant provides grounded AI answers. The React client calls FastAPI, whose services retrieve project data from Firebase, calculate risk, aggregate dashboard metrics, and handle document storage. Gemini supplies explanations, not official risk scores. Connections beyond the sampled excerpts are included only where the README documents them; unsampled implementation details are not inferred.
Main entry points: chat.py AI chat API · api.ts API client · project_service.py Project analytics · projects.py Projects API
Components 28
Officer application
- Authentication UI
frontend/src/context/AuthContext.tsx - Firebase web client
frontend/src/services/firebase.ts - Application routes
frontend/src/App.tsx - API client
frontend/src/services/api.ts - Executive dashboard
frontend/src/pages/DashboardPage.tsx - Project explorer
frontend/src/pages/ProjectsPage.tsx - Project 360 view
frontend/src/pages/ProjectDetailPage.tsx - Risk audit portal
frontend/src/pages/RiskEnginePage.tsx - AI assistant
frontend/src/pages/AiAssistantPage.tsx
API and domain services
- Authentication API
backend/app/api/auth.py - Dashboard API
backend/app/api/dashboard.py - Projects API
backend/app/api/projects.py - AI chat API
backend/app/api/chat.py - Document API
backend/app/api/storage.py - Project analytics
backend/app/services/project_service.py - Deterministic risk engine
backend/app/services/risk_engine.py - Dashboard aggregation
backend/app/services/dashboard_service.py - Domain query matching
backend/app/services/query_engine.py - Grounded AI service
backend/app/services/gemini_service.py - Document storage
backend/app/services/storage_service.py - Project domain models
backend/app/models/project.py
Persistence and integrations
- Firebase data access
backend/app/services/firebase_service.py - Firebase Realtime DB
- Cloud document storage
- Google Gemini
Backend controls
- Token verification
backend/app/core/security.py - Rate limiter
backend/app/core/rate_limiter.py
Other components
- Officer
Connections 39
- Officer → Application routes: uses
- Application routes → Authentication UI: provides auth
frontend/src/App.tsx - Authentication UI → Firebase web client: uses
frontend/src/context/AuthContext.tsx - Officer → Executive dashboard: views metrics
- Officer → Project explorer: explores projects
- Officer → Project 360 view: inspects project
- Officer → Risk audit portal: audits risk
frontend/src/pages/RiskEnginePage.tsx - Officer → AI assistant: asks questions
- Executive dashboard → API client: requests metrics
frontend/src/pages/DashboardPage.tsx - Risk audit portal → API client: requests projects
frontend/src/pages/RiskEnginePage.tsx - API client → Dashboard API: HTTP requests
- API client → Projects API: HTTP requests
- API client → AI chat API: HTTP requests
- API client → Document API: HTTP requests
- Authentication API → Token verification: verifies tokens
backend/app/api/auth.py - Authentication API → Firebase data access: uses
backend/app/api/auth.py - Dashboard API → Dashboard aggregation: calls
backend/app/api/dashboard.py - Dashboard aggregation → Project analytics: aggregates projects
backend/app/services/dashboard_service.py - Projects API → Project analytics: calls
backend/app/api/projects.py - AI chat API → Project analytics: retrieves project data
backend/app/api/chat.py - AI chat API → Domain query matching: matches questions
backend/app/api/chat.py - AI chat API → Deterministic risk engine: gets risk metrics
backend/app/api/chat.py - AI chat API → Grounded AI service: requests grounded answers
backend/app/api/chat.py - Document API → Document storage: handles documents
backend/app/api/storage.py - Project analytics → Firebase data access: reads project data
backend/app/services/project_service.py - Firebase data access → Firebase Realtime DB: reads and writes
- Project analytics → Deterministic risk engine: calculates risk
backend/app/services/project_service.py - Project analytics → Project domain models: parses records
backend/app/services/project_service.py - Deterministic risk engine → Project domain models: scores projects
backend/app/services/risk_engine.py - Dashboard aggregation → Project domain models: uses domain records
backend/app/services/dashboard_service.py - Document storage → Firebase data access: stores metadata
backend/app/services/storage_service.py - Document storage → Cloud document storage: stores documents
- Grounded AI service → Google Gemini: generates explanations
- Projects API → Token verification: requires authorization
backend/app/api/projects.py - AI chat API → Token verification: requires authorization
backend/app/api/chat.py - Projects API → Rate limiter: limits requests
backend/app/api/projects.py - AI chat API → Rate limiter: limits requests
backend/app/api/chat.py - Document API → Token verification: requires roles
backend/app/api/storage.py - Document API → Rate limiter: limits uploads
backend/app/api/storage.py