Implement multi-tenant platform API + standalone Vite control plane #6

Open
highperfocused wants to merge 1 commits from feat/multi-tenant-swarm-platform into main

Summary

This PR fully implements the multi-tenant platform requested in #5.

Backend (Node gateway)

  • Adds a new /v1/platform/* API surface for:
    • auth: register, login, me
    • tenant management + RBAC memberships
    • agent lifecycle management (create, scale, restart, remove)
    • tenant-scoped audit logs
    • tenant event stream (SSE) + buffered event fetch
  • Adds persistent platform state storage under CWD/.platform.
  • Adds password hashing + signed bearer tokens.
  • Adds tenant isolation checks on all tenant-scoped endpoints.
  • Adds quota checks per tenant (agents, replicas/agent, total replicas).

Swarm orchestration

  • Adds a Swarm orchestrator abstraction with:
    • Docker Swarm driver (docker service create/scale/update/rm/inspect)
    • Mock driver fallback for local/dev (PLATFORM_SWARM_MODE=mock|auto|docker)
  • Adds periodic + delayed status refresh so transitions (pending -> running/failed) are observable.

Frontend (separate project)

  • Adds a standalone Vite + React app at platform-ui/ (not bundled into backend image).
  • Implements:
    • register/login screens
    • tenant switcher and tenant creation
    • membership management UI
    • agent create/scale/restart/remove UI
    • optimistic updates + retry-aware API requests
    • live tenant event stream consumption
    • audit log panel

Docker/config/docs updates

  • Adds root .dockerignore excluding platform-ui/ from image context.
  • Keeps frontend separate from backend runtime image.
  • Installs Docker CLI in runtime image and mounts Docker socket in compose for swarm control.
  • Adds new platform env vars to .env.example and compose.yaml.
  • Adds docs/platform.md and README updates.

Validation

  • npm run build
  • cd platform-ui && npm run lint
  • cd platform-ui && npm run build
  • Manual smoke test:
    • register + tenant creation
    • spawn agent in mock mode
    • tenant isolation check (Tenant B cannot read Tenant A)
    • audit log entries present

Closes #5

## Summary This PR fully implements the multi-tenant platform requested in #5. ### Backend (Node gateway) - Adds a new `/v1/platform/*` API surface for: - auth: register, login, me - tenant management + RBAC memberships - agent lifecycle management (create, scale, restart, remove) - tenant-scoped audit logs - tenant event stream (SSE) + buffered event fetch - Adds persistent platform state storage under `CWD/.platform`. - Adds password hashing + signed bearer tokens. - Adds tenant isolation checks on all tenant-scoped endpoints. - Adds quota checks per tenant (agents, replicas/agent, total replicas). ### Swarm orchestration - Adds a Swarm orchestrator abstraction with: - Docker Swarm driver (`docker service create/scale/update/rm/inspect`) - Mock driver fallback for local/dev (`PLATFORM_SWARM_MODE=mock|auto|docker`) - Adds periodic + delayed status refresh so transitions (`pending -> running/failed`) are observable. ### Frontend (separate project) - Adds a standalone Vite + React app at `platform-ui/` (not bundled into backend image). - Implements: - register/login screens - tenant switcher and tenant creation - membership management UI - agent create/scale/restart/remove UI - optimistic updates + retry-aware API requests - live tenant event stream consumption - audit log panel ### Docker/config/docs updates - Adds root `.dockerignore` excluding `platform-ui/` from image context. - Keeps frontend separate from backend runtime image. - Installs Docker CLI in runtime image and mounts Docker socket in compose for swarm control. - Adds new platform env vars to `.env.example` and `compose.yaml`. - Adds `docs/platform.md` and README updates. ## Validation - `npm run build` - `cd platform-ui && npm run lint` - `cd platform-ui && npm run build` - Manual smoke test: - register + tenant creation - spawn agent in mock mode - tenant isolation check (Tenant B cannot read Tenant A) - audit log entries present Closes #5
highperfocused added 1 commit 2026-03-12 22:17:25 +01:00
Implement multi-tenant platform API and standalone Vite control plane
All checks were successful
Build and Push Docker Image / build (pull_request) Successful in 1m32s
c24a4721bd
All checks were successful
Build and Push Docker Image / build (pull_request) Successful in 1m32s
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/multi-tenant-swarm-platform:feat/multi-tenant-swarm-platform
git checkout feat/multi-tenant-swarm-platform
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: highperfocused/agent#6