How pranjalbaruah708-sudo/powerflow works
GridFlow is a web application for distribution-network power-flow studies. Engineers import or edit a network, validate it, run a study, inspect results and recommendations, and manage saved cases and reports. The frontend also exposes equipment, scenario, and what-if tools. The backend’s study execution service converts the network model for OpenDSS, processes solver output, and produces study results. Source excerpts support the main study flow and selected frontend calls; several documented-by-code capabilities are represented without asserting unsampled internal wiring.
Main entry points: App.tsx Study workspace · api.ts API client · study_router.py Study endpoints · study_service.py Study orchestration
Components 27
Study workspace
- Study workspace
frontend/src/App.tsx - Network import
frontend/src/components/NetworkImportDialog.tsx - Network editor
frontend/src/components/NetworkModelModal.tsx - What-if studies
frontend/src/components/WhatIfSimulationDialog.tsx - Equipment library
frontend/src/components/EquipmentLibraryModal.tsx - Results and diagram
frontend/src/components/StudyResultsInspector.tsx - Cases and projects
frontend/src/components/StudyCasesModal.tsx - Reports export
frontend/src/services/exportStudyService.ts - Login and session
frontend/src/services/authService.ts
API and domain services
- API client
frontend/src/services/api.ts - FastAPI application
backend/app/main.py - Study endpoints
backend/app/routers/study_router.py - Persistence endpoints
backend/app/routers/persistence_router.py - Network schema
backend/app/schemas/network_model.py - Workbook import
backend/app/services/excel_service.py - Topology validation
backend/app/services/topology_validator.py - Equipment catalog
backend/app/services/library_service.py - Load allocation
backend/app/services/load_allocation_service.py
Power-flow execution
- Study orchestration
backend/app/services/study_service.py - DSS conversion
backend/app/services/dss_converter.py - OpenDSS solver
backend/app/services/opendss_service.py - Result processing
backend/app/services/result_processor.py - Recommendations
backend/app/services/recommendation_engine.py
Identity and persistence
- Authentication API
backend/app/routers/auth_router.py - Study persistence
backend/app/services/storage_service.py - Relational database
backend/app/db/session.py
Other components
- Engineer
Connections 33
- Engineer → Study workspace: uses
frontend/src/App.tsx - Study workspace → API client: requests studies
frontend/src/App.tsx - Study workspace → Network import: opens import
frontend/src/App.tsx - Study workspace → Network editor: edits network
frontend/src/App.tsx - Study workspace → What-if studies: opens simulation
frontend/src/App.tsx - Study workspace → Equipment library: opens catalog
frontend/src/App.tsx - Study workspace → Cases and projects: manages cases
frontend/src/App.tsx - Study workspace → Results and diagram: shows results
frontend/src/App.tsx - Study workspace → Reports export: exports report
frontend/src/App.tsx - Network import → API client: uploads workbook
frontend/src/components/NetworkImportDialog.tsx - Network editor → API client: loads data
frontend/src/components/NetworkModelModal.tsx - What-if studies → API client: submits changes
frontend/src/components/WhatIfSimulationDialog.tsx - Equipment library → API client: manages equipment
frontend/src/components/EquipmentLibraryModal.tsx - Cases and projects → API client: loads cases
frontend/src/components/StudyCasesModal.tsx - API client → Study endpoints: calls study API
frontend/src/services/api.ts - API client → Persistence endpoints: calls persistence API
frontend/src/services/api.ts - FastAPI application → Study endpoints: registers routes
backend/app/main.py - FastAPI application → Persistence endpoints: registers routes
backend/app/main.py - FastAPI application → Authentication API: registers routes
backend/app/main.py - Login and session → Authentication API: authenticates
frontend/src/services/authService.ts - Study endpoints → Network schema: validates input
backend/app/routers/study_router.py - Study endpoints → Workbook import: parses workbook
backend/app/routers/study_router.py - Study endpoints → Study orchestration: runs study
backend/app/routers/study_router.py - Study endpoints → Topology validation: checks topology
backend/app/main.py - Study endpoints → Load allocation: allocates load
backend/app/main.py - Study endpoints → Equipment catalog: serves catalog
backend/app/main.py - Study orchestration → DSS conversion: converts network
backend/app/services/study_service.py - Study orchestration → OpenDSS solver: runs power flow
backend/app/services/study_service.py - Study orchestration → Result processing: processes output
backend/app/services/study_service.py - Study orchestration → Recommendations: generates advice
backend/app/services/study_service.py - Persistence endpoints → Study persistence: reads and writes
backend/app/main.py - Study persistence → Relational database: persists records
backend/app/services/storage_service.py - Reports export → API client: uses study data
frontend/src/services/exportStudyService.ts