How satvika0112/greenshift works
GreenShift is a multi-tenant platform for turning submitted, deferrable workloads into explainable, carbon- and cost-aware execution windows, then governing execution through human approval and Kubernetes dispatch. Its principal flow continues through runtime status tracking and baseline-versus-actual impact reporting, with lifecycle events recorded in a tamper-evident ledger. The React control plane is the documented enterprise UI; sampled code also shows a Streamlit dashboard. README capabilities establish several subsystem responsibilities, while only selected source excerpts were available, so uncertain internal call wiring is omitted.
Main entry points: routers API routers · database.py Platform database · service.py Decision orchestration · ledger.py Audit ledger
Components 23
Control planes
- React control plane
frontend/src/App.tsx - Streamlit dashboard
app/dashboard/main.py - Frontend API client
frontend/src/api/client.ts
API and governance
- FastAPI application
app/api/main.py - API routers
app/api/routers - Tenant and RBAC
app/api/tenant_scope.py - Company onboarding
app/companies/service.py - Human approval gate
app/approval/service.py
Scheduling and data
- Workload ingestion
app/ingest/service.py - Carbon and tariff data
app/ingest/data_sources.py - Decision orchestration
app/decide/service.py - Window scheduling
app/decide/scheduler.py - Policy ranking
app/decide/optimization_policy.py - Capacity and batching
app/decide/batch_scheduler.py
Execution and measurement
- Kubernetes dispatch
app/dispatch/service.py - Execution status
app/dispatch/status_tracker.py - Impact analytics
app/analytics/actual_impact.py - Audit ledger
app/trust/ledger.py - User notifications
app/notify/service.py
Shared state
- Platform database
app/shared/database.py
Other components
- Organization user
- Regional data providers
- Kubernetes cluster
Connections 30
- Organization user → React control plane: uses
- React control plane → Frontend API client: requests data
- Organization user → Streamlit dashboard: uses
- Streamlit dashboard → Frontend API client: requests data
- Frontend API client → FastAPI application: HTTP requests
- FastAPI application → API routers: dispatches routes
- API routers → Tenant and RBAC: enforces scope
- API routers → Company onboarding: onboards tenants
- API routers → Workload ingestion: submits workloads
- API routers → Decision orchestration: requests scheduling
- API routers → Human approval gate: records decisions
- API routers → Impact analytics: serves reports
- API routers → Audit ledger: serves audit history
- Workload ingestion → Platform database: persists workloads
- Regional data providers → Carbon and tariff data: provides signals
- Carbon and tariff data → Platform database: stores observations
- Decision orchestration → Window scheduling: evaluates workloads
- Window scheduling → Policy ranking: ranks feasible windows
- Window scheduling → Capacity and batching: checks capacity
- Decision orchestration → Platform database: persists decisions
- Decision orchestration → Audit ledger: records schedule events
- Human approval gate → Platform database: updates approval state
- Human approval gate → Audit ledger: records approval events
- Kubernetes dispatch → Kubernetes cluster: creates Jobs
- Kubernetes dispatch → Audit ledger: records dispatch events
- Execution status → Platform database: updates job status
- Impact analytics → Platform database: reads outcomes
- Impact analytics → Audit ledger: records lifecycle events
- User notifications → Organization user: sends updates
- Platform database → Decision orchestration: supplies pending jobs