nerak repo

This commit is contained in:
2026-07-07 15:52:39 -05:00
committed by nightshade
commit 3b64b2b2c1
84 changed files with 5383 additions and 0 deletions
+155
View File
@@ -0,0 +1,155 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 920 580" font-family="system-ui, -apple-system, sans-serif">
<defs>
<marker id="arrow" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#64748b"/>
</marker>
<marker id="arrow-amber" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#f59e0b"/>
</marker>
<marker id="arrow-emerald" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#10b981"/>
</marker>
</defs>
<!-- Background -->
<rect width="920" height="580" rx="12" fill="#0f172a"/>
<!-- Title -->
<text x="460" y="38" text-anchor="middle" fill="#f8fafc" font-size="18" font-weight="600">Multi-Reactor Architecture</text>
<!-- Subtitle -->
<text x="460" y="58" text-anchor="middle" fill="#475569" font-size="10">request/task/cpu ratio configurable in compose.yml</text>
<!-- HTTP Clients -->
<rect x="20" y="105" width="110" height="44" rx="8" fill="#1e293b" stroke="#334155" stroke-width="1.5"/>
<text x="75" y="132" text-anchor="middle" fill="#94a3b8" font-size="13" font-weight="500">HTTP Clients</text>
<!-- Arrows from clients to request reactors -->
<line x1="130" y1="117" x2="178" y2="117" stroke="#64748b" stroke-width="1.5" marker-end="url(#arrow)"/>
<line x1="130" y1="127" x2="178" y2="185" stroke="#64748b" stroke-width="1.5" marker-end="url(#arrow)"/>
<line x1="130" y1="137" x2="178" y2="255" stroke="#64748b" stroke-width="1.5" marker-end="url(#arrow)"/>
<!-- ==================== REQUEST REACTORS ==================== -->
<rect x="173" y="76" width="270" height="228" rx="10" fill="none" stroke="#334155" stroke-width="1" stroke-dasharray="6,4"/>
<text x="308" y="96" text-anchor="middle" fill="#60a5fa" font-size="12" font-weight="600" letter-spacing="0.5">REQUEST REACTORS</text>
<!-- Request Reactor 0 -->
<rect x="188" y="106" width="240" height="40" rx="8" fill="#1e3a5f" stroke="#3b82f6" stroke-width="1.5"/>
<text x="203" y="131" fill="#93c5fd" font-size="11" font-weight="600">Core 0</text>
<text x="260" y="131" fill="#cbd5e1" font-size="11">event loop</text>
<rect x="348" y="114" width="72" height="24" rx="5" fill="#1e293b" stroke="#475569" stroke-width="1"/>
<text x="384" y="131" text-anchor="middle" fill="#94a3b8" font-size="10">pipeline</text>
<!-- Request Reactor 1 -->
<rect x="188" y="158" width="240" height="40" rx="8" fill="#1e3a5f" stroke="#3b82f6" stroke-width="1.5"/>
<text x="203" y="183" fill="#93c5fd" font-size="11" font-weight="600">Core 1</text>
<text x="260" y="183" fill="#cbd5e1" font-size="11">event loop</text>
<rect x="348" y="166" width="72" height="24" rx="5" fill="#1e293b" stroke="#475569" stroke-width="1"/>
<text x="384" y="183" text-anchor="middle" fill="#94a3b8" font-size="10">pipeline</text>
<!-- Ellipsis -->
<circle cx="308" cy="212" r="2" fill="#475569"/>
<circle cx="308" cy="222" r="2" fill="#475569"/>
<!-- Request Reactor N -->
<rect x="188" y="240" width="240" height="40" rx="8" fill="#1e3a5f" stroke="#3b82f6" stroke-width="1.5"/>
<text x="203" y="265" fill="#93c5fd" font-size="11" font-weight="600">Core N</text>
<text x="260" y="265" fill="#cbd5e1" font-size="11">event loop</text>
<rect x="348" y="248" width="72" height="24" rx="5" fill="#1e293b" stroke="#475569" stroke-width="1"/>
<text x="384" y="265" text-anchor="middle" fill="#94a3b8" font-size="10">pipeline</text>
<!-- ==================== TASK REACTORS ==================== -->
<rect x="173" y="330" width="270" height="228" rx="10" fill="none" stroke="#334155" stroke-width="1" stroke-dasharray="6,4"/>
<text x="308" y="350" text-anchor="middle" fill="#fbbf24" font-size="12" font-weight="600" letter-spacing="0.5">TASK REACTORS</text>
<!-- Task Reactor 0 -->
<rect x="188" y="360" width="240" height="40" rx="8" fill="#422006" stroke="#f59e0b" stroke-width="1.5"/>
<text x="203" y="385" fill="#fcd34d" font-size="11" font-weight="600">Core</text>
<text x="236" y="385" fill="#cbd5e1" font-size="11">event loop</text>
<rect x="348" y="368" width="72" height="24" rx="5" fill="#1e293b" stroke="#475569" stroke-width="1"/>
<text x="384" y="385" text-anchor="middle" fill="#94a3b8" font-size="10">cron / jobs</text>
<!-- Task Reactor 1 -->
<rect x="188" y="412" width="240" height="40" rx="8" fill="#422006" stroke="#f59e0b" stroke-width="1.5"/>
<text x="203" y="437" fill="#fcd34d" font-size="11" font-weight="600">Core</text>
<text x="236" y="437" fill="#cbd5e1" font-size="11">event loop</text>
<rect x="348" y="420" width="72" height="24" rx="5" fill="#1e293b" stroke="#475569" stroke-width="1"/>
<text x="384" y="437" text-anchor="middle" fill="#94a3b8" font-size="10">cron / jobs</text>
<!-- Ellipsis -->
<circle cx="308" cy="466" r="2" fill="#475569"/>
<circle cx="308" cy="476" r="2" fill="#475569"/>
<!-- Task Reactor N -->
<rect x="188" y="494" width="240" height="40" rx="8" fill="#422006" stroke="#f59e0b" stroke-width="1.5"/>
<text x="203" y="519" fill="#fcd34d" font-size="11" font-weight="600">Core</text>
<text x="236" y="519" fill="#cbd5e1" font-size="11">event loop</text>
<rect x="348" y="502" width="72" height="24" rx="5" fill="#1e293b" stroke="#475569" stroke-width="1"/>
<text x="384" y="519" text-anchor="middle" fill="#94a3b8" font-size="10">cron / jobs</text>
<!-- Task DB -->
<rect x="20" y="410" width="110" height="44" rx="8" fill="#1e293b" stroke="#f59e0b" stroke-width="1.5"/>
<text x="75" y="429" text-anchor="middle" fill="#fcd34d" font-size="11" font-weight="600">nerak_tasks</text>
<text x="75" y="444" text-anchor="middle" fill="#94a3b8" font-size="10">database</text>
<!-- Arrows: task DB to/from task reactors -->
<line x1="130" y1="425" x2="183" y2="425" stroke="#f59e0b" stroke-width="1.5" marker-end="url(#arrow-amber)"/>
<line x1="183" y1="437" x2="130" y2="437" stroke="#f59e0b" stroke-width="1.5" marker-end="url(#arrow-amber)"/>
<!-- ==================== SHARED THREAD POOL ==================== -->
<rect x="540" y="76" width="350" height="270" rx="10" fill="none" stroke="#334155" stroke-width="1" stroke-dasharray="6,4"/>
<text x="715" y="100" text-anchor="middle" fill="#34d399" font-size="12" font-weight="600" letter-spacing="0.5">SHARED THREAD POOL</text>
<text x="715" y="116" text-anchor="middle" fill="#6b7280" font-size="10">remaining cores</text>
<!-- Work queue label -->
<text x="715" y="140" text-anchor="middle" fill="#94a3b8" font-size="10">work queue</text>
<!-- Queue visualization -->
<rect x="568" y="148" width="294" height="36" rx="6" fill="#1e293b" stroke="#475569" stroke-width="1"/>
<rect x="576" y="154" width="24" height="24" rx="4" fill="#064e3b" stroke="#10b981" stroke-width="1"/>
<rect x="606" y="154" width="24" height="24" rx="4" fill="#064e3b" stroke="#10b981" stroke-width="1"/>
<rect x="636" y="154" width="24" height="24" rx="4" fill="#064e3b" stroke="#10b981" stroke-width="1"/>
<rect x="666" y="154" width="24" height="24" rx="4" fill="#064e3b" stroke="#10b981" stroke-width="1"/>
<rect x="696" y="154" width="24" height="24" rx="4" fill="#0f172a" stroke="#334155" stroke-width="1" stroke-dasharray="3,2"/>
<rect x="726" y="154" width="24" height="24" rx="4" fill="#0f172a" stroke="#334155" stroke-width="1" stroke-dasharray="3,2"/>
<rect x="756" y="154" width="24" height="24" rx="4" fill="#0f172a" stroke="#334155" stroke-width="1" stroke-dasharray="3,2"/>
<rect x="786" y="154" width="24" height="24" rx="4" fill="#0f172a" stroke="#334155" stroke-width="1" stroke-dasharray="3,2"/>
<rect x="816" y="154" width="24" height="24" rx="4" fill="#0f172a" stroke="#334155" stroke-width="1" stroke-dasharray="3,2"/>
<!-- Arrows from queue down to threads -->
<line x1="630" y1="184" x2="630" y2="214" stroke="#475569" stroke-width="1" marker-end="url(#arrow)"/>
<line x1="720" y1="184" x2="720" y2="214" stroke="#475569" stroke-width="1" marker-end="url(#arrow)"/>
<line x1="810" y1="184" x2="810" y2="214" stroke="#475569" stroke-width="1" marker-end="url(#arrow)"/>
<!-- Thread boxes -->
<rect x="570" y="218" width="110" height="48" rx="6" fill="#064e3b" stroke="#10b981" stroke-width="1.5"/>
<text x="625" y="247" text-anchor="middle" fill="#6ee7b7" font-size="11" font-weight="500">Thread 1</text>
<rect x="690" y="218" width="60" height="48" rx="6" fill="#064e3b" stroke="#10b981" stroke-width="1.5"/>
<text x="720" y="247" text-anchor="middle" fill="#6ee7b7" font-size="11" font-weight="500">...</text>
<rect x="760" y="218" width="110" height="48" rx="6" fill="#064e3b" stroke="#10b981" stroke-width="1.5"/>
<text x="815" y="247" text-anchor="middle" fill="#6ee7b7" font-size="11" font-weight="500">Thread N</text>
<!-- Result return -->
<text x="715" y="298" text-anchor="middle" fill="#6b7280" font-size="10">on complete, resumes pipeline on reactor</text>
<!-- ==================== INVOKE ARROWS ==================== -->
<!-- Arrow from request reactors to pool -->
<path d="M 443,185 L 535,168" fill="none" stroke="#10b981" stroke-width="1.5" marker-end="url(#arrow-emerald)" stroke-dasharray="5,3"/>
<text x="476" y="164" fill="#34d399" font-size="10" font-weight="500">invoke()</text>
<!-- Arrow from task reactors to pool -->
<path d="M 443,430 Q 510,390 535,310" fill="none" stroke="#10b981" stroke-width="1.5" marker-end="url(#arrow-emerald)" stroke-dasharray="5,3"/>
<text x="518" y="390" fill="#34d399" font-size="10" font-weight="500">invoke()</text>
<!-- ==================== TASK ARROWS ==================== -->
<!-- task() from request reactors to task DB -->
<path d="M 188,286 Q 110,320 85,405" fill="none" stroke="#f59e0b" stroke-width="1.5" marker-end="url(#arrow-amber)" stroke-dasharray="5,3"/>
<text x="108" y="330" fill="#fbbf24" font-size="10" font-weight="500">task()</text>
<!-- task() from task reactors to task DB (self-enqueue) -->
<path d="M 188,540 Q 130,556 85,458" fill="none" stroke="#f59e0b" stroke-width="1.5" marker-end="url(#arrow-amber)" stroke-dasharray="5,3"/>
<text x="120" y="540" fill="#fbbf24" font-size="10" font-weight="500">task()</text>
</svg>

After

Width:  |  Height:  |  Size: 10 KiB

+95
View File
@@ -0,0 +1,95 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 300" width="760" height="300">
<rect width="760" height="300" fill="#09080f"/>
<defs>
<linearGradient id="sg1" x1="0" y1="0" x2="1" y2="1">
<stop offset="0%" stop-color="#3b82f6"/>
<stop offset="100%" stop-color="#2563eb"/>
</linearGradient>
<linearGradient id="sg2" x1="0" y1="0" x2="1" y2="1">
<stop offset="0%" stop-color="#8b5cf6"/>
<stop offset="100%" stop-color="#7c3aed"/>
</linearGradient>
<linearGradient id="sg3" x1="0" y1="0" x2="1" y2="1">
<stop offset="0%" stop-color="#f59e0b"/>
<stop offset="100%" stop-color="#d97706"/>
</linearGradient>
<linearGradient id="sg4" x1="0" y1="0" x2="1" y2="1">
<stop offset="0%" stop-color="#10b981"/>
<stop offset="100%" stop-color="#059669"/>
</linearGradient>
<style>text{font-family:'JetBrains Mono','Fira Code',monospace}</style>
</defs>
<!-- Outer container -->
<rect x="20" y="16" width="720" height="268" rx="14" fill="#0f0d1a" stroke="#1e1b2e" stroke-width="1.5"/>
<!-- Route label -->
<text x="44" y="46" fill="#94a3b8" font-size="12" font-weight="600">POST /todos</text>
<!-- .before label -->
<text x="44" y="72" fill="#475569" font-size="9">.before</text>
<!-- session() box: x=44 w=108 → right edge 152 -->
<rect x="44" y="80" width="108" height="40" rx="8" fill="#1e293b" stroke="#3b82f6" stroke-width="1"/>
<text x="98" y="105" text-anchor="middle" fill="#93c5fd" font-size="11" font-weight="600">session()</text>
<!-- Arrow 1: line 152→170, triangle tip at 180 -->
<line x1="152" y1="100" x2="170" y2="100" stroke="#64748b" stroke-width="1.5"/>
<polygon points="180,100 170,95 170,105" fill="#64748b"/>
<!-- .post pipeline label -->
<text x="188" y="72" fill="#475569" font-size="9">.post pipeline</text>
<!-- param() box: x=188 w=108 → right edge 296 -->
<rect x="188" y="80" width="108" height="40" rx="8" fill="url(#sg1)"/>
<text x="242" y="98" text-anchor="middle" fill="#fff" font-size="11" font-weight="700">param()</text>
<text x="242" y="113" text-anchor="middle" fill="rgba(255,255,255,0.65)" font-size="8">validate title</text>
<!-- Arrow 2: line 296→314, triangle tip at 324 -->
<line x1="296" y1="100" x2="314" y2="100" stroke="#64748b" stroke-width="1.5"/>
<polygon points="324,100 314,95 314,105" fill="#64748b"/>
<!-- db() box: x=324 w=108 → right edge 432 -->
<rect x="324" y="80" width="108" height="40" rx="8" fill="url(#sg2)"/>
<text x="378" y="98" text-anchor="middle" fill="#fff" font-size="11" font-weight="700">db()</text>
<text x="378" y="113" text-anchor="middle" fill="rgba(255,255,255,0.65)" font-size="8">INSERT todo</text>
<!-- Arrow 3: line 432→450, triangle tip at 460 -->
<line x1="432" y1="100" x2="450" y2="100" stroke="#64748b" stroke-width="1.5"/>
<polygon points="460,100 450,95 450,105" fill="#64748b"/>
<!-- emit() box: x=460 w=108 → right edge 568 -->
<rect x="460" y="80" width="108" height="40" rx="8" fill="url(#sg3)"/>
<text x="514" y="98" text-anchor="middle" fill="#fff" font-size="11" font-weight="700">emit()</text>
<text x="514" y="113" text-anchor="middle" fill="rgba(255,255,255,0.65)" font-size="8">todo_created</text>
<!-- Arrow 4: line 568→586, triangle tip at 596 -->
<line x1="568" y1="100" x2="586" y2="100" stroke="#64748b" stroke-width="1.5"/>
<polygon points="596,100 586,95 586,105" fill="#64748b"/>
<!-- redirect() box: x=596 w=108 → right edge 704 -->
<rect x="596" y="80" width="108" height="40" rx="8" fill="url(#sg4)"/>
<text x="650" y="98" text-anchor="middle" fill="#fff" font-size="11" font-weight="700">redirect()</text>
<text x="650" y="113" text-anchor="middle" fill="rgba(255,255,255,0.65)" font-size="8">302 → /todos</text>
<!-- ===== Pipeline Context ===== -->
<rect x="44" y="146" width="672" height="120" rx="10" fill="#111827" stroke="#1f2937" stroke-width="1"/>
<text x="64" y="170" fill="#6b7280" font-size="10" font-weight="600">PIPELINE CONTEXT</text>
<!-- Context cards: each 148w x 52h, gap 12 -->
<rect x="60" y="182" width="148" height="52" rx="6" fill="#1e1b2e" stroke="#3b82f6" stroke-width="0.75"/>
<text x="134" y="206" text-anchor="middle" fill="#e2e8f0" font-size="11" font-weight="600">user_id</text>
<text x="134" y="222" text-anchor="middle" fill="#6b7280" font-size="9">← session</text>
<rect x="220" y="182" width="148" height="52" rx="6" fill="#1e1b2e" stroke="#3b82f6" stroke-width="0.75"/>
<text x="294" y="206" text-anchor="middle" fill="#e2e8f0" font-size="11" font-weight="600">title</text>
<text x="294" y="222" text-anchor="middle" fill="#6b7280" font-size="9">← param</text>
<rect x="380" y="182" width="148" height="52" rx="6" fill="#1e1b2e" stroke="#8b5cf6" stroke-width="0.75"/>
<text x="454" y="206" text-anchor="middle" fill="#e2e8f0" font-size="11" font-weight="600">todo</text>
<text x="454" y="222" text-anchor="middle" fill="#6b7280" font-size="9">← db .set</text>
<rect x="540" y="182" width="148" height="52" rx="6" fill="#1e1b2e" stroke="#374151" stroke-width="0.75"/>
<text x="614" y="206" text-anchor="middle" fill="#e2e8f0" font-size="11" font-weight="600">base_layout</text>
<text x="614" y="222" text-anchor="middle" fill="#6b7280" font-size="9">← .context</text>
</svg>

After

Width:  |  Height:  |  Size: 5.2 KiB

+66
View File
@@ -0,0 +1,66 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 900 300" width="900" height="300">
<rect width="900" height="300" fill="#09080f"/>
<defs>
<linearGradient id="pubG" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="#f59e0b"/>
<stop offset="100%" stop-color="#d97706"/>
</linearGradient>
<linearGradient id="subG" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="#06b6d4"/>
<stop offset="100%" stop-color="#0891b2"/>
</linearGradient>
<linearGradient id="busG" x1="0" y1="0" x2="1" y2="0">
<stop offset="0%" stop-color="#7c3aed"/>
<stop offset="50%" stop-color="#a855f7"/>
<stop offset="100%" stop-color="#7c3aed"/>
</linearGradient>
<style>text{font-family:'JetBrains Mono','Fira Code',monospace}</style>
</defs>
<!-- ===== Publisher: todos module ===== -->
<rect x="30" y="30" width="220" height="130" rx="12" fill="#1e1b2e" stroke="#f59e0b" stroke-width="1.5"/>
<rect x="30" y="30" width="220" height="36" rx="12" fill="url(#pubG)"/>
<text x="140" y="53" text-anchor="middle" fill="#fff" font-size="12" font-weight="700">todos module</text>
<text x="50" y="86" fill="#fcd34d" font-size="10">.post pipeline:</text>
<text x="58" y="102" fill="#e2e8f0" font-size="10">param() → db()</text>
<text x="58" y="118" fill="#e2e8f0" font-size="10">→ emit("todo_created")</text>
<text x="58" y="134" fill="#e2e8f0" font-size="10">→ redirect("/todos")</text>
<!-- .publishes contract -->
<text x="140" y="175" text-anchor="middle" fill="#92400e" font-size="9" font-weight="600">.publishes</text>
<rect x="40" y="182" width="200" height="28" rx="6" fill="#451a03" stroke="#f59e0b" stroke-width="0.75"/>
<text x="140" y="201" text-anchor="middle" fill="#fcd34d" font-size="9">todo_created → user_id, title</text>
<!-- ===== Event Bus pill ===== -->
<rect x="330" y="118" width="140" height="44" rx="22" fill="url(#busG)"/>
<text x="400" y="145" text-anchor="middle" fill="#fff" font-size="11" font-weight="700">Event Bus</text>
<!-- Arrow: publisher → bus -->
<line x1="250" y1="140" x2="320" y2="140" stroke="#f59e0b" stroke-width="2"/>
<polygon points="330,140 320,135 320,145" fill="#f59e0b"/>
<!-- ===== Subscriber 1: activity module ===== -->
<rect x="570" y="20" width="300" height="100" rx="12" fill="#1e1b2e" stroke="#06b6d4" stroke-width="1.5"/>
<rect x="570" y="20" width="300" height="36" rx="12" fill="url(#subG)"/>
<text x="720" y="43" text-anchor="middle" fill="#fff" font-size="12" font-weight="700">activity module</text>
<text x="595" y="74" fill="#67e8f9" font-size="10">.events:</text>
<text x="603" y="92" fill="#e2e8f0" font-size="9">"todo_created" → db(log.sql)</text>
<!-- Elbow: bus right → subscriber 1 -->
<path d="M470,140 L525,140 L525,70 L560,70" stroke="#06b6d4" stroke-width="1.5" fill="none"/>
<polygon points="570,70 560,65 560,75" fill="#06b6d4"/>
<!-- ===== Subscriber 2: notifications module ===== -->
<rect x="570" y="160" width="300" height="100" rx="12" fill="#1e1b2e" stroke="#06b6d4" stroke-width="1.5"/>
<rect x="570" y="160" width="300" height="36" rx="12" fill="url(#subG)"/>
<text x="720" y="183" text-anchor="middle" fill="#fff" font-size="12" font-weight="700">notifications module</text>
<text x="595" y="214" fill="#67e8f9" font-size="10">.events:</text>
<text x="603" y="232" fill="#e2e8f0" font-size="9">"todo_created" → call(notify)</text>
<!-- Elbow: bus right → subscriber 2 -->
<path d="M470,140 L525,140 L525,210 L560,210" stroke="#06b6d4" stroke-width="1.5" fill="none"/>
<polygon points="570,210 560,205 560,215" fill="#06b6d4"/>
<!-- Footer -->
<text x="450" y="290" text-anchor="middle" fill="#64748b" font-size="10">Modules are decoupled — publishers don't know about subscribers</text>
</svg>

After

Width:  |  Height:  |  Size: 3.8 KiB

+46
View File
@@ -0,0 +1,46 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 320" width="760" height="320">
<rect width="760" height="320" fill="#09080f"/>
<defs>
<style>text{font-family:'JetBrains Mono','Fira Code',monospace}</style>
</defs>
<!-- Level 1: Root Config — y=24 h=60 → bottom 84 -->
<rect x="40" y="24" width="680" height="60" rx="10" fill="#2d2640" stroke="#7c3aed" stroke-width="1.5"/>
<text x="380" y="50" text-anchor="middle" fill="#c084fc" font-size="12" font-weight="700">Root Config</text>
<text x="380" y="70" text-anchor="middle" fill="#94a3b8" font-size="10">.errors = { 404 → render 404.html }</text>
<!-- Gap: 84 → 118 (34px gap) -->
<!-- Level 2: Module Config — y=118 h=60 → bottom 178 -->
<rect x="120" y="118" width="520" height="60" rx="10" fill="#1e293b" stroke="#3b82f6" stroke-width="1.5" stroke-dasharray="5,3"/>
<text x="380" y="144" text-anchor="middle" fill="#60a5fa" font-size="12" font-weight="700">Module Config</text>
<text x="380" y="164" text-anchor="middle" fill="#94a3b8" font-size="10">.errors = { ... }</text>
<!-- Gap: 178 → 212 (34px gap) -->
<!-- Level 3: Route — y=212 h=60 → bottom 272 -->
<rect x="200" y="212" width="360" height="60" rx="10" fill="#0c2d3e" stroke="#06b6d4" stroke-width="1.5" stroke-dasharray="5,3"/>
<text x="380" y="238" text-anchor="middle" fill="#22d3ee" font-size="12" font-weight="700">Route /todos/:id</text>
<text x="380" y="258" text-anchor="middle" fill="#94a3b8" font-size="10">.errors = { ... }</text>
<!-- Error origin dot: y=296 -->
<circle cx="380" cy="296" r="10" fill="#ef4444" opacity="0.85"/>
<text x="380" y="300" text-anchor="middle" fill="#fff" font-size="10" font-weight="700">!</text>
<text x="400" y="300" fill="#fca5a5" font-size="10"> 404 raised in pipeline step</text>
<!-- Arrow 1: error dot (286) → route bottom (272). Line + up triangle -->
<line x1="380" y1="286" x2="380" y2="275" stroke="#ef4444" stroke-width="2"/>
<polygon points="380,272 375,279 385,279" fill="#ef4444"/>
<!-- Arrow 2: route top (212) → module bottom (178). Line in gap + up triangle -->
<line x1="380" y1="212" x2="380" y2="181" stroke="#ef4444" stroke-width="2"/>
<polygon points="380,178 375,185 385,185" fill="#ef4444"/>
<!-- Label -->
<text x="400" y="200" fill="#6b7280" font-size="9">no 404 handler → bubble up</text>
<!-- Arrow 3: module top (118) → root bottom (84). Line in gap + up triangle -->
<line x1="380" y1="118" x2="380" y2="87" stroke="#ef4444" stroke-width="2"/>
<polygon points="380,84 375,91 385,91" fill="#ef4444"/>
<!-- Label -->
<text x="400" y="106" fill="#22c55e" font-size="9" font-weight="600">✓ matched → render 404.html</text>
</svg>

After

Width:  |  Height:  |  Size: 2.7 KiB

+58
View File
@@ -0,0 +1,58 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 270" width="760" height="270">
<rect width="760" height="270" fill="#09080f"/>
<defs>
<linearGradient id="rG" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="#a855f7"/>
<stop offset="100%" stop-color="#7c3aed"/>
</linearGradient>
<linearGradient id="mG" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="#3b82f6"/>
<stop offset="100%" stop-color="#2563eb"/>
</linearGradient>
<style>text{font-family:'JetBrains Mono','Fira Code',monospace}</style>
</defs>
<!-- Root node: x=290 y=20 w=180 h=44 → center 380, bottom 64 -->
<rect x="290" y="20" width="180" height="44" rx="10" fill="url(#rG)"/>
<text x="380" y="47" text-anchor="middle" fill="#fff" font-size="12" font-weight="700">config() — root</text>
<!-- Elbow connectors: root bottom center → down to 82 → horizontal → down to child tops at 108 -->
<!-- Vertical trunk from root -->
<line x1="380" y1="64" x2="380" y2="82" stroke="#64748b" stroke-width="1.5"/>
<!-- Horizontal bar -->
<line x1="130" y1="82" x2="630" y2="82" stroke="#64748b" stroke-width="1.5"/>
<!-- Vertical drops to each child -->
<line x1="130" y1="82" x2="130" y2="108" stroke="#64748b" stroke-width="1.5"/>
<line x1="380" y1="82" x2="380" y2="108" stroke="#64748b" stroke-width="1.5"/>
<line x1="630" y1="82" x2="630" y2="108" stroke="#64748b" stroke-width="1.5"/>
<!-- Level 1: each w=170 h=40, top at y=108 → bottom at 148 -->
<rect x="45" y="108" width="170" height="40" rx="8" fill="url(#mG)"/>
<text x="130" y="133" text-anchor="middle" fill="#fff" font-size="11" font-weight="600">sqlite_config()</text>
<rect x="295" y="108" width="170" height="40" rx="8" fill="url(#mG)"/>
<text x="380" y="133" text-anchor="middle" fill="#fff" font-size="11" font-weight="600">todos_config()</text>
<rect x="545" y="108" width="170" height="40" rx="8" fill="url(#mG)"/>
<text x="630" y="133" text-anchor="middle" fill="#fff" font-size="11" font-weight="600">auth_config()</text>
<!-- Elbow connectors: todos bottom center → down to 162 → horizontal → down to leaf tops at 178 -->
<line x1="380" y1="148" x2="380" y2="162" stroke="#64748b" stroke-width="1"/>
<line x1="260" y1="162" x2="500" y2="162" stroke="#64748b" stroke-width="1"/>
<line x1="260" y1="162" x2="260" y2="178" stroke="#64748b" stroke-width="1"/>
<line x1="500" y1="162" x2="500" y2="178" stroke="#64748b" stroke-width="1"/>
<!-- Level 2 leaf nodes: w=170 h=64, top at y=178 -->
<rect x="175" y="178" width="170" height="64" rx="8" fill="#0f0d1a" stroke="#10b981" stroke-width="1"/>
<text x="260" y="200" text-anchor="middle" fill="#6ee7b7" font-size="10">.databases</text>
<text x="260" y="216" text-anchor="middle" fill="#6ee7b7" font-size="10">.resources</text>
<text x="260" y="232" text-anchor="middle" fill="#6ee7b7" font-size="10">.events</text>
<rect x="415" y="178" width="170" height="64" rx="8" fill="#0f0d1a" stroke="#10b981" stroke-width="1"/>
<text x="500" y="200" text-anchor="middle" fill="#6ee7b7" font-size="10">.publishes</text>
<text x="500" y="216" text-anchor="middle" fill="#6ee7b7" font-size="10">.context</text>
<text x="500" y="232" text-anchor="middle" fill="#6ee7b7" font-size="10">.errors</text>
<!-- Footer -->
<text x="380" y="262" text-anchor="middle" fill="#64748b" font-size="10">First registration wins — root can override module defaults</text>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

+52
View File
@@ -0,0 +1,52 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 360" width="760" height="360">
<rect width="760" height="360" fill="#09080f"/>
<defs>
<style>text{font-family:'JetBrains Mono','Fira Code',monospace}</style>
</defs>
<!-- Outermost: Global .before / .after -->
<rect x="30" y="20" width="700" height="310" rx="14" fill="#1a1328" stroke="#7c3aed" stroke-width="1.5"/>
<text x="50" y="46" fill="#c084fc" font-size="11" font-weight="700">Global .before</text>
<text x="50" y="62" fill="#9580b8" font-size="9">session()</text>
<text x="610" y="46" fill="#c084fc" font-size="11" font-weight="700">Global .after</text>
<text x="610" y="62" fill="#9580b8" font-size="9">call(log_request)</text>
<!-- Middle: Resource .before / .after -->
<rect x="60" y="78" width="640" height="230" rx="12" fill="#111827" stroke="#3b82f6" stroke-width="1.5"/>
<text x="80" y="102" fill="#60a5fa" font-size="11" font-weight="700">Resource .before</text>
<text x="80" y="118" fill="#7b9ec9" font-size="9">logged_in()</text>
<text x="570" y="102" fill="#60a5fa" font-size="11" font-weight="700">Resource .after</text>
<!-- Inner: Route pipeline -->
<rect x="90" y="134" width="580" height="152" rx="10" fill="#0f0d1a" stroke="#06b6d4" stroke-width="1.5"/>
<text x="110" y="158" fill="#22d3ee" font-size="11" font-weight="700">Route Pipeline — POST /todos</text>
<!-- Steps inside route -->
<rect x="110" y="172" width="100" height="36" rx="6" fill="#1e293b" stroke="#3b82f6" stroke-width="0.75"/>
<text x="160" y="194" text-anchor="middle" fill="#93c5fd" font-size="10" font-weight="600">param()</text>
<line x1="210" y1="190" x2="228" y2="190" stroke="#64748b" stroke-width="1.5"/>
<polygon points="238,190 228,185 228,195" fill="#64748b"/>
<rect x="238" y="172" width="100" height="36" rx="6" fill="#1e293b" stroke="#8b5cf6" stroke-width="0.75"/>
<text x="288" y="194" text-anchor="middle" fill="#c4b5fd" font-size="10" font-weight="600">db()</text>
<line x1="338" y1="190" x2="356" y2="190" stroke="#64748b" stroke-width="1.5"/>
<polygon points="366,190 356,185 356,195" fill="#64748b"/>
<rect x="366" y="172" width="100" height="36" rx="6" fill="#1e293b" stroke="#f59e0b" stroke-width="0.75"/>
<text x="416" y="194" text-anchor="middle" fill="#fcd34d" font-size="10" font-weight="600">emit()</text>
<line x1="466" y1="190" x2="484" y2="190" stroke="#64748b" stroke-width="1.5"/>
<polygon points="494,190 484,185 484,195" fill="#64748b"/>
<rect x="494" y="172" width="100" height="36" rx="6" fill="#1e293b" stroke="#10b981" stroke-width="0.75"/>
<text x="544" y="194" text-anchor="middle" fill="#6ee7b7" font-size="10" font-weight="600">redirect()</text>
<!-- Route .before / .after labels -->
<text x="110" y="244" fill="#22d3ee" font-size="9">Route .before runs first inside this scope</text>
<text x="110" y="260" fill="#22d3ee" font-size="9">Route .after runs last inside this scope</text>
<!-- Execution order arrows at bottom -->
<text x="380" y="348" text-anchor="middle" fill="#64748b" font-size="10">Execution order: global .before → resource .before → route pipeline → resource .after → global .after</text>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

+96
View File
@@ -0,0 +1,96 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 400" width="760" height="400">
<rect width="760" height="400" fill="#09080f"/>
<defs>
<linearGradient id="clientG" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="#06b6d4"/>
<stop offset="100%" stop-color="#0891b2"/>
</linearGradient>
<linearGradient id="serverG" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="#8b5cf6"/>
<stop offset="100%" stop-color="#7c3aed"/>
</linearGradient>
<linearGradient id="chanG" x1="0" y1="0" x2="1" y2="0">
<stop offset="0%" stop-color="#f59e0b"/>
<stop offset="50%" stop-color="#fbbf24"/>
<stop offset="100%" stop-color="#f59e0b"/>
</linearGradient>
<style>text{font-family:'JetBrains Mono','Fira Code',monospace}</style>
</defs>
<text x="380" y="28" text-anchor="middle" fill="#e2e8f0" font-size="13" font-weight="700">SSE / Datastar — Real-Time Push</text>
<!-- ===== Left: Client A (subscriber) ===== -->
<rect x="30" y="50" width="180" height="80" rx="10" fill="#1e1b2e" stroke="#06b6d4" stroke-width="1.5"/>
<rect x="30" y="50" width="180" height="32" rx="10" fill="url(#clientG)"/>
<text x="120" y="71" text-anchor="middle" fill="#fff" font-size="11" font-weight="700">Client A</text>
<text x="50" y="100" fill="#67e8f9" font-size="9">GET /todos</text>
<text x="50" y="114" fill="#67e8f9" font-size="9">.sse channel connected</text>
<!-- ===== Left: Client B (subscriber) ===== -->
<rect x="30" y="150" width="180" height="80" rx="10" fill="#1e1b2e" stroke="#06b6d4" stroke-width="1.5"/>
<rect x="30" y="150" width="180" height="32" rx="10" fill="url(#clientG)"/>
<text x="120" y="171" text-anchor="middle" fill="#fff" font-size="11" font-weight="700">Client B</text>
<text x="50" y="200" fill="#67e8f9" font-size="9">GET /todos</text>
<text x="50" y="214" fill="#67e8f9" font-size="9">.sse channel connected</text>
<!-- ===== Channel pill ===== -->
<rect x="280" y="110" width="200" height="44" rx="22" fill="url(#chanG)"/>
<text x="380" y="128" text-anchor="middle" fill="#1e1b2e" font-size="10" font-weight="700">Channel</text>
<text x="380" y="143" text-anchor="middle" fill="#78350f" font-size="9">todos/{{user_id}}</text>
<!-- Arrows: clients → channel (subscribe) -->
<line x1="210" y1="90" x2="270" y2="132" stroke="#06b6d4" stroke-width="1.5"/>
<polygon points="280,132 270,127 268,137" fill="#06b6d4"/>
<line x1="210" y1="190" x2="270" y2="132" stroke="#06b6d4" stroke-width="1.5"/>
<polygon points="280,132 270,127 268,137" fill="#06b6d4"/>
<text x="220" y="86" fill="#475569" font-size="8">subscribe</text>
<text x="220" y="198" fill="#475569" font-size="8">subscribe</text>
<!-- ===== Right: Server pipeline (POST) ===== -->
<rect x="30" y="270" width="700" height="110" rx="12" fill="#0f0d1a" stroke="#7c3aed" stroke-width="1.5"/>
<text x="50" y="296" fill="#c084fc" font-size="11" font-weight="700">POST /todos — another client submits a form</text>
<!-- Pipeline steps -->
<rect x="50" y="310" width="90" height="32" rx="6" fill="#1e293b" stroke="#3b82f6" stroke-width="0.75"/>
<text x="95" y="330" text-anchor="middle" fill="#93c5fd" font-size="9">param()</text>
<line x1="140" y1="326" x2="155" y2="326" stroke="#64748b" stroke-width="1"/>
<polygon points="163,326 155,322 155,330" fill="#64748b"/>
<rect x="163" y="310" width="90" height="32" rx="6" fill="#1e293b" stroke="#8b5cf6" stroke-width="0.75"/>
<text x="208" y="330" text-anchor="middle" fill="#c4b5fd" font-size="9">db()</text>
<line x1="253" y1="326" x2="268" y2="326" stroke="#64748b" stroke-width="1"/>
<polygon points="276,326 268,322 268,330" fill="#64748b"/>
<!-- datastar / sse step highlighted -->
<rect x="276" y="306" width="180" height="40" rx="6" fill="#451a03" stroke="#f59e0b" stroke-width="1.5"/>
<text x="366" y="324" text-anchor="middle" fill="#fcd34d" font-size="10" font-weight="700">datastar() / sse()</text>
<text x="366" y="339" text-anchor="middle" fill="#fbbf24" font-size="8">.channel = "todos/{{user_id}}"</text>
<!-- Arrow from datastar step up to channel -->
<path d="M366,306 L366,280 L380,280 L380,162" stroke="#f59e0b" stroke-width="2" fill="none"/>
<polygon points="380,154 375,162 385,162" fill="#f59e0b"/>
<text x="394" y="230" fill="#f59e0b" font-size="9" font-weight="600">push to channel</text>
<!-- Arrows: channel → clients (broadcast) -->
<line x1="280" y1="125" x2="218" y2="94" stroke="#f59e0b" stroke-width="1.5" stroke-dasharray="4,3"/>
<polygon points="210,90 218,89 216,99" fill="#f59e0b"/>
<line x1="280" y1="140" x2="218" y2="186" stroke="#f59e0b" stroke-width="1.5" stroke-dasharray="4,3"/>
<polygon points="210,190 218,181 216,191" fill="#f59e0b"/>
<text x="222" y="110" fill="#92400e" font-size="8">broadcast</text>
<text x="222" y="180" fill="#92400e" font-size="8">broadcast</text>
<!-- Datastar DOM update note -->
<rect x="530" y="100" width="200" height="64" rx="8" fill="#111827" stroke="#1f2937" stroke-width="1"/>
<text x="550" y="120" fill="#6b7280" font-size="9" font-weight="600">DATASTAR MODE</text>
<text x="550" y="136" fill="#94a3b8" font-size="9">.target = "todos"</text>
<text x="550" y="152" fill="#94a3b8" font-size="9">.mode = mode_prepend</text>
<!-- Footer -->
<text x="380" y="396" text-anchor="middle" fill="#64748b" font-size="10">Without .channel, events push directly to the requesting client</text>
</svg>

After

Width:  |  Height:  |  Size: 5.4 KiB

+89
View File
@@ -0,0 +1,89 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 340" width="760" height="340">
<rect width="760" height="340" fill="#09080f"/>
<defs>
<linearGradient id="dbG" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="#8b5cf6"/>
<stop offset="100%" stop-color="#7c3aed"/>
</linearGradient>
<style>text{font-family:'JetBrains Mono','Fira Code',monospace}</style>
</defs>
<text x="380" y="28" text-anchor="middle" fill="#e2e8f0" font-size="13" font-weight="700">Database Multi-Tenancy</text>
<!-- Config block -->
<rect x="40" y="50" width="320" height="86" rx="10" fill="#111827" stroke="#1f2937" stroke-width="1"/>
<text x="60" y="74" fill="#6b7280" font-size="9" font-weight="600">.databases config</text>
<text x="60" y="96" fill="#c4b5fd" font-size="10">.connect =</text>
<text x="60" y="114" fill="#fcd34d" font-size="10">"file:<tspan fill="#f59e0b" font-weight="700">{{user_id}}</tspan>_todo.db?mode=rwc"</text>
<!-- Arrow right -->
<line x1="360" y1="93" x2="398" y2="93" stroke="#64748b" stroke-width="1.5"/>
<polygon points="408,93 398,88 398,98" fill="#64748b"/>
<!-- Resolution box -->
<rect x="408" y="50" width="180" height="86" rx="10" fill="#111827" stroke="#f59e0b" stroke-width="1"/>
<text x="428" y="74" fill="#f59e0b" font-size="9" font-weight="600">RUNTIME RESOLUTION</text>
<text x="428" y="96" fill="#94a3b8" font-size="10">user_id from</text>
<text x="428" y="114" fill="#94a3b8" font-size="10">pipeline context</text>
<!-- Three request arrows going down -->
<!-- User alice -->
<rect x="40" y="170" width="180" height="36" rx="8" fill="#1e293b" stroke="#3b82f6" stroke-width="1"/>
<text x="130" y="192" text-anchor="middle" fill="#93c5fd" font-size="10">Request: user_id = alice</text>
<!-- User bob -->
<rect x="40" y="224" width="180" height="36" rx="8" fill="#1e293b" stroke="#3b82f6" stroke-width="1"/>
<text x="130" y="246" text-anchor="middle" fill="#93c5fd" font-size="10">Request: user_id = bob</text>
<!-- User carol -->
<rect x="40" y="278" width="180" height="36" rx="8" fill="#1e293b" stroke="#3b82f6" stroke-width="1"/>
<text x="130" y="300" text-anchor="middle" fill="#93c5fd" font-size="10">Request: user_id = carol</text>
<!-- Arrows to databases -->
<line x1="220" y1="188" x2="398" y2="188" stroke="#64748b" stroke-width="1"/>
<polygon points="408,188 398,183 398,193" fill="#64748b"/>
<line x1="220" y1="242" x2="398" y2="242" stroke="#64748b" stroke-width="1"/>
<polygon points="408,242 398,237 398,247" fill="#64748b"/>
<line x1="220" y1="296" x2="398" y2="296" stroke="#64748b" stroke-width="1"/>
<polygon points="408,296 398,291 398,301" fill="#64748b"/>
<!-- Database: alice -->
<rect x="408" y="170" width="220" height="36" rx="8" fill="#2d2640" stroke="#8b5cf6" stroke-width="1.5"/>
<text x="440" y="192" fill="#c4b5fd" font-size="10">file:</text>
<text x="472" y="192" fill="#fcd34d" font-size="10" font-weight="700">alice</text>
<text x="505" y="192" fill="#c4b5fd" font-size="10">_todo.db</text>
<!-- Database: bob -->
<rect x="408" y="224" width="220" height="36" rx="8" fill="#2d2640" stroke="#8b5cf6" stroke-width="1.5"/>
<text x="440" y="246" fill="#c4b5fd" font-size="10">file:</text>
<text x="472" y="246" fill="#fcd34d" font-size="10" font-weight="700">bob</text>
<text x="495" y="246" fill="#c4b5fd" font-size="10">_todo.db</text>
<!-- Database: carol -->
<rect x="408" y="278" width="220" height="36" rx="8" fill="#2d2640" stroke="#8b5cf6" stroke-width="1.5"/>
<text x="440" y="300" fill="#c4b5fd" font-size="10">file:</text>
<text x="472" y="300" fill="#fcd34d" font-size="10" font-weight="700">carol</text>
<text x="505" y="300" fill="#c4b5fd" font-size="10">_todo.db</text>
<!-- DB icons (simple cylinder shapes) -->
<g transform="translate(648, 170)">
<ellipse cx="18" cy="6" rx="18" ry="6" fill="#7c3aed" opacity="0.5"/>
<rect x="0" y="6" width="36" height="24" fill="#7c3aed" opacity="0.3"/>
<ellipse cx="18" cy="30" rx="18" ry="6" fill="#7c3aed" opacity="0.5"/>
</g>
<g transform="translate(648, 224)">
<ellipse cx="18" cy="6" rx="18" ry="6" fill="#7c3aed" opacity="0.5"/>
<rect x="0" y="6" width="36" height="24" fill="#7c3aed" opacity="0.3"/>
<ellipse cx="18" cy="30" rx="18" ry="6" fill="#7c3aed" opacity="0.5"/>
</g>
<g transform="translate(648, 278)">
<ellipse cx="18" cy="6" rx="18" ry="6" fill="#7c3aed" opacity="0.5"/>
<rect x="0" y="6" width="36" height="24" fill="#7c3aed" opacity="0.3"/>
<ellipse cx="18" cy="30" rx="18" ry="6" fill="#7c3aed" opacity="0.5"/>
</g>
<!-- Footer -->
<text x="380" y="336" text-anchor="middle" fill="#64748b" font-size="10">One config, per-user databases — Mustache interpolation in .connect at runtime</text>
</svg>

After

Width:  |  Height:  |  Size: 4.7 KiB

+82
View File
@@ -0,0 +1,82 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 300" width="760" height="300">
<rect width="760" height="300" fill="#09080f"/>
<defs>
<linearGradient id="bootG" x1="0" y1="0" x2="1" y2="0">
<stop offset="0%" stop-color="#7c3aed"/>
<stop offset="100%" stop-color="#a855f7"/>
</linearGradient>
<linearGradient id="warmG" x1="0" y1="0" x2="1" y2="0">
<stop offset="0%" stop-color="#f59e0b"/>
<stop offset="100%" stop-color="#fbbf24"/>
</linearGradient>
<linearGradient id="runG" x1="0" y1="0" x2="1" y2="0">
<stop offset="0%" stop-color="#10b981"/>
<stop offset="100%" stop-color="#34d399"/>
</linearGradient>
<style>text{font-family:'JetBrains Mono','Fira Code',monospace}</style>
</defs>
<text x="380" y="28" text-anchor="middle" fill="#e2e8f0" font-size="13" font-weight="700">Boot-Time Compilation</text>
<!-- Phase 1: config() -->
<rect x="30" y="50" width="200" height="110" rx="10" fill="#1e1b2e" stroke="#7c3aed" stroke-width="1.5"/>
<rect x="30" y="50" width="200" height="32" rx="10" fill="url(#bootG)"/>
<text x="130" y="71" text-anchor="middle" fill="#fff" font-size="11" font-weight="700">config()</text>
<text x="50" y="96" fill="#c4b5fd" font-size="9">.includes</text>
<text x="50" y="112" fill="#c4b5fd" font-size="9">.databases</text>
<text x="50" y="128" fill="#c4b5fd" font-size="9">.resources</text>
<text x="50" y="144" fill="#c4b5fd" font-size="9">.events / .errors</text>
<!-- Arrow 1 -->
<line x1="230" y1="105" x2="268" y2="105" stroke="#64748b" stroke-width="1.5"/>
<polygon points="278,105 268,100 268,110" fill="#64748b"/>
<!-- Phase 2: Precompile -->
<rect x="278" y="50" width="200" height="110" rx="10" fill="#1e1b2e" stroke="#f59e0b" stroke-width="1.5"/>
<rect x="278" y="50" width="200" height="32" rx="10" fill="url(#warmG)"/>
<text x="378" y="71" text-anchor="middle" fill="#1e1b2e" font-size="11" font-weight="700">Precompile</text>
<text x="298" y="96" fill="#fcd34d" font-size="9">Compile pipelines</text>
<text x="298" y="112" fill="#fcd34d" font-size="9">Compile templates</text>
<text x="298" y="128" fill="#fcd34d" font-size="9">Prepare SQL statements</text>
<text x="298" y="144" fill="#fcd34d" font-size="9">Build route table</text>
<!-- Arrow 2 -->
<line x1="478" y1="105" x2="516" y2="105" stroke="#64748b" stroke-width="1.5"/>
<polygon points="526,105 516,100 516,110" fill="#64748b"/>
<!-- Phase 3: Execution Graph -->
<rect x="526" y="50" width="200" height="110" rx="10" fill="#1e1b2e" stroke="#10b981" stroke-width="1.5"/>
<rect x="526" y="50" width="200" height="32" rx="10" fill="url(#runG)"/>
<text x="626" y="71" text-anchor="middle" fill="#fff" font-size="11" font-weight="700">Execution Graph</text>
<text x="546" y="96" fill="#6ee7b7" font-size="9">Pre-warmed pipelines</text>
<text x="546" y="112" fill="#6ee7b7" font-size="9">Optimized query plans</text>
<text x="546" y="128" fill="#6ee7b7" font-size="9">Compiled templates</text>
<text x="546" y="144" fill="#6ee7b7" font-size="9">Ready to serve</text>
<!-- Phase labels -->
<text x="130" y="180" text-anchor="middle" fill="#7c3aed" font-size="9" font-weight="600">RUNS ONCE AT BOOT</text>
<text x="378" y="180" text-anchor="middle" fill="#f59e0b" font-size="9" font-weight="600">RUNS ONCE AT BOOT</text>
<text x="626" y="180" text-anchor="middle" fill="#10b981" font-size="9" font-weight="600">SERVES ALL REQUESTS</text>
<!-- Runtime section -->
<rect x="30" y="200" width="696" height="76" rx="10" fill="#0f0d1a" stroke="#10b981" stroke-width="1" stroke-dasharray="5,3"/>
<text x="50" y="224" fill="#6ee7b7" font-size="10" font-weight="600">Runtime: each request executes a pre-warmed pipeline</text>
<!-- Request arrows -->
<text x="50" y="248" fill="#475569" font-size="9">req →</text>
<rect x="90" y="236" width="80" height="24" rx="4" fill="#1e293b" stroke="#10b981" stroke-width="0.75"/>
<text x="130" y="252" text-anchor="middle" fill="#6ee7b7" font-size="9">pipeline</text>
<line x1="170" y1="248" x2="184" y2="248" stroke="#10b981" stroke-width="1"/>
<polygon points="192,248 184,244 184,252" fill="#10b981"/>
<text x="200" y="252" fill="#475569" font-size="9">→ response</text>
<text x="320" y="248" fill="#475569" font-size="9">req →</text>
<rect x="360" y="236" width="80" height="24" rx="4" fill="#1e293b" stroke="#10b981" stroke-width="0.75"/>
<text x="400" y="252" text-anchor="middle" fill="#6ee7b7" font-size="9">pipeline</text>
<line x1="440" y1="248" x2="454" y2="248" stroke="#10b981" stroke-width="1"/>
<polygon points="462,248 454,244 454,252" fill="#10b981"/>
<text x="470" y="252" fill="#475569" font-size="9">→ response</text>
<!-- Footer -->
<text x="380" y="296" text-anchor="middle" fill="#64748b" font-size="10">Zero per-request compilation — config builds the graph, requests just execute it</text>
</svg>

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 504 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 796 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 756 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB