- 7 minutes to read

Example C4 Diagrams

C4 Diagrams is part of experimental builds. To access this capability, contact your sales representative.

This page provides realistic C4 diagram examples across all major diagram types. Each example is designed for educational learning and testing the import features in the app. All Mermaid markup is copy-paste ready.

Understanding C4 Diagram Types

Before diving into examples, let's clarify a common question: What distinguishes different C4 diagram types?

The Hierarchy: L1, L2, L3 — Zoom Levels

The core C4 model defines four levels of zoom, each zooming deeper into a specific system:

Level Name Audience Question Answered Content
L1 Context Everyone What is the system and who uses it? System boundary, actors (people), external systems, high-level relationships
L2 Container Technical teams How is the system internally structured? Applications, services, databases, message buses, technology choices
L3 Component Developers What is inside a specific container? Internal components, modules, libraries, internal interactions
L4 Code Senior developers What is the detailed implementation? UML class diagrams, method-level detail

Key insight: L1, L2, and L3 are bound together by hierarchical zoom. You create an L1 diagram, identify an interesting System, then zoom into that system for L2. From L2, you pick a Container and zoom in for L3.

What keeps them together? Not just a name — it's the relationship: L1 → shows System X → L2 zooms into System X's internals → L3 zooms into Container Y's internals.


Supplementary Diagram Types

Beyond the zoom hierarchy, the C4 model defines additional diagram types that answer different architectural questions:

Diagram Type Question Answered Content
System Landscape How do multiple systems in the organization relate? All systems, integrations, external dependencies (broader than L1)
Dynamic How do systems/containers interact at runtime? Sequence of interactions, behavior, message flow over time
Deployment Where is the system deployed and on what infrastructure? Deployment environments, servers, containers, cloud services, network topology

These are NOT rendering view modes of L1L3. They're supplementary diagrams that look at the architecture from different angles.


L1: System Context Diagram

The System Context diagram is the zoomed-out view showing your system and its surroundings.

Key Points

Shows one central system in a box
Shows actors (people and roles) who use the system
Shows external systems the system depends on
Shows high-level relationships with labels describing interaction type
Avoids technical detail — no databases, APIs, or protocols mentioned
Suitable for non-technical stakeholders — board members, executives, business analysts

Example: Order Management System

C4Context title Order Management System - L1 Context Diagram Person(customer, "Customer", "Places orders for products") Person(support_agent, "Support Agent", "Handles customer inquiries and returns") Person(warehouse_staff, "Warehouse Staff", "Picks and ships orders") System(order_system, "Order Management System", "Manages orders, inventory, and fulfillment") System_Ext(payment_gateway, "Payment Gateway", "Processes credit card payments") System_Ext(email_service, "Email Service", "Sends order confirmations and updates") System_Ext(warehouse_erp, "Warehouse ERP", "Manages physical inventory and shipping") Rel(customer, order_system, "Places orders", "Web/Mobile") Rel(support_agent, order_system, "Manages returns", "Web") Rel(warehouse_staff, warehouse_erp, "Checks order fulfillment", "Web") Rel(order_system, payment_gateway, "Processes payments", "REST API") Rel(order_system, email_service, "Sends notifications", "SMTP") Rel(order_system, warehouse_erp, "Sends fulfillment requests", "REST API")

Test Data Setup

To recreate this in Nodinite, create:

Systems:

  • Customer (C4Type: Person)
  • Support Agent (C4Type: Person)
  • Warehouse Staff (C4Type: Person)
  • Order Management System (C4Type: InternalSystem)
  • Payment Gateway (C4Type: ExternalSystem)
  • Email Service (C4Type: ExternalSystem)
  • Warehouse ERP (C4Type: ExternalSystem)

L2: Container Diagram

The Container diagram zooms into a specific system and shows its internal structure — the applications, services, databases, and how they communicate.

Key Points

One system boundary containing the system being described
Containers (applications, services, databases) with their technology stacks
Swimlanes/layers for organizing containers by domain or tier
Explicit relationships showing communication protocols and data flow
Shows what is inside vs outside the system boundary
Answers "How is this system built?" — useful for technical planning

Example: Order Management System Internal Structure

C4Container title Order Management System - L2 Container Diagram Person(customer, "Customer", "Places orders via web or mobile") Boundary(order_system, "Order Management System") { Container(web_app, "Web Application", "React.js", "Displays orders and order history. Allows customers to place and track orders.") Container(mobile_app, "Mobile App", "React Native", "Allows customers to place orders on their phone") Container(admin_portal, "Admin Portal", "ASP.NET Core", "Internal tool for support agents to manage orders and refunds") Container(order_api, "Order API", "ASP.NET Core REST", "Provides order management capabilities to web, mobile, and admin applications") Container(fulfillment_svc, "Fulfillment Service", "Node.js", "Coordinates order fulfillment with warehouse ERP") ContainerDb(order_db, "Order Database", "SQL Server", "Stores customers, orders, and line items") ContainerDb(inventory_cache, "Inventory Cache", "Redis", "Caches current inventory levels") ContainerQueue(message_bus, "Message Bus", "Azure Service Bus", "Asynchronous event processing for order fulfillment") } System_Ext(payment_gateway, "Payment Gateway", "Processes payments") System_Ext(email_service, "Email Service", "Sends notifications") System_Ext(warehouse_erp, "Warehouse ERP", "Manages physical inventory") Rel(customer, web_app, "Uses", "HTTPS") Rel(customer, mobile_app, "Uses", "HTTPS") Rel(web_app, order_api, "Calls", "REST/JSON") Rel(mobile_app, order_api, "Calls", "REST/JSON") Rel(admin_portal, order_api, "Calls", "REST/JSON") Rel(order_api, order_db, "Reads/Writes", "SQL") Rel(order_api, inventory_cache, "Reads", "Redis Protocol") Rel(order_api, message_bus, "Publishes Order Placed event", "AMQP") Rel(fulfillment_svc, message_bus, "Subscribes to events", "AMQP") Rel(fulfillment_svc, warehouse_erp, "Sends fulfillment requests", "REST/JSON") Rel(order_api, payment_gateway, "Processes payment", "REST/JSON") Rel(order_api, email_service, "Sends notifications", "SMTP")

Test Data Setup

To recreate this in Nodinite, create:

Domains (swimlanes):

  • Experience APIs
  • Process APIs
  • System APIs

Services in Example API:

  • Web Application (C4ContainerType: WebApp, C4Technology: React.js)
  • Mobile App (C4ContainerType: MobileApp, C4Technology: React Native)
  • Admin Portal (C4ContainerType: WebApp, C4Technology: ASP.NET Core)

Services in Process APIs:

  • Order API (C4ContainerType: RestApi, C4Technology: ASP.NET Core REST)
  • Fulfillment Service (C4ContainerType: Service, C4Technology: Node.js)

Services in System APIs:

  • Order Database (C4ContainerType: Database, C4Technology: SQL Server)
  • Inventory Cache (C4ContainerType: Cache, C4Technology: Redis)
  • Message Bus (C4ContainerType: MessageBus, C4Technology: Azure Service Bus)

L3: Component Diagram

The Component diagram zooms into a specific container and shows its internal structure — the modules, classes, and interactions within.

Key Points

One container boundary being decomposed
Components (modules, libraries, classes) with their responsibilities
Internal interactions between components
Not typically shared with non-technical audiences
Useful for developers implementing or maintaining the container

Example: Order API Components

C4Component title Order API - L3 Component Diagram Person(client, "API Client", "Web app, mobile app, or admin portal") Container_Boundary(order_api, "Order API") { Component(api_gateway, "API Gateway", "ASP.NET Core", "Handles HTTP routing, authentication, rate limiting") Component(order_controller, "Order Controller", "ASP.NET Core MVC", "REST endpoints for CRUD operations on orders") Component(payment_controller, "Payment Controller", "ASP.NET Core MVC", "Payment processing endpoints") Component(order_logic, "Order Service", "C#", "Business logic for order validation, calculation, and workflow") Component(payment_logic, "Payment Service", "C#", "Encapsulates payment gateway integration") Component(inventory_logic, "Inventory Service", "C#", "Manages inventory allocation and calculation") Component(order_repo, "Order Repository", "C# + Entity Framework", "Data access for orders") Component(customer_repo, "Customer Repository", "C# + Entity Framework", "Data access for customers") Component(mapper, "Mapper", "C# + AutoMapper", "DTO to Domain object mapping") Component(order_validator, "Order Validator", "FluentValidation", "Validates order syntax and business rules") } Rel(client, api_gateway, "Makes HTTP requests", "REST/JSON") Rel(api_gateway, order_controller, "Routes to", "In-process") Rel(api_gateway, payment_controller, "Routes to", "In-process") Rel(order_controller, mapper, "Uses", "In-process") Rel(order_controller, order_validator, "Uses", "In-process") Rel(order_controller, order_logic, "Delegates to", "In-process") Rel(payment_controller, payment_logic, "Delegates to", "In-process") Rel(order_logic, inventory_logic, "Uses", "In-process") Rel(order_logic, order_repo, "Uses", "In-process") Rel(payment_logic, customer_repo, "Uses", "In-process") Rel(payment_logic, payment_gateway, "Calls", "HTTPS")

System Landscape Diagram

The System Landscape diagram shows how multiple systems within your organization relate to each other. It's like L1, but broader — instead of focusing on one system, you see all systems and their dependencies.

Key Points

Shows multiple systems (internal and external)
Shows actors and their relationships to systems
Shows inter-system dependencies and integrations
Broader scope than L1 Context (which focuses on one system)
Useful for enterprise architecture and portfolio management

Example: Finance Department System Landscape

C4Context title Finance Department System Landscape Person(accountant, "Accountant", "Records and reports financial transactions") Person(controller, "Finance Controller", "Reviews financial reports and makes decisions") Person(finance_analyst, "Finance Analyst", "Performs financial analysis and forecasting") System(gl_system, "General Ledger System", "Central financial records and chart of accounts") System(ap_system, "Accounts Payable System", "Manages vendor invoices and payments") System(ar_system, "Accounts Receivable System", "Manages customer invoices and collections") System(budget_system, "Budget & Forecasting System", "Tracks budgets and financial forecasts") System(reporting_system, "Financial Reporting System", "Generates financial statements and reports") System_Ext(erp_system, "ERP System", "Contains HR, inventory, and operational data") System_Ext(bank_system, "Bank System", "Provides bank account and transaction data") System_Ext(tax_software, "Tax Software", "Calculates and files tax returns") Rel(accountant, gl_system, "Records transactions", "Web") Rel(accountant, ap_system, "Records vendor invoices", "Web") Rel(accountant, ar_system, "Records customer invoices", "Web") Rel(controller, reporting_system, "Reviews reports", "Web") Rel(finance_analyst, budget_system, "Creates forecasts", "Web") Rel(finance_analyst, reporting_system, "Analyzes data", "Web") Rel(gl_system, ap_system, "Receives GL postings from AP", "REST API") Rel(gl_system, ar_system, "Receives GL postings from AR", "REST API") Rel(gl_system, budget_system, "Provides actual vs budget comparison", "REST API") Rel(reporting_system, gl_system, "Reads transactions", "REST API") Rel(reporting_system, ap_system, "Reads liabilities", "REST API") Rel(reporting_system, ar_system, "Reads receivables", "REST API") Rel(ap_system, bank_system, "Initiates payments", "REST API") Rel(ar_system, bank_system, "Deposits collections", "REST API") Rel(gl_system, erp_system, "Receives labor costs and inventory adjustments", "REST API") Rel(reporting_system, tax_software, "Provides tax data", "File Export")

Dynamic Diagram (Sequence-Based)

The Dynamic diagram shows how systems or containers interact at runtime. It illustrates the sequence of calls and message flows during a specific business scenario or use case.

Key Points

Shows sequence of interactions over time
Focuses on a specific business scenario or workflow
Shows order of operations and data flow
Reveals bottlenecks and integration points
Useful for understanding workflows, performance issues, and troubleshooting

Example: Order Placement Workflow

C4Dynamic title Order Placement - Sequence of Interactions Person(customer, "Customer") Container(web_app, "Web Application") Container(order_api, "Order API") Container(payment_gateway, "Payment Gateway") Container(message_bus, "Message Bus") Container(fulfillment_svc, "Fulfillment Service") Container(order_db, "Order Database") Rel(customer, web_app, "1. Click 'Place Order'") Rel(web_app, order_api, "2. POST /orders with items and payment info") Rel(order_api, order_db, "3. INSERT Order record (status=pending)") Rel(order_api, payment_gateway, "4. Charge credit card") Rel(payment_gateway, order_api, "5. Return success/failure") Rel(order_api, order_db, "6. UPDATE Order status=paid") Rel(order_api, message_bus, "7. PUBLISH OrderPlaced event") Rel(message_bus, fulfillment_svc, "8. Deliver OrderPlaced event") Rel(fulfillment_svc, order_api, "9. GET /orders/{orderId}") Rel(fulfillment_svc, order_db, "10. Query OrderItems") Rel(order_api, web_app, "11. Return order confirmation") Rel(web_app, customer, "12. Display 'Order Confirmed'")

Deployment Diagram

The Deployment diagram shows how systems and containers are deployed across infrastructure and runtime environments. It illustrates physical and virtual infrastructure — servers, containers, cloud services, databases, load balancers, etc.

Key Points

Shows deployment environments (production, staging, development)
Shows infrastructure nodes (servers, containers, cloud services)
Shows container placement on infrastructure
Shows network topology and connections
Useful for operations teams, DevOps, and capacity planning

Example: Order Management System Deployment

C4Deployment title Order Management System - Production Deployment Person(web_browser, "Web Browser", "User agent") Deployment_Node(azure_region, "Azure East US (Production)", "Azure Region") { Deployment_Node(app_service, "App Service Plan", "Azure App Service") { Container(web_app, "Web App", "React.js SPA", "Served via CDN") Container(order_api, "Order API", "ASP.NET Core", "2 instances behind load balancer") } Deployment_Node(data_tier, "Data Tier", "Azure Virtual Network") { Container(order_db, "Order Database", "Azure SQL Database", "Geo-replicated, automated backups") Container(redis_cache, "Redis Cache", "Azure Cache for Redis", "99.9% availability tier") } Deployment_Node(integration_tier, "Integration", "Managed Services") { Container(service_bus, "Service Bus", "Azure Service Bus", "Standard tier, auto-scaling") } } Deployment_Node(cdn, "Content Delivery Network", "Azure CDN") { Container(static_assets, "Static Assets", "React bundles, images", "Geo-replicated") } Deployment_Node(on_prem, "On-Premises (Hybrid)", "Company Data Center") { Deployment_Node(firewall, "Network DMZ", "Fortinet FortiGate") { Container(api_gateway, "API Gateway", "Kong", "TLS termination, API rate limiting") } Deployment_Node(warehouse_system, "Warehouse LAN", "Isolated Subnet") { Container(warehouse_erp, "Warehouse ERP", "Legacy monolith", "Custom TCP protocol") } } Rel(web_browser, cdn, "HTTPS", "Gets static assets") Rel(cdn, api_gateway, "HTTPS", "Proxies to API") Rel(api_gateway, order_api, "HTTPS", "Routes API calls") Rel(order_api, order_db, "TDS", "SQL queries") Rel(order_api, redis_cache, "Redis Protocol", "Caching") Rel(order_api, service_bus, "AMQP", "Event publishing") Rel(api_gateway, warehouse_erp, "Custom TCP", "Fulfillment sync")

Quick Reference: Which Diagram to Use?

Use this table to decide which diagram type is right for your question:

Your Question Use This Diagram Audience
"Who uses the system and what does it interact with?" L1: Context Everyone
"How is the system structured internally?" L2: Container Technical teams
"What modules make up this container?" L3: Component Developers
"How do multiple enterprise systems relate?" System Landscape Enterprise architects, CIOs
"How do systems interact during a specific workflow?" Dynamic Technical teams, troubleshooting
"Where and how is the system deployed?" Deployment DevOps, operations, infrastructure

Test Data Summary

All examples on this page use realistic but simplified architectures suitable for:

  • Testing import features — copy Mermaid code and import into Nodinite
  • Learning C4 concepts — understand what each diagram type communicates
  • Repository setup — create sample Systems, Services, and Domains
  • Team training — show examples to help others understand C4

To use these examples in Nodinite:

  1. Copy the Mermaid code from any code block
  2. Navigate to C4 Diagrams → New Diagram
  3. Paste the code into the Mermaid import dialog
  4. The system creates stub entities matching the diagram
  5. Enrich those entities with your actual metadata

Key Takeaway: Diagrams Tell Different Stories

Remember: it's not just the name that keeps L1, L2, L3 together. It's the hierarchical zoom relationship:

L1 Context: "Here's the Order System"
↓ (zoom into Order System)
L2 Container: "It's built from Web App, APIs, Database, Message Bus"
↓ (zoom into Order API)
L3 Component: "The Order API contains Controller, OrderService, OrderRepository"

System Landscape, Dynamic, and Deployment diagrams are not zoom levels — they're supplementary questions that provide different perspectives on the same architecture.


Next Step

Ready to create your first C4 diagram? Creating Your First C4 Diagram walks you through setting up Repository properties and designing a complete diagram in the interactive Syncfusion designer.