C4 architecture examples
Explore complete C4 and AAL examples for banking, web platforms, event-driven systems, AI, platform engineering, and edge systems.
Use C4 AI Instructions with an external AI assistant, then copy its generated AAL into a new C4 Architecture project. Inspect diagnostics and explicitly Save.
Example: Digital Banking (Three-Level)
A complete architecture demonstrating System, Container, and Component semantics with synchronous and event relationships:
architecture DigitalBanking {
person Customer "Customer"
system BankingPlatform "Digital Banking Platform" platform {
container MobileApp "Mobile Banking App" mobile
container BankingAPI "Banking API" api {
technology "Java / Spring Boot"
component AccountController "Account Controller" controller
component AccountService "Account Service" applicationservice
component AccountRepository "Account Repository" repository
component CoreBankingAdapter "Core Banking Adapter" adapter
component TransactionPublisher "Transaction Event Publisher" publisher
}
container EventBus "Banking Event Bus" eventbus
container AccountDB "Account Database" relationaldb {
technology "PostgreSQL"
}
}
system IdentityPlatform "Identity Platform" external identity
system CoreBanking "Core Banking System" external coresystem
system FraudPlatform "Fraud Platform" external fraud
Customer -> BankingPlatform "Uses"
BankingAPI -> IdentityPlatform "Validates customer identity" {
mode synchronous
protocol oidc
}
BankingAPI -> CoreBanking "Executes banking transactions" {
mode synchronous
protocol https
}
BankingAPI -> EventBus "Publishes transaction events" {
mode event
protocol kafka
}
AccountRepository -> AccountDB "Reads and writes account data" {
mode synchronous
protocol postgres
}
CoreBankingAdapter -> CoreBanking "Invokes banking services" {
mode synchronous
protocol https
}
TransactionPublisher -> EventBus "Publishes transaction event" {
mode event
protocol kafka
}
}
view context {
title "Digital Banking — System Context"
}
view container BankingPlatform {
title "Digital Banking — Container Architecture"
layout left-to-right
}
view component BankingAPI {
title "Banking API — Component Architecture"
layout top-to-bottom
}
Example: Component Architecture
A component-level view showing controllers, application services, repositories, adapters, and publishers:
architecture ClientPlatform {
person Customer "Customer"
system ClientPlatform "Client Platform" {
container BFF "Backend for Frontend" bff {
component ProfileController "Profile Controller" controller
component ProfileService "Profile Service" applicationservice
component ProfileRepository "Profile Repository" repository
component CustomerMapper "Customer Mapper" mapper
component CRMAdapter "CRM Adapter" adapter
component EventPublisher "Profile Event Publisher" publisher
}
container WebApp "Web Application" web
container EventBus "Event Bus" eventbus
}
system CRM "Salesforce" external crm
Customer -> WebApp "Uses"
WebApp -> BFF "Requests profile data" {
mode synchronous
protocol graphql
}
BFF -> CRM "Fetches customer data" {
mode synchronous
protocol rest
}
BFF -> EventBus "Publishes profile updates" {
mode event
protocol kafka
}
}
view component BFF {
title "BFF — Component Architecture"
layout top-to-bottom
}
Example: Modern Web Platform
architecture ModernPlatform {
person Customer "Customer"
system Platform "Modern Platform" {
container WebApp "Web App" web
container Gateway "API Gateway" gateway
container API "Platform API" api
container EventBus "Event Bus" eventbus
container Cache "Cache" cache
container Vectors "Knowledge Vectors" vectorstore
container Agent "AI Agent" agent
container Guardrail "AI Guardrail" guardrail
}
system Identity "Identity Provider" external identity
system CRM "CRM" external saas
system Legacy "Legacy Mainframe" external mainframe
Customer -> WebApp "Uses"
WebApp -> Gateway "Requests platform services" {
mode synchronous
protocol https
}
Gateway -> API "Routes requests" {
mode synchronous
protocol grpc
}
API -> EventBus "Publishes domain events" {
mode event
protocol kafka
}
API -> Cache "Reads cached data" {
mode synchronous
protocol redis
}
API -> Agent "Requests AI assistance" {
mode synchronous
protocol openai-api
}
Agent -> Vectors "Retrieves knowledge" {
mode synchronous
}
Agent -> Guardrail "Validates AI interaction" {
mode synchronous
}
API -> Identity "Validates identity" {
mode synchronous
protocol oidc
}
API -> CRM "Reads customer information" {
mode synchronous
protocol rest
}
API -> Legacy "Retrieves legacy records" {
mode batch
protocol sftp
}
}
view container Platform {
title "Modern Platform — Container Architecture"
layout left-to-right
include Customer
include Identity
include CRM
include Legacy
}
Example: Event-Driven Platform
architecture EventDrivenPlatform {
person Customer "Customer"
system Platform "Event-Driven Platform" {
container WebApp "Web Application" web {
technology "React"
}
container Gateway "API Gateway" gateway
container OrderService "Order Service" service {
technology "Java / Spring Boot"
}
container EventBus "Event Bus" eventbus
container Stream "Event Stream" stream
container Database "Application Database" relationaldb {
technology "PostgreSQL"
}
container Batch "Reconciliation Batch" batch
}
system Identity "Identity Provider" external identity
Customer -> WebApp "Places orders"
WebApp -> Gateway "Submits order" {
mode synchronous
protocol https
}
Gateway -> OrderService "Routes order request" {
mode synchronous
protocol grpc
}
OrderService -> Database "Persists order" {
mode synchronous
protocol postgres
}
OrderService -> EventBus "Publishes order created event" {
mode event
protocol kafka
}
EventBus -> Stream "Forwards to stream" {
mode stream
protocol kafka
}
Stream -> Batch "Triggers reconciliation" {
mode stream
protocol kafka
}
}
view container Platform {
title "Event-Driven Platform — Container Architecture"
layout left-to-right
include Customer
include Identity
}
Example: AI Platform
architecture AIPlatform {
person User "AI User"
system AIPlatform "AI Platform" {
container ChatApp "Chat Application" web
container Gateway "API Gateway" gateway
container Agent "AI Agent Runtime" agent
container Model "Language Model" model
container Embedding "Embedding Service" embedding
container Vectors "Knowledge Vector Store" vectorstore
container Guardrail "AI Guardrail" guardrail
container MCP "MCP Server" mcpserver
}
system Identity "Identity Provider" external identity
User -> ChatApp "Asks questions"
ChatApp -> Gateway "Submits query" {
mode synchronous
protocol https
}
Gateway -> Agent "Routes to agent" {
mode synchronous
protocol grpc
}
Agent -> Guardrail "Validates input" {
mode synchronous
}
Agent -> Embedding "Generates query embedding" {
mode synchronous
protocol openai-api
}
Embedding -> Vectors "Stores embedding" {
mode synchronous
}
Agent -> Vectors "Retrieves knowledge" {
mode synchronous
}
Agent -> Model "Generates response" {
mode synchronous
protocol anthropic-api
}
Agent -> MCP "Calls external tools" {
mode tool
protocol mcp
}
Gateway -> Identity "Validates identity" {
mode synchronous
protocol oidc
}
}
view container AIPlatform {
title "AI Platform — Container Architecture"
layout left-to-right
include User
include Identity
}
Example: Legacy Integration
architecture LegacyIntegration {
person Customer "Customer"
system Channel "Channel Platform" {
container WebApp "Web Application" web
container API "Channel API" api
container Queue "Command Queue" queue
}
system Core "Core Banking" {
container Mainframe "Core Mainframe" mainframeapp
}
system Identity "Identity Provider" external identity
Customer -> WebApp "Uses"
WebApp -> API "Requests services" {
mode synchronous
protocol https
}
API -> Identity "Validates identity" {
mode synchronous
protocol saml
}
API -> Queue "Enqueues command" {
mode asynchronous
protocol amqp
}
Queue -> Mainframe "Processes command" {
mode batch
protocol sftp
}
}
view container Channel {
title "Legacy Integration — Channel Platform"
layout left-to-right
include Customer
include Identity
include Mainframe
}
Example: Agent Network (A2A)
A multi-agent platform using agent-to-agent (A2A) collaboration, MCP tool servers, RAG, agent memory, a model registry, and an evaluation platform.
architecture AgentNetwork {
person User "Product Owner"
system AgentPlatform "Agent Orchestration Platform" agentorchestration {
container Coordinator "Multi-Agent Coordinator" agentcoordinator
container Planner "Planning Agent" agent
container Researcher "Research Agent" agent
container Writer "Writer Agent" agent
container A2AServer "A2A Server" a2aserver
container MCP "Tool Server" mcpserver
container Memory "Agent Memory" agentmemory
container Guardrail "AI Guardrail" guardrail
}
system ModelRegistry "Model Registry" modelregistry
system RAGPlatform "RAG Platform" ragplatform {
container Vectors "Knowledge Vector Store" vectorstore
container Chunking "Chunking & Ingestion" chunking
}
system EvalPlatform "AI Evaluation Platform" evalplatform
User -> AgentPlatform "Submits research brief"
Coordinator -> Planner "Delegates planning" {
mode a2a
protocol a2a
}
Coordinator -> Researcher "Delegates research" {
mode a2a
protocol a2a
}
Coordinator -> Writer "Delegates writing" {
mode a2a
protocol a2a
}
Researcher -> A2AServer "Collaborates with remote agents" {
mode a2a
protocol a2a
}
Researcher -> MCP "Calls external tools" {
mode tool
protocol mcp
}
Researcher -> RAGPlatform "Retrieves knowledge" {
mode synchronous
}
RAGPlatform -> Chunking "Ingests documents" {
mode batch
}
Chunking -> Vectors "Stores embeddings" {
mode synchronous
}
Planner -> Memory "Reads and writes memory" {
mode synchronous
}
Writer -> Guardrail "Validates output" {
mode synchronous
}
Coordinator -> ModelRegistry "Resolves model versions" {
mode synchronous
}
EvalPlatform -> AgentPlatform "Runs regression evaluations" {
mode batch
}
}
view context {
title "Agent Network — System Context"
}
view container AgentPlatform {
title "Agent Orchestration — Container Architecture"
layout left-to-right
include User
include ModelRegistry
include RAGPlatform
include EvalPlatform
}
Example: Real-Time Streaming
A real-time trading platform using WebSocket, SSE, Kafka streams, materialized real-time data, and pub/sub notifications.
architecture RealTimePlatform {
person Trader "Trader"
system RealTimePlatform "Real-Time Platform" realtimeplatform {
container Dashboard "Trading Dashboard" web {
technology "React + WebSocket"
}
container RealTimeGateway "Real-Time Gateway" realtime
container Quotes "Quote Stream" stream {
technology "Apache Kafka"
}
container LiveStore "Real-Time Quote Store" realtimedata
container PubSub "Notifications Pub/Sub" pubsub
container History "Market Data Warehouse" warehouse {
technology "Snowflake"
}
}
system Identity "Identity Provider" external identity
system MarketData "Market Data Feed" external thirdparty
Trader -> Dashboard "Watches live quotes"
Dashboard -> RealTimeGateway "Subscribes to quotes" {
mode realtime
protocol websocket
}
Dashboard -> RealTimeGateway "Receives price alerts" {
mode realtime
protocol sse
}
RealTimeGateway -> Quotes "Consumes market stream" {
mode stream
protocol kafka
}
Quotes -> LiveStore "Materializes latest quotes" {
mode stream
protocol kafka
}
RealTimeGateway -> PubSub "Publishes alert events" {
mode event
protocol nats
}
Quotes -> History "Offloads to warehouse" {
mode batch
}
RealTimeGateway -> Identity "Validates session" {
mode synchronous
protocol oidc
}
MarketData -> Quotes "Publishes market feed" {
mode stream
protocol kafka
}
}
view container RealTimePlatform {
title "Real-Time Platform — Container Architecture"
layout left-to-right
include Trader
include Identity
include MarketData
}
Example: Platform Engineering / IDP
An internal developer platform (Backstage-style) with a service catalog, scaffolder, golden paths, CI/CD, a container platform, service mesh, and observability.
architecture DeveloperPlatform {
person Developer "Software Engineer"
system IDP "Internal Developer Platform" developerportal {
container Portal "Developer Portal" idp {
technology "Backstage"
component Catalog "Service Catalog" service
component Scaffolder "Service Scaffolder" scaffold
component GoldenPath "Golden Path Template" goldenpath
component Plugin "Portal Plugin" plugin
}
container Templates "Template Service" service
}
system CICD "CI/CD Platform" cicd {
container Pipeline "Build Pipeline" service
container Registry "Artifact Registry" objectstore
}
system ContainerPlatform "Container Platform" containerplatform {
container Cluster "Kubernetes Cluster" containerplatform
container Mesh "Service Mesh" servicemesh
}
system Observability "Observability Platform" external observability
system Identity "Identity Provider" external identity
Developer -> IDP "Discovers and scaffolds services"
Portal -> Templates "Fetches golden-path templates" {
mode synchronous
protocol rest
}
Scaffolder -> CICD "Triggers build pipeline" {
mode asynchronous
protocol webhook
}
CICD -> ContainerPlatform "Deploys workloads" {
mode synchronous
protocol grpc
}
Cluster -> Mesh "Enforces traffic policy" {
mode synchronous
}
ContainerPlatform -> Observability "Emits telemetry" {
mode stream
protocol grpc
}
Portal -> Identity "SSO for developers" {
mode synchronous
protocol oidc
}
}
view context {
title "Internal Developer Platform — System Context"
}
view component Portal {
title "Developer Portal — Component Architecture"
layout top-to-bottom
}
Example: FinOps & GreenOps
A FinOps platform with cost optimization, carbon tracking, a semantic metrics layer, and reverse ETL pushing budget alerts to a notification provider.
architecture FinOpsPlatform {
person FinOpsAnalyst "FinOps Analyst"
system FinOps "FinOps Platform" finops {
container CostOptimizer "Cost Optimizer" costoptimizer
container CarbonTracker "Carbon Tracker" carbontracker
container MetricsLayer "Metrics / Semantic Layer" metricsservice
container ReverseETL "Reverse ETL Service" reversetl
}
system Cloud "Cloud Platform" external cloudplatform
system DataWarehouse "Enterprise Data Warehouse" external datawarehouse
system Alerting "Notification Provider" external notificationprovider
FinOpsAnalyst -> FinOps "Reviews unit economics"
CostOptimizer -> Cloud "Pulls cost and usage data" {
mode batch
}
CarbonTracker -> Cloud "Pulls carbon metrics" {
mode batch
}
CostOptimizer -> DataWarehouse "Reads governed spend metrics" {
mode synchronous
protocol sql
}
MetricsLayer -> DataWarehouse "Serves semantic metrics" {
mode synchronous
protocol sql
}
ReverseETL -> Alerting "Pushes budget alerts" {
mode event
protocol webhook
}
CarbonTracker -> MetricsLayer "Publishes carbon metrics" {
mode synchronous
}
}
view container FinOps {
title "FinOps Platform — Container Architecture"
layout left-to-right
include FinOpsAnalyst
include Cloud
include DataWarehouse
include Alerting
}
Example: Supply Chain Security
Software supply chain security with a zero-trust gateway, SBOM generation, posture management, DLP, and API security integrated with CI/CD and a container platform.
architecture SupplyChainSecurity {
person SecurityEngineer "Security Engineer"
system SupplyChainSecurity "Supply Chain Security" supplychainsecurity {
container ZeroTrust "Zero Trust Gateway" zerotrustgateway
container SBOM "SBOM Service" sbom
container Posture "Posture Management" posture
container DLP "DLP Service" dlp
}
system CICD "CI/CD Platform" external cicd
system ContainerPlatform "Container Platform" external containerplatform
system APISecurity "API Security Platform" external apisecurity
SecurityEngineer -> SupplyChainSecurity "Monitors posture"
CICD -> SBOM "Generates bill of materials" {
mode asynchronous
protocol webhook
}
SBOM -> Posture "Reports vulnerable components" {
mode event
}
ZeroTrust -> ContainerPlatform "Enforces identity per request" {
mode synchronous
protocol grpc
}
Posture -> ContainerPlatform "Scans workloads" {
mode batch
}
APISecurity -> ZeroTrust "Publishes runtime signals" {
mode event
}
DLP -> ZeroTrust "Classifies sensitive payloads" {
mode synchronous
}
}
view container SupplyChainSecurity {
title "Supply Chain Security — Container Architecture"
layout left-to-right
include SecurityEngineer
include CICD
include ContainerPlatform
include APISecurity
}
Example: Edge & WebAssembly
An edge platform with CDN, edge functions, a WebAssembly runtime and components, and an IoT gateway — fanning out to an origin application.
architecture EdgePlatform {
person User "End User"
system Edge "Edge Platform" edgeplatform {
container CDN "Content Delivery Network" cdn
container EdgeFn "Edge Function" edgefunction {
technology "Cloudflare Workers"
}
container WASM "WASM Runtime" wasm
container WASMComponent "WASM Component" wasmcomponent
container IoT "IoT Gateway" iot
}
system Origin "Origin Application" {
container API "Origin API" api
container DB "Origin Database" relationaldb
}
system Identity "Identity Provider" external identity
User -> Edge "Requests content"
Edge -> CDN "Serves cached assets" {
mode synchronous
protocol https
}
CDN -> EdgeFn "Invokes edge function on miss" {
mode synchronous
}
EdgeFn -> WASM "Runs sandboxed compute" {
mode synchronous
}
WASM -> WASMComponent "Composes components" {
mode synchronous
}
EdgeFn -> Origin "Fans out to origin" {
mode asynchronous
protocol https
}
IoT -> EdgeFn "Streams device telemetry" {
mode realtime
protocol mqtt
}
EdgeFn -> Identity "Validates tokens at edge" {
mode synchronous
protocol oauth2
}
API -> DB "Reads and writes data" {
mode synchronous
protocol postgres
}
}
view container Edge {
title "Edge Platform — Container Architecture"
layout left-to-right
include User
include Origin
include Identity
}