Local Development
Prerequisites
| Tool | Version | Install |
|---|---|---|
| Node.js | ≥ 20 | nodejs.org |
| pnpm | ≥ 9 | npm i -g pnpm |
| Rust | stable | rustup.rs |
| Stellar CLI | latest | cargo install stellar-cli |
The Rust toolchain and Stellar CLI are only required if you are working on the Soroban contracts in packages/contracts/. Frontend and API work does not require them.
Setup
git clone https://github.com/drydocs/meridian.git
cd meridian
pnpm installRunning the full stack
pnpm devTurborepo starts all dev tasks in parallel:
- Web at
http://localhost:3000/app/(Vite dev server with HMR) - API at
http://localhost:3001(Fastify withtsx watch) - Docs at
http://localhost:3000/docs/(VitePress, proxied from port 3002)
The Vite dev server proxies /api/* to http://localhost:3001 and /docs/* to the VitePress dev server at port 3002.
Running services individually
# Web only
pnpm --filter @meridian/web dev
# API only
pnpm --filter @meridian/api-local devHealth check
curl http://localhost:3001/health
# {"status":"ok"}Running tests
pnpm testTo run tests for a single package:
pnpm --filter @meridian/shared test
pnpm --filter @meridian/stellar-sdk-helpers testType checking
pnpm typecheckLinting
pnpm lintBuilding packages
If you edit a packages/ library, rebuild it before the apps pick up the changes:
pnpm buildOr build a single package:
pnpm --filter @meridian/shared buildWorking with the contracts
packages/contracts/ has three crates: vault (the coordinator) and two yield adapters, blend-adapter and defindex-adapter. Build and test them all together from the contracts package root, or individually:
cd packages/contracts
# Build every crate's WASM (outputs to target/wasm32v1-none/release/)
stellar contract build
# Run every crate's Rust tests
cargo test
# Or a single crate
cargo test --manifest-path blend-adapter/Cargo.tomlstellar contract build targets wasm32v1-none, not wasm32-unknown-unknown. Install the correct target with rustup target add wasm32v1-none if you haven't already.
See Testnet Deployment for deploying the contracts to testnet, and Vault Contract for how the vault and adapters fit together.
Wallet setup
Install a Stellar wallet browser extension (for example, Freighter) and switch it to Testnet mode. Fund your testnet account using Stellar Friendbot.
The local API server targets testnet because .env.example pins STELLAR_NETWORK=testnet explicitly, not because testnet is the fallback: mainnet is now the default when STELLAR_NETWORK is unset at all, since the product is live there. Copy .env.example to .env (see "Environment setup" above) rather than skipping it, an environment that never loads .env targets mainnet by default, not testnet.