Skip to content

Put the API behind a custom domain (make the backend host portable) #170

Description

@Muawiya-contact

Goal
Serve the backend on a stable custom domain (e.g. api.oneconcept.app) instead of the raw provider hostname (api-production-f3a9f.up.railway.app), so the backend host can change with just a DNS update — no mobile release.

Why this matters (and why it’s a prerequisite for #169)
The API base URL is not just a config value — it’s embedded in several places, most of them expensive to change:

  • EXPO_PUBLIC_API_BASE_URL is compiled into the mobile OTA bundle → changing it needs a new mobile release shipped to every phone.
  • Supabase Auth → Redirect URLs allowlists .../reset-password.
  • The root README “Install the app” / API references and the backend’s own /confirmed + /reset-password pages assume the domain.

Today, moving hosts (Railway → Oracle, #169) or even a Railway domain change would force a mobile release + Supabase reconfig. With a custom domain in front, a host move becomes a DNS record change — invisible to installed apps.

Scope

  1. Register/choose a domain (or subdomain) for the API.
  2. Point it at the current Railway service (custom domain in Railway supports this) over HTTPS.
  3. Set EXPO_PUBLIC_API_BASE_URL to the new domain in both EAS environments (preview + production — keep them in sync) and ship one mobile release on it (JS-only OTA is enough — the URL is a JS env value, not native).
  4. Add the new https://<api-domain>/reset-password to Supabase → Auth → Redirect URLs (keep the old one until all clients are updated).
  5. Update the README API/APK references and any docs that hardcode the Railway hostname.
  6. Verify /health, /confirmed, /reset-password, and a normal app session all work on the new domain, then retire the raw hostname.

Acceptance

Note
Do this before the Oracle migration (#169) — it’s the single highest-leverage step to de-risk that move and any future host change.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions