Skip to content

Latest commit

 

History

History
196 lines (141 loc) · 4.95 KB

File metadata and controls

196 lines (141 loc) · 4.95 KB

Contributing to Swyft

Thanks for your interest in contributing. Swyft is built almost entirely by external contributors — the maintainer handles architecture decisions, PR reviews, and releases. Contributors handle features.

Pick up an issue and open a PR — that's it.


Table of Contents


Getting Started

  1. Fork the repository on GitHub.
  2. Clone your fork:
    git clone https://github.com/<your-username>/Swyft.git
    cd Swyft
  3. Add the upstream remote:
    git remote add upstream https://github.com/Valreb001/Swyft.git
  4. Follow the Development Setup section below.

Development Setup

Prerequisites

Tool Version Notes
Node.js ≥ 18 Use nvm or fnm
pnpm ≥ 8 npm install -g pnpm
Rust stable rustup toolchain install stable
stellar-cli latest See Stellar docs
Docker any For local Postgres + Redis

Install dependencies

pnpm install

Configure environment

cp apps/api/.env.example apps/api/.env
# Edit apps/api/.env — see Environment Variables section in README

Start local services (Postgres + Redis)

cd apps/api
docker compose up -d

Run the full stack

pnpm dev

This starts the NestJS API and Next.js dApp simultaneously via Turborepo.

Run contract tests

cd packages/contract
cargo test --workspace

Run API tests

pnpm --filter api test

Finding Work

  • Browse open issues
  • Issues labelled good first issue are well-scoped and don't require deep protocol knowledge
  • Issues labelled bounty have a financial reward attached
  • Comment on an issue before starting work to avoid duplication

Branch and Commit Conventions

Branch names follow the pattern:

<type>/<short-description>

Examples: feat/multi-hop-router, fix/pool-tick-overflow, docs/update-readme

Commit messages follow Conventional Commits:

<type>(<scope>): <short description>

[optional body]

[optional footer: closes #<issue>]

Valid types: feat, fix, docs, chore, refactor, test, ci, perf

Examples:

feat(contracts): add tick spacing to pool factory
fix(api): prevent duplicate nonce consumption
docs: add CONTRIBUTING.md

Pull Request Process

  1. Branch from main:
    git checkout main
    git pull upstream main
    git checkout -b feat/your-feature
  2. Make your changes, including tests.
  3. Ensure CI passes locally:
    pnpm lint
    pnpm test
    pnpm build
  4. Push your branch and open a PR against main.
  5. Fill in the PR template — summary, testing steps, linked issue.
  6. One maintainer approval is required to merge.
  7. PRs are squash-merged — keep your commit history clean but it isn't strictly required.

Code Standards

  • TypeScript: Strict mode enabled. No any without a comment explaining why.
  • Rust: cargo clippy must pass with no warnings. Follow standard Rust idioms.
  • Formatting: Run pnpm format before committing. Prettier config is at .prettierrc.
  • Linting: Run pnpm lint before committing. ESLint config is in each app/package.
  • Accessibility: Frontend components must meet WCAG 2.1 AA. Use semantic HTML and ARIA attributes where needed.

Testing

Layer How to run Expectation
Soroban contracts cargo test --workspace in packages/contract All tests pass
NestJS API unit pnpm --filter api test All tests pass
NestJS API e2e pnpm --filter api test:e2e Requires running Postgres + Redis
TypeScript SDK pnpm --filter @swyft/sdk test All tests pass

New features must include tests. Bug fixes should include a regression test.


Issue Labels

Label Meaning
good first issue No deep protocol knowledge needed
bounty Financial reward attached
contracts Soroban / Rust work
backend NestJS / API work
frontend Next.js / React work
sdk TypeScript SDK work
docs Documentation
bug Something is broken
enhancement New feature or improvement

Questions?

Open a GitHub Discussion — the maintainer and community are there to help.