Contracts first
@ysk-kit/contracts is the only source of enums, DTOs, error codes, and ts-rest routes. Do not use TypeScript enum.
This repository is the living saas flavor. Identity, files, notifications, jobs, mail, API keys, crypto, and realtime are already wired. Product domains stay out of the kit.
pnpm create @ysk-kit/appysk-kit add modulepnpm layers · testapps/web ──► @ysk-kit/web-sdk ──► @ysk-kit/contracts
▲
apps/api (HTTP adapter) ──────────────┤
│ │
▼ │
application / use-cases ─────────────┤
│ │
▼ │
domain (entities, ports) ────────────┘
▲
│ implements
infra (prisma, redis, s3, mail)
@ysk-kit/contracts is the only source of enums, DTOs, error codes, and ts-rest routes. Do not use TypeScript enum.
The business core does not know Express, Prisma, or React. Domain and application depend on ports. pnpm layers enforces this.
Browsers, phones, partners, and agents share REST + OpenAPI. Clients talk to the API only through @ysk-kit/sdk.
Auth, jobs, and billing are not required in every product. Thin strips llm / billing / orgs / push; add them back when you need them.
| Area | What you get |
|---|---|
| Scaffold | pnpm create @ysk-kit/app; from this checkout pnpm --filter @ysk-kit/create-app start |
| Flavors | saas, desktop, gateway, php-bridge, trading, static-web3 |
| Preset | Default thin; full keeps the living demonstration |
| Database | Prisma 7, MySQL default; --db postgresql|sqlite |
| HTTP | Express 5 default; HTTP_ADAPTER=fastify |
| Envelope | { ok, data } / { ok, error }; four documented exceptions |
| Clients | Vite 8 + React 19; Expo 57; Electron 44 |
| CLI | ysk-kit / yskk: add module, add capability, upgrade, check agent |
| Examples | Ten overlays: clinic, CRM, stock, tickets… |
| Guardrails | ysk-kit upgrade refreshes law / skills / TypeScript / Biome; check agent flags enum, client Prisma, raw fetch |
| Default ports | API 3001 · Web 5173 · Admin 5174 · OpenAPI /docs |
| Ops | Compose + PM2; optional Jaeger / Prometheus / Grafana |
--flavor picks apps; --preset then thins optional capabilities. php-bridge and static-web3 ignore preset.
| Flavor | What you get |
|---|---|
saas | API + web + admin + optional mobile |
desktop | API + Electron |
gateway | API + admin (machine API keys ysk_live_…) |
php-bridge | OpenAPI + TypeScript / PHP clients, no Node apps |
trading | API + web + worker |
static-web3 | Vite web only |
--no-admin / --no-mobile apply; so do --preset and --db@ysk-kit/sdk (platform: desktop)safeStoragePOST /v1/me/api-keys, then Authorization: Bearer ysk_live_…GATEWAY.mdrequest()TRADING.md@ysk-kit/* client libraries only. No Prisma, no DATABASE_URLAPI_PUBLIC_URL at a remote API if the UI needs oneWEB3.mdysk-kit add <name> merges a catalogued capability. ysk-kit add module writes one hexagonal HTTP slice. Do not confuse the two.
llm, team (organizations), billing, push (devices)pnpm ysk-kit add llm|team|billing|push. billing needs team first| Name | What it adds |
|---|---|
auth | Session / OTP Prisma, JWT, OTP TTL, optional Twilio |
rbac | Permissions already live in ROLE_PERMISSIONS |
audit-log | Audit Prisma fragment |
storage | FileObject, S3_*, @ysk-kit/storage |
i18n | Default locale zh-HK |
jobs | Redis + BullMQ; in-memory queue when REDIS_URL is unset |
mail | SMTP; log adapter when empty |
notifications | In-app notification routes |
llm | Chat Completions; copies a source tree |
websocket | Socket.IO realtime |
push | Devices + Expo / FCM |
mobile | Points at the Expo template |
team | Organization + Membership (alias org) |
apikey | ApiKey fragment |
crypto | AES-256-GCM, CRYPTO_MASTER_KEY |
billing | Stripe Checkout; needs Organization first |
ysk-kit add module^[a-z][a-z0-9-]*$. URL is /v1/<name>--prisma merges a title / body / authorId modelapplication/, and run pnpm db:migrate && pnpm gen:openapiHumans and AI agents follow the same path: scaffold thin, add a module, fill application/ and Prisma, then verify with pnpm layers.
{ ok: true, data }; failure { ok: false, error }. Pagination lives inside datacode values live in contracts (VALIDATION_FAILED, UNAUTHENTICATED, NOT_FOUND…)POST /v1/llm/stream SSE; invoice PDF HTTP 302; GET /docs HTML; GET /openapi.json| Layer | Default |
|---|---|
| Monorepo | pnpm 12.8.1 + Turborepo 2 |
| Language | TypeScript 6 strict + exactOptionalPropertyTypes |
| Web / admin | Vite 8 + React 19 + TanStack Router / Query + Tailwind 4 |
| Mobile | Expo 57 |
| Desktop | Electron 44 |
| HTTP | Express 5; Fastify 5 optional |
| Contract | ts-rest + Zod 4 |
| Database | Prisma 7 (MySQL default) |
| Auth | JWT + refresh; email/password and +852 OTP |
| Observability | Prometheus GET /metrics; optional OTLP / Jaeger / Grafana |
contracts · domain-kernel · applicationapi-http · api-express · api-fastifysdk · web-sdk · ui · ui-logicauth · apikey · cryptojobs · mail · storage · i18nllm · push · realtimeysk-kit upgrade, not installing registry @ysk-kit/* into the destination product@ysk-kit/auth, jobs, mail, push, or the AWS SDK@ysk-kit/uiFrom npm: pnpm create @ysk-kit/app. From this checkout: pnpm --filter @ysk-kit/create-app start. YSK_ROOT selects which product tree the CLI patches.
--preset thin|full, --db mysql|postgresql|sqlite, --flavor, --no-admin, --no-mobile, --yesyanshekki/ysk-kit at tag v{version}add module <kebab> [--prisma] [--web]add <capability>generate openapi (same as pnpm gen:openapi)upgrade [--dry-run]: copy allowlisted law, skills, TypeScript / Biome, pnpm layerscheck agent: flag TypeScript enum, Prisma in clients, raw fetch(clinic-booking · crm-contacts · inventory-stock · helpdesk-tickets · membership-clubcourse-enrollment · invoice-quotes · event-rsvp · job-board · field-work-orderspnpm --filter @ysk-kit/examples start apply clinic-booking --yespnpm layers && pnpm typecheck && pnpm test && pnpm gen:openapi && pnpm ysk-kit check agent[email protected] / ysk-admin-dev (see .env.example)The five shots below are the real clinic-booking UI (1280×800), not invented admin chrome. Concept art is labelled separately.


Module page: list + create on the same Zod schema. Real screenshot.

Overlapping SCHEDULED slots are rejected. Real screenshot.

One appointment row inside the envelope. Real screenshot.

GET /docs Scalar UI. Real screenshot.

Capabilities and flavors interlock like hex tiles. Concept art.

Contracts, application, infra. Concept art.

Web, phone, desktop, and gateway share contracts. Concept art.
pnpm devpnpm create @ysk-kit/app my-product --preset thin --db mysql --flavor saas
cd my-product
pnpm install
cp .env.example .env
docker compose up -d mysql
pnpm db:generate && pnpm db:migrate && pnpm db:seed
pnpm ysk-kit add module appointment --prisma --web
pnpm gen:openapi
pnpm dev
# API http://127.0.0.1:3001 · Web :5173 · Admin :5174
Need a scaffold, white-label, or a custom build? See Business — no prices on this page.
YSK Kit is published under MIT. YSK Limited can scaffold a product, add modules and capabilities, white-label AppShell, or custom-build from the kit — no fee for open-source use; custom work is quoted in writing.
For self-serve scaffold, internal trials, and open-source work.
pnpm create @ysk-kit/appFor teams that need a flavor chosen, white-label, production, or a PHP bridge.
Pick a flavor and database; get a runnable API / web / admin.
php-bridge emits envelope-aware TypeScript and PHP clients.
One contract set. Vite, Expo, and Electron all go through @ysk-kit/sdk.
Compose + PM2; optionally onto YSK Server.
| Custom scope | Notes |
|---|---|
| Scaffold | Node 24, pnpm 12, flavor / preset / database, first migrate / seed, pnpm dev |
| Modules and capabilities | add module, llm / team / billing / push, fields and business rules |
| White-label | AppShell name, mark, default locale zh-HK / en |
| Flavor cut | Gateway keys, desktop Electron, php-bridge, trading worker, static-web3 |
| Production | Compose, PM2, reverse proxy, optional YSK Server |
| Training | Contracts first, envelope, pnpm layers, agent skills |
| After delivery | Docs, remote training, warranty window. Small follow-ups can use outsourcing monthly tech tickets |
From enquiry to warranty, every step has a written scope. Open-source download and scaffold / custom work are billed separately.
Honest limits: YSK Kit is not multi-tenant SaaS. YSK does not turn your product into YSK cloud. Industry domains stay in the product repo. CI does not start Redis / Stripe / Twilio by default. YSK does not apply for cloud accounts on your behalf.
Yes. MIT licensed for you to install. YSK does not charge for that use. Scaffold and custom work are quoted by scope.
Flavor, modules, white-label, and production vary widely. The written proposal is the quote. Small follow-ups can use existing outsourcing monthly tech tickets; larger work is a project.
No. The product still runs on a host you own or the contract names. YSK does not operate a multi-tenant cloud edition of YSK Kit.
Direct answer: Yes. MIT licensed for you to install. Scaffold or custom work: see Business. No prices on this page.
Direct answer: Omni is a local-model gateway. Server is a single-host Linux control plane. Kit is the contract-first platform you scaffold a new product from.
Direct answer: Node.js 24 and pnpm 12. Default ports: API 3001, web 5173, admin 5174.
Direct answer: Thin (default) strips llm, billing, organizations, and push. Full keeps the living demonstration. Restore with pnpm ysk-kit add.
Direct answer: No. Product domains stay in the product repository. The ten examples are overlays applied onto a new directory.
Direct answer: No. The product still runs on a host you own or the contract names. YSK does not operate a multi-tenant cloud edition of YSK Kit.
MIT · YSK Limited. Contract-first. Scaffold a product in fifteen minutes. Scaffold or custom work quoted in writing.