Skip to content
Mermaid templates

C4 Container Diagram

C4 model — container view of a typical SaaS application.

Template previewMermaid
Rendering…

Make it your own.

C4Container
title Container diagram — SaaS app

Person(user, "Customer")
System_Boundary(c1, "SaaS Platform") {
  Container(web, "Web App", "Next.js", "Browser-facing UI")
  Container(api, "API", "Node.js", "Business logic + auth")
  ContainerDb(db, "Database", "Postgres", "All persistent state")
  Container(worker, "Worker", "Node.js", "Background jobs")
  ContainerDb(cache, "Cache", "Redis", "Sessions, hot data")
}
System_Ext(stripe, "Stripe", "Payments")
System_Ext(ses, "SES", "Email")

Rel(user, web, "HTTPS")
Rel(web, api, "JSON / REST")
Rel(api, db, "SQL")
Rel(api, cache, "RESP")
Rel(api, worker, "Queue")
Rel(worker, stripe, "API")
Rel(worker, ses, "SMTP")