# This site, from the inside

How this site is built: layers, build, the path of a request and the decisions behind it.

## micodigo.cl architecture

micodigo.cl is a Next 16 static export served by Cloudflare Workers Static Assets. A Hono Worker handles only /api/* and /mcp. Content lives in zod-validated files, and the pages, the knowledge base and this MCP server all come from it.

- **Front end**: Next 16 with output: 'export': static HTML in Spanish (no prefix) and English (under /en), with no middleware, ISR or server actions.
- **Edge**: Cloudflare Workers Static Assets serves out/ without invoking the Worker.
- **Worker**: A Hono app handles /api/* and /mcp. Platform-specific code lives in adapters, so moving to Vercel means adding one.
- **Content**: Profile, services, case studies and FAQ in YAML and markdown, validated with zod at build time. Only verified facts get published.
- **Knowledge base**: At build time, scripts/build-kb.ts writes a JSON file with the profile, services, case studies, FAQ and CV in ES and EN, plus a MiniSearch index. The Worker imports it, since it can't read files at runtime.
- **Tools**: One typed zod registry (input, output and readOnlyHint), adapted to both MCP and the AI SDK.

## Endpoints

- `POST /mcp`: Public read-only MCP server (JSON-RPC over stateless Streamable HTTP).
- `GET /api/stats`: Public MCP server counters, cached for 30 s.
- `GET /api/ping`: The Cloudflare POP that served the request, and the build in use.

## MCP

- Stateless Streamable HTTP with JSON responses, using the official SDK's MCP protocol.
- A limit of 300 requests per 10 minutes, keyed by a daily HMAC of the IP plus user agent. Weekly counters per tool and per client name, and a distinct-visitor count built from another HMAC that changes every week; those keys expire after 40 days. Neither the IP in the clear nor the time of each call is stored. It all lives in Upstash Redis; if Redis doesn't answer, the server keeps serving.

## Stack

next 16.4.5, react 19.3.1, typescript 5.9.3, tailwindcss 4.3.3, hono 4.13.16, @hono/mcp 0.3.5, @modelcontextprotocol/sdk 1.32.2, zod 4.6.7, minisearch 7.2.0, @upstash/ratelimit 2.2.0, @upstash/redis 1.40.0, wrangler 4.156.1

## Path of a request

### When you request a page

1. Your browser
2. Cloudflare serves out/ (HTML, .md twins and JS) with Workers Static Assets, without invoking the Worker
3. The Hono Worker handles only /api/* and /mcp
4. Upstash Redis keeps the rate limit and the /mcp counters

### When it ships

1. A pull request on GitHub runs lint, types, tests, build and e2e
2. On merge to main, GitHub Actions builds the export and the KB
3. wrangler deploy uploads out/ and the Worker to Cloudflare

## Build

- Commit: ff2c27c
- Built: 2026-11-15 03:06 UTC

## The hero is a shadow

The home page index is the parallel shadow of a tesseract: a rigid rotation in SO(4) carries it to the Hasse diagram, and its 32 edges are the index's 32 connections.

On desktop there's no drift: the index uses the same projection as the renderer, so the final adjustment (screenLock) moves nothing.

On phones and portrait tablets (up to 1023 px wide) the index reflows into 6 rows and the screenLock absorbs that offset. It's the only step that isn't exact.

Minimum measured vertex separation during the shadow:

- 1920×1080: 23.2 px
- 1440×900: 18.5 px
- 1280×720: 14.2 px
- 390×844: 10.8 px
- 360×640: 5.9 px

Source: ADR 0006, the SO(4) shadow path.

## Decisions

Every major decision is written down as an ADR in the repo.

- ADR 0001: Hosting on Cloudflare, portable to Vercel
- ADR 0002: Static export, languages by route groups and no Cache Components
- ADR 0003: Hero engine and render tiers
- ADR 0004: Content exclusion with an allowlist and HMAC
- ADR 0005: Performance budgets
- ADR 0006: SO(4) shadow path: separation and adjustments
- ADR 0007: LÁMINA design system: tokens, fonts and specimen
- ADR 0008: React 19.3 View Transitions within one language
- ADR 0009: /mcp CPU on the Workers free plan
- ADR 0010: Hero narrative on the home page
- ADR 0011: The case study “Architecture” block: static SVG in v1
- ADR 0012: The number column uses “N°”, with the degree sign

## Accessibility

Measured 2026-11-12

On November 12, 2026, axe-core 4.14.0 found no violations in the site's e2e tests, on desktop and mobile Chromium 156 (Playwright). They cover every published page.

There's a skip link, motion pauses from the status bar and follows the system's reduced-motion setting, and at 320 px the tested pages have no horizontal scroll.

I haven't tested it with real screen readers, Safari or Firefox yet, so I don't claim WCAG conformance.

## Colophon

Type: Archivo and JetBrains Mono, SIL OFL

MATERIALS: code 100% · hand-made illustrations 0

---

- Page: https://micodigo.cl/en/architecture
- En español: https://micodigo.cl/arquitectura.md
- Index for agents: https://micodigo.cl/llms.txt
