Development
Requirements
Node 22 or newer, Docker, and a Reown project id for wallet connections.
First run
npm install
cp .env.example .env.local # then fill in the values below
docker start mutate-postgres-1 mutate-redis-1 # or your own Postgres and Redis
npm run db:migrate
npm run dev # http://localhost:3000
npm run worker # in a second terminal
Postgres listens on port 54329 and Redis on 56379 (see .env.example).
Environment
The full list is in .env.example. The values you need first:
| Variable | Purpose |
|---|---|
APP_URL, NEXT_PUBLIC_APP_URL | The site origin; write routes reject other origins |
NEXT_PUBLIC_REOWN_PROJECT_ID | Wallet connections. Add the site's domain in the Reown dashboard |
DATABASE_URL, REDIS_URL | Data stores |
SOLANA_CLUSTER, SOLANA_RPC_URLS, NEXT_PUBLIC_SOLANA_RPC_URL | Chain access. Only devnet executes transactions |
PROTOCOL_METADATA_AUTHORITY | Required to prepare a launch: the protocol wallet's public key |
PUBLIC_METADATA_BASE_URL | A public origin serving /api/metadata and /api/media; localhost is rejected |
METADATA_VOTING_MINUTES, METADATA_PROPOSAL_COOLDOWN_HOURS | Holder vote length on identity changes (default 10) and the wait before the creator may propose another change for the same token (default 24) |
DBC_MIGRATION_USD_TARGET | Graduation target in USD (default 750) |
MUTATE_MUTATION_FEE_USD_CENTS | The one-time mutation fee in USD cents (default 1900) |
MUTATE_TOKEN_MINT, MUTATE_PRICE_API_KEY | Needed for any $MUTATE quote or burn |
IMAGE_PROVIDER | openai (default) or mock. mock is devnet only: no API key, fake deterministic edits |
MUTATE_DEVNET_USD_PRICE | Devnet only: fixed USD price for $MUTATE (replaces the Jupiter key). Also makes $MUTATE selectable as a pair |
JUPITER_TOKENS_API_URL | Optional override for the token list API |
BLOB_READ_WRITE_TOKEN | Optional. When set, images go to a private Vercel Blob store instead of UPLOAD_DIR |
DATABASE_POOL_MAX | Optional. Connections per process (default 5) |
Image generation needs an OpenAI key and is disabled otherwise: image jobs then fail with IMAGE_GENERATION_DISABLED.
Commands
| Command | What it does |
|---|---|
npm run dev | Dev server (webpack) |
npm run worker | Background job worker |
npm run typecheck, npm run lint | Static checks |
npm test | Unit tests |
npm run test:integration | Database integration tests (RUN_DB_TESTS=1) |
npm run db:generate | Create a migration from schema changes |
npm run db:migrate | Apply migrations |
npm run check | Lint, types, tests, Anchor tests and a build |
Notes
- The public devnet RPC rate limits aggressively. A worker with a backlog of reconcile jobs can trigger 429 errors; a dedicated RPC fixes this.
- Clear the cached quote list after changing
CURATED_QUOTE_MINTS: delete thequote-assets:*keys in Redis. - The Vercel deployment serves the front end only. It has no database, Redis, upload storage or worker.
- Commits carry no tool attribution.