Files
gh-anton-abyzov-specweave-p…/agents/diagrams-architect/templates/deployment-template.mmd
2025-11-29 17:56:28 +08:00

78 lines
3.2 KiB
Plaintext

C4Deployment
title {{SYSTEM_NAME}} Deployment Diagram - {{ENVIRONMENT}}
Deployment_Node(cloud, "{{CLOUD_PROVIDER}}", "Cloud Platform") {
Deployment_Node(region, "{{REGION}}", "Geographic Region") {
Deployment_Node(cdn, "CDN", "Content Delivery Network") {
Container(static, "{{STATIC_ASSETS}}", "Static Files", "{{STATIC_DESCRIPTION}}")
}
Deployment_Node(compute, "{{COMPUTE_SERVICE}}", "Compute") {
Deployment_Node(web_cluster, "Web Cluster", "Auto-scaling group") {
Container(webapp, "{{WEB_APP}}", "{{WEB_TECH}}", "{{WEB_DESCRIPTION}}")
}
Deployment_Node(api_cluster, "API Cluster", "Auto-scaling group") {
Container(api, "{{API_NAME}}", "{{API_TECH}}", "{{API_DESCRIPTION}}")
}
Deployment_Node(worker_cluster, "Worker Cluster", "Auto-scaling group") {
Container(worker, "{{WORKER_NAME}}", "{{WORKER_TECH}}", "{{WORKER_DESCRIPTION}}")
}
}
Deployment_Node(database, "{{DATABASE_SERVICE}}", "Managed Database") {
ContainerDb(db, "{{DB_NAME}}", "{{DB_TECH}}", "{{DB_DESCRIPTION}}")
}
Deployment_Node(cache, "{{CACHE_SERVICE}}", "Managed Cache") {
ContainerDb(redis, "{{CACHE_NAME}}", "Redis", "{{CACHE_DESCRIPTION}}")
}
Deployment_Node(queue, "{{QUEUE_SERVICE}}", "Message Queue") {
Container(mq, "{{QUEUE_NAME}}", "{{QUEUE_TECH}}", "{{QUEUE_DESCRIPTION}}")
}
}
}
Deployment_Node(monitoring, "{{MONITORING_SERVICE}}", "Observability Platform") {
Container(logs, "{{LOGGING_SERVICE}}", "Centralized Logging", "{{LOGGING_DESCRIPTION}}")
Container(metrics, "{{METRICS_SERVICE}}", "Metrics & Alerting", "{{METRICS_DESCRIPTION}}")
}
%% Relationships
Rel(webapp, api, "API calls", "HTTPS")
Rel(api, db, "Queries", "PostgreSQL Protocol")
Rel(api, redis, "Caches", "Redis Protocol")
Rel(api, mq, "Publishes jobs", "AMQP")
Rel(worker, mq, "Consumes jobs", "AMQP")
Rel(worker, db, "Updates data", "PostgreSQL Protocol")
%% Monitoring
Rel(webapp, logs, "Ships logs", "HTTP")
Rel(api, logs, "Ships logs", "HTTP")
Rel(worker, logs, "Ships logs", "HTTP")
Rel(webapp, metrics, "Exports metrics", "Prometheus")
Rel(api, metrics, "Exports metrics", "Prometheus")
%% Template Variables:
%% {{SYSTEM_NAME}} - Name of your system
%% {{ENVIRONMENT}} - Environment name (Production, Staging, Development)
%% {{CLOUD_PROVIDER}} - Cloud provider (AWS, Azure, GCP, Hetzner)
%% {{REGION}} - Geographic region (us-east-1, eu-central-1, etc.)
%% {{COMPUTE_SERVICE}} - Compute service (ECS, Kubernetes, VMs)
%% {{DATABASE_SERVICE}} - Database service (RDS, Cloud SQL, Managed PostgreSQL)
%% {{CACHE_SERVICE}} - Cache service (ElastiCache, Memorystore)
%% {{QUEUE_SERVICE}} - Queue service (SQS, Pub/Sub, RabbitMQ)
%% {{MONITORING_SERVICE}} - Monitoring platform (CloudWatch, Datadog, Grafana)
%% {{*_NAME}} - Component names
%% {{*_TECH}} - Technologies used
%% {{*_DESCRIPTION}} - Component descriptions
%% Common Cloud Services by Provider:
%% AWS: ECS, RDS, ElastiCache, SQS, CloudWatch
%% Azure: App Service, Azure SQL, Redis Cache, Service Bus, Application Insights
%% GCP: Cloud Run, Cloud SQL, Memorystore, Pub/Sub, Cloud Logging
%% Hetzner: Cloud Servers, Managed PostgreSQL, Object Storage