Skip to content

ADR 002: Subdomain Architecture

Accepted (revised)

Lakea consists of multiple applications that need to be accessible under a unified brand:

  • Portal (main entry)
  • Handbook (documentation)
  • Exoplanet Catalog (data visualization)
  • Future apps…

We initially considered path-based routing (lakea.dev/docs, lakea.dev/exoplanet-catalog) with a proxy, but this added complexity:

  • Required a dev proxy for local testing
  • Required an edge proxy (Cloudflare Worker) for production
  • Base path configuration broke direct dev access
  • Complex routing logic needed

Use subdomains instead of path-based routing.

AppLocalProduction
Portallocalhost:4320lakea.dev
Handbooklocalhost:4322docs.lakea.dev
Exoplanet Cataloglocalhost:4321exoplanet.lakea.dev

Each app is a separate Cloudflare Pages project with its own custom domain.

  • Simpler deployment: Each app deploys independently to its own Pages project
  • No proxy needed: No dev proxy, no edge proxy, no Workers
  • Direct dev access works: Apps run on their own port with no path conflicts
  • Free: Cloudflare Pages allows unlimited custom domains on free tier
  • Independent scaling: Each app can have its own caching, redirects, etc.
  • DNS setup required: Need to configure subdomains in Cloudflare DNS
  • Cross-origin in dev: Links between apps open in new context (different ports)
  • Cookie sharing: Requires explicit configuration if needed (not currently needed)
  • Cross-app links use getAppLink() which returns full URLs
  1. Create separate Cloudflare Pages projects for each app
  2. Configure custom domains in Cloudflare DNS:
    • lakea.dev → portal Pages project
    • docs.lakea.dev → handbook Pages project
    • exoplanet.lakea.dev → exoplanet-catalog Pages project