Please read our Code of Conduct before contributing.
- Fork and clone the repo.
- Install dependencies:
pnpm install(root workspace). - Copy
.env.exampleto.envand fill in the required values. - Start the backend:
pnpm --filter backend dev. - Start the mobile app:
pnpm --filter mobile start.
Install the following before cloning:
| Tool | Version | Install |
|---|---|---|
| Node.js | ≥ 18.x | nodejs.org or nvm install 18 |
| npm | latest | bundled with Node |
| Docker | latest | docs.docker.com/get-docker |
| Rust + Cargo | ≥ 1.74 | curl https://sh.rustup.rs -sSf | sh |
| Soroban CLI | latest | cargo install --locked soroban-cli |
| Freighter Wallet | latest | See below |
Freighter is the Stellar browser wallet needed to sign transactions in the app.
- Install the extension for Chrome or Firefox.
- Open Freighter, create or import a wallet, and save your seed phrase securely.
- Click the network dropdown (top of the popup) and select Testnet.
- Copy your public key — you'll need it to fund the account.
The Stellar Friendbot instantly credits 10,000 test XLM to any new Testnet account.
Option A — browser:
https://friendbot.stellar.org/?addr=YOUR_PUBLIC_KEY
Option B — curl:
curl "https://friendbot.stellar.org/?addr=YOUR_PUBLIC_KEY"A {"hash": "..."} response confirms success. Refresh Freighter to see the balance.
git clone https://github.com/YOUR_USERNAME/stellar-greenpay.git
cd stellar-greenpay
git remote add upstream https://github.com/your-org/stellar-greenpay.git
chmod +x scripts/setup-dev.sh && ./scripts/setup-dev.shCopy the env files and fill in your values:
cp frontend/.env.example frontend/.env.local
cp backend/.env.example backend/.envStart the app:
# terminal 1
cd backend && npm run dev # → http://localhost:4000
# terminal 2
cd frontend && npm run dev # → http://localhost:3000Or run both services with Docker hot reload:
docker compose -f docker-compose.yml -f docker-compose.dev.yml up --buildThe Docker override watches backend changes through backend/src with Nodemon and runs the frontend Next.js dev server with polling enabled, so source edits are picked up without rebuilding images.
- Open
http://localhost:3000in your browser. - Click Connect Wallet and approve the Freighter prompt.
- Browse to any listed climate project and click Donate.
- Enter an XLM amount and confirm the transaction in Freighter.
- The on-chain transaction hash appears in the UI — paste it into Stellar Expert (testnet) to verify.
💡 A Loom walkthrough of this flow is available in
docs/walkthrough.md.
The donations API must sustain 100 concurrent users with a p95 latency under 500 ms. This is validated by the k6 load test.
Before merging any change to POST /api/donations or the Stellar submission
pipeline:
# Requires k6 — brew install k6
k6 run scripts/load-test.jsThe test enforces the p95 threshold as a hard check. A failed threshold means the PR is not mergeable until the regression is resolved.
See docs/performance.md for the full target table and how to record baseline numbers.
- Never log or persist private keys anywhere in the codebase.
- Mobile: use
expo-secure-storefor all key-adjacent data (seemobile/src/hooks/useWallet.ts). - Extension: use
window.freighter.signTransaction— never ask the user for their secret key. - All Stellar transactions target the testnet unless
NETWORK=mainnetis explicitly set in the environment.
pnpm test # unit + integration
pnpm test:e2e # end-to-end (requires running backend + Horizon testnet)