System Layout & Architecture
Multi-monorepo shape, standardized tooling, deployment topology, and the 9-pillar enterprise blueprint.
SlashOne
Your account, your subscription, your products
One account for the suite: one sign-in, one bill, one place to see every product you own.
Next.js 16 (web)NestJS 11 (api Phase 1-4)FirestorePostgresTL;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 canonicalbackend-coreNestJS infrastructure synced via script. Frontends deploy to Vercel, backends to Railway. Seeecosystem.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.
| Product | Domain (frontend / backend) | Type | Backend | Frontend | CI |
|---|---|---|---|---|---|
| SlashOne | slashhub.hk + app.slashhub.hk / api.slashone.slashhub.space | Public site, account, SSO, subscription | NestJS 11 ✅ | Next.js | CI ✅ |
| SlashBooks | books.slashhub.hk / api.books.slashhub.space | Accounting | NestJS 11 ✅ | Next.js | CI ✅ |
| SlashStudio | studio.slashhub.hk / api.studio.slashhub.space | Client work | Express | Next.js | CI ✅ |
| SlashMarketer | marketer.slashhub.hk / api.marketer.slashhub.space | Campaigns + attribution — public beta | FastAPI | Next.js | CI ✅ |
| TimePlate | timeplate.slashhub.hk / api.timeplate.slashhub.space | Workforce / HR | Express (→ NestJS) | Next.js + Expo mobile | CI ✅ |
| SlashAI (foundation) | ai.slashhub.hk / api.slashai.slashhub.space | Cross-product agent | NestJS 11 ✅ | Next.js | CI ✅ |
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
| Tool | Version | Purpose |
|---|---|---|
| TypeScript | ^6.0.3 | Language |
| pnpm | 11.5.1 | Package manager |
| Turborepo | ^2.10.0 | Build orchestration |
| Node.js | 22 | Runtime |
| Next.js | ^16.2.9 | Frontend framework |
| NestJS | ^11.1.27 | Backend framework |
| Express | ^5.2.1 | Legacy backend (being migrated) |
| ESLint | ^9.22 | Linting (flat config) |
| Prettier | ^3.9.0 | Formatting |
| Husky | ^9 | Pre-commit hooks |
| lint-staged | ^15 | Run linters on staged files |
| Firebase | Admin SDK ^14.1.0 | Auth + Firestore + Storage |
| Zod | ^4.4.3 | Schema 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 inecosystem.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()decoratorLoggingInterceptor(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:
rsyncsource files (excludingnode_modules,dist)- Rewrite
@slashhub/backend-core→@<product>/backend-coreinpackage.json+README.md
| Product | Package Name |
|---|---|
| SlashOne | @slashone/backend-core |
| SlashBooks | @slashbooks/backend-core |
| SlashStudio | @slashstudio/backend-core |
| SlashAI | @slashai/backend-core |
| Product | Backend | Status |
|---|---|---|
| SlashOne | NestJS 11 | ✅ Migrated |
| SlashAI | NestJS 11 | ✅ Migrated |
| SlashBooks | NestJS 11 | ✅ Migrated (running) |
| SlashStudio | Express | 🔴 Pending (apps/api) |
| TimePlate | Express | 🔴 Pending (apps/api) |
| SlashMarketer | FastAPI | ⚪ 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:
| Product | App(s) | Status |
|---|---|---|
| SlashOne | apps/web, apps/admin | ✅ |
| SlashBooks | apps/web | ✅ |
| SlashStudio | apps/workspace | ✅ |
| SlashMarketer | apps/web | ✅ |
| TimePlate | apps/admin, apps/admin-platform, apps/expo-mobile-app | ✅ |
| SlashAI | apps/web | ✅ |
Each Next.js app follows the same conventions:
- TypeScript strict mode
- ESLint flat config (root +
@next/eslint-plugin-next) tsconfig.jsonextends roottsconfig.base.json(withjsx: react-jsx)- pnpm workspaces for
@<product>/sharedetc.
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@v4actions/setup-node@v4(Node 22)- Turbo cache for build acceleration
--frozen-lockfilefor 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-commitexists,_/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.
| Team | Product | Packages Owned |
|---|---|---|
| Backend A | SlashBooks | slashbooks/packages/backend-core |
| Backend B | TimePlate | timeplate/apps/api |
| AI Team | SlashAI | slashai/packages/backend-core |
| Platform | SlashOne | slashone/packages/backend-core, slashone/schemas/events/ |
| Studio | SlashStudio | slashstudio/apps/workspace |
| Frontend | All frontends | apps/web, apps/admin |
- Independent deployability — Each product ships its own Railway/Vercel deploy. A bug in one doesn't block another.
- Parallel team development (多人併發) — Teams work in independent repos/monorepos without stepping on each other.
- 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.)
- Canonical + synced backend-core — One source of truth (
Slashhub/packages/backend-core/), distributed by script. Drift is detectable viamake check-sync. - Convergent backend — All production backends converge on NestJS. Express backends are legacy; migration is tracked in
docs/product/governance/backend-standardization.md. - Cross-product orchestration — Root
Makefileenables unifiedmake lint/make buildetc. acrossPRODUCT_DIRS. - Automated verification —
scripts/verify-standardization.shruns the full compliance gate; failures indicate drift.
| Task | Command |
|---|---|
| Verify all standards | bash scripts/verify-standardization.sh |
| Sync backend-core | make sync |
| Check sync only | make check-sync |
| Lint everything | make lint |
| Typecheck everything | make typecheck |
| Build everything | make build |
| Lint one product | make <product>-lint |
| Read backend spec | docs/product/governance/backend-standardization.md |
| Read domain config | docs/product/architecture/domains.md |
| Read this doc | docs/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-contextso it can default-scope to the right company/workspace for the current Org. - Service JWTs from SlashAI to products carry
orgId+workspaceIdclaims. - See
orgs-cutover.mdfor 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.
Continue reading
Ecosystem
7-product portfolio + 3-layer positioning + relationship map. The strategic view of what each product is, who it serves, and how they relate.
~8 min read
Use Cases
Concrete, persona-driven scenarios for every product. Freelancer / OPC / SME personas with end-to-end flows.
~25 min read
Domains
Domain mapping (.hk / .space) and CORS allowlist. Every product site, frontend + backend URLs, dev stack.
~3 min read