PowerSync Superadmin System

A polished multi-outlet control system for your PowerSync service.

The app now centers on a superadmin panel with outlet provisioning, outlet-scoped auth, PowerSync token issuance, outlet code validation, device management, and payment visibility on top of Prisma-ready Postgres models.

Configuration Checklist

DATABASE_URLconfigured
APP_SESSION_SECRETconfigured
POWERSYNC_URLconfigured
SUPERADMIN_UI_PREVIEWconfigured
SUPERADMIN_SEED_EMAILmissing
SUPERADMIN_SEED_PASSWORDmissing
POWERSYNC_PRIVATE_KEYconfigured
POWERSYNC_PUBLIC_KEYconfigured

Included capabilities

Protected superadmin workspace at /superadmin
Prisma models for superadmins, outlets, outlet users, devices, and payments
Outlet-aware app auth with rotating refresh tokens
6-character alphanumeric outlet code lookup for PowerSync-connected clients

Route surface

live surface
GET/superadmin/login

Seeded superadmin entry point for the multi-outlet control room.

POST/api/auth/login

Authenticate outlet users with email, password, and a 6-character alphanumeric outlet code.

POST/api/auth/refresh

Rotate a long-lived refresh token and restore an outlet user session.

GET/api/powersync/auth/token

Issue a short-lived PowerSync JWT that also carries outlet metadata.

POST/api/powersync/auth/token

Exchange a refresh token for a fresh PowerSync JWT after long offline periods.

POST/api/powersync/check-outlet-code

Resolve a 6-character alphanumeric outlet code and return the active outlet on success.

GET/api/powersync/auth/keys

Expose the public JWKS PowerSync uses to verify issued tokens.

POST/api/powersync/data

Persist PowerSync CRUD batches to Postgres synchronously.