Welcome, and thank you for your interest in contributing! This guide covers everything you need to go from a clean checkout to an open pull request: local setup, running checks, documentation standards, and the issue workflow.
- Prerequisites
- Local Setup
- Running Web Checks
- Running Contract Checks
- Documentation Standards
- Issue and PR Workflow
- CI Expectations
| Tool | Minimum version | Notes |
|---|---|---|
| Node.js | 18 | 22 is used in CI |
| npm | 8 | Do not use pnpm or yarn — it creates lockfile conflicts |
| Rust + Cargo | stable (1.74+) | Install via rustup.rs |
wasm32-unknown-unknown |
— | rustup target add wasm32-unknown-unknown |
| Stellar CLI | 21+ | Installation guide |
| Freighter wallet | latest | freighter.app — browser extension for UI testing |
Run the bootstrap script to verify everything is installed:
./scripts/bootstrap.shgit clone <repository-url>
cd predinex-stellar
# Install web dependencies
cd web
npm install
cd ..Create web/.env.local with:
NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXT_PUBLIC_NETWORK=testnet
NEXT_PUBLIC_SOROBAN_CONTRACT_ID=<testnet-contract-C-strkey>The contract address for the shared testnet deployment is in web/.env.example. For a local deployment, follow the Local End-to-End Runbook.
cd web
npm run devOpen http://localhost:3000.
All three checks must pass before opening a PR. Run them from the web/ directory:
# Lint
npm run lint
# Unit tests (single run, matches CI)
npm test -- --run
# Production build
npm run buildTests live in web/tests/ and use Vitest with React Testing Library.
| Directory | What it covers |
|---|---|
tests/components/ |
React component behaviour |
tests/routes/ |
Route-level smoke tests — verifies every top-level App Router page mounts without crashing |
tests/lib/ |
API client and utility functions |
tests/helpers/ |
Shared render helpers (renderWithProviders) |
tests/integration/ |
Cross-cutting integration scenarios |
Run a single file during development:
npm test -- --run tests/routes/smoke.test.tsxRun in watch mode while iterating:
npm test -- --watchRun with coverage:
npm run test:coverageWhen adding a new top-level route, add a smoke test entry to tests/routes/smoke.test.tsx so CI catches broken imports or missing providers at the route level.
Run these from contracts/predinex/:
# Format check
cargo fmt --check
# Lint
cargo clippy -- -D warnings
# Unit tests
cargo testTo build the WASM artifact:
stellar contract buildThe compiled output lands at contracts/predinex/target/wasm32-unknown-unknown/release/predinex.wasm.
For a full local deploy-to-testnet walkthrough, see the Local End-to-End Runbook.
Only add a comment when the why is non-obvious — a hidden constraint, a subtle invariant, or a workaround for a specific bug. Do not comment on what the code does; well-named identifiers already do that.
Add JSDoc to exported utility functions and complex hooks. One short summary line is enough; avoid multi-paragraph blocks.
Significant architectural decisions (new caching strategies, contract interface changes, new hooks) belong in web/docs/. Reference them from web/DEVELOPMENT.md or web/FRONTEND.md as appropriate.
Any change that touches the contract interface must follow the process in docs/CONTRACT_VERSIONING.md. Breaking changes require an explicit major version bump and a migration note before the PR can be merged.
- Comment on the issue to let others know you are working on it.
- Fork the repository and clone your fork.
- Create a branch from
mainusing the convention below.
<type>/<short-description>
Examples:
feat/route-smoke-testsfix/market-pagination-resetdocs/contributing-guiderefactor/wallet-adapter-cleanup
Write imperative-mood subject lines under 72 characters. Put context in the body when needed.
feat: add smoke tests for all top-level App Router routes
Covers home, markets, create, dashboard, disputes, rewards,
activity, and incentives. Uses a shared provider harness so
route-level provider failures are caught independently of the
component suite.
Before marking a PR ready for review:
-
npm run lintpasses -
npm test -- --runpasses (no new failures) -
npm run buildsucceeds - Contract checks pass if contract files were touched (
cargo fmt --check,cargo clippy,cargo test) - PR description references the issue number(s) with
Closes #<number> - New top-level routes include a smoke test entry in
tests/routes/smoke.test.tsx - New architectural decisions are documented in
web/docs/
The repository provides a pull request template at .github/PULL_REQUEST_TEMPLATE.md. Fill it in completely — incomplete descriptions slow down review.
The CI workflow (.github/workflows/ci.yml) runs on every push and pull request to main. It includes:
| Job | Steps |
|---|---|
| Web Checks | npm ci → npm run lint → npm test -- --run → npm run build |
| Bundle size budget | Checked on PRs; fails if JS exceeds 350 KB, CSS exceeds 80 KB, or total static exceeds 500 KB |
| Contract Checks | cargo fmt --check → cargo clippy -- -D warnings → cargo test |
Run all of these locally before pushing to avoid CI failures blocking your PR.
For deeper context on the project architecture, see: