This guide explains how to deploy the Stellar Goal Vault project:
- Contract → Stellar testnet
- Backend → Render
- Frontend → Vercel
- GitHub repository access
- Node.js 18+ and npm 9+
- Render account for backend deployment
- Vercel account for frontend deployment
- Soroban CLI installed for contract deployment
- Stellar testnet account funded with friendbot
The backend uses CONTRACT_ID to enable the on-chain pledge flow.
Follow the official Soroban setup guide: https://soroban.stellar.org/docs/getting-started/setup#install-the-soroban-cli
If you do not already have a testnet account, fund one with friendbot:
PUBLIC_KEY="G..."
curl "https://friendbot.stellar.org/?addr=$PUBLIC_KEY"From the repository root:
SECRET_KEY="S..." npm run deploy:contractIf deploy succeeds, the script will:
- Build the contract
- Deploy it to Stellar testnet
- Print the contract ID
- Save the contract ID to
contracts/contract_id.txt
Set the backend environment variable:
CONTRACT_ID=<your-contract-id>If you want to override the default RPC endpoint or network passphrase:
SECRET_KEY="S..." NETWORK_PASSPHRASE="Test SDF Network ; September 2015" RPC_URL="https://soroban-testnet.stellar.org:443" npm run deploy:contract- Sign in to https://render.com
- Click New → Web Service
- Connect your GitHub repository
- Choose the
backendfolder as the Root Directory
- Build Command:
npm install && npx tsc -p ./tsconfig.json- Start Command:
node dist/index.js- Health Check Path:
/api/health
Render will provide PORT automatically. The backend defaults to 3001 when PORT is unset, but Render will set it to the correct value in the service environment.
Set these in Render's environment configuration:
CONTRACT_ID=<your-contract-id>
SOROBAN_RPC_URL=https://soroban-testnet.stellar.org:443Optionally add:
ALLOWED_ASSETS=USDC,XLM
ALLOWED_ORIGINS=https://<your-vercel-domain>
DB_PATH=backend/data/campaigns.db
DEFAULT_MAX_PER_CONTRIBUTOR=0ALLOWED_ORIGINSrestricts CORS to your frontend domain.- Do not rely on SQLite for production data persistence on Render; the container filesystem is ephemeral.
- The backend uses SQLite (
better-sqlite3) by default. - Render's storage is not permanent across redeploys.
- For production, use an external database and update
DB_PATHaccordingly.
- Sign in to https://vercel.com
- Click Add New Project
- Select the Stellar Goal Vault repository
- Use the
frontendfolder as the Root Directory
- Build Command:
npm install && npm run build- Output Directory:
dist
Set the frontend base API URL:
VITE_API_URL=https://<your-backend-service>.onrender.comThis value must be the Render backend URL without a trailing /.
- Save the environment variables
- Trigger deploy
- Wait until the build succeeds
Open in browser or use curl:
curl https://<your-backend-service>.onrender.com/api/healthExpected response:
{
"service": "stellar-goal-vault-backend",
"status": "ok",
"timestamp": "...",
"uptimeSeconds": 0,
"database": {
"status": "up",
"reachable": true
}
}- Open your Vercel frontend URL
- Confirm the app loads
- Confirm the app makes API requests to the Render backend
If the app fails to load data, verify the frontend env variable VITE_API_URL.
If CONTRACT_ID is missing, the app may still run, but on-chain pledge integration will not function.
Use the backend health endpoint and the frontend deployment status in Vercel to verify end-to-end availability.
soroban-cli not installed: install it from Soroban docsSECRET_KEYinvalid: confirm the secret key belongs to a funded testnet account- friendbot errors: regenerate the public address and retry
- contract ID not saved: inspect
contracts/contract_id.txt
- If build fails, run locally:
cd backend
npm install
npx tsc -p ./tsconfig.json- If Render cannot start the service:
- ensure the start command is
node dist/index.js - ensure
CONTRACT_IDandSOROBAN_RPC_URLare set - use Render logs to troubleshoot startup errors
- ensure the start command is
- If the frontend shows network failures:
- verify
VITE_API_URLuseshttps:// - confirm the Vercel environment variable is deployed
- confirm Render backend health check passes at
/api/health
- verify
- Set
ALLOWED_ORIGINS=https://<your-vercel-domain>on the backend - If in development, leave
ALLOWED_ORIGINSempty so the backend permits local origins
- Backend uses SQLite by default
- Render storage is ephemeral; data may reset on redeploy
- For production, use an external database and add a persistent
DB_PATH
- Contract deployed to testnet and
CONTRACT_IDsaved - Render backend service built with
npx tsc -p ./tsconfig.json - Backend started with
node dist/index.js - Render health check path set to
/api/health - Vercel frontend configured with
VITE_API_URL - Frontend loads and fetches data from the backend
If these items pass, the deployment guide has been successfully applied.
- Runbook — Common Operational Tasks — step-by-step procedures for resetting the database, rotating API keys, redeploying contracts, rolling back the backend, and clearing the event cache.
- Architecture Diagrams
- Contributing Guide