wealth/docs/decisions/0061-admin-app-and-platform.md

1.5 KiB

0061 Admin panel in its own app and platform

Status: Accepted · Area: architecture · Date: 2026-10-11 · Decided by: user

Context

The admin panel (journey J11 in the app design) was out of scope, and admin-only state was set by hand in Mongo. The user chose to build it in this monorepo, so it reuses island, libs and tools, but keeps it apart from the public product.

Decision

  • apps/wall-street-plaza is the admin app and platforms/garden-roof its platform; both are tagged scope:admin. scope:admin depends only on scope:admin and scope:shared. scope:market never imports scope:admin, and the reverse is also not allowed.
  • The admin app talks only to the back end's admin API (apps/admin-api in the Nest monorepo), never to the public gateway. The browser calls it on the app's own origin under /api, rewritten to ADMIN_API_INTERNAL_ORIGIN, as 0018 does for the gateway.
  • The admin app builds and deploys on its own origin (dev port 7002), so no admin code ships in bull or bear.

Alternatives

  • A separate repository: it would need island, libs and tools published as versioned packages, and they would drift.
  • Admin routes inside bull/bear: admin code would ship to public visitors, and the gateway would carry admin routes.

Consequences

  • Domain-free UI that the admin needs (a table, a pager) goes to island, so both products can use it.
  • The admin API owns admin auth, with its own cookie names, so an admin session and a market session on the same host never collide.