1+ # Manhattan Power Grid - Environment Configuration Template
2+ # Copy this file to .env and update with your settings
3+
4+ # =============================================================================
5+ # Flask Application Settings
6+ # =============================================================================
7+
8+ # Environment: development, production, testing
9+ FLASK_ENV = development
10+
11+ # Enable debug mode (set to False in production)
12+ FLASK_DEBUG = True
13+
14+ # Secret key for session management (generate a secure key for production)
15+ SECRET_KEY = your-secret-key-here-change-in-production
16+
17+ # Application host and port
18+ FLASK_HOST = 0.0.0.0
19+ FLASK_PORT = 5000
20+
21+ # =============================================================================
22+ # Database Configuration
23+ # =============================================================================
24+
25+ # Database URL (SQLite for development, PostgreSQL for production)
26+ DATABASE_URL = sqlite:///manhattan_grid.db
27+
28+ # Production PostgreSQL example:
29+ # DATABASE_URL=postgresql://username:password@localhost:5432/manhattan_grid
30+
31+ # Database connection pool settings
32+ DB_POOL_SIZE = 10
33+ DB_MAX_OVERFLOW = 20
34+
35+ # =============================================================================
36+ # SUMO Traffic Simulation
37+ # =============================================================================
38+
39+ # SUMO installation directory (required for vehicle simulation)
40+ SUMO_HOME = /path/to/sumo
41+
42+ # Windows example:
43+ # SUMO_HOME=C:\Program Files (x86)\Eclipse\Sumo
44+
45+ # Linux example:
46+ # SUMO_HOME=/usr/share/sumo
47+
48+ # macOS example:
49+ # SUMO_HOME=/opt/homebrew/share/sumo
50+
51+ # SUMO configuration
52+ SUMO_GUI = False
53+ SUMO_STEP_LENGTH = 1.0
54+ SUMO_BEGIN_TIME = 0
55+ SUMO_END_TIME = 3600
56+
57+ # =============================================================================
58+ # Power Grid Simulation
59+ # =============================================================================
60+
61+ # Grid update interval (seconds)
62+ GRID_UPDATE_INTERVAL = 5
63+
64+ # Power flow analysis settings
65+ POWER_FLOW_SOLVER = pandapower
66+ VOLTAGE_TOLERANCE = 0.05
67+ FREQUENCY_TOLERANCE = 0.1
68+
69+ # =============================================================================
70+ # Vehicle-to-Grid (V2G) Settings
71+ # =============================================================================
72+
73+ # V2G system enable/disable
74+ V2G_ENABLED = True
75+
76+ # Default V2G power rating per vehicle (kW)
77+ V2G_POWER_RATING = 250
78+
79+ # Energy pricing ($/kWh)
80+ V2G_ENERGY_PRICE = 0.15
81+
82+ # V2G activation threshold (percentage of substation capacity)
83+ V2G_ACTIVATION_THRESHOLD = 90
84+
85+ # =============================================================================
86+ # Machine Learning & AI
87+ # =============================================================================
88+
89+ # OpenAI API key for AI chatbot (optional)
90+ OPENAI_API_KEY = your-openai-api-key-here
91+
92+ # OpenAI model configuration
93+ OPENAI_MODEL = gpt-3.5-turbo
94+ OPENAI_MAX_TOKENS = 1000
95+ OPENAI_TEMPERATURE = 0.7
96+
97+ # ML model training settings
98+ ML_RETRAIN_INTERVAL = 3600
99+ ML_BATCH_SIZE = 32
100+ ML_LEARNING_RATE = 0.001
101+
102+ # =============================================================================
103+ # External Services
104+ # =============================================================================
105+
106+ # Mapbox access token for enhanced mapping (optional)
107+ MAPBOX_ACCESS_TOKEN = your-mapbox-token-here
108+
109+ # Weather API configuration (optional)
110+ WEATHER_API_KEY = your-weather-api-key
111+ WEATHER_UPDATE_INTERVAL = 1800
112+
113+ # =============================================================================
114+ # Logging Configuration
115+ # =============================================================================
116+
117+ # Logging level: DEBUG, INFO, WARNING, ERROR, CRITICAL
118+ LOG_LEVEL = INFO
119+
120+ # Log file location
121+ LOG_FILE = logs/manhattan_grid.log
122+
123+ # Log rotation settings
124+ LOG_MAX_BYTES = 10485760
125+ LOG_BACKUP_COUNT = 5
126+
127+ # Structured logging format
128+ LOG_FORMAT = json
129+
130+ # =============================================================================
131+ # Security Settings
132+ # =============================================================================
133+
134+ # CORS allowed origins (comma-separated)
135+ CORS_ORIGINS = http://localhost:3000,http://localhost:5000
136+
137+ # API rate limiting
138+ RATE_LIMIT_ENABLED = True
139+ RATE_LIMIT_PER_MINUTE = 60
140+ RATE_LIMIT_PER_HOUR = 1000
141+
142+ # Session timeout (seconds)
143+ SESSION_TIMEOUT = 3600
144+
145+ # =============================================================================
146+ # Performance Settings
147+ # =============================================================================
148+
149+ # Enable caching
150+ CACHE_ENABLED = True
151+ CACHE_TYPE = simple
152+ CACHE_DEFAULT_TIMEOUT = 300
153+
154+ # Background task settings
155+ CELERY_BROKER_URL = redis://localhost:6379/0
156+ CELERY_RESULT_BACKEND = redis://localhost:6379/0
157+
158+ # =============================================================================
159+ # Development Settings
160+ # =============================================================================
161+
162+ # Enable profiling (development only)
163+ PROFILING_ENABLED = False
164+
165+ # Mock external services (for testing)
166+ MOCK_SUMO = False
167+ MOCK_WEATHER = False
168+ MOCK_OPENAI = False
169+
170+ # =============================================================================
171+ # Monitoring & Metrics
172+ # =============================================================================
173+
174+ # Enable metrics collection
175+ METRICS_ENABLED = True
176+
177+ # Metrics export interval (seconds)
178+ METRICS_EXPORT_INTERVAL = 60
179+
180+ # Health check endpoint
181+ HEALTH_CHECK_ENABLED = True
182+
183+ # =============================================================================
184+ # Backup & Recovery
185+ # =============================================================================
186+
187+ # Database backup settings
188+ BACKUP_ENABLED = True
189+ BACKUP_INTERVAL = 86400
190+ BACKUP_RETENTION_DAYS = 30
191+ BACKUP_LOCATION = backups/
192+
193+ # =============================================================================
194+ # Deployment Settings
195+ # =============================================================================
196+
197+ # Environment identifier
198+ ENVIRONMENT = development
199+
200+ # Application version (auto-populated by CI/CD)
201+ APP_VERSION = 2.0.0
202+
203+ # Build information
204+ BUILD_ID = local
205+ BUILD_DATE = 2025-01-15
206+
207+ # =============================================================================
208+ # Feature Flags
209+ # =============================================================================
210+
211+ # Enable experimental features
212+ FEATURE_ADVANCED_ML = False
213+ FEATURE_BLOCKCHAIN_TRADING = False
214+ FEATURE_IOT_INTEGRATION = False
215+ FEATURE_MULTI_CITY = False
0 commit comments