Thanks for your interest in contributing. This guide covers everything you need to get started with the backend (NestJS) and contract (Soroban/Rust) and how to make sure your changes pass CI before opening a PR.
- Project Structure
- Prerequisites
- Backend Setup
- Contract Setup
- Running CI Locally
- GitHub Actions Workflows
- Pull Request Checklist
- Troubleshooting
InsightArena/
├── backend/ # NestJS API (Node.js 20, pnpm)
├── contract/ # Soroban smart contracts (Rust)
└── frontend/ # Next.js web app
CI is scoped — backend workflows only trigger on changes under backend/, contract workflows trigger on all PRs.
- Node.js 20+
- pnpm 9 —
npm install -g pnpm@9 - PostgreSQL (local or Docker)
- Make
- Rust (stable) —
curl https://sh.rustup.rs -sSf | sh - wasm32 target —
rustup target add wasm32-unknown-unknown - Soroban CLI (for testnet deployment/smoke tests)
- Make
cd backend
# 1. Install dependencies
pnpm install
# 2. Configure environment
cp .env.example .env
# Edit .env with your local DB credentials and secrets
# 3. Run database migrations
pnpm run migration:run
# 4. Start in dev mode
pnpm run start:devAPI will be available at http://localhost:3000/api/v1
Swagger docs at http://localhost:3000/api/v1/docs
cd contract
# 1. Build the WASM artifact
make build
# 2. Run unit tests
make testFor testnet smoke tests (optional, requires a funded Soroban identity):
make smoke-testAlways run CI locally before pushing. This mirrors exactly what GitHub Actions runs.
cd backend
# Run all checks at once (lint + test + build)
make ci
# Or individually
make lint # ESLint
make test # Jest unit tests
make build # TypeScript compilationAll three must pass. If make ci exits with no errors, your PR will pass the backend workflow.
cd contract
make test # cargo test --lib
make build # cargo build --target wasm32-unknown-unknown --releaseBoth must pass. This mirrors the build-and-test job in contract-ci.yml.
Triggers on push/PR when files under backend/ change.
| Job | Command | What it checks |
|---|---|---|
| Lint | pnpm run lint |
ESLint rules across all source files |
| Test | pnpm run test |
Jest unit tests (*.spec.ts) |
| Build | pnpm run build |
TypeScript compilation via NestJS CLI |
All three jobs run in parallel. A PR cannot be merged if any job fails.
Triggers on push to main and all PRs.
| Job | Command | What it checks |
|---|---|---|
| Unit Tests | cargo test |
All Rust unit tests |
| WASM Build | cargo build --target wasm32-unknown-unknown --release |
Contract compiles to valid WASM |
Before opening a PR, confirm:
-
make cipasses locally (backend changes) -
make test && make buildpasses locally (contract changes) - No new lint errors introduced
- New logic has corresponding unit tests
-
.env.exampleupdated if new env vars were added - PR targets the
developbranch (notmaindirectly) - PR description explains what changed and why
# Auto-fix most issues
pnpm run lint
# If issues remain, check the output and fix manually# Run a specific test file
pnpm run test -- path/to/file.spec.ts
# Run in watch mode for debugging
pnpm run test:watch# Clean and rebuild
make clean && make build# Run with output to see panic messages
cargo test -- --nocapture# Make sure the target is installed
rustup target add wasm32-unknown-unknown
# Clean and retry
cargo clean && make buildIf you see ERR_PNPM_OUTDATED_LOCKFILE, your lockfile is out of sync:
pnpm install # updates the lockfileThen commit the updated pnpm-lock.yaml.
Join the Telegram to ask questions or discuss contributions:
👉 https://t.me/+hR9dZKau8f84YTk0