Skip to main content

Local development

Requirements

  • Node.js and a package manager compatible with the app's package.json
  • A PostgreSQL database
  • A Stellar wallet browser extension (Freighter is what the end-to-end tests drive) if you want to test the sign-in and signing flow by hand

Environment variables

Copy .env.example to .env and fill in:

VariablePurpose
DATABASE_URLPostgreSQL connection string.
SESSION_SECRETSigns both the session JWT and the SEP-53 login challenge token. Generate one with openssl rand -base64 32.
NEXT_PUBLIC_HOME_DOMAINThe domain embedded in the sign-in message a wallet is asked to sign; binds a signature to this specific deployment.
NEXT_PUBLIC_DEFAULT_NETWORKTESTNET or PUBLIC, the network selected on first load.
NEXT_PUBLIC_MAINNET_RPC_URLOnly needed for PUBLIC network use. Stellar's own foundation doesn't run a free public Mainnet RPC; the Stellar RPC providers list has options.

Running it

npm install
npx prisma migrate deploy
npm run dev

npm run build runs prisma generate and prisma migrate deploy before next build, so a fresh clone's first build also brings the database schema up to date.

Testing

  • npm run test runs the Vitest suite: unit tests for CSV parsing, address/amount validation, and transaction chunking, plus integration tests against a real Stellar RPC endpoint for balance checking and the full prepare-sign-submit engine.
  • npm run test:e2e runs Playwright against a real Freighter build, downloaded first by e2e/scripts/download-freighter.sh, so the end-to-end suite exercises an actual wallet extension rather than a mock.

Linting

npm run lint runs ESLint with the Next.js config. There's no separate formatting step beyond what ESLint enforces.