Skip to Content
FeaturesConsole

Console

The console is a Next.js 14 static export deployed to S3 + CloudFront at app.<domain>. It is the web surface for tenant owners, developers, and platform admins.

Pages

RouteWho sees itPurpose
/loginAllCognito Hosted UI redirect (social + email/password)
/pendingNew usersShown when approval_status=pending; wait for admin approval
/onboardingApproved new usersWorkspace creation form
/workspacesAllList the user’s workspaces; owners can delete their own
/AllDashboard: proxy URL, getting-started checklist, quick actions
/proxyAllProxy setup: OS-specific install snippets, env-var precedence warning
/usersOwnerInvite/remove users, see role + grant status
/grantsOwnerGrant editor: model picker, region picker, budget field
/keysAllAPI key list: create (raw value once), revoke, see name/last-used/expiry
/modelsAllModel catalog; developers see their grant’s filtered list
/billingAllBilling dashboard tabs: “My Usage”, “Tenant Billing” (owner)
/settingsOwnerTenant settings: name, default region, slug, tier, Stripe portal
/adminPlatform adminTenant list, user approval, tier management

Auth flow in the frontend

  1. The app checks localStorage for Cognito tokens on mount.
  2. If absent or expired → redirect to /login → Cognito Hosted UI → PKCE → return with tokens.
  3. The use-auth hook refreshes tokens automatically.
  4. API requests carry Authorization: Bearer <access_token>; a 401 triggers a single refresh-and-retry.

AuthGuard calls GET /v1/tenants/me after login and redirects users with no active tenant to /onboarding (skipping the call when already on /onboarding to avoid a redirect loop).

API client conventions

src/lib/api.ts attaches the bearer token, runs snakelizeKeys() on request bodies, sends query params camelCase (no conversion), runs camelizeKeys() on responses, and retries once on a 401 after refreshing the token.

Last updated on