{
direction: column; gap: 72;
|-| { stroke: --gray-deep; font-size: 12; }
.rose { fill: --rose-wash; stroke: --rose-deep; }
.sky { fill: --sky-wash; stroke: --sky-deep; }
.amber { fill: --amber-wash; stroke: --amber-deep; }
.lime { fill: --lime-wash; stroke: --lime-deep; }
.iconic { direction: row; gap: 8; padding: 12 18; }
|icon| { fill: --rose-soft; stroke: --rose-deep; }
}
|box#users| .rose.iconic [ |icon| "users"; "Users" ]
|group#svc| "Service" { layout: grid; columns: repeat(2); gap: 50; padding: 26; } [
|box#api| "API" .sky
|slant#db| "Postgres" .amber
|oval#worker| "Worker" .lime
|box#mail| .rose.iconic [ |icon| "envelope"; "Mail" ]
api -> db
api --> worker "jobs"
worker -> mail
]
users:bottom -> svc.api "HTTPS"{
layout: tree; direction: row; gap: 50;
.eng { fill: --sky-wash; stroke: --sky-deep; color: --sky-ink; }
.des { fill: --rose-wash; stroke: --rose-deep; color: --rose-ink; }
.ops { fill: --amber-wash; stroke: --amber-deep; color: --amber-ink; }
#eng |-| { stroke: --sky-deep; }
#des |-| { stroke: --rose-deep; }
}
|topic#co| "Founders" [
|topic#eng| "Engineering" .eng [
|topic| "Platform" .eng
|topic| "Product" .eng
]
|topic#des| "Design" .des [
|topic| "Brand" .des
]
|topic#ops| "Operations" .ops
]|chart| "Signups" {
width: 440; height: 280;
categories: "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun";
} [
|bars| "Free" { data: 24, 31, 28, 44, 39, 22, 18;
fill: --purple-soft; radius: 6; }
|line| "Paid" { data: 8, 11, 14, 13, 19, 9, 7;
stroke: --rose; curve: smooth; marker: circle; }
]{
layout: sequence; gap: 45 55;
.app { fill: --sky-wash; stroke: --sky-ink; }
.auth { fill: --purple-wash; stroke: --purple-ink; }
.api { fill: --lime-wash; stroke: --lime-ink; }
}
|box#app| "App" .app
|box#auth| "Auth" .auth
|box#api| "API" .api
app -> auth "sign in"
auth --> app "token"
app -> api "GET /me"
api --> app "profile"{
layout: grid; columns: repeat(2); gap: 75;
.a { fill: --purple-wash; stroke: --purple-ink; }
.b { fill: --teal-wash; stroke: --teal-ink; }
.c { fill: --amber-wash; stroke: --amber-ink; }
}
|entity#author| "Author" .a {
columns: repeat(3); cell: 1 1;
} [
"PK" "id" "int"
"" "name" "varchar"
]
|entity#post| "Post" .b {
columns: repeat(3); cell: 2 1;
} [
"PK" "id" "int"
"FK" "author_id" "int"
"" "title" "varchar"
]
|entity#tag| "Tag" .c {
columns: repeat(3); cell: 2 2;
} [
"PK" "id" "int"
"" "name" "varchar"
]
author +-< post
post >-< tag{
.edge { fill: none; stroke: --stroke-dark; }
}
|drawing#plate| "COVER PLATE" { scale: 1; clearance: 20 } [
|rect#body| .edge { width: 80; height: 50; radius: 16; }
|hole#bolt| { width: 8; translate: -24 0;
pattern: grid(2, 1, 48, 0); }
body:left (-) body:right { side: bottom; }
body:top (-) body:bottom { side: right; }
bolt (o)
]{
layout: schematic; padding: 5 20;
|v3::label| { symbol: power; } [ "3V3" ]
|gpio::label| { symbol: power; } [ "GPIO" ]
}
|R#r1| "220R"
|LED#d1| "STATUS"
|Q#q1| "2N3904"
|R#r2| "10k"
|v3| - r1 - d1.a
d1.k - q1.c
q1.e - |gnd|
|gpio| - r2 - q1.b