Skip to content
MSO CloudDocumentation

Onboarding

On this page

Goal: from git clone to a working dashboard with your name in it, in under 30 minutes. The step-by-step version with checks per step is From clone to a running app.

Prerequisites#

  • macOS, Linux, or WSL2.
  • Docker Desktop (or compatible) — for Postgres, Redis, RustFS (the S3-compatible object store).
  • Node 26.13.1 (.nvmrc; package.json engines >=26.13.0 <27).
  • pnpm 12.23.0 (packageManager pin; npm install -g pnpm@12.23.0, since Node 26 has no Corepack).
  • Python 3.10+ — only for scripts/audit/*.py audit scripts.

First-time setup#

git clone https://github.com/younetgroup/yng-mso-platform.git
cd yng-mso-platform

cp .env.example .env
# No edits needed: start-dev.sh replaces the placeholder NEXTAUTH_SECRET,
# SESSION_SECRET, ENCRYPTION_KEY, RLS_CONTEXT_HMAC_KEY and CUBE_API_SECRET
# with generated values. All other defaults work for local dev.

pnpm install

# Starts Postgres/Redis/RustFS, migrates, seeds, then runs `pnpm dev` detached
# (logs: .dev-server.log; stop: ./scripts/stop-dev.sh; --foreground streams logs).
# Occupied ports: set WEB_PORT / PG_PORT / REDIS_PORT in .env first.
./scripts/start-dev.sh

Open http://localhost:3000. Sign in with one of the seeded accounts documented in scripts/CREDENTIALS.md. Those are deterministic seed passwords for dev/staging only — and the file is tracked in git, so treat every password in it as public: never reuse one elsewhere, and rotate/override each account before any non-local deployment .

What you got#

A sample org (brands, orders across TTS / Shopee / Lazada, creators, inventory). Migrations: packages/schema/drizzle/ (numbered, applied in order). RLS policies: packages/schema/sql/rls-policies.sql, mandatory for every org-scoped table.

Running the gate locally#

Run the canonical complete local gate before any push:

pnpm run verify   # format → types → lint → test → build/topology → security → data/RLS → audits

audit:all in package.json is the one list of static audits; do not re-list them.

verify:data (scripts/audit/data-reconciliation.ts) reconciles metric surfaces against live data, and verify:rls probes effective non-superuser roles, so both need the local data plane up and seeded (./scripts/start-dev.sh). The pre-push hook is a fast non-DB subset. CI additionally runs fresh-database gates and an isolated Playwright smoke; run pnpm run test:e2e for operator journeys touched by your change.

Never --no-verify.

Common dev tasks#

You want to… Do this
Add a database table Edit packages/schema/src/tables/*.ts, export from packages/schema/src/tables.ts. Run pnpm --filter @yng/schema db:generate. Add RLS policy + indexes.
Add a tRPC route New file under apps/web/src/server/routers/. Register in root.ts. Use orgProcedure / brandProcedure. Every mutation calls a rateLimit* helper.
Add a queue job Add it to the shared durable-job contract, enqueue web-originated work with enqueueDurableJob(...) in the domain transaction, then add the worker processor/wiring. Define stable colon-free job ID, idempotency, retry and DLQ classification.
Add a connector Follow Add a data source; a worked marketing example is Add a connector.
Add Vietnamese copy Add the key to packages/i18n/src/messages/vi.ts AND en.ts. Never hardcode in JSX.
Add an icon Edit packages/ui/src/components/icons.tsx. Never inline an SVG in a page component.
Debug a SQL query pnpm --filter @yng/schema db:studio opens Drizzle Studio against local Postgres.
Test a feature in the browser ./scripts/start-dev.sh (or --foreground for E2E/live logs). Follow the Verification section of AGENTS.md before claiming "done".

Troubleshooting#

  • pnpm install fails with peer-dep errors. Make sure pnpm is the exact version pinned in package.json#packageManager (npm install -g pnpm@12.23.0).
  • pnpm dev says port 3000 is in use. Override WEB_PORT in .env, restart ./scripts/start-dev.sh.
  • i18n-hardcoded-vi regression. You added a string with Vietnamese diacritics directly in JSX. Move it to packages/i18n/src/messages/{vi,en}.ts and reference via t(). If you intentionally refactored several files at once and counts genuinely decreased, refresh the baseline: python3 scripts/audit/i18n-hardcoded-vi.py --update-baseline.
  • Postgres "permission denied for table X". RLS blocked an unscoped path. Use orgProcedure / brandProcedure or wrap the complete short DB unit in runWithRlsContext; a bare setOrgContext outside a transaction does not enforce or persist context.

In this section