Skip to content

Production deployment requires a reverse proxy to split /v1/ traffic #183

@Prikis

Description

@Prikis

Problem

The dashboard hardcodes BASE = '/v1' in client.ts and relies on the Vite dev server's proxy config to split traffic between the admin server and the runtime server:

  • /v1/reservations/* → cycles-server (runtime plane)
  • /v1/* → cycles-server-admin

This works fine in development, but the Vite proxy is only active during npm run dev. In production, the built static files have no proxy — so deploying the dashboard requires setting up a separate reverse proxy (nginx, proxy servlet, etc.) purely to replicate what the Vite config already does. This adds significant operational complexity for what should be a straightforward static file deployment.

Proposed Fix

Replace the hardcoded BASE with two configurable environment variables:

VITE_ADMIN_URL=https://your-admin-server:7979
VITE_RUNTIME_URL=https://your-runtime-server:7878

And update client.ts to use them:

const ADMIN_BASE = (import.meta.env.VITE_ADMIN_URL ?? 'http://localhost:7979') + '/v1'
const RUNTIME_BASE = (import.meta.env.VITE_RUNTIME_URL ?? 'http://localhost:7878') + '/v1'

API calls would then use the appropriate base depending on whether they target the admin or runtime plane. This eliminates the need for any proxy infrastructure, is consistent with standard Vite environment variable patterns, and makes the dashboard deployable anywhere without server-side configuration.

The Vite proxy config in vite.config.ts could remain as-is for local development convenience, or be removed since it would no longer be necessary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions