How fahad3235/green-factory-ai works
Green Factory Brain AI is a simulated-factory energy intelligence product: factory staff inspect telemetry, explore deterministic energy and carbon calculations, review proposed mitigations, and make the approval decision before any simulated state change. Its major capabilities include the dashboard and digital twin, scenario simulation, agent workflows, carbon forecasting and reporting, and an optional LLM copilot. The backend API and browser-side simulation are both represented. Some frontend and agent internals were not sampled, so relationships beyond documented behavior are omitted.
Main entry points: routes.py API routes · copilot_agent.py AI copilot · main.py FastAPI application · index.html Dashboard and views
Components 18
Factory Experience
- Dashboard and views
preview/index.html - 3D digital twin
preview/digital-twin.html - Simulator view
preview/simulation.html - Manager confirmation gate
preview/index.html
Simulation and Metrics
- Seeded simulation engine
preview/src/domain/calculations.mjs - Typed calculation engine
preview/src/domain/calculations.ts
API and Agents
- FastAPI application
src/api/main.py - API routes
src/api/routes.py - API contracts
src/models/schemas.py - Runtime settings
src/core/config.py - Mitigation workflow
src/agents/copilot_agent.py - AI copilot
src/agents/copilot_agent.py
Carbon and Reporting
- Energy and carbon formulas
src/core/calculations.py - Carbon credit forecast
src/core/calculations.py - Carbon and savings reports
preview/index.html
Other components
- Factory staff
- Groq API
- Gemini API
Connections 21
- Factory staff → Dashboard and views: uses
README.md - Factory staff → 3D digital twin: inspects
README.md - Factory staff → Simulator view: runs scenarios
README.md - Simulator view → Seeded simulation engine: simulates telemetry
README.md - Seeded simulation engine → Typed calculation engine: typed parity
preview/src/domain/calculations.ts - FastAPI application → API routes: includes router
src/api/main.py - FastAPI application → Runtime settings: loads settings
src/api/main.py - FastAPI application → Dashboard and views: serves UI
src/api/main.py - API routes → API contracts: validates payloads
src/api/routes.py - API routes → Runtime settings: reads settings
src/api/routes.py - API routes → AI copilot: runs copilot
src/api/routes.py - API routes → Mitigation workflow: evaluates scenario
src/api/routes.py - API routes → Energy and carbon formulas: calculates telemetry
src/api/routes.py - API routes → Carbon credit forecast: calculates forecast
src/api/routes.py - AI copilot → Runtime settings: uses provider keys
src/agents/copilot_agent.py - AI copilot → Groq API: requests completion
src/agents/copilot_agent.py - AI copilot → Gemini API: requests completion
src/agents/copilot_agent.py - Mitigation workflow → Manager confirmation gate: requires approval
README.md - Factory staff → Manager confirmation gate: approves or rejects
README.md - Dashboard and views → Carbon and savings reports: opens reports
README.md - Energy and carbon formulas → Carbon credit forecast: feeds calculations
src/core/calculations.py