How emirhannavdar/ges_battery works
GES Battery is a PV-plant simulation and operations application: operators use a Next.js dashboard to authenticate, fetch weather and market inputs, run or manage simulations, and review or compare saved results. FastAPI routes requests into authentication, integrations, simulation, and persistence; Celery tasks provide background EPİAŞ and weather work. The README documents capabilities beyond the sampled excerpts, so those branches are included where paths are supported, with evidence cited to the README. Unsampled implementation details and unverified links are omitted.
Main entry points: auth_request.py Authentication routes · simulation_manager.py Simulation manager · api.py FastAPI application · simulation_request.py Simulation routes
Components 32
Dashboard
- Dashboard views
frontend/app/(panel) - Dashboard components
frontend/components - Backend proxy
frontend/app/api/[...path]/route.ts - API client
frontend/lib/client.ts
API and integrations
- FastAPI application
api/api.py - EPİAŞ routes
api/endpoints/epias_request.py - Weather routes
api/endpoints/visual_crossing_request.py - Simulation routes
api/endpoints/simulation_request.py - EPİAŞ client
api/services/epias.py - Weather client
api/services/visual_crossing.py
Identity and access
- Authentication routes
auth/auth_request.py - JWT authentication
auth/auth.py - Role authorization
auth/roles.py - Location geocoding
auth/geocoding.py
PV simulation
- Simulation manager
simulation/simulation_manager.py - Inverter model
simulation/inverter.py - Transformer model
simulation/transformer.py - EKK controller
simulation/ekk.py - Energy analyzer
simulation/energy_analyzer.py - Simulation clock
simulation/simulation_clock.py
Data and jobs
- PostgreSQL
- User and location data
database/database.py - Saved scenarios
database/simulation_repository.py - Weather records
database/weather_db.py - PTF records
database/epias_ptf_db.py - Celery app
tasks/celery_app.py - EPİAŞ tasks
tasks/epias_tasks.py - Weather tasks
tasks/weather_tasks.py
Other components
- Operator
- EPİAŞ
- Visual Crossing
- Redis
Connections 42
- Operator → Dashboard views: uses
- Dashboard views → Dashboard components: renders
- Dashboard components → API client: requests
- API client → Backend proxy: forwards
- Backend proxy → FastAPI application: forwards requests
- FastAPI application → EPİAŞ routes: registers
api/api.py - FastAPI application → Weather routes: registers
api/api.py - FastAPI application → Simulation routes: registers
api/api.py - FastAPI application → Authentication routes: registers
api/api.py - EPİAŞ routes → EPİAŞ client: calls
api/endpoints/epias_request.py - EPİAŞ client → EPİAŞ: requests data
- EPİAŞ routes → PTF records: stores and reads
api/endpoints/epias_request.py - Weather routes → Weather client: calls
api/endpoints/visual_crossing_request.py - Weather client → Visual Crossing: requests weather
- Weather routes → Weather records: stores and reads
api/endpoints/visual_crossing_request.py - Simulation routes → Simulation manager: runs simulation
api/endpoints/simulation_request.py - Simulation routes → Weather records: reads weather
- Simulation routes → Saved scenarios: saves and loads
api/endpoints/simulation_request.py - Simulation manager → Inverter model: steps
simulation/simulation_manager.py - Simulation manager → Transformer model: calculates losses
simulation/simulation_manager.py - Simulation manager → EKK controller: controls power
simulation/simulation_manager.py - Simulation manager → Energy analyzer: analyzes output
simulation/simulation_manager.py - Simulation manager → Simulation clock: validates time
simulation/simulation_manager.py - Authentication routes → JWT authentication: authenticates
auth/auth_request.py - Authentication routes → User and location data: reads and updates
auth/auth_request.py - Authentication routes → Location geocoding: resolves location
auth/auth_request.py - JWT authentication → User and location data: loads user
auth/auth.py - Role authorization → JWT authentication: checks active user
auth/roles.py - Authentication routes → Role authorization: enforces roles
auth/auth_request.py - User and location data → PostgreSQL: queries
- Saved scenarios → PostgreSQL: persists runs
- Weather records → PostgreSQL: persists records
- PTF records → PostgreSQL: persists prices
- EPİAŞ tasks → Celery app: runs as task
tasks/epias_tasks.py - Weather tasks → Celery app: runs as task
tasks/weather_tasks.py - EPİAŞ tasks → EPİAŞ client: fetches prices
tasks/epias_tasks.py - EPİAŞ tasks → PTF records: stores prices
tasks/epias_tasks.py - Weather tasks → Weather client: fetches weather
tasks/weather_tasks.py - Weather tasks → Weather records: stores weather
tasks/weather_tasks.py - Celery app → Redis: uses broker
- EPİAŞ client → Redis: caches token
api/services/epias.py - Authentication routes → Redis: rate limits login