Back to all docs
SlashHub Docs

System Layout & Architecture

Multi-monorepo shape, standardized tooling, deployment topology, and the 9-pillar enterprise blueprint.

For developers~10 min readLast reviewed: 2026-07-02
S

SlashOne

Your account, your subscription, your products

Open

One account for the suite: one sign-in, one bill, one place to see every product you own.

Layer 3 · Federation2026slashhub.hk
One sign-in across every product
One bill, one card, one upgrade path
Organisation and role management
SlashAI included — the assistant inside every product
Next.js 16 (web)NestJS 11 (api Phase 1-4)FirestorePostgres

TL;DR: SlashHub Limited ships three foundation services — SlashHub SSO, the Subscription System and SlashAI — plus separate product sites for SlashOne, SlashBooks, SlashStudio, SlashMarketer and TimePlate (DEC-0225, 2026-11-15). Each product has its own front door, repo and deploy; there is no combined OS shell. The implementation is a multi-monorepo estate under a unified coordination layer. The repos share standardized tooling (TypeScript, pnpm, Turborepo, ESLint, Prettier, Husky) and a canonical backend-core NestJS infrastructure synced via script. Frontends deploy to Vercel, backends to Railway. See ecosystem.md §1–§4 for the estate picture; counts in this file are repo counts, not products.


Slashhub/
│
├── Makefile                           # Cross-product orchestration (lint/build/test all)
├── docs/                              # Categorised documentation (see docs/README.md)
│   ├── README.md                      # Master index
│   ├── governance/                    # Standards, audits, issue register
│   ├── architecture/                  # System layout, domains, repos, contracts
│   ├── operations/                    # Deployment status + runbooks
│   ├── roadmap/                       # Forward plans
│   ├── market/                        # HK market + pitches
│   ├── legal/                         # Legal-document versions
│   ├── product/reports/               # Per-product PM reports
│   ├── templates/                     # Copy-and-customise doc templates
│   └── archive/                       # Superseded records (read-only)
│
├── scripts/                           # Cross-product automation
│   ├── sync-backend-core.sh           # Sync canonical backend-core → the NestJS products
│   └── verify-standardization.sh      # full compliance check
│
├── packages/                          # Cross-product shared code
│   └── backend-core/                  # Canonical source of NestJS infra
│                                       #   (synced into each product)
│
├── .editorconfig                      # Root editor config
├── .gitignore                         # Root git ignore
├── .prettierrc                        # Root prettier config
│
├── slashone/        [GIT REPO]        # Public site, account console, SSO + subscription
├── slashbooks/      [GIT REPO]        # Accounting
├── slashstudio/     [GIT REPO]        # Client work: workspaces, engagements, tasks
├── slashmarketer/   [GIT REPO]        # Campaigns, assets, publishing, attribution (public beta)
├── timeplate/       [GIT REPO]        # HR for shift teams
├── slashai/         [GIT REPO]        # The foundation agent
└── cs-platform/     [GIT REPO]        # Shared support platform (internal, not a product)

Archived and frozen repositories are not part of the estate and are omitted here; see §History.

Each product is an independent Turborepo monorepo with its own package.json, pnpm-workspace.yaml, turbo.json, CI, and deployment.


ProductDomain (frontend / backend)TypeBackendFrontendCI
SlashOneslashhub.hk + app.slashhub.hk / api.slashone.slashhub.spacePublic site, account, SSO, subscriptionNestJS 11 ✅Next.jsCI ✅
SlashBooksbooks.slashhub.hk / api.books.slashhub.spaceAccountingNestJS 11 ✅Next.jsCI ✅
SlashStudiostudio.slashhub.hk / api.studio.slashhub.spaceClient workExpressNext.jsCI ✅
SlashMarketermarketer.slashhub.hk / api.marketer.slashhub.spaceCampaigns + attribution — public betaFastAPINext.jsCI ✅
TimePlatetimeplate.slashhub.hk / api.timeplate.slashhub.spaceWorkforce / HRExpress (→ NestJS)Next.js + Expo mobileCI ✅
SlashAI (foundation)ai.slashhub.hk / api.slashai.slashhub.spaceCross-product agentNestJS 11 ✅Next.jsCI ✅

See ecosystem.md for the estate shape, domains.md for full domain + CORS configuration, and IP-FRAMEWORK.md §4 for SlashMarketer's IP constraints.


Each product monorepo follows the same shape:

<Product>/
├── apps/                              # Deployable applications
│   ├── api*/                         # Backend API (NestJS, Express or FastAPI)
│   ├── web/                          # Public Next.js frontend
│   ├── admin/                        # Admin panel (some products)
│   └── workspace/                    # Workspace app (some products)
│
├── packages/                         # Shared workspace packages
│   ├── backend-core/                 # NestJS infra (synced from canonical; NestJS products)
│   ├── chat-kit/                     # Streaming chat, AI panel (every frontend)
│   ├── shared/                       # Business logic / types
│   └── shared-constants/             # Shared constants (some products)
│
├── firebase/                         # Firebase tests, rules (TimePlate, SlashBooks)
├── patches/                          # pnpm patches (TimePlate, for Expo)
│
├── .github/workflows/                # CI workflows
│   └── ci.yml                        # Standard CI: lint → typecheck → test → build
│
├── .husky/                           # Pre-commit hooks
│   ├── pre-commit                    # Runs lint-staged
│   └── _/                            # Husky runtime
│
├── tsconfig.base.json                # Inherited by all app tsconfigs
├── eslint.config.mjs                 # Root ESLint flat config
├── .prettierrc                       # Prettier config (singleQuote, trailingComma, etc.)
├── .editorconfig                     # Editor config
├── .gitignore                        # Unified gitignore
├── .nvmrc                            # Node version pin
│
├── package.json                      # Root: devDeps, scripts, husky/lint-staged
├── pnpm-workspace.yaml               # Workspace members
├── turbo.json                        # Turborepo orchestration
├── Dockerfile                        # Root Dockerfile (some products)
└── railway.json / railway.toml       # Railway deploy config

ToolVersionPurpose
TypeScript^6.0.3Language
pnpm11.5.1Package manager
Turborepo^2.10.0Build orchestration
Node.js22Runtime
Next.js^16.2.9Frontend framework
NestJS^11.1.27Backend framework
Express^5.2.1Legacy backend (being migrated)
ESLint^9.22Linting (flat config)
Prettier^3.9.0Formatting
Husky^9Pre-commit hooks
lint-staged^15Run linters on staged files
FirebaseAdmin SDK ^14.1.0Auth + Firestore + Storage
Zod^4.4.3Schema validation
Vercel—Frontend hosting
Railway—Backend hosting

SlashMarketer exception: SlashMarketer uses a different stack — Next.js for the FE, Python FastAPI for the BE (not NestJS), vLLM + Hugging Face transformers for the model side, Firestore for the data layer, and spot GPU compute for self-hosted inference. This is intentional and documented in ecosystem.md §6.


All backend APIs converge on NestJS with a single shared backend-core providing:

  • FirebaseModule (Admin init, Firestore, Auth, Storage)
  • FirebaseAuthGuard (Bearer token verification)
  • RolesGuard + @Roles() (RBAC)
  • @Public() decorator (skip auth)
  • @CurrentUser() decorator
  • LoggingInterceptor (request-id logging)
  • TransformInterceptor ({success, data, meta} envelope)
  • TimeoutInterceptor (30s timeout)
  • HttpExceptionFilter (unified error responses)
  • ZodValidationPipe (Zod schema validation)

Location: Slashhub/packages/backend-core/

This is the single source of truth. Each product's per-product packages/backend-core/ is a synced copy:

make sync                # Push canonical → every product the sync script lists
make check-sync          # Verify those products are in sync

The sync script (scripts/sync-backend-core.sh) does:

  1. rsync source files (excluding node_modules, dist)
  2. Rewrite @slashhub/backend-core → @<product>/backend-core in package.json + README.md
ProductPackage Name
SlashOne@slashone/backend-core
SlashBooks@slashbooks/backend-core
SlashStudio@slashstudio/backend-core
SlashAI@slashai/backend-core
ProductBackendStatus
SlashOneNestJS 11✅ Migrated
SlashAINestJS 11✅ Migrated
SlashBooksNestJS 11✅ Migrated (running)
SlashStudioExpress🔴 Pending (apps/api)
TimePlateExpress🔴 Pending (apps/api)
SlashMarketerFastAPI⚪ Out of scope (Python; no backend-core copy)

TimePlate and SlashMarketer have no packages/backend-core/ on disk (verified 2026-11-17); the NestJS products do, under the names above.


All frontends deploy to Vercel:

ProductApp(s)Status
SlashOneapps/web, apps/admin✅
SlashBooksapps/web✅
SlashStudioapps/workspace✅
SlashMarketerapps/web✅
TimePlateapps/admin, apps/admin-platform, apps/expo-mobile-app✅
SlashAIapps/web✅

Each Next.js app follows the same conventions:

  • TypeScript strict mode
  • ESLint flat config (root + @next/eslint-plugin-next)
  • tsconfig.json extends root tsconfig.base.json (with jsx: react-jsx)
  • pnpm workspaces for @<product>/shared etc.

All products have per-product GitHub Actions:

<Product>/.github/workflows/
├── ci.yml                       # Standard: lint → typecheck → build → test
└── <surface>.yml                # Product-specific deploy (e.g. `workspace.yml` in SlashStudio)
jobs:
  lint:        runs pnpm lint
  typecheck:   runs pnpm typecheck
  test:        runs pnpm test
  build:       runs pnpm build

All use:

  • pnpm/action-setup@v4
  • actions/setup-node@v4 (Node 22)
  • Turbo cache for build acceleration
  • --frozen-lockfile for reproducible installs

Run from the Slashhub root:

make help                # Show all targets
make lint                # Lint every repo in PRODUCT_DIRS
make typecheck           # Typecheck every repo in PRODUCT_DIRS
make test                # Test every repo in PRODUCT_DIRS
make build               # Build every repo in PRODUCT_DIRS
make format              # Format every repo in PRODUCT_DIRS
make clean               # Clean every repo in PRODUCT_DIRS
make sync                # Sync backend-core + chat-kit + the other canonical kits
make check               # Run all quality checks
make gate                # THE gate (scripts/gate.sh) — one PASS/FAIL table

# Per-product targets
make slashbooks-lint
make slashai-test
make timeplate-clean
make slashone-typecheck
make slashstudio-format

PRODUCT_DIRS is the list the Makefile loops over; cs-platform and the frozen mobile client are excluded on purpose (different stacks), and their gates run per their own README.

bash scripts/verify-standardization.sh

Runs the full compliance gate across:

  • Config files (.prettierrc, tsconfig.base.json, eslint.config.mjs, .editorconfig, .gitignore, .nvmrc)
  • package.json (tooling versions, scripts, lint-staged config, husky setup)
  • Husky (.husky/pre-commit exists, _/ runtime exists)
  • CI workflows (.github/workflows/ exists)
  • packages/backend-core/ present
  • Backend-core sync status across the products that consume it

                          ┌─────────────────────────────┐
                          │   SlashHub Domain Topology   │
                          └──────────────┬───────────────┘
                                         │
        ┌────────────────────────────────┼────────────────────────────────┐
        │                                │                                │
   FRONTEND (.hk)                  BACKEND (.space)                  ADMIN / CI
   hosted by Vercel                hosted by Railway                 GitHub Actions
        │                                │                                │
        │  https://slashhub.hk           │  https://api.slashone...       │
        │  https://app.slashhub.hk       │  https://api.books...          │
        │  https://books.slashhub.hk     │  https://api.studio...         │
        │  https://studio.slashhub.hk    │  https://api.marketer...       │
        │  https://marketer.slashhub.hk  │  https://api.timeplate...      │
        │  https://timeplate.slashhub.hk │  https://api.slashai...        │
        │  https://ai.slashhub.hk        │                                │
        │                                │                                │
   ┌────▼────┐                      ┌────▼────┐                    ┌──────▼──────┐
   │ Next.js │  ──── HTTPS API ────►│ NestJS  │ ──── Firestore ──►│  Firebase   │
   │  16     │                      │ 11 /    │ ──── Auth ───────►│   Admin     │
   └─────────┘                      │ Express │                    └─────────────┘
                                    └────┬────┘
                                         │
                                    (per-product)

See docs/product/architecture/domains.md for the full CORS allowlist.


TeamProductPackages Owned
Backend ASlashBooksslashbooks/packages/backend-core
Backend BTimePlatetimeplate/apps/api
AI TeamSlashAIslashai/packages/backend-core
PlatformSlashOneslashone/packages/backend-core, slashone/schemas/events/
StudioSlashStudioslashstudio/apps/workspace
FrontendAll frontendsapps/web, apps/admin

  1. Independent deployability — Each product ships its own Railway/Vercel deploy. A bug in one doesn't block another.
  2. Parallel team development (多人併發) — Teams work in independent repos/monorepos without stepping on each other.
  3. Standardized tooling — Every product monorepo shares the same TS / pnpm / turbo / ESLint / Prettier / Husky versions. Differences are documented and intentional. (SlashMarketer is a deliberate exception — see Tooling Stack note above.)
  4. Canonical + synced backend-core — One source of truth (Slashhub/packages/backend-core/), distributed by script. Drift is detectable via make check-sync.
  5. Convergent backend — All production backends converge on NestJS. Express backends are legacy; migration is tracked in docs/product/governance/backend-standardization.md.
  6. Cross-product orchestration — Root Makefile enables unified make lint / make build etc. across PRODUCT_DIRS.
  7. Automated verification — scripts/verify-standardization.sh runs the full compliance gate; failures indicate drift.

TaskCommand
Verify all standardsbash scripts/verify-standardization.sh
Sync backend-coremake sync
Check sync onlymake check-sync
Lint everythingmake lint
Typecheck everythingmake typecheck
Build everythingmake build
Lint one productmake <product>-lint
Read backend specdocs/product/governance/backend-standardization.md
Read domain configdocs/product/architecture/domains.md
Read this docdocs/product/architecture/system-layout.md (you are here)

SlashOne's Organization is the user-defined bucket that groups a user's per-product workspaces into a single addressable container.

┌─────────────── SlashOne ───────────────┐
│  Organization: "Acme Ltd"             │
│  ┌─────────────────────────────────┐  │
│  │ Workspace  (SlashStudio)        │  │  ← existing per-product entity
│  │ Workspace  (SlashStudio)        │  │     (created in the product, imported
│  │ Company    (SlashBooks)         │  │      into the Org via the discovery flow)
│  │ Outlet     (TimePlate)          │  │
│  └─────────────────────────────────┘  │
│                                       │
│  (No Org)  ─  workspaces created before│
│              the Org feature, or       │
│              workspaces not yet in     │
│              any Org                    │
└───────────────────────────────────────┘
  • On first sign-in SlashOne auto-creates one personal Org ("My Workspace").
  • Users can create more Orgs to group per-product entities.
  • Each product implements /api/v1/internal/ai/org-context so it can default-scope to the right company/workspace for the current Org.
  • Service JWTs from SlashAI to products carry orgId + workspaceId claims.
  • See orgs-cutover.md for the migration runbook.

Earlier revisions of this page described a single "OS" with modules and a brand hierarchy. That shape was rejected on 2026-11-15 (DEC-0225): there is no OS, the foundation is three services, and products are separate sites. The archived marketplace and the frozen mobile client are outside the estate (DEC-0212, DEC-0225 §5) and are recorded in the decision log, not here.


Last reviewed: 2026-11-17 — rebuilt against DEC-0225: foundation + separate product sites; the archived marketplace and the frozen client removed from every current-state table; product/app/workflow lists re-verified against the repos; SlashMarketer stated as public beta with its FastAPI stack retained; PRODUCT_DIRS counts no longer stated as a product count.

Prior: 2026-10-09 — SlashMarketer state reconciled to code: monorepo built with apps/web live at marketer.slashhub.hk and apps/api (FastAPI); removed the pre-build status wording; corrected Makefile scope.

Prior: 2026-10-04 — Corrected: SlashMarketer is scaffolded (FYP Round 1: apps/web, apps/api, apps/mirofish), not "pending"; part of DOC-1a doc-vs-code reconciliation.

Prior: 2026-07-02 — Audit fixes: doc count 10→13, "6 products" → "6 production products (SlashMarketer pending)" throughout, tooling section now flags SlashMarketer's Python stack.