This document establishes consistent naming conventions for the Energy Tracking Platform services.
- Use lowercase with hyphens:
iot-mock,data-ingestion,auth-service - Docker container names:
energy-{service-name}(e.g.,energy-iot-mock) - Docker compose service names:
{service-name}(e.g.,iot-mock)
- Use proper capitalization:
IoT Mock Service,Data Ingestion Service,Auth Service - Consistent in API documentation, logs, and user interfaces
- Class names:
IoTMockTester,DeviceManager(PascalCase) - File names:
iot_mock.py,device_manager.py(snake_case for Python) - Variable names:
iot_mock_service,device_manager(snake_case) - API endpoints:
/api/v1/iot-mock/devices(kebab-case)
| Service | Directory | Docker Service | Container Name | Display Name |
|---|---|---|---|---|
| IoT Mock | iot-mock |
iot-mock |
energy-iot-mock |
IoT Mock Service |
| Data Ingestion | data-ingestion |
data-ingestion |
energy-data-ingestion |
Data Ingestion Service |
| Auth Service | auth-service |
auth-service |
energy-auth-service |
Auth Service |
| API Gateway | api-gateway |
api-gateway |
energy-api-gateway |
API Gateway Service |
| Analytics | analytics |
analytics |
energy-analytics |
Analytics Service |
| Notification | notification |
notification |
energy-notification |
Notification Service |
# docker-compose.yml
services:
iot-mock:
container_name: energy-iot-mock
build:
context: ./services/iot-mock# Python class
class IoTMockManager:
"""Manages IoT mock devices"""
# Variable names
iot_mock_service = IoTMockManager()# API documentation
app = FastAPI(
title="IoT Mock Service",
description="IoT mock device service for energy tracking platform"
)# Don't use inconsistent naming
services:
mock-iot: # Wrong - should be iot-mock
mockIoT: # Wrong - should be iot-mock# Don't use inconsistent display names
title="Mock IoT Service" # Wrong - should be "IoT Mock Service"
title="IOT Mock Service" # Wrong - should be "IoT Mock Service"- Be Consistent: Once established, use the same naming pattern throughout
- Context Matters: Use appropriate case for the context (kebab-case for URLs, PascalCase for classes, etc.)
- User-Facing vs Internal: Display names should be user-friendly, internal names should be developer-friendly
- Avoid Abbreviations: Use full words when possible (
iot-mocknotim) - Follow Language Conventions: Python uses snake_case, JavaScript uses camelCase, etc.
When renaming services:
- Update directory names
- Update docker-compose.yml service names
- Update container names
- Update API titles and descriptions
- Update documentation
- Update log messages
- Update environment variable references
- Update script references
- Update README files
- Update test files