Skip to content
PlutoDocs

Quickstart

Run the Pluto app against the mock API on your machine. About 3 minutes.

Real screen, captured from the app
  1. 1Live quotes from the mock API
  2. 2A real route: 70% Uniswap v4, 30% V3 fork
  3. 3A dev wallet that signs but never broadcasts

Run it

Your local setup
Browserlocalhost:3000
Pluto appbun run dev
NEXT_PUBLIC_API_URL
Mock API127.0.0.1:4010
openapi.yamlsrc/lib/api/
Mock API$ bunx @stoplight/prism-cli mock src/lib/api/openapi.yaml -p 4010
Pluto app$ bun run dev

Answers are fixed examples from the spec

Start the mock API

The mock serves src/lib/api/openapi.yaml on port 4010.

Terminal 1
bunx @stoplight/prism-cli mock src/lib/api/openapi.yaml -p 4010

Have the backend repo?

cd pluto-be/api && npm i && npm run mock serves the same contract.

Install and configure

Terminal 2
# NEXT_PUBLIC_API_URL=http://127.0.0.1:4010
cp .env.example .env.local
bun install

Start the app

Terminal 2
# http://localhost:3000 → /swap
bun run dev

Env vars

The app reads two variables. Everything else (chain, contracts, limits, feature flags) comes from GET /config.

Where settings come from
.env.local
  • NEXT_PUBLIC_API_URLrequired
  • NEXT_PUBLIC_WC_PROJECT_IDoptional
GET /config
Everything else, at runtime
Chain · 99901Contracts · 7Limits · default 0.5% · max 50%Feature flags · 4
Source: .env.example · GET /config

Dev-only tools

Real screen, captured from the app
  1. 1Mock API variants: one menu per endpoint
  2. 2Pick an error, an approval step or a relay state
  3. 3Dev wallet: reject the next request, or start on the wrong network
  4. 4The Mock QA button, bottom left in dev builds

Mock QA and the dev wallet are left out of production builds.

Check your work

The checks, in order
  1. 1Typesbun run typecheckAPI drift, wrong props
  2. 2Lintbun run lintHook misuse, dead code
  3. 3Formatbun run format:checkStyle noise in diffs
  4. 4Unit testsbun run testBroken maths and rules
  5. 5Buildbun run buildBroken pages and MDX
Source: package.json → scripts
bun run typecheck && bun run lint && bun run format:check && bun test && bun run build