Skip to content
MSO CloudDocumentation

From clone to a running app with sample data

On this page

You finish with the web app and the worker running on your machine, a sample organization to look at, and the inner-loop checks passing. Plan for about 30 minutes, most of it the first pnpm install and image pulls.

Before you start#

Need Version Where it is pinned
Node 26.13.1 .nvmrc; engines in package.json is >=26.13.0 <27
pnpm 12.23.0 packageManager in package.json; Node 26 has no Corepack, so install it with npm install -g pnpm@12.23.0
Docker with Compose any current docker-compose.yml starts Postgres, Redis and RustFS (S3-compatible storage)
Python 3.10 or newer only for the audit scripts in scripts/audit/
Free disk 20 GiB start-dev.sh stops below that

Check what you have:

node --version          # v26.13.x
pnpm --version          # 12.23.0
docker compose version

If a default port is taken on your machine, set WEB_PORT, PG_PORT, REDIS_PORT, MINIO_API_PORT or MINIO_CONSOLE_PORT in .env after step 2 and before step 3.

Steps#

  1. Clone and install.

    git clone <repository URL from your onboarding invite>
    cd <the cloned directory>
    pnpm install
    

    Run pnpm install again after every pull. Cannot find module 'zod' together with a node_modules missing warning means a reinstall is due; do not edit a tsconfig or an import to work around it.

  2. Create .env from the example.

    cp .env.example .env
    

    Leave the values as they are. The example ships local-only defaults: DATABASE_URL points at the Compose Postgres, NEXTAUTH_URL at http://localhost:3000, ENCRYPTION_KEY is all zeros. start-dev.sh replaces a missing or placeholder NEXTAUTH_SECRET, SESSION_SECRET, ENCRYPTION_KEY, RLS_CONTEXT_HMAC_KEY and CUBE_API_SECRET with openssl rand -hex 32 values (it prints generated <KEY> in .env). Do not paste a real vendor token, a production key or a password from another system into this file. Connector credentials you add later go through the app, which stores them encrypted with ENCRYPTION_KEY.

  3. Bring up the data plane, migrate and seed.

    ./scripts/start-dev.sh --no-app
    

    In order, the script starts Postgres, Redis and RustFS with docker compose up -d, waits for Postgres and Redis, runs pnpm --filter @yng/schema migrate, then seeds sample data with pnpm tsx scripts/generate-sample-data.ts unless an organization with is_sample = true already exists. It then seeds a super admin (pnpm seed:admin) and a second demo tenant, and starts the Cube semantic layer on :4000 (best effort: a slow Cube only warns; add --no-cube to skip it).

    Flag Effect
    --reseed wipe and recreate the sample data
    --no-seed skip seeding, for real-org work
    --no-cube do not start Cube
    pnpm sample:remove drop the sample data later
  4. Start the app.

    ./scripts/start-dev.sh --foreground     # live logs in this terminal, Ctrl-C stops the app
    

    Without a flag the script runs pnpm dev (web and worker through Turborepo) detached, writes .dev-server.log and .dev-server.pid, and returns once http://localhost:3000 answers. Keep one dev server per checkout: a second pnpm dev is refused when the ports are held. To stop everything, run ./scripts/stop-dev.sh (containers and app, data kept) or ./scripts/stop-dev.sh --volumes (also wipes Postgres, Redis and RustFS data).

    Check both processes:

    curl -fsS http://localhost:3000/api/health
    curl -fsS http://localhost:9464/ready      # worker; WORKER_METRICS_PORT overrides 9464
    
  5. Sign in. Open http://localhost:3000/auth/signin. The sample organization is sample-retailer; its owner is demo@yng.local. The password is in scripts/CREDENTIALS.md, which is tracked in git: treat every password in it as public, use it only against this local stack, and never reuse it elsewhere. The sample data holds brands, orders across TikTok Shop, Shopee and Lazada, creators and inventory, so the dashboards render with numbers.

  6. Run the inner loop. From the repository root:

    pnpm run typecheck
    pnpm run lint
    pnpm test
    pnpm run audit:all
    

    pnpm test is pure unit (no database, Redis or network; a socket opened in a unit test fails it) and also runs the script tests. Run test and verify at the root, never through --filter, which hides cross-package failures. pnpm run verify is the complete local non-browser gate (format, typecheck, lint, test, build, security scan, verify:data, verify:rls, audit:all) and needs the data plane from step 3 running. On a 16-core or smaller machine, do not run typecheck, test and a build at the same time.

If it fails#

Symptom Cause and fix
REFUSING TO RUN — this host looks like production A production signal was found (a production env file, production Compose services, NODE_ENV=production). You are on the wrong machine.
insufficient free disk space Fewer than 20 GiB free. Clear generated caches (apps/web/.next/dev, .turbo) or free disk.
an app dev port is already in use Another pnpm dev holds :3000 or :9464. Run ./scripts/stop-dev.sh, or KILL_PORT_HOLDER=1 ./scripts/start-dev.sh, or pick WEB_PORT=3001 WORKER_METRICS_PORT=9465.
pnpm install reports peer-dependency errors pnpm is not the pinned version. npm install -g pnpm@12.23.0.
Postgres permission denied for table X Row-level security blocked an unscoped query. Use orgProcedure or brandProcedure, or wrap the whole short DB unit in runWithRlsContext (Coding standards).
Cube not ready after 60 s The app still starts. Check docker compose logs cube, or start with --no-cube.

Where to go next#