System Architecture - seojedaperez/IgnisMap GitHub Wiki
The IgnisMap emergency response system is built on Microsoft Azure cloud services, providing real-time fire monitoring, AI-powered analysis, and coordinated emergency response capabilities 1. The architecture leverages eight core Azure services with an estimated monthly cost of $165-270 USD 2.
The system is organized into critical and supporting service tiers based on operational importance and cost impact 3 .
graph TB
subgraph "Critical Services ($115-150/month)"
AzureMaps["emergency-app-maps<br/>Azure Maps S1<br/>$50-80/month"]
CosmosDB["emergency-app-cosmos<br/>Cosmos DB<br/>$25-40/month"]
Functions["emergency-app-functions<br/>Function App<br/>$10-20/month"]
OpenAI["emergency-openai<br/>Cognitive Services<br/>$30-50/month"]
end
subgraph "Supporting Services ($50-120/month)"
EventHub["emergency-app-events<br/>Event Hubs<br/>$30-50/month"]
CogServices["emergency-app-cognitive<br/>Cognitive Services<br/>$30-50/month"]
KeyVault["emergency-app-vault<br/>Key Vault"]
AppInsights["emergency-app-insights<br/>Application Insights"]
Storage["emergencystorage<br/>Storage Account"]
end
subgraph "External Data Sources"
NASA["NASA FIRMS API"]
Weather["Open-Meteo API"]
end
AzureMaps --> Functions
CosmosDB --> Functions
Functions --> OpenAI
Functions --> CogServices
EventHub --> Functions
KeyVault --> Functions
KeyVault --> CosmosDB
KeyVault --> AzureMaps
Functions --> AppInsights
Functions --> Storage
NASA --> EventHub
Weather --> Functions
The Azure infrastructure is provisioned through automated shell scripts that create and configure all necessary resources in a single resource group 4 .
flowchart TD
Start["azure-setup.sh"] --> Login["az login verification"]
Login --> ResourceGroup["Create emergency-rg<br/>Resource Group"]
ResourceGroup --> Maps["Create emergency-app-maps<br/>S1 SKU"]
Maps --> Cosmos["Create emergency-app-cosmos<br/>GlobalDocumentDB"]
Cosmos --> Containers["Create 8 Cosmos containers<br/>Organizations, FireAlerts, etc."]
Containers --> Storage["Create storage account<br/>Standard_LRS"]
Storage --> Functions["Create emergency-app-functions<br/>Node.js 18, v4"]
Functions --> Cognitive["Create emergency-app-cognitive<br/>CognitiveServices S0"]
Cognitive --> EventHubs["Create emergency-app-events<br/>Standard SKU"]
EventHubs --> KeyVault["Create emergency-app-vault<br/>Standard SKU"]
KeyVault --> Secrets["Store connection strings<br/>and API keys"]
Secrets --> Insights["Create emergency-app-insights<br/>Application Insights"]
Insights --> Config["Configure Function App<br/>environment variables"]
Config --> Output["Generate azure-config.json<br/>configuration file"]
All Azure resources follow the naming pattern {APP_NAME}-{SERVICE_TYPE}
where APP_NAME
is "emergency-app" 5 :
Service Type | Resource Name | Purpose |
---|---|---|
Maps | emergency-app-maps |
Geospatial mapping services |
Cosmos DB | emergency-app-cosmos |
Global document database |
Functions | emergency-app-functions |
Serverless compute platform |
Cognitive Services | emergency-app-cognitive |
AI and ML services |
Event Hubs | emergency-app-events |
Real-time data streaming |
Key Vault | emergency-app-vault-{timestamp} |
Secrets management |
App Insights | emergency-app-insights |
Application monitoring |
Storage | emergencystorage{timestamp} |
File and blob storage |
Cosmos DB serves as the primary data store with eight specialized containers optimized for different data types and access patterns 6 .
graph TB
subgraph "EmergencyDB Database"
Orgs["Organizations<br/>Partition: /organizationType<br/>400 RU/s"]
Zones["MonitoringZones<br/>Partition: /organizationId<br/>400 RU/s"]
Alerts["FireAlerts<br/>Partition: /organizationId<br/>1000 RU/s"]
Plans["TacticalPlans<br/>Partition: /organizationType<br/>400 RU/s"]
Satellite["SatelliteData<br/>Partition: /satellite<br/>2000 RU/s<br/>TTL: 30 days"]
Weather["WeatherData<br/>Partition: /location<br/>800 RU/s<br/>TTL: 7 days"]
Resources["ResourceAllocation<br/>Partition: /organizationId<br/>400 RU/s"]
Audit["AuditLog<br/>Partition: /organizationId<br/>400 RU/s"]
end
subgraph "Access Patterns"
Orgs --> "Query by organization type"
Zones --> "Query by organization ID"
Alerts --> "Query by organization ID"
Plans --> "Query by organization type"
Satellite --> "Query by satellite source"
Weather --> "Query by geographic region"
Resources --> "Query by organization ID"
Audit --> "Query by organization ID"
end
The system uses a comprehensive schema with eight main entity types 7 :
erDiagram
Organizations {
string id PK
string name
string type
object contactInfo
array capabilities
array activeZones
date createdAt
date lastActive
}
MonitoringZones {
string id PK
string organizationId FK
string name
object polygon
object center
string riskLevel
date lastUpdated
}
FireAlerts {
string id PK
string organizationId FK
object location
number confidence
string severity
string status
date detectedAt
date lastUpdated
}
TacticalPlans {
string id PK
string alertId FK
string organizationType
object strategy
array resources
string status
date createdAt
}
SatelliteData {
string id PK
string satellite
object coordinates
number brightness
number confidence
date acquisitionDate
number ttl
}
WeatherData {
string id PK
string location
object conditions
number temperature
number humidity
number windSpeed
date timestamp
number ttl
}
ResourceAllocation {
string id PK
string alertId FK
string organizationId FK
array fireStations
array aircraft
array personnel
string deploymentStatus
date lastUpdated
}
AuditLog {
string id PK
string userId
string organizationId FK
string action
string entityType
object changes
date timestamp
}
Organizations ||--o{ MonitoringZones : manages
Organizations ||--o{ FireAlerts : receives
Organizations ||--o{ ResourceAllocation : allocates
Organizations ||--o{ AuditLog : generates
FireAlerts ||--o{ TacticalPlans : triggers
FireAlerts ||--o{ ResourceAllocation : requires
The Function App receives configuration through environment variables managed by the provisioning script 8 :
Variable | Source | Purpose |
---|---|---|
COSMOS_CONNECTION_STRING |
Cosmos DB primary connection string | Database access |
AZURE_MAPS_KEY |
Azure Maps primary key | Geospatial services |
COGNITIVE_SERVICES_ENDPOINT |
Cognitive Services endpoint URL | AI service access |
COGNITIVE_SERVICES_KEY |
Cognitive Services primary key | AI service authentication |
APPINSIGHTS_INSTRUMENTATIONKEY |
Application Insights key | Telemetry collection |
Three critical secrets are stored in Key Vault for secure access 9 :
graph LR
KeyVault["emergency-app-vault"] --> CosmosSecret["CosmosConnectionString"]
KeyVault --> MapsSecret["AzureMapsKey"]
KeyVault --> CognitiveSecret["CognitiveServicesKey"]
CosmosSecret --> CosmosDB["emergency-app-cosmos"]
MapsSecret --> AzureMaps["emergency-app-maps"]
CognitiveSecret --> CogServices["emergency-app-cognitive"]
The Event Hubs namespace emergency-app-events
contains the satellite-data
event hub configured for high-throughput satellite data ingestion 10 :
- Partition count: 4 partitions for parallel processing
- Message retention: 7 days
- SKU: Standard tier for production workloads
sequenceDiagram
participant NASA as "NASA FIRMS API"
participant EventHub as "satellite-data Event Hub"
participant Functions as "Azure Functions"
participant Cosmos as "Cosmos DB"
participant AI as "Cognitive Services"
participant Maps as "Azure Maps"
participant Insights as "Application Insights"
NASA->>EventHub: Satellite fire data every 15 minutes
EventHub->>Functions: ProcessSatelliteData trigger
Functions->>AI: Analyze fire imagery and risk
Functions->>Cosmos: Store processed fire alerts
Functions->>Functions: GenerateTacticalPlan
Functions->>Maps: Calculate evacuation routes
Functions->>Cosmos: Store tactical plans and resources
Functions->>Insights: Log performance metrics
Note over Functions: Core Functions:
Note over Functions: - ProcessSatelliteData
Note over Functions: - AnalyzeFireRisk
Note over Functions: - GenerateTacticalPlan
Note over Functions: - SendAlerts
Note over Functions: - UpdateWeatherData
The serverless compute layer handles critical processing tasks 11 :
graph TB
subgraph "Azure Functions Runtime"
ProcessSat["ProcessSatelliteData<br/>Timer: Every 15 min<br/>NASA FIRMS integration"]
AnalyzeRisk["AnalyzeFireRisk<br/>HTTP Trigger<br/>AI-powered analysis"]
GenPlan["GenerateTacticalPlan<br/>Event Hub Trigger<br/>Resource optimization"]
SendAlerts["SendAlerts<br/>HTTP Trigger<br/>Multi-channel notifications"]
UpdateWeather["UpdateWeatherData<br/>Timer: Every hour<br/>Weather API integration"]
end
subgraph "External APIs"
NASA_API["NASA FIRMS API"]
Weather_API["Open-Meteo API"]
end
subgraph "Azure Services"
EventHubSvc["Event Hubs"]
CosmosSvc["Cosmos DB"]
CognitiveSvc["Cognitive Services"]
MapsSvc["Azure Maps"]
end
NASA_API --> ProcessSat
Weather_API --> UpdateWeather
ProcessSat --> EventHubSvc
EventHubSvc --> GenPlan
AnalyzeRisk --> CognitiveSvc
GenPlan --> MapsSvc
ProcessSat --> CosmosSvc
AnalyzeRisk --> CosmosSvc
GenPlan --> CosmosSvc
SendAlerts --> CosmosSvc
UpdateWeather --> CosmosSvc
Application Insights provides comprehensive monitoring through performance tracking, error logging, and custom telemetry 12 :
graph TB
subgraph "Application Insights Monitoring"
Performance["Performance Monitoring<br/>Function execution times<br/>Resource utilization"]
Errors["Error Tracking<br/>Exception logging<br/>Failure analysis"]
Custom["Custom Telemetry<br/>Fire detection accuracy<br/>Response time metrics"]
Dependencies["Dependency Tracking<br/>External API monitoring<br/>Database performance"]
end
subgraph "Data Sources"
FunctionApp["Azure Functions"]
CosmosMetrics["Cosmos DB"]
MapsMetrics["Azure Maps"]
ExternalAPIs["External APIs"]
end
subgraph "Alerting"
Alerts["Azure Monitor Alerts"]
Dashboard["Custom Dashboards"]
Reports["Performance Reports"]
end
FunctionApp --> Performance
FunctionApp --> Errors
FunctionApp --> Custom
CosmosMetrics --> Dependencies
MapsMetrics --> Dependencies
ExternalAPIs --> Dependencies
Performance --> Alerts
Errors --> Alerts
Custom --> Dashboard
Dependencies --> Reports
The system monitors critical metrics for emergency response effectiveness:
Metric | Target | Purpose |
---|---|---|
Alert response time | < 30 seconds | Emergency response effectiveness |
Fire detection accuracy | > 95% | Prediction system reliability |
System availability | 99.9% | Service continuity |
Tactical plan generation | < 2 minutes | Operational readiness |
Satellite data latency | < 5 minutes | Real-time monitoring capability |
The Azure infrastructure operates with an estimated monthly cost of $165-270 USD 13 :
Wiki pages you might want to explore:
- [Azure Cloud Infrastructure (seojedaperez/IgnisMap)](/wiki/seojedaperez/IgnisMap#2.1)