Standalone Tower Dashboard
The Tower is Mallnline's platform-wide admin dashboard. Historically, it was embedded within the main ngwenya-front monolithic SvelteKit application at the /admin and /tower routes.
As part of the Platform Admin Isolation epic, The Tower has been fully extracted into a standalone SvelteKit repository (ngwenya-tower) running on its own dedicated port/subdomain (tower.mallnline.com).
IMPORTANT
No customer-facing features (Visitors) or Malet Owner features (The Deck) live in The Tower. It is strictly an internal oversight workspace for platform administrators.
Architectural Shifts
Extracting The Tower from the frontend monolith required decoupling several core systems:
1. Decoupled Theme System
In the monolith, themes were toggled globally via a darkMode store and a body.dark-mode CSS class. The standalone Tower application implements its own independent themeStore.ts and DarkMode.svelte component.
- It uses the same
$malladaptive design tokens (--mall-surface,--mall-border,--mall-text). - Hardcoded fallback hex colors (e.g.,
#1a1a2e,#2d2d44) were systematically removed from all analytics widgets to ensure 100% theme-awareness parity with the main storefront.
2. Cross-Subdomain Authentication
Because the Tower now runs on tower.mallnline.com while the main app runs on mallnline.com, authentication state must be shared across subdomains.
- The backend API issues the
userJWT cookie withDomain=.mallnline.com. - The standalone Tower SvelteKit app uses the exact same
hooks.server.tslogic to parse the JWT cookie and hydrateevent.locals.user. - If a user is not authenticated or lacks the
is_privilegedflag, the Tower automatically redirects them to the main storefront'sauthroute:https://mallnline.com/auth?redirect=https://tower.mallnline.com.
3. Dedicated DevOps Observability
The Tower is not just a UI for platform data; it monitors the platform itself. It integrates natively with the Tower Subgraph to display:
- Project Status & Git Feed: Powered by the backend's
devopsmodule reading.gitrepositories directly. Thengwenya-towerrepo is actively monitored and badged with a unique pink accent (#ec4899). - Platform Health: A real-time grid powered by the dual-layer health probing system, mapping out exactly which subgraphs are reachable.
- Test Coverage: Real-time line/branch/statement test coverage parsing.
Repository Structure
The ngwenya-tower repository contains the complete admin component library previously housed in src/lib/components/admin/:
ngwenya-tower/
โโโ src/
โ โโโ lib/
โ โ โโโ components/
โ โ โ โโโ ProjectStatusWidget.svelte
โ โ โ โโโ CoverageHeatmap.svelte
โ โ โ โโโ AlertsAnalytics.svelte
โ โ โ โโโ ... (all admin widgets)
โ โ โโโ queries/
โ โ โ โโโ towerDevOps.ts # Tower-unique
โ โ โ โโโ towerHealth.ts # Tower-unique
โ โ โ โโโ errorTracking.ts # Tower-unique
โ โ โ โโโ alerts.ts # Tower-unique
โ โ โโโ stores/
โ โ โโโ themeStore.ts
โ โโโ mall/
โ โ โโโ tokens.css # Shared design system tokens
โ โโโ routes/
โ โโโ +page.svelte # Main dashboard layout
NOTE
Shared queries (admin, auth, malet, orders, organizations, lobby, etc.) are now imported from the @ngwenya/queries workspace package. Tower-specific queries remain in src/lib/queries/.
Shared Package Status
โ `@ngwenya/queries` โ Completed
The shared GraphQL query package has been implemented and is live. Tower, Deck, and Storefront all consume queries from @ngwenya/queries via pnpm workspace links. See Shared Query Package for full documentation.
๐ `@mallnline/ui` โ Planned
Foundational components like MallHandle.svelte and DarkMode.svelte were duplicated into the ngwenya-tower repo during the extraction. The next phase is to create a shared @mallnline/ui NPM workspace package to house these agnostic components, ensuring design synchronization across the Storefront, The Deck, and The Tower without code duplication.
Related
- Shared Query Package โ The
@ngwenya/queriesworkspace package for shared GraphQL operations. - Workspaces & The Tower โ Overview of the conceptual separation between The Deck and The Tower.
- Tower Subgraph โ The Rust/Axum subgraph powering the health and devops analytics.
- Tower Health Observability โ Deep dive into the dual-layer probing architecture.
- Tower DevOps Monitoring โ How the Git commit feed and test coverage widgets gather data.
- Admin Dashboard & Audit Tools โ User-facing support manual for navigating the Tower dashboard.