Skip to content

Commit 0fbf139

Browse files
Version 1
1 parent a05ead5 commit 0fbf139

87 files changed

Lines changed: 1527681 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
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

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: '[BUG] '
5+
labels: 'bug'
6+
assignees: ''
7+
---
8+
9+
## 🐛 Bug Description
10+
11+
A clear and concise description of what the bug is.
12+
13+
## 🔄 Steps to Reproduce
14+
15+
1. Go to '...'
16+
2. Click on '...'
17+
3. Scroll down to '...'
18+
4. See error
19+
20+
## ✅ Expected Behavior
21+
22+
A clear and concise description of what you expected to happen.
23+
24+
## ❌ Actual Behavior
25+
26+
A clear and concise description of what actually happened.
27+
28+
## 📸 Screenshots
29+
30+
If applicable, add screenshots to help explain your problem.
31+
32+
## 🖥️ Environment
33+
34+
**Desktop:**
35+
- OS: [e.g. Windows 10, macOS 12.0, Ubuntu 20.04]
36+
- Browser: [e.g. Chrome 96, Firefox 95, Safari 15]
37+
- Python Version: [e.g. 3.8.10]
38+
- SUMO Version: [e.g. 1.15.0]
39+
40+
**Server/Backend:**
41+
- Python Version: [e.g. 3.8.10]
42+
- Flask Version: [e.g. 2.3.3]
43+
- Database: [e.g. PostgreSQL 13]
44+
45+
## 📋 Package Versions
46+
47+
Please run `pip freeze` and paste the output here:
48+
49+
```
50+
Flask==2.3.3
51+
numpy==1.26.4
52+
...
53+
```
54+
55+
## 📊 System Logs
56+
57+
If applicable, add relevant log outputs:
58+
59+
**Application Logs:**
60+
```
61+
[2025-01-15 10:30:00] ERROR: ...
62+
```
63+
64+
**Browser Console:**
65+
```
66+
Error: ...
67+
```
68+
69+
**SUMO Logs:**
70+
```
71+
Warning: ...
72+
```
73+
74+
## 🔍 Additional Context
75+
76+
Add any other context about the problem here:
77+
78+
- When did this start happening?
79+
- Does it happen consistently or intermittently?
80+
- Have you made any recent changes to your setup?
81+
- Are there any workarounds you've found?
82+
83+
## ✅ Checklist
84+
85+
- [ ] I have searched existing issues to make sure this is not a duplicate
86+
- [ ] I have provided all requested environment information
87+
- [ ] I have included relevant logs and error messages
88+
- [ ] I have tested this with the latest version
89+
- [ ] I have provided clear steps to reproduce the issue

0 commit comments

Comments
 (0)