This guide documents the fastest supported way to boot the repository locally for backend, contract, and frontend development.
- Node.js 18+ and npm
- Rust and Cargo
wasm32-unknown-unknownRust target for Soroban contract builds
Optional:
- Freighter or another Stellar wallet for frontend testing
- Docker, PostgreSQL, and Redis only if you want to test non-default infrastructure paths
backend/- Express + TypeScript API with Prismacontracts/vault/- main Soroban vault contractcontracts/mock-strategy/- mock contract used by testsfrontend/- React + Vite app
Use this order for a clean first boot:
- Install backend dependencies and create the local database
- Build or test contracts if you are changing on-chain code
- Install frontend dependencies and point it at your local backend
- Start backend and frontend in separate terminals
The default local backend path does not require PostgreSQL or Redis. Prisma falls back to the SQLite database defined in backend/prisma/schema.prisma, and Redis-backed features fall back to in-memory behavior when REDIS_URL is not set.
cd backend
cp .env.example .env
npm install
npx prisma migrate dev
npm run devBackend defaults:
- API base URL:
http://localhost:3000 - Health endpoint:
http://localhost:3000/health - Readiness endpoint:
http://localhost:3000/ready - Local Prisma DB:
backend/prisma/dev.db
Recommended minimum local env updates in backend/.env:
PORT=3000
NODE_ENV=development
STELLAR_RPC_URL=https://soroban-testnet.stellar.org
STELLAR_NETWORK_PASSPHRASE=Test SDF Network ; September 2015
VAULT_CONTRACT_ID=Notes:
- Leave
DATABASE_URLunset to keep the default SQLite workflow. - Leave
REDIS_URLunset unless you are explicitly testing Redis-backed rate limiting or nonce storage. - Routes that invoke Soroban transactions need a real
VAULT_CONTRACT_ID, and some flows also require backend signing credentials such asSTELLAR_SECRET_KEY.
You only need this section if you are working on the smart contracts.
From the repo root:
rustup target add wasm32-unknown-unknown
cargo testTo build the main contract artifact directly:
cargo build -p vault --target wasm32-unknown-unknown --releaseUseful paths:
- Main contract crate:
contracts/vault - Mock strategy crate:
contracts/mock-strategy - Deployment notes:
contracts/vault/DEPLOYMENT.md
The frontend expects a local backend plus Stellar network settings.
cd frontend
cp .env.example .env
npm install
npm run devRecommended minimum local env in frontend/.env:
VITE_SOROBAN_RPC_URL=https://soroban-testnet.stellar.org
VITE_STELLAR_NETWORK_PASSPHRASE=Test SDF Network ; September 2015
VITE_VAULT_CONTRACT_ID=Frontend default:
- App URL:
http://localhost:5173
Important:
- Set
VITE_VAULT_CONTRACT_IDto the same contract ID used by the backend when you want the UI to target a deployed vault. - Some views can still boot without a contract ID, but transaction flows will not work end-to-end.
Once dependencies are installed, the normal dev loop is:
Terminal 1:
cd backend
npm run devTerminal 2:
cd frontend
npm run devOptional Terminal 3 for contract work:
cargo testUse these commands after bootstrapping:
cd backend
npm testcd frontend
npm run test:runcd /Users/macbook/stellar/YieldVault-RWA
cargo testManual checks:
- Open
http://localhost:5173 - Verify
http://localhost:3000/healthreturns a healthy response - Confirm the frontend can reach the backend without CORS errors
Set the contract ID in both backend/.env and frontend/.env before testing real vault actions.
Re-run:
cd backend
npx prisma migrate devIf you want a clean local SQLite reset, remove backend/prisma/dev.db and rerun the migration.
Expected in the default local path. Redis is optional unless you are specifically testing Redis-backed behavior.
Check backend port 3000, then verify any frontend API configuration in the app matches your local backend URL.
- Root overview:
README.md - Backend details:
backend/README.md - Frontend details:
frontend/README.md - Environment matrix:
docs/ENV_VARIABLE_MATRIX.md