All guide pages
Run it locally
How-to
Run the FairPay appLink to this section
- Install dependencies from the repository root.bash
npm install - Start it.bash
npm run dev:fairpayThis builds the SDK, starts the API on
127.0.0.1:8788and the web app onhttp://localhost:5174.
With no settings, the app keeps its data in a built-in local database (apps/fairpay/data) and runs with the relayer and faucet off: you can sign in, split bills and browse FairEats, but private payments and the test USDC faucet are off. To turn them on, put testnet-only RELAYER_KEY, FAUCET_KEY and MERCHANT_ADDRESS in apps/fairpay/.env. If that file doesn't set them, the app reads them from apps/faireats/.env. MERCHANT_ADDRESS also creates the demo restaurant, Saffron Table, on first start. The server refuses to start if the relayer and faucet keys are the same.
Check: open http://localhost:5174. You should see "Split the bill. Everyone pays their part." and the footer should say "Data: local database". Tests: npm run test:fairpay.
Run the standalone FairEats appLink to this section
Careful: use keys that hold only testnet funds. Never paste a key that holds real money into .env, and never commit .env.
- Install dependencies from the repository root.bash
npm install - Create your environment file.bash
cp apps/faireats/.env.example apps/faireats/.envOn Windows PowerShell:
PowerShellCopy-Item apps/faireats/.env.example apps/faireats/.env - Fill in the four required values in
apps/faireats/.env:apps/faireats/.envRELAYER_KEY=0xYOUR_TESTNET_RELAYER_KEY FAUCET_KEY=0xYOUR_TESTNET_FAUCET_KEY MERCHANT_ADDRESS=0xYOUR_ALLOWLISTED_PAYOUT_ADDRESS KITCHEN_PIN=choose-at-least-6-charactersOptional:
PORT(default 8787),RPC_URL(defaulthttps://),testnet-rpc .monad .xyz DB_FILE,TRUST_PROXY_HOPS,INDEXER_CONFIRMATIONS. The server refuses to start if a required value is missing or malformed. - Start the app in development mode.bash
npm run devThis builds the SDK, starts the API on
127.0.0.1:8787and Vite onhttp://localhost:5173.
Check: open http://localhost:5173. You should see "Tonight at Saffron Table" and the menu. The kitchen is at http:// with your KITCHEN_PIN.
Production build of FairEats locallyLink to this section
npm startThis builds the SDK and the frontend, then serves both on http://127.0.0.1:8787 with the strict Content-Security-Policy.
Build this website and the demo locallyLink to this section
The pages you are reading and the demo at /app/ are one static build. It needs no .env and no keys.
npm install
npm run build:vercel
npm run preview -w sitebuild:vercel builds the SDK, builds FairEats in demo mode (npm run build:demo -w faireats, output apps/), builds this site into apps/site/dist, then copies the demo into apps/site/dist/app and checks the output for anything that looks like a key.
Check: open http://localhost:5182 for the site and http:// for the demo. Stop the preview with Ctrl+C.
To work on the site with live reload, run npm run dev -w site (port 5181). The demo is not served in this mode; build it as above.