Wiki — Tutorial / Guide (step sections)
A polished knowledge-base tutorial page that walks through deploying the fictional Project Nimbus storefront to the Verdant Edge network on Aurora DB. It pairs a persistent docs sidebar and a serif body column with a vertical numbered step list — each step carrying prose, a copy-able code block, a mark-complete checkbox, and a collapsible show-solution panel. A sticky progress sidebar tracks completion with a live progress ring, clickable smooth-scroll step links, scrollspy highlighting, and a next-guide call to action.
MCP
程式碼
:root {
--bg: #ffffff;
--bg-2: #f7f8fa;
--panel: #ffffff;
--ink: #1a1a1f;
--ink-2: #3a3a42;
--muted: #6b7280;
--line: rgba(20, 20, 30, 0.10);
--line-2: rgba(20, 20, 30, 0.18);
--link: #2563eb;
--link-hover: #1d4ed8;
--accent: #2563eb;
--note: #2563eb;
--tip: #16a34a;
--warn: #d97706;
--danger: #dc2626;
--code-bg: #f4f4f6;
--kbd-bg: #eceef2;
--r-sm: 6px;
--r-md: 10px;
--r-lg: 14px;
--sans: "Inter", system-ui, -apple-system, sans-serif;
--serif: "Source Serif 4", Georgia, serif;
--mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
--shadow-sm: 0 1px 2px rgba(20, 20, 30, 0.05);
--shadow-md: 0 4px 16px rgba(20, 20, 30, 0.08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
margin: 0;
font-family: var(--sans);
background: var(--bg);
color: var(--ink);
line-height: 1.55;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
@media (prefers-reduced-motion: reduce) {
html { scroll-behavior: auto; }
* { transition: none !important; }
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
border-radius: var(--r-sm);
}
code, pre, kbd { font-family: var(--mono); }
.skip-link {
position: absolute;
left: -999px;
top: 8px;
background: var(--ink);
color: #fff;
padding: 8px 14px;
border-radius: var(--r-sm);
z-index: 90;
}
.skip-link:focus { left: 8px; }
/* ───────── Layout ───────── */
.layout {
display: grid;
grid-template-columns: 248px minmax(0, 1fr) 268px;
max-width: 1440px;
margin: 0 auto;
align-items: start;
}
/* ───────── Sidebar nav ───────── */
.sidebar {
position: sticky;
top: 0;
align-self: start;
height: 100vh;
overflow-y: auto;
padding: 22px 18px 40px;
border-right: 1px solid var(--line);
background: var(--bg-2);
}
.brand {
display: flex;
align-items: center;
gap: 9px;
padding: 4px 8px 18px;
font-weight: 700;
font-size: 15px;
}
.brand-mark { color: var(--accent); font-size: 18px; }
.brand-name em { font-style: normal; color: var(--muted); font-weight: 600; }
.nav-group { margin-bottom: 22px; }
.nav-head {
margin: 0 0 6px;
padding: 0 8px;
font-size: 11px;
font-weight: 700;
letter-spacing: 0.06em;
text-transform: uppercase;
color: var(--muted);
}
.nav-link {
display: block;
padding: 6px 10px;
border-radius: var(--r-sm);
color: var(--ink-2);
font-size: 13.5px;
font-weight: 500;
}
.nav-link:hover { background: rgba(20, 20, 30, 0.05); color: var(--ink); text-decoration: none; }
.nav-link.is-current {
background: rgba(37, 99, 235, 0.10);
color: var(--link-hover);
font-weight: 600;
box-shadow: inset 2px 0 0 var(--accent);
}
/* ───────── Content ───────── */
.content {
min-width: 0;
padding: 30px clamp(20px, 4vw, 56px) 80px;
}
.crumbs {
display: flex;
flex-wrap: wrap;
gap: 8px;
align-items: center;
font-size: 12.5px;
color: var(--muted);
margin-bottom: 22px;
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--link); }
.crumbs span[aria-current] { color: var(--ink-2); font-weight: 600; }
.guide-head { max-width: 760px; }
.eyebrow {
margin: 0 0 6px;
font-size: 12px;
font-weight: 700;
letter-spacing: 0.08em;
text-transform: uppercase;
color: var(--accent);
}
.guide-head h1 {
margin: 0 0 14px;
font-size: clamp(28px, 4vw, 40px);
line-height: 1.12;
letter-spacing: -0.02em;
font-weight: 800;
}
.lede {
font-family: var(--serif);
font-size: 18px;
line-height: 1.65;
color: var(--ink-2);
margin: 0 0 22px;
}
.meta-pills {
display: flex;
flex-wrap: wrap;
gap: 10px;
list-style: none;
margin: 0 0 26px;
padding: 0;
}
.meta-pills li {
display: flex;
align-items: center;
gap: 7px;
padding: 6px 12px;
border: 1px solid var(--line);
border-radius: 999px;
background: var(--panel);
box-shadow: var(--shadow-sm);
font-size: 12.5px;
}
.pill-k { color: var(--muted); font-weight: 500; }
.pill-v { font-weight: 700; color: var(--ink); }
.pill-med { color: var(--warn); }
/* ───────── Callouts ───────── */
.callout {
border: 1px solid var(--line);
border-left-width: 4px;
border-radius: var(--r-md);
padding: 14px 16px;
margin: 22px 0;
background: var(--bg-2);
max-width: 760px;
}
.callout-title {
margin: 0 0 6px;
font-weight: 700;
font-size: 13.5px;
display: flex;
align-items: center;
gap: 8px;
}
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout ul { margin: 0; padding-left: 20px; line-height: 1.7; font-size: 14px; color: var(--ink-2); }
.callout-icon {
display: inline-grid;
place-items: center;
width: 18px;
height: 18px;
border-radius: 50%;
font-size: 11px;
color: #fff;
}
.callout-note { border-left-color: var(--note); }
.callout-note .callout-icon { background: var(--note); }
.callout-tip { border-left-color: var(--tip); }
.callout-tip .callout-icon { background: var(--tip); }
.callout-warn { border-left-color: var(--warn); }
.callout-warn .callout-icon { background: var(--warn); }
/* ───────── Steps ───────── */
.steps {
list-style: none;
margin: 36px 0 0;
padding: 0;
max-width: 820px;
}
.step {
display: grid;
grid-template-columns: 44px minmax(0, 1fr);
gap: 18px;
padding-bottom: 12px;
scroll-margin-top: 24px;
}
.step-rail {
display: flex;
flex-direction: column;
align-items: center;
}
.step-num {
display: grid;
place-items: center;
width: 36px;
height: 36px;
border-radius: 50%;
border: 1.5px solid var(--line-2);
background: var(--panel);
font-weight: 800;
font-size: 15px;
color: var(--ink-2);
transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.step-rail::after {
content: "";
flex: 1;
width: 2px;
margin-top: 6px;
background: var(--line);
}
.step:last-child .step-rail::after { display: none; }
.step.is-done .step-num {
background: var(--tip);
border-color: var(--tip);
color: #fff;
}
.step.is-done .step-num::after { content: "✓"; }
.step.is-done .step-num { font-size: 0; }
.step.is-done .step-num::after { font-size: 16px; }
.step-body {
padding-bottom: 24px;
min-width: 0;
}
.step-head {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 16px;
flex-wrap: wrap;
}
.step-body h2 {
margin: 4px 0 10px;
font-size: 21px;
font-weight: 700;
letter-spacing: -0.01em;
}
.step-body p {
font-family: var(--serif);
font-size: 16px;
line-height: 1.7;
color: var(--ink-2);
margin: 0 0 14px;
max-width: 680px;
}
.step-hint { font-size: 14.5px; color: var(--muted); }
.step-check {
display: inline-flex;
align-items: center;
gap: 8px;
flex-shrink: 0;
padding: 6px 12px;
border: 1px solid var(--line);
border-radius: 999px;
background: var(--panel);
font-size: 13px;
font-weight: 600;
color: var(--ink-2);
cursor: pointer;
user-select: none;
transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.step-check:hover { background: var(--bg-2); border-color: var(--line-2); }
.step-check input { width: 16px; height: 16px; accent-color: var(--tip); cursor: pointer; }
.step.is-done .step-check {
background: rgba(22, 163, 74, 0.10);
border-color: rgba(22, 163, 74, 0.35);
color: var(--tip);
}
/* ───────── Code blocks ───────── */
.code {
border: 1px solid var(--line);
border-radius: var(--r-md);
overflow: hidden;
margin: 0 0 16px;
background: var(--code-bg);
box-shadow: var(--shadow-sm);
}
.code-bar {
display: flex;
align-items: center;
justify-content: space-between;
padding: 7px 12px;
background: #ececf0;
border-bottom: 1px solid var(--line);
}
.code-lang {
font-family: var(--mono);
font-size: 11.5px;
font-weight: 600;
color: var(--muted);
letter-spacing: 0.02em;
}
.copy {
font-family: var(--sans);
font-size: 12px;
font-weight: 600;
color: var(--ink-2);
background: var(--panel);
border: 1px solid var(--line);
border-radius: var(--r-sm);
padding: 4px 11px;
cursor: pointer;
transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.copy:hover { background: var(--bg-2); border-color: var(--line-2); }
.copy.copied { background: var(--tip); border-color: var(--tip); color: #fff; }
.code pre {
margin: 0;
padding: 14px 16px;
overflow-x: auto;
font-size: 13px;
line-height: 1.7;
color: #24252c;
}
p code, li code, .step-hint code {
font-family: var(--mono);
font-size: 0.86em;
background: var(--code-bg);
border: 1px solid var(--line);
border-radius: var(--r-sm);
padding: 1px 5px;
}
kbd {
font-family: var(--mono);
font-size: 0.82em;
background: var(--kbd-bg);
border: 1px solid var(--line-2);
border-bottom-width: 2px;
border-radius: var(--r-sm);
padding: 1px 6px;
color: var(--ink);
}
/* ───────── Solution disclosure ───────── */
.solution {
border: 1px solid var(--line);
border-radius: var(--r-md);
background: var(--bg-2);
margin: 0 0 8px;
max-width: 760px;
}
.solution summary {
cursor: pointer;
padding: 11px 14px;
font-size: 13.5px;
font-weight: 600;
color: var(--link);
list-style: none;
display: flex;
align-items: center;
gap: 8px;
}
.solution summary::-webkit-details-marker { display: none; }
.solution summary::before {
content: "▸";
font-size: 11px;
color: var(--muted);
transition: transform 0.18s;
}
.solution[open] summary::before { transform: rotate(90deg); }
.solution summary:hover { color: var(--link-hover); }
.solution[open] summary { border-bottom: 1px solid var(--line); }
.solution > p { padding: 12px 14px 0; margin: 0 0 12px; font-family: var(--serif); font-size: 15px; line-height: 1.65; color: var(--ink-2); }
.solution > .code { margin: 0 14px 14px; }
/* ───────── Next CTA ───────── */
.next-cta {
display: grid;
grid-template-columns: 1fr auto;
grid-template-areas: "k arrow" "t arrow" "d arrow";
column-gap: 18px;
align-items: center;
max-width: 760px;
margin: 40px 0 0;
padding: 22px 24px;
border: 1px solid var(--line);
border-radius: var(--r-lg);
background: linear-gradient(180deg, var(--bg-2), var(--panel));
box-shadow: var(--shadow-sm);
transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.next-cta:hover {
text-decoration: none;
transform: translateY(-2px);
box-shadow: var(--shadow-md);
border-color: var(--line-2);
}
.next-k { grid-area: k; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.next-t { grid-area: t; font-size: 19px; font-weight: 700; color: var(--ink); margin: 2px 0; }
.next-d { grid-area: d; font-size: 14px; color: var(--muted); font-weight: 400; }
.next-arrow {
grid-area: arrow;
font-size: 24px;
color: var(--accent);
transition: transform 0.2s;
}
.next-cta:hover .next-arrow { transform: translateX(4px); }
/* ───────── Progress sidebar ───────── */
.progress {
position: sticky;
top: 0;
align-self: start;
height: 100vh;
overflow-y: auto;
padding: 30px 20px;
}
.progress-card {
border: 1px solid var(--line);
border-radius: var(--r-lg);
background: var(--panel);
box-shadow: var(--shadow-sm);
padding: 18px 16px;
}
.ring-wrap { position: relative; width: 132px; margin: 4px auto 16px; }
.ring { width: 132px; height: 132px; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--line); stroke-width: 9; }
.ring-fill {
fill: none;
stroke: var(--tip);
stroke-width: 9;
stroke-linecap: round;
stroke-dasharray: 326.7;
stroke-dashoffset: 326.7;
transition: stroke-dashoffset 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.ring-text {
position: absolute;
inset: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
line-height: 1.1;
}
.ring-text strong { font-size: 26px; font-weight: 800; }
.ring-text span { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.progress-title {
margin: 0 0 8px;
font-size: 11px;
font-weight: 700;
letter-spacing: 0.06em;
text-transform: uppercase;
color: var(--muted);
}
.progress-list {
list-style: none;
margin: 0 0 14px;
padding: 0;
counter-reset: pl;
}
.progress-list li { counter-increment: pl; }
.progress-list a {
display: flex;
align-items: center;
gap: 9px;
padding: 6px 8px;
border-radius: var(--r-sm);
font-size: 13px;
font-weight: 500;
color: var(--ink-2);
line-height: 1.3;
}
.progress-list a:hover { background: var(--bg-2); text-decoration: none; color: var(--ink); }
.progress-list a.is-active { background: rgba(37, 99, 235, 0.08); color: var(--link-hover); font-weight: 600; }
.dot {
flex-shrink: 0;
width: 16px;
height: 16px;
border-radius: 50%;
border: 1.5px solid var(--line-2);
display: grid;
place-items: center;
font-size: 10px;
color: transparent;
transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.progress-list a.is-complete .dot {
background: var(--tip);
border-color: var(--tip);
color: #fff;
}
.progress-list a.is-complete .dot::after { content: "✓"; }
.progress-reset {
width: 100%;
font-family: var(--sans);
font-size: 12.5px;
font-weight: 600;
color: var(--muted);
background: transparent;
border: 1px solid var(--line);
border-radius: var(--r-sm);
padding: 7px;
cursor: pointer;
transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.progress-reset:hover { background: var(--bg-2); color: var(--danger); border-color: var(--line-2); }
/* ───────── Nav toggle / drawer ───────── */
.nav-toggle {
display: none;
position: fixed;
top: 14px;
left: 14px;
z-index: 80;
width: 42px;
height: 42px;
border: 1px solid var(--line);
border-radius: var(--r-md);
background: var(--panel);
box-shadow: var(--shadow-md);
cursor: pointer;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 4px;
}
.nav-toggle span {
display: block;
width: 18px;
height: 2px;
background: var(--ink);
border-radius: 2px;
transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.sidebar-scrim {
position: fixed;
inset: 0;
z-index: 60;
background: rgba(15, 15, 25, 0.4);
}
/* ───────── Toast ───────── */
.toast {
position: fixed;
bottom: 22px;
left: 50%;
transform: translateX(-50%) translateY(20px);
background: var(--ink);
color: #fff;
font-size: 13.5px;
font-weight: 500;
padding: 10px 18px;
border-radius: 999px;
box-shadow: var(--shadow-md);
opacity: 0;
pointer-events: none;
transition: opacity 0.25s, transform 0.25s;
z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
/* ───────── Responsive ───────── */
@media (max-width: 1080px) {
.layout { grid-template-columns: 220px minmax(0, 1fr); }
.progress {
position: static;
height: auto;
grid-column: 2;
padding: 0 clamp(20px, 4vw, 56px) 40px;
}
.progress-card { max-width: 760px; }
.ring-wrap { margin: 4px 0 16px; }
}
@media (max-width: 820px) {
.layout { grid-template-columns: 1fr; }
.nav-toggle { display: flex; }
.sidebar {
position: fixed;
top: 0;
left: 0;
z-index: 70;
width: 280px;
max-width: 84vw;
transform: translateX(-100%);
transition: transform 0.25s ease;
box-shadow: var(--shadow-md);
}
.sidebar.open { transform: translateX(0); }
.content { padding-top: 68px; }
.progress { grid-column: 1; padding-left: clamp(20px, 4vw, 56px); }
}
@media (max-width: 520px) {
.guide-head h1 { font-size: 26px; }
.lede { font-size: 16px; }
.step { grid-template-columns: 34px minmax(0, 1fr); gap: 12px; }
.step-num { width: 30px; height: 30px; font-size: 13px; }
.step-head { flex-direction: column; gap: 8px; }
.step-check { align-self: flex-start; }
.next-cta { grid-template-columns: 1fr; grid-template-areas: "k" "t" "d" "arrow"; }
.next-arrow { justify-self: start; margin-top: 8px; }
.meta-pills li { font-size: 12px; }
.ring-wrap { margin: 4px auto 16px; }
}(function () {
"use strict";
var TOTAL = 7;
var RING_CIRCUMFERENCE = 2 * Math.PI * 52; // r=52 → ~326.7
var ringFill = document.getElementById("ringFill");
var ringPct = document.getElementById("ringPct");
var ringCount = document.getElementById("ringCount");
var progressList = document.getElementById("progressList");
var resetBtn = document.getElementById("resetBtn");
// Track completion state per step (1-indexed).
var done = {};
/* ───────── Toast helper ───────── */
var toastEl = document.getElementById("toast");
var toastTimer = null;
function toast(msg) {
if (!toastEl) return;
toastEl.textContent = msg;
toastEl.classList.add("show");
clearTimeout(toastTimer);
toastTimer = setTimeout(function () {
toastEl.classList.remove("show");
}, 1800);
}
/* ───────── Progress ring + sidebar sync ───────── */
if (ringFill) {
ringFill.style.strokeDasharray = RING_CIRCUMFERENCE.toFixed(1);
ringFill.style.strokeDashoffset = RING_CIRCUMFERENCE.toFixed(1);
}
function countDone() {
var n = 0;
for (var k in done) {
if (done[k]) n++;
}
return n;
}
function render() {
var n = countDone();
var pct = Math.round((n / TOTAL) * 100);
if (ringFill) {
var offset = RING_CIRCUMFERENCE * (1 - n / TOTAL);
ringFill.style.strokeDashoffset = offset.toFixed(1);
}
if (ringPct) ringPct.textContent = pct + "%";
if (ringCount) ringCount.textContent = n + " / " + TOTAL;
// Sync sidebar dots.
var links = progressList ? progressList.querySelectorAll("a[data-jump]") : [];
links.forEach(function (a) {
var id = a.getAttribute("data-jump");
a.classList.toggle("is-complete", !!done[id]);
});
}
function setStep(id, value, opts) {
opts = opts || {};
done[id] = value;
var step = document.getElementById("step-" + id);
if (step) step.classList.toggle("is-done", value);
var cb = document.querySelector('.step-done[data-target="' + id + '"]');
if (cb) cb.checked = value;
render();
if (!opts.silent) {
if (value) {
toast(
countDone() === TOTAL
? "All steps complete — nice work!"
: "Step " + id + " marked complete"
);
} else {
toast("Step " + id + " reopened");
}
}
}
/* ───────── Per-step checkbox toggles ───────── */
document.querySelectorAll(".step-done").forEach(function (cb) {
cb.addEventListener("change", function () {
setStep(cb.getAttribute("data-target"), cb.checked);
});
});
/* ───────── Sidebar smooth-scroll + active highlight ───────── */
if (progressList) {
progressList.addEventListener("click", function (e) {
var a = e.target.closest("a[data-jump]");
if (!a) return;
e.preventDefault();
var id = a.getAttribute("data-jump");
var target = document.getElementById("step-" + id);
if (!target) return;
target.scrollIntoView({
behavior: prefersReduced() ? "auto" : "smooth",
block: "start",
});
var heading = target.querySelector("h2");
if (heading) {
heading.setAttribute("tabindex", "-1");
heading.focus({ preventScroll: true });
}
history.replaceState(null, "", "#step-" + id);
});
}
function prefersReduced() {
return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
}
/* ───────── Scrollspy: highlight current step in sidebar ───────── */
var steps = Array.prototype.slice.call(document.querySelectorAll(".step"));
if ("IntersectionObserver" in window && steps.length) {
var io = new IntersectionObserver(
function (entries) {
entries.forEach(function (entry) {
if (!entry.isIntersecting) return;
var id = entry.target.getAttribute("data-step");
var links = progressList
? progressList.querySelectorAll("a[data-jump]")
: [];
links.forEach(function (a) {
a.classList.toggle(
"is-active",
a.getAttribute("data-jump") === id
);
});
});
},
{ rootMargin: "-30% 0px -55% 0px", threshold: 0 }
);
steps.forEach(function (s) {
io.observe(s);
});
}
/* ───────── Code copy ───────── */
document.querySelectorAll(".copy").forEach(function (btn) {
btn.addEventListener("click", function () {
var block = btn.closest(".code");
var pre = block ? block.querySelector("pre") : null;
if (!pre) return;
var text = pre.innerText;
var onDone = function () {
var original = btn.textContent;
btn.textContent = "Copied!";
btn.classList.add("copied");
toast("Copied to clipboard");
setTimeout(function () {
btn.textContent = original;
btn.classList.remove("copied");
}, 1400);
};
if (navigator.clipboard && navigator.clipboard.writeText) {
navigator.clipboard.writeText(text).then(onDone, fallbackCopy);
} else {
fallbackCopy();
}
function fallbackCopy() {
var ta = document.createElement("textarea");
ta.value = text;
ta.setAttribute("readonly", "");
ta.style.position = "absolute";
ta.style.left = "-9999px";
document.body.appendChild(ta);
ta.select();
try {
document.execCommand("copy");
onDone();
} catch (err) {
toast("Copy failed — select and copy manually");
}
document.body.removeChild(ta);
}
});
});
/* ───────── Reset progress ───────── */
if (resetBtn) {
resetBtn.addEventListener("click", function () {
for (var i = 1; i <= TOTAL; i++) {
setStep(String(i), false, { silent: true });
}
render();
toast("Progress reset");
});
}
/* ───────── Mobile nav drawer ───────── */
var navToggle = document.getElementById("navToggle");
var sidebar = document.getElementById("sidebar");
var scrim = document.getElementById("scrim");
function openNav() {
sidebar.classList.add("open");
navToggle.setAttribute("aria-expanded", "true");
navToggle.setAttribute("aria-label", "Close navigation");
if (scrim) scrim.hidden = false;
}
function closeNav() {
sidebar.classList.remove("open");
navToggle.setAttribute("aria-expanded", "false");
navToggle.setAttribute("aria-label", "Open navigation");
if (scrim) scrim.hidden = true;
}
if (navToggle && sidebar) {
navToggle.addEventListener("click", function () {
if (sidebar.classList.contains("open")) closeNav();
else openNav();
});
if (scrim) scrim.addEventListener("click", closeNav);
sidebar.addEventListener("click", function (e) {
if (e.target.closest(".nav-link") && window.innerWidth <= 820) closeNav();
});
document.addEventListener("keydown", function (e) {
if (e.key === "Escape" && sidebar.classList.contains("open")) closeNav();
});
}
/* ───────── Next CTA (demo) ───────── */
var nextCta = document.getElementById("nextCta");
if (nextCta) {
nextCta.addEventListener("click", function (e) {
e.preventDefault();
toast("Loading next guide: Backups & recovery…");
});
}
render();
})();<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Deploying Project Nimbus to the Edge — Aurora DB Docs</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Source+Serif+4:opsz,[email protected],400;8..60,500;8..60,600&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="style.css" />
</head>
<body>
<a class="skip-link" href="#guide">Skip to guide</a>
<button class="nav-toggle" id="navToggle" aria-expanded="false" aria-controls="sidebar" aria-label="Open navigation">
<span></span><span></span><span></span>
</button>
<div class="layout">
<!-- ───────── Left sidebar nav ───────── -->
<nav class="sidebar" id="sidebar" aria-label="Documentation">
<div class="brand">
<span class="brand-mark" aria-hidden="true">◈</span>
<span class="brand-name">Aurora DB <em>Docs</em></span>
</div>
<div class="nav-group">
<p class="nav-head">Get started</p>
<a href="#" class="nav-link">Overview</a>
<a href="#" class="nav-link">Installation</a>
<a href="#" class="nav-link">Quickstart</a>
</div>
<div class="nav-group">
<p class="nav-head">Guides</p>
<a href="#" class="nav-link">Schema design</a>
<a href="#" class="nav-link">Replication topology</a>
<a href="#guide" class="nav-link is-current" aria-current="page">Deploy to the Edge</a>
<a href="#" class="nav-link">Backups & recovery</a>
</div>
<div class="nav-group">
<p class="nav-head">Reference</p>
<a href="#" class="nav-link">CLI commands</a>
<a href="#" class="nav-link">Configuration</a>
<a href="#" class="nav-link">REST API</a>
</div>
</nav>
<div class="sidebar-scrim" id="scrim" hidden></div>
<!-- ───────── Main article ───────── -->
<main class="content" id="guide">
<nav class="crumbs" aria-label="Breadcrumb">
<a href="#">Docs</a><span aria-hidden="true">/</span>
<a href="#">Guides</a><span aria-hidden="true">/</span>
<span aria-current="page">Deploy to the Edge</span>
</nav>
<header class="guide-head">
<p class="eyebrow">Tutorial</p>
<h1>Deploying Project Nimbus to the Edge</h1>
<p class="lede">
Ship a read-replica of your <strong>Aurora DB</strong> cluster to the
<em>Verdant Edge</em> network so the fictional <strong>Project Nimbus</strong> storefront
serves catalog queries from a region close to every customer. By the end you will have a
live edge endpoint, a tuned cache, and a smoke-tested failover.
</p>
<ul class="meta-pills" aria-label="Guide details">
<li><span class="pill-k">Time</span><span class="pill-v">~25 min</span></li>
<li><span class="pill-k">Difficulty</span><span class="pill-v pill-med">Intermediate</span></li>
<li><span class="pill-k">Steps</span><span class="pill-v" id="stepTotalPill">7</span></li>
<li><span class="pill-k">Updated</span><span class="pill-v">Jun 8, 2026</span></li>
</ul>
<div class="callout callout-note" role="note">
<p class="callout-title"><span class="callout-icon" aria-hidden="true">✦</span> Prerequisites</p>
<ul>
<li>An Aurora DB cluster on <code>v4.2+</code> with the primary in a healthy state.</li>
<li>The <code>aurora</code> CLI installed and logged in (<kbd>aurora login</kbd>).</li>
<li>A Verdant Edge account with at least one <strong>deploy token</strong>.</li>
<li>Roughly <code>2 GB</code> of free disk on the build host for the snapshot.</li>
</ul>
</div>
</header>
<!-- ───────── Steps ───────── -->
<ol class="steps" id="steps">
<li class="step" id="step-1" data-step="1">
<div class="step-rail" aria-hidden="true"><span class="step-num">1</span></div>
<div class="step-body">
<div class="step-head">
<h2>Provision a read-replica</h2>
<label class="step-check">
<input type="checkbox" class="step-done" data-target="1" />
<span>Mark complete</span>
</label>
</div>
<p>
Start by carving off a <em>read-only</em> replica from the primary. Replicas stream the
write-ahead log and never accept writes, which makes them safe to push far from the
primary region. Give the replica a recognizable label so it shows up clearly in the
topology view.
</p>
<div class="code" data-lang="bash">
<div class="code-bar"><span class="code-lang">bash</span><button class="copy" type="button">Copy</button></div>
<pre><code>aurora replica create \
--cluster nimbus-prod \
--label edge-verdant-eu \
--mode read-only \
--lag-budget 250ms</code></pre>
</div>
<p class="step-hint">The command prints a replica ID like <code>rpl_9f3ac21</code>. Keep it handy — later steps reference it.</p>
</div>
</li>
<li class="step" id="step-2" data-step="2">
<div class="step-rail" aria-hidden="true"><span class="step-num">2</span></div>
<div class="step-body">
<div class="step-head">
<h2>Snapshot and seed the edge node</h2>
<label class="step-check">
<input type="checkbox" class="step-done" data-target="2" />
<span>Mark complete</span>
</label>
</div>
<p>
The edge node needs a consistent base image before it can tail the log. Take a
point-in-time snapshot, then hand the snapshot URI to the seed command. Aurora verifies
the checksum on arrival, so a corrupted transfer fails loudly instead of silently.
</p>
<div class="code" data-lang="bash">
<div class="code-bar"><span class="code-lang">bash</span><button class="copy" type="button">Copy</button></div>
<pre><code>aurora snapshot create rpl_9f3ac21 --out s3://nimbus-snaps/edge-eu.arz
aurora edge seed \
--from s3://nimbus-snaps/edge-eu.arz \
--region verdant-eu-west \
--verify-checksum</code></pre>
</div>
<details class="solution">
<summary>Show solution — snapshot is stuck at <code>pending</code></summary>
<p>
A snapshot that stays <code>pending</code> usually means an open long-running
transaction is pinning the WAL. List them and cancel the offender, then re-run the
snapshot:
</p>
<div class="code" data-lang="bash">
<div class="code-bar"><span class="code-lang">bash</span><button class="copy" type="button">Copy</button></div>
<pre><code>aurora tx list --cluster nimbus-prod --older-than 5m
aurora tx cancel tx_4471</code></pre>
</div>
</details>
</div>
</li>
<li class="step" id="step-3" data-step="3">
<div class="step-rail" aria-hidden="true"><span class="step-num">3</span></div>
<div class="step-body">
<div class="step-head">
<h2>Configure the edge cache</h2>
<label class="step-check">
<input type="checkbox" class="step-done" data-target="3" />
<span>Mark complete</span>
</label>
</div>
<p>
Catalog reads are bursty and highly repetitive, so a small in-memory cache pays for
itself. Create an <code>edge.toml</code> alongside the node and declare which query
shapes are cacheable. Anything not listed falls through to the replica.
</p>
<div class="code" data-lang="toml">
<div class="code-bar"><span class="code-lang">edge.toml</span><button class="copy" type="button">Copy</button></div>
<pre><code>[cache]
size_mb = 512
ttl = "30s"
stale_ok = true
[[cache.rules]]
match = "catalog.product.read"
key = "{sku}:{locale}"
ttl = "120s"</code></pre>
</div>
<div class="callout callout-tip" role="note">
<p class="callout-title"><span class="callout-icon" aria-hidden="true">✓</span> Tip</p>
<p>Set <code>stale_ok = true</code> so the edge serves slightly stale data during a primary blip instead of erroring — almost always the right call for a storefront.</p>
</div>
</div>
</li>
<li class="step" id="step-4" data-step="4">
<div class="step-rail" aria-hidden="true"><span class="step-num">4</span></div>
<div class="step-body">
<div class="step-head">
<h2>Deploy the edge endpoint</h2>
<label class="step-check">
<input type="checkbox" class="step-done" data-target="4" />
<span>Mark complete</span>
</label>
</div>
<p>
With the node seeded and the cache configured, push the deploy. The CLI uploads the
config, rolls the node out region by region, and returns a public endpoint once the
first region reports healthy.
</p>
<div class="code" data-lang="bash">
<div class="code-bar"><span class="code-lang">bash</span><button class="copy" type="button">Copy</button></div>
<pre><code>aurora edge deploy \
--config edge.toml \
--replica rpl_9f3ac21 \
--token "$VERDANT_DEPLOY_TOKEN"</code></pre>
</div>
<p class="step-hint">Output ends with your endpoint: <code>https://eu.edge.nimbus.aurora.dev</code>.</p>
</div>
</li>
<li class="step" id="step-5" data-step="5">
<div class="step-rail" aria-hidden="true"><span class="step-num">5</span></div>
<div class="step-body">
<div class="step-head">
<h2>Point the app at the edge</h2>
<label class="step-check">
<input type="checkbox" class="step-done" data-target="5" />
<span>Mark complete</span>
</label>
</div>
<p>
Route only <em>read</em> traffic to the edge while writes continue to the primary. The
Aurora client does this automatically when you pass a split connection string — reads
go to the nearest healthy edge, writes to <code>primary</code>.
</p>
<div class="code" data-lang="js">
<div class="code-bar"><span class="code-lang">app.config.js</span><button class="copy" type="button">Copy</button></div>
<pre><code>export const db = createClient({
primary: "aurora://primary.nimbus.aurora.dev",
reads: "aurora://eu.edge.nimbus.aurora.dev",
policy: "nearest-healthy",
});</code></pre>
</div>
<details class="solution">
<summary>Show solution — reads still hitting the primary</summary>
<p>
If latency hasn't dropped, the client may be ignoring the <code>reads</code> route
because the edge failed its health probe. Confirm the route and force a re-probe:
</p>
<div class="code" data-lang="bash">
<div class="code-bar"><span class="code-lang">bash</span><button class="copy" type="button">Copy</button></div>
<pre><code>aurora edge status eu.edge.nimbus.aurora.dev
aurora edge probe --force eu.edge.nimbus.aurora.dev</code></pre>
</div>
</details>
</div>
</li>
<li class="step" id="step-6" data-step="6">
<div class="step-rail" aria-hidden="true"><span class="step-num">6</span></div>
<div class="step-body">
<div class="step-head">
<h2>Verify replication lag</h2>
<label class="step-check">
<input type="checkbox" class="step-done" data-target="6" />
<span>Mark complete</span>
</label>
</div>
<p>
Before you trust the edge with live traffic, confirm it is keeping up. Watch the lag
metric for a minute or two under real load — it should sit comfortably under the
<code>250ms</code> budget you set in Step 1.
</p>
<div class="code" data-lang="bash">
<div class="code-bar"><span class="code-lang">bash</span><button class="copy" type="button">Copy</button></div>
<pre><code>aurora edge watch eu.edge.nimbus.aurora.dev --metric lag --interval 2s</code></pre>
</div>
<div class="callout callout-warn" role="note">
<p class="callout-title"><span class="callout-icon" aria-hidden="true">!</span> Watch out</p>
<p>Sustained lag above the budget means the link is saturated. Lower the cache TTL or move the edge to a region with a shorter network path to the primary.</p>
</div>
</div>
</li>
<li class="step" id="step-7" data-step="7">
<div class="step-rail" aria-hidden="true"><span class="step-num">7</span></div>
<div class="step-body">
<div class="step-head">
<h2>Run a failover smoke test</h2>
<label class="step-check">
<input type="checkbox" class="step-done" data-target="7" />
<span>Mark complete</span>
</label>
</div>
<p>
Finally, prove the safety net works. Drain the edge node and confirm the client falls
back to the primary with zero failed reads. Aurora's <code>drain</code> is graceful —
in-flight queries finish before the node bows out.
</p>
<div class="code" data-lang="bash">
<div class="code-bar"><span class="code-lang">bash</span><button class="copy" type="button">Copy</button></div>
<pre><code>aurora edge drain eu.edge.nimbus.aurora.dev --grace 10s
aurora edge resume eu.edge.nimbus.aurora.dev</code></pre>
</div>
<p>
If reads stay green throughout the drain, your edge deployment is production-ready.
Repeat Steps 1–4 to add more regions to the <em>Verdant Edge</em> fleet.
</p>
</div>
</li>
</ol>
<!-- ───────── Next guide CTA ───────── -->
<a class="next-cta" href="#" id="nextCta">
<span class="next-k">Next guide</span>
<span class="next-t">Backups & point-in-time recovery</span>
<span class="next-d">Schedule automated snapshots and restore Project Nimbus to any second in the last 35 days.</span>
<span class="next-arrow" aria-hidden="true">→</span>
</a>
</main>
<!-- ───────── Sticky progress sidebar ───────── -->
<aside class="progress" aria-label="Your progress">
<div class="progress-card">
<div class="ring-wrap">
<svg class="ring" viewBox="0 0 120 120" role="img" aria-labelledby="ringLabel">
<title id="ringLabel">Guide completion</title>
<circle class="ring-track" cx="60" cy="60" r="52" />
<circle class="ring-fill" id="ringFill" cx="60" cy="60" r="52" />
</svg>
<div class="ring-text">
<strong id="ringPct">0%</strong>
<span id="ringCount">0 / 7</span>
</div>
</div>
<p class="progress-title">Your progress</p>
<ol class="progress-list" id="progressList">
<li><a href="#step-1" data-jump="1"><span class="dot"></span>Provision a read-replica</a></li>
<li><a href="#step-2" data-jump="2"><span class="dot"></span>Snapshot & seed</a></li>
<li><a href="#step-3" data-jump="3"><span class="dot"></span>Configure the cache</a></li>
<li><a href="#step-4" data-jump="4"><span class="dot"></span>Deploy the endpoint</a></li>
<li><a href="#step-5" data-jump="5"><span class="dot"></span>Point the app</a></li>
<li><a href="#step-6" data-jump="6"><span class="dot"></span>Verify lag</a></li>
<li><a href="#step-7" data-jump="7"><span class="dot"></span>Failover smoke test</a></li>
</ol>
<button class="progress-reset" id="resetBtn" type="button">Reset progress</button>
</div>
</aside>
</div>
<div class="toast" id="toast" role="status" aria-live="polite"></div>
<script src="script.js"></script>
</body>
</html>Tutorial / Guide (step sections)
A complete step-by-step guide view for Aurora DB, themed around deploying the fictional Project Nimbus storefront to the Verdant Edge network. The page opens with a header carrying the title, estimated time, difficulty, step count, and a prerequisites callout, then runs through seven numbered steps. Each step has a heading, serif body prose, a code block with a one-click copy button, and a mark complete checkbox; several steps also include a collapsible show solution panel for the common failure case.
A sticky right-rail progress card tracks how far you have gotten: a progress ring and a 3 / 7-style
counter update live as you tick steps off, while the step list below doubles as a clickable index that
smooth-scrolls to any step and moves focus there. An IntersectionObserver scrollspy highlights the
step you are currently reading, completed steps get a green check, and a reset button clears the
slate. The guide closes with a next guide call-to-action card.
Everything is vanilla — no frameworks, no build step. The left docs nav collapses into a drawer below
820px, a toast() helper confirms actions, code copy falls back to execCommand when the clipboard
API is unavailable, and reduced-motion preferences are respected throughout.
Illustrative UI only — fictional articles, products, and data.