| Pattern | Purpose |
|---|---|
main |
Production-ready code |
dev |
Integration branch |
feat/<name> |
New features |
fix/<name> |
Bug fixes |
chore/<name> |
Tooling, deps, config |
contract/<name> |
Smart contract changes |
migration/<name> |
DB schema changes |
All PRs target dev. Only dev → main merges go to production.
Follow Conventional Commits:
feat(contracts): add match escrow vault dispute resolution
fix(backend): correct varchar/integer comparison in tournament view
chore(deps): bump next to 14.2.25
migration: add governance tables
Types: feat, fix, chore, docs, refactor, test, migration, contract
cd backend
cp env.example .env # fill in DATABASE_URL, JWT_SECRET, etc.
cargo sqlx migrate run
cargo build
cargo testcd contracts
rustup target add wasm32-unknown-unknown
cargo test
cargo build --target wasm32-unknown-unknown --releasecd server
npm ci
npm run prisma:generate
npm run buildcd frontend
npm ci
npm run build- Keep PRs focused — one concern per PR
- All CI checks must pass before merge
- Smart contract changes require two approvals
- DB migrations must include a
.down.sql - Never force-push to
mainordev
- All public functions must have tests in
test.rs - Use
#[contracttype]for all storage keys - Bump the contract version constant on any interface change
- Document breaking changes in the PR description
- Migrations are append-only — never edit an existing migration file
- Test both
upanddownmigrations locally before opening a PR - Column/type changes require a multi-step migration (add → backfill → drop)