Skip to content

Installation & Configuration

This page covers how to run and configure the admin panel. The preferred workflow is Docker Compose.

Deployment

Use the admin-svelte-dev service from the repo root:

docker compose up admin-svelte-dev

This starts the admin panel on http://localhost:3102 (the container listens on port 3000 internally; compose.yml maps it to 3102:3000) and proxies API requests to the local API container (dev, on port 8000).

For AWS deployment, the admin panel is deployed through Terraform and ECS. See Terraform Deployment Guide and Infrastructure Reference.

Development

The admin-svelte-dev service (built from tracker-admin-svelte/docker/dev.Dockerfile) uses hot reload via the SvelteKit/Vite dev server, so code changes are picked up without restarting the container.

docker compose up admin-svelte-dev

tracker-admin-svelte depends on the shared tracker-shared package via npm workspaces defined at the repo root, so dependencies are installed once at the workspace root rather than inside the app directory. The dev container's entrypoint (tracker-admin-svelte/docker/dev-entrypoint.sh) checks whether /workspace/node_modules is missing or older than any of the workspace package.json/package-lock.json files and runs npm install at the workspace root automatically before starting npm run dev, so you don't normally need to install dependencies by hand.

If you need to work outside Docker, install dependencies from the repo root (not from inside tracker-admin-svelte) and then run the app's dev script:

npm install
npm run dev --workspace=tracker-admin-svelte

Configuration

The admin panel talks to the API at /api/v1 (configurable via the VITE_API_URL environment variable in tracker-admin-svelte/.env; defaults to /api/v1).

In Docker Compose development, admin-svelte-dev proxies /api/v1 to the API container.

In the production container image, nginx rewrites the upstream API target using the API_URL environment variable during container startup.

Proxy Configuration

In development, the admin panel uses a Vite proxy to avoid CORS issues. This is configured in tracker-admin-svelte/vite.config.ts:

export default defineConfig({
  server: {
    host: "0.0.0.0",
    port: 3000,
    proxy: {
      "/api/v1": {
        target: "http://dev:8000",
        changeOrigin: true,
        secure: false,
      },
      "/static": {
        target: "http://dev:8000",
        changeOrigin: true,
        secure: false,
      },
    },
  },
  // ...
});

This configuration proxies /api/v1 and /static requests to http://dev:8000 (the dev service's container name/port) in the Docker Compose dev stack.

In the production image, nginx proxies API requests to the backend. The container startup script substitutes the upstream target into tracker-admin-svelte/docker/nginx.conf (baked into the image at /etc/nginx/conf.d/default.conf), replacing the __API_URL__ placeholder with the API_URL environment variable at container start.