Sample web app

Three tiers on AWS

Architecture10 nodes · 9 connections

diagram.html#The link keeps the view, selection, route and playback.

About this diagram

Components and what they call: services, stores and the infrastructure between them.

Ask for one like it

Make an architecture diagram of this repository, backed by evidence from the code.

Read about architecture diagrams

The JSON

web-app/diagram.json157 lines
{  "kind": "architecture",  "density": "compact",  "title": "Sample web app",  "subtitle": "Three tiers on AWS",  "direction": "RIGHT",  "groups": [    { "id": "region", "label": "AWS us-west-2" },    {      "id": "sg-api",      "label": "sg-api · :443 / :8000",      "parent": "region",      "tone": "security"    }  ],  "nodes": [    {      "id": "users",      "type": "client",      "card": { "title": "Users", "subtitle": "Browser and mobile" }    },    {      "id": "auth",      "type": "security",      "card": { "title": "Auth provider", "subtitle": "OAuth 2.0" }    },    {      "id": "cdn",      "type": "gateway",      "group": "region",      "card": { "title": "CloudFront", "subtitle": "CDN" }    },    {      "id": "lb",      "type": "gateway",      "group": "sg-api",      "card": {        "title": "Load balancer",        "subtitle": "HTTPS",        "tag": ":443"      }    },    {      "id": "api",      "type": "service",      "group": "sg-api",      "card": {        "title": "API server",        "subtitle": "FastAPI",        "brand": "fastapi",        "tag": ":8000"      }    },    {      "id": "cache",      "type": "cache",      "group": "region",      "card": {        "title": "Redis",        "subtitle": "Read-through cache",        "brand": "redis",        "tag": ":6379"      }    },    {      "id": "db",      "type": "database",      "group": "region",      "card": {        "title": "PostgreSQL",        "subtitle": "Primary",        "brand": "postgresql",        "tag": ":5432"      }    },    {      "id": "s3",      "type": "storage",      "group": "region",      "card": { "title": "S3", "subtitle": "Static assets" }    },    {      "id": "queue",      "type": "queue",      "group": "region",      "card": { "title": "SQS", "subtitle": "Job queue" }    },    {      "id": "worker",      "type": "service",      "group": "region",      "card": { "title": "Worker", "subtitle": "Async jobs" }    }  ],  "edges": [    {      "id": "e1",      "from": "users",      "to": "cdn",      "label": "HTTPS",      "tone": "main"    },    { "id": "e2", "from": "cdn", "to": "lb", "tone": "main" },    {      "id": "e3",      "from": "cdn",      "to": "s3",      "label": "static",      "kind": "async"    },    { "id": "e4", "from": "lb", "to": "api", "tone": "main" },    {      "id": "e5",      "from": "auth",      "to": "api",      "label": "verify JWT",      "tone": "security"    },    {      "id": "e6",      "from": "api",      "to": "cache",      "label": "read-through"    },    {      "id": "e7",      "from": "api",      "to": "db",      "label": "SQL",      "tone": "main"    },    {      "id": "e8",      "from": "api",      "to": "queue",      "label": "enqueue",      "kind": "async"    },    { "id": "e9", "from": "queue", "to": "worker" }  ],  "notes": [    {      "title": "Edge",      "items": [        "CloudFront fronts all traffic",        "S3 serves static assets"      ]    },    {      "title": "Security",      "items": [        "OAuth 2.0 with JWT and PKCE",        "API and load balancer isolated in a security group"      ]    }  ]}

More architecture examples

All examples