How adityaupasani594/ecotimeshackathon works
Purpose and Runtime Entry Points
CRITPATH is a data-centre EPC scheduling and risk-intelligence platform. It turns schedule, procurement, and specification inputs into a task/equipment knowledge graph, calculates CPM status, and exposes simulation, compliance, and AI-assisted recovery workflows.
Primary runtime entry point: backend.api:app in backend/api.py, served with Uvicorn. The production UI is built from frontend/ and served as backend static assets; development UI starts from frontend/src/main.jsx.
API and Application Boundary
FastAPI is the service boundary for ingestion, graph/CPM retrieval, delay and procurement simulations, mitigation advice, compliance reporting, and grounded chat. backend/api.py owns route orchestration and frontend delivery; backend/database.py and backend/data/critpath.db provide persisted application state where applicable.
The frontend is a React/Vite dashboard. frontend/src/App.jsx coordinates API-backed application state and composes the operational views.
Ingestion and Canonical Models
The ingestion pipeline normalizes fragmented schedule, procurement, and specification sources into domain objects. backend/ingestion/parser.py is the orchestration boundary, delegating structured-file normalization and document extraction to readers such as backend/ingestion/excel_reader.py and backend/ingestion/text_reader.py. AI-assisted extraction is isolated in backend/ingestion/llm_extractor.py.
Canonical scheduling and asset schemas live in backend/models/task.py and backend/models/equipment.py. Seed inputs are backend/data/tasks.csv, backend/data/procurement.csv, and backend/data/specifications.txt.
Dual-Layer Graph Assembly
Graph construction separates logical schedule dependencies from physical asset relationships. backend/graph/task_graph.py manages the dependency DAG used for CPM. backend/graph/equipment_graph.py represents equipment, tags, specifications, and vendors. backend/graph/graph_builder.py assembles both layers, validates them, and creates task-to-equipment cross-links.
This is the core integration boundary: procurement or equipment risks are translated through cross-links into affected installation and commissioning tasks.
CPM and Risk Propagation
The CPM engine operates over the validated task DAG. backend/cpm/forward_pass.py computes early dates; backend/cpm/backward_pass.py computes late dates and float; backend/cpm/critical_path.py identifies critical work and propagates injected delays through successors.
Simulation requests enter through the API, modify or evaluate schedule conditions, then return updated finish impact, critical-path status, and downstream effects. Procurement delay simulation first resolves equipment dependencies through the graph layer.
Intelligence, Compliance, and External Services
Gemini is the external AI dependency, configured through GOOGLE_API_KEY. It is used for ingestion extraction and for recovery/mitigation recommendations, with relevant implementation expected behind backend/ingestion/llm_extractor.py and API workflows in backend/api.py.
Compliance combines procurement/submittal data with specification text and task sequencing. It detects equipment requirement mismatches and out-of-sequence commissioning risks before presenting them to the UI.
Presentation Workflows
frontend/src/components/GanttChart.jsx renders CPM timing, dependency links, critical work, and float. frontend/src/components/Simulator.jsx drives delay scenarios and AI recovery advice. frontend/src/components/ComplianceLog.jsx displays compliance findings, while frontend/src/components/Copilot.jsx provides grounded specification Q&A with citations.
The UI consumes backend results rather than owning scheduling logic; graph construction, CPM calculations, persistence, AI calls, and compliance evaluation remain backend responsibilities.
Main entry points: api.py FastAPI service · App.jsx Dashboard shell · parser.py Ingestion parser · graph_builder.py Graph builder
Components 19
React dashboard
- Dashboard shell · Coordinates API-backed operational views.
frontend/src/App.jsx - Gantt view
frontend/src/components/GanttChart.jsx - Simulator · Runs delay scenarios and recovery advice.
frontend/src/components/Simulator.jsx - Compliance log
frontend/src/components/ComplianceLog.jsx - Copilot
frontend/src/components/Copilot.jsx
Backend service
- FastAPI service · Runtime entry point and workflow orchestrator.
backend/api.py - Application state
backend/data/critpath.db
Ingestion and models
- Ingestion parser · Normalizes schedule, procurement, and specification sources.
backend/ingestion/parser.py - Seed inputs
backend/data/tasks.csv - Source readers
backend/ingestion/excel_reader.py - AI extractor
backend/ingestion/llm_extractor.py - Canonical models
backend/models/task.py
Graph and scheduling
- Graph builder · Validates both graph layers and creates task-equipment links.
backend/graph/graph_builder.py - Task dependency DAG · Logical dependencies used by CPM.
backend/graph/task_graph.py - Equipment graph · Equipment, tags, specifications, and vendors.
backend/graph/equipment_graph.py - Forward pass · Computes early dates.
backend/cpm/forward_pass.py - Backward pass · Computes late dates and float.
backend/cpm/backward_pass.py - Critical path engine · Identifies critical work and propagates delays.
backend/cpm/critical_path.py
Other components
- Gemini · Used with GOOGLE_API_KEY.
Connections 26
- Dashboard shell → Gantt view: composes
- Dashboard shell → Simulator: composes
- Dashboard shell → Compliance log: composes
- Dashboard shell → Copilot: composes
- Dashboard shell → FastAPI service: API requests
- FastAPI service → Application state: persists state
- FastAPI service → Ingestion parser: ingestion
- FastAPI service → Graph builder: graph and simulation workflows
- FastAPI service → Gemini: recovery advice and chat
- Seed inputs → Ingestion parser: schedule and procurement
- Source readers → Ingestion parser: normalized extraction
- Ingestion parser → AI extractor: AI-assisted documents
- AI extractor → Gemini: extracts with
- Ingestion parser → Canonical models: creates
- Canonical models → Graph builder: domain objects
- Graph builder → Task dependency DAG: builds
- Graph builder → Equipment graph: builds and cross-links
- Task dependency DAG → Forward pass: validated DAG
- Forward pass → Backward pass: early dates
- Backward pass → Critical path engine: late dates and float
- Equipment graph → Critical path engine: equipment delay impacts · Cross-links resolve affected installation and commissioning tasks.
- Critical path engine → FastAPI service: CPM and downstream effects
- FastAPI service → Gantt view: timing and critical work
- FastAPI service → Simulator: scenario results
- FastAPI service → Compliance log: compliance findings
- FastAPI service → Copilot: grounded answers