How naren-ship-it/gogreen_backend works
This Django/Channels application supports a cycling-energy gamification system: administrators manage participants, cycles, groups, themes, and display screens, while live power readings feed participant monitoring and ranking displays. The principal flow is Modbus polling, persistence of readings, then WebSocket delivery of live chart data; separate APIs manage operations and reports/files support administration. The excerpts and index establish the shown calls and routes. Other README-level product claims cannot be checked because no README content was provided, and unsampled view behavior is represented conservatively.
Main entry points: models.py Cycling records · routing.py WebSocket routing · urls.py HTTP routing · views.py Admin management
Components 22
Runtime and ingestion
- ASGI lifespan
electricity_monitoring_be/application.py - Modbus polling
cloud_sync/sync/modbus_client.py - Reading persistence
cloud_sync/sync/services.py - WebSocket routing
electricity_monitoring_be/routing.py - HTTP routing
electricity_monitoring_be/urls.py
Cycling domain
- Cycling records
core/models.py
Administration APIs
- Core APIs
core/api.py - Admin management
admin_panel/views.py - Admin serializers
admin_panel/serializer.py - Core web views
core/web.py
Live displays
- Screen configuration
screen_controller/models.py - Screen serializers
screen_controller/serializer.py - Screen control socket
screen_controller/consumers.py - Power monitor socket
core/power_monitor_consumer.py - Group ranking socket
core/group_participant_consumer.py - App title socket
core/app_title_consumer.py - Echo socket
core/consumers.py
Reports and files
- Excel reporting
excel_report/views.py - File management
file_manager/views.py
Other components
- Administrator / client
- Modbus meter
- Display client
Connections 33
- ASGI lifespan → Modbus polling: starts
electricity_monitoring_be/application.py - Modbus polling → Modbus meter: reads registers
cloud_sync/sync/modbus_client.py - Modbus polling → Cycling records: loads controllers
cloud_sync/sync/modbus_client.py - Modbus polling → Reading persistence: saves readings
cloud_sync/sync/modbus_client.py - Reading persistence → Cycling records: updates totals
cloud_sync/sync/services.py - Core APIs → Cycling records: reads and writes
core/api.py - Core APIs → Screen configuration: reads screens
core/api.py - Core APIs → Screen serializers: serializes screens
core/api.py - Admin management → Cycling records: manages records
admin_panel/views.py - Admin management → Screen configuration: manages screens
admin_panel/views.py - Admin management → Screen serializers: uses serializers
admin_panel/views.py - Admin management → Admin serializers: uses serializers
admin_panel/views.py - Administrator / client → HTTP routing: requests APIs
electricity_monitoring_be/urls.py - HTTP routing → Core APIs: routes to
electricity_monitoring_be/urls.py - HTTP routing → Admin management: routes to
- HTTP routing → Core web views: routes to
electricity_monitoring_be/urls.py - HTTP routing → Excel reporting: routes to
- HTTP routing → File management: routes to
- Administrator / client → WebSocket routing: opens socket
electricity_monitoring_be/routing.py - WebSocket routing → Screen control socket: routes to
electricity_monitoring_be/routing.py - WebSocket routing → Power monitor socket: routes to
electricity_monitoring_be/routing.py - WebSocket routing → Group ranking socket: routes to
electricity_monitoring_be/routing.py - WebSocket routing → App title socket: routes to
electricity_monitoring_be/routing.py - WebSocket routing → Echo socket: routes to
electricity_monitoring_be/routing.py - Screen control socket → Screen configuration: updates screens
screen_controller/consumers.py - Screen control socket → Screen serializers: uses serializers
screen_controller/consumers.py - Screen control socket → Display client: broadcasts controls
- Power monitor socket → Cycling records: queries readings
core/power_monitor_consumer.py - Power monitor socket → Administrator / client: streams charts
- Group ranking socket → Cycling records: uses cycling data
core/group_participant_consumer.py - App title socket → Cycling records: uses app data
core/app_title_consumer.py - Excel reporting → Cycling records: queries data
excel_report/views.py - File management → Administrator / client: serves files