ADR-0056: Public rental marketplace is a standalone Astro app that reads Go directly

Status

Accepted (2026-08-26); Consequences amended 2026-09-10 by ADR-0063

Tags

rental, astro, architecture, product-boundary, seo, cloudflare, caching, adr-0052, adr-0054, adr-0055, adr-0063

Decision

The public rental marketplace is a new independently deployed Astro application at frontend/astro/apps/rental, served from rent.gremlin.my. It renders anonymous, unauthenticated pages only, and its server-side code calls the Go backend directly at {RENTAL_API_URL}/api/public/rental/… rather than proxying through Bun. RENTAL_API_URL holds an origin only (https://api.kokweng.net); every path lives as a constant in src/lib/rental-api.ts. The variable deliberately carries no PUBLIC_ prefix, which is what makes “the browser never calls the API” a mechanical guarantee in Astro rather than a convention. The public path stays unversioned (/api/public/rental/…, not /api/v1/…). These URLs are the ones crawlers index and people paste into WhatsApp; a version segment in a contract that can never break is decoration. This is pinned in slice 1’s design so the two sides cannot drift. rental-api.ts’s response types are pinned against slice 1’s public golden fixture using the existing asymmetric contract-drift pattern (ADR-0052): Go owns the shape, a Go test asserts the client is a subset of what Go emits.

Why

frontend/astro/AGENTS.md permits an independently deployed product beside the platform app “only when an ADR records the product and data boundary”, with the quiz app (ADR-0054) as the one prior exception. This is the second. AGENTS.md also states that all frontend API calls go through Bun on port 3100, and marks calling Go directly as wrong. That rule exists to forward auth cookies and avoid cross-origin problems. Neither applies here: every response this app reads is anonymous and public, and the call is server-to-server from a Cloudflare Worker. Routing it through Bun would add a hop and make a public marketing site — the one thing that must stay up to attract users at all — depend on Bun’s uptime, in exchange for cookie forwarding it never needs. Unlike ADR-0054, this app shares the platform’s database and identity indirectly, through the Go API described in ADR-0055. It owns no database, no auth, and no writes. The boundary is read-only and one-directional.

Considered options

  • Route through Bun to follow the existing rule literally — rejected. Adds a hop and a uptime dependency for cookie handling and CORS that an anonymous server-to-server read does not need. Recorded here as a deliberate exception rather than left as a silent violation for the next reader to find.
  • Build the public pages inside the existing platform Astro app — rejected. It would put an anonymous, aggressively CDN-cached, SEO-critical surface inside an app built around authenticated platform users, and couple this product’s deploy cadence to the platform’s.
  • Serve the marketplace from the SolidStart panel — rejected. The panel is an authenticated admin surface; its rendering and caching model is the opposite of what a crawlable, edge-cached public site needs.

Consequences

  • A second Astro major lives in this workspace: the new app starts on Astro 7 while platform, quiz, and plans stay on 6. pnpm handles this; expect some friction in Turbo and shared types. Delivery step 1 measures it.
  • AGENTS.md’s “everything goes through Bun” rule now has a documented exception scoped to anonymous public reads. It is not a general licence to call Go directly.
  • The marketplace’s availability is coupled to Go and to Cloudflare, not to Bun.
  • Because the app holds no session and writes nothing, the “Arrange Viewing” handoff is a plain link to another origin. Amended 2026-09-10 (ADR-0063), corrected after design review: the target is no longer panel.gremlin.my/tenant/book/{slug}. The authenticated rental portal moved out of the panel into its own SolidStart app, so PANEL_URL in apps/rental/src/pages/property/[slug].astro is repointed to the portal host and renamed, since it no longer points at the panel. This marketplace’s own host is unchanged, and the portal URL becomes explicit configuration. This handoff places no registrable-domain requirement on the portal: it is a top-level cross-origin navigation carrying no session, so cookie scope does not apply to it. The portal’s host is instead constrained by the Better Auth session cookie’s registrable domain, which committed configuration places on .kokweng.net (backend/bun/fly.toml:15) rather than gremlin.my. ADR-0063 therefore selects a sibling host under that domain and defers any gremlin.my migration. The earlier statement here — that the portal “must also stay on a gremlin.my subdomain” — is withdrawn. rent.gremlin.my remains held by this ADR in either case.
  • This app places four requirements on slice 1’s public contract, all of which must land before its public golden fixture freezes: photo width/height, a filter-independent areas facet, the unversioned public path, and the slug rules in ADR-0057.