Welcome to the YieldVault-RWA project. This guide outlines how to set up your environment, follow our contribution workflow, and engage with the review process.
- Setup
- Development Workflow
- Branching Strategy
- Testing Requirements
- Pull Request Process
- Review Expectations
- Release Cycle
- Node.js 18+ (for backend)
- Rust 1.70+ (for WASM/contracts)
- Docker (for local database and services)
- Git
# Clone the repository
git clone https://github.com/yourusername/YieldVault-RWA.git
cd YieldVault-RWA
# Install dependencies
npm ci # Backend
cd frontend && npm ci # FrontendCopy environment templates and configure for local development:
# Backend
cp backend/.env.example backend/.env.local
# Edit backend/.env.local with your local settings
# Frontend
cp frontend/.env.example frontend/.env.localSee ENVIRONMENT_VARIABLES.md for detailed configuration.
cd backend
npm run prisma:migrate:dev
npm run prisma:seed # Optional: seed test data# Backend (from project root)
npm run dev:backend
# Frontend (from project root)
npm run dev:frontend
# Both (from project root)
npm run dev- Check the Roadmap to understand current priorities
- Review existing issues and pull requests to avoid duplication
- Ask in discussions if your feature is significant or aligns with current direction
We follow a modified Git Flow:
-
main: Production-ready code. Protected branch; all changes via PR.
-
staging: Pre-production testing. Staging deployments automatically trigger from this branch.
-
feat/*: Feature branches for new functionality
- Branch from:
main - Format:
feat/kebab-case-description - Example:
feat/add-withdrawal-orchestration
- Branch from:
-
fix/*: Bug fix branches
- Branch from:
main - Format:
fix/kebab-case-description - Example:
fix/referral-accrual-calculation
- Branch from:
-
docs/*: Documentation-only changes
- Branch from:
main - Format:
docs/kebab-case-description - Example:
docs/query-optimization-guide
- Branch from:
-
chore/*: Dependency updates, refactoring, tooling
- Branch from:
main - Format:
chore/kebab-case-description - Example:
chore/upgrade-prisma
- Branch from:
git fetch origin
git checkout -b feat/your-feature-name origin/mainAll code changes require tests. We use:
- Backend: Jest for unit and integration tests
- Frontend: Vitest for unit tests, Cypress for E2E tests
- Contracts: Foundry/Hardhat tests for Solidity code
YieldVault-RWA is organized as a pnpm workspace monorepo. Tests can be run at the root workspace level or inside individual packages:
-
pnpm test(Root Workspace Pipeline): Runs the orchestrated test pipeline across all workspace packages with explicit production flags:pnpm test # Executes: pnpm --filter backend test -- --runInBand --coverage && pnpm --filter frontend test --run
- Backend: Runs Jest with
--runInBand(serial worker execution to prevent concurrency collisions on SQLite) and collects coverage reports inbackend/coverage/. - Frontend: Runs Vitest with
--runin deterministic single-pass mode.
- Backend: Runs Jest with
-
pnpm -r test(Recursive Package Run): Executes thetestlifecycle script defined in each package (backend,frontend,packages/api-schemas) recursively in topological dependency order:pnpm -r testPackage-level test scripts are aligned so that running recursively executes with the proper flags (
jest --runInBand --coveragein backend andvitest runin frontend), guaranteeing that backend coverage artifacts are generated and frontend tests run non-interactively without hanging.
# Backend tests (runs Jest with --runInBand and --coverage)
cd backend && pnpm test
# Or from root:
pnpm --filter backend test
# Frontend unit & component tests (runs Vitest in single-run mode)
cd frontend && pnpm test
# Or from root:
pnpm --filter frontend test
# Frontend watch mode (for active local development)
cd frontend && pnpm test:watch
# Frontend E2E tests (Playwright)
cd frontend && pnpm test:e2e
# Cypress smoke tests
cd frontend && pnpm test:cypress
# Soroban smart contract tests
cargo test -p vault- Unit tests: ≥80% line coverage for new code
- Integration tests: Critical paths must be covered
- E2E tests: Happy path and key user workflows
# Backend
cd backend && npm run lint
npm run format
# Frontend
cd frontend && npm run lint
npm run formatCode must pass linting before PR approval.
Commit messages must use Conventional Commits with a lower-case type drawn from this list:
fix · feat · chore · docs · test · refactor
# Valid
fix: correct rounding on share price accrual
feat(frontend): add vesting schedule to dashboard
# Rejected — the type must be lower-case
Fix: correct rounding on share price accrual
FEAT: add vesting schedule to dashboardThe lower-case requirement is enforced by commitlint.config.js through the
.husky/commit-msg hook, so an upper-case type is rejected at commit time. It
also keeps the changelog correct: cliff.toml sets conventional_commits = true
and groups release notes by parsed type, and git-cliff's parser accepts both
cases. Without this rule Fix: would be parsed as its own type and split into a
separate changelog group from fix:.
To check a message without committing:
echo "Fix: something" | npx commitlint- Ensure your branch is up-to-date with
main - Run all local tests and linting checks
- Verify your commit messages are clear and descriptive
git fetch origin
git rebase origin/main
npm run test
npm run lintUse our PR template:
- Title: Clear, concise description of the change
- Format:
[area] description(e.g.,[api] add withdrawal retry logic)
- Format:
- Description: Explain what, why, and how
- Linked Issues: Reference related issues with "Closes #123"
- Testing: Describe test coverage and how to verify locally
- Screenshots: Include for UI changes
- All CI checks must pass (tests, linting, security scans)
- At least 1 approval from a code owner (see CODEOWNERS)
- For sensitive changes (auth, secrets, dependencies): additional review required
- Discussions must be resolved before merging
- Code Owners: Automatically requested (see CODEOWNERS)
- Security: Triggered for sensitive paths (see SECURITY_REVIEW.md)
- Teams: Additional domain experts may be requested
- Standard PRs: Review within 1 business day
- Urgent/hotfixes: Review within 4 hours
- Blocked/waiting PRs: Unblock within 1 business day
- Correctness: Does the code do what it claims?
- Tests: Is coverage adequate? Do tests pass?
- Performance: Could this impact latency or throughput?
- Security: Does this introduce vulnerabilities? (See SECURITY_REVIEW.md)
- Style: Does it follow project conventions?
- Documentation: Are API changes documented?
- Be constructive and respectful
- Distinguish between blocking and non-blocking feedback
- Approve when satisfied with the quality
- Use "Request Changes" only for critical issues
See SECURITY_REVIEW.md for sensitive review guidelines.
We use Semantic Versioning:
- MAJOR.MINOR.PATCH (e.g., 1.2.3)
- PATCH: Bug fixes and non-breaking changes
- MINOR: New features, backward compatible
- MAJOR: Breaking changes
- Patch releases: As needed for critical fixes (any day)
- Minor releases: Bi-weekly (every other Thursday)
- Major releases: Quarterly or as needed
- Create a release PR from
maintostaging - Update version numbers and CHANGELOG.md
- Merge to
stagingfor pre-production testing - Tag release on
mainand create GitHub release - Automated deployment follows
See Release Documentation for detailed procedures.
- Questions: Open a GitHub discussion
- Bugs: File an issue with the bug template
- Ideas: Start a discussion before opening an issue
- Chat: Reach out to maintainers
Thank you for contributing to YieldVault-RWA!