Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Architecture

System Diagram

User → Cloudflare Tunnel → approuter :8080 → cochranblock :8081
                                           → oakilydokily :3000
cochranblock :8081 → redb (embedded ACID database)
                   → Embedded Assets (HTML/CSS/PDF baked into binary)

Binary Composition

The release binary embeds everything at compile time via include_packed:

  • All HTML assets (assets/, content/)
  • CSS and static files
  • PDFs (capability statement, resume)
  • redb database file path (database itself is runtime-created)

No files are read from disk at runtime except the redb database. The binary is fully self-contained.

Subdomain Dispatch

Two-layer routing system for 20 subdomains:

Layer 1 — Middleware (subdomain::layer)

Runs on every request before the router sees it. Bidirectional:

  • Inbound: products.cochranblock.org/ → rewrites URI to /products and continues to the normal router. Sub-paths are also rewritten: deploy.cochranblock.org/confirmed/deploy/confirmed. Paths already prefixed by the subdomain name (e.g. form action="/deploy" POSTed from deploy.cochranblock.org) pass through unchanged.
  • Outbound: cochranblock.org/products → 301 redirect to https://products.cochranblock.org.

The 19 standard subdomains handled by this middleware: products, services, about, deploy, book, security, arch, stats, openbooks, govdocs, codeskillz, tinybinaries, search, handbook, changelog, downloads, source, analytics, privacy.

Layer 2 — f2_root Handler Dispatch

Special subdomains that serve their own standalone assets (not path-rewritten):

SubdomainHandler
cochranblock.org (apex)LET’S TEAM page (assets/lets-team.html)
manual.cochranblock.orgFolded manifesto + ops manual
knox.cochranblock.orgKNOXAI operator portal
simplify.cochranblock.orgSimplify page
whyme.cochranblock.orgHire-me page
everything elseStandard C7+C8 template routing

Template System

Pages use two compile-time constants:

  • C7 — skip-link + .cb-nav navigation block + <main> opener
  • C8</main> + footer + closing tags

Handler pattern:

#![allow(unused)]
fn main() {
pub async fn f67(State(_p0): State<Arc<t0>>) -> Html<String> {
    let v0 = r#"<section>...</section>"#;
    Html([C7, v0, C8].concat())
}
}

Standalone artifact pages (manifesto, constitution, etc.) use f105() to inject the nav shim after <body>.

Storage

  • redb: single-file ACID embedded database. Used for intake form submissions, analytics, and session data.
  • No external database. No cloud storage. The database file lives on the VPS at a configured path.

Infrastructure Cost

Line itemCost
VPS (gd)~$10/month
Cloudflare TunnelFree
Domain~$12/year
Total~$10/month

THE COCHRAN BLOCK, LLC · CAGE 1CQ66 · UEI W7X3HAQL9CF9 · UNLICENSE · cochranblock.org