build: Vercel builds against the real API by default

- new `app:build` script bakes NEXT_PUBLIC_LMS_API=https://api.rezina.yaltopia.com into
  the student app; the URL lives in package.json, so nobody sets it by hand
- vercel.json runs `app:build`, so a deploy of this branch talks to the API with no
  dashboard settings
- `demo:build` (the hosted artifact demo) is unchanged and keeps demo data: its sandbox
  blocks calls to outside servers (artifact check: no network attempts)
- README: Vercel section updated, including how to build the old in-memory demo
This commit is contained in:
n3p-tun3 2026-11-02 20:00:19 +03:00
parent d92180542b
commit ff5772e9cf
3 changed files with 9 additions and 3 deletions

View File

@ -31,6 +31,6 @@ npx -y pnpm@9 run i18n:check # every locale has every key
node tools/waitlist-check.mjs # waitlist Apps Script: validation, dedupe, formula-injection guard node tools/waitlist-check.mjs # waitlist Apps Script: validation, dedupe, formula-injection guard
``` ```
**Vercel (standalone demo):** `vercel.json` builds the static export, then `tools/vercel-build.mjs` injects the runtime mock and the seed. Outside Claude, all data lives in memory in each visitor's browser and resets on reload. Deploy with `npx vercel deploy --prod`. **Vercel:** `vercel.json` runs `app:build`, which builds the student app against the real API (`https://api.rezina.yaltopia.com`, set in `package.json`). `demo:build` stays on demo data: it feeds the Claude-hosted demo, whose sandbox can't reach outside servers. To preview the old in-memory demo on Vercel, build with `npx -y pnpm@9 --filter demo build && node tools/vercel-build.mjs`. Deploy with `npx vercel deploy --prod`.
Phases 1–3 (Fastify API, Postgres, ArifPay, R2 video) haven't started yet. They wait on decisions D1, D2 and D8 in SPEC §17. Phases 1–3 (Fastify API, Postgres, ArifPay, R2 video) haven't started yet. They wait on decisions D1, D2 and D8 in SPEC §17.

View File

@ -3,6 +3,7 @@
"private": true, "private": true,
"packageManager": "pnpm@9.15.9", "packageManager": "pnpm@9.15.9",
"scripts": { "scripts": {
"app:build": "NEXT_PUBLIC_LMS_API=https://api.rezina.yaltopia.com pnpm --filter demo build",
"demo:build": "pnpm --filter demo build && node tools/artifact-inline.mjs apps/demo/out dist/demo.html && node tools/artifact-check.mjs dist/demo.html", "demo:build": "pnpm --filter demo build && node tools/artifact-inline.mjs apps/demo/out dist/demo.html && node tools/artifact-check.mjs dist/demo.html",
"test": "node packages/features/src/domain.check.ts && node packages/data/src/api.check.ts", "test": "node packages/features/src/domain.check.ts && node packages/data/src/api.check.ts",
"typecheck": "pnpm -r exec tsc --noEmit", "typecheck": "pnpm -r exec tsc --noEmit",

View File

@ -1,7 +1,12 @@
{ {
"installCommand": "npx -y pnpm@9 install --frozen-lockfile", "installCommand": "npx -y pnpm@9 install --frozen-lockfile",
"buildCommand": "npx -y pnpm@9 --filter demo build && node tools/vercel-build.mjs", "buildCommand": "npx -y pnpm@9 run app:build",
"outputDirectory": "apps/demo/out", "outputDirectory": "apps/demo/out",
"framework": null, "framework": null,
"rewrites": [{ "source": "/waitlist", "destination": "/waitlist/index.html" }] "rewrites": [
{
"source": "/waitlist",
"destination": "/waitlist/index.html"
}
]
} }