Skip to content

Web Dashboard

tonythethompson edited this page Jul 28, 2026 · 4 revisions

Portal (portal.trackdub)

The Trackdub portal is a client-rendered React / TanStack Start SPA. No backend logic lives in this repo (no server functions, no Lovable Cloud, no Supabase). All API calls go to api.trackdub.com with cookie credentials.

Architecture

portal.trackdub.com              api.trackdub.com
(UI, routes, auth client)  ──►   Better Auth + D1 Worker
Route guards (UX only)     ──►   Worker authorizes every protected call
  • Auth: host-only session cookie on api.trackdub.com (Secure; HttpOnly; SameSite=Lax). Portal never reads the cookie; it uses credentials: "include".
  • Signup: invite-only, enforced by the Worker. No public signup UI.
  • Guards: ensure-session style client checks for UX; Worker is the real boundary.

Environment

Variable Default Notes
VITE_API_BASE_URL https://api.trackdub.com Public build var; compiled into the bundle
VITE_APP_ENV production Optional banners/logging

Worker CORS requirements

  • Exact Access-Control-Allow-Origin: https://portal.trackdub.com (never *)
  • Access-Control-Allow-Credentials: true
  • Handles OPTIONS preflight
  • Portal origin in Better Auth trustedOrigins

Local development

git clone https://github.com/trackdubllc/portal.trackdub.git
cd portal.trackdub
npm i
npm run dev

Run the Worker locally (or point VITE_API_BASE_URL at a deployed API) when exercising auth flows. See Cloud-API-and-Job-Management.

What this is not

  • Not the monorepo frontend/ Amplify + Cognito app
  • Not OpenAPI-generated from a C# Trackdub.Api
  • Not a host for dubbing jobs (jobs/billing UI may appear later as stubs until the Worker ships those APIs)

Related

Clone this wiki locally