Appearance
Contributor Model
Purpose: Define how human contributors participate in the rustchat project. Last Updated: 2026-03-24
Getting Started
Prerequisites
- Rust 1.80+ with
cargo - Node.js 20+ with
npm - PostgreSQL 16+
- Redis 7+
- S3-compatible storage (RustFS/MinIO for local dev)
Repository Structure
| Path | Contents |
|---|---|
backend/ | Rust API server (Axum 0.8 + Tokio) |
frontend/ | Vue 3.5 + TypeScript SPA |
push-proxy/ | Mobile push notification gateway |
tools/mm-compat/ | Python Mattermost compatibility tooling |
docs/ | Project documentation |
.governance/ | LLM operating model policies |
Quick Start
See Running Environment for full Docker-based local development setup.
Contribution Rules
- All changes go through pull requests — no direct pushes to
main. - Every PR must answer:
- What problem is solved?
- Which area is affected?
- Does behavior change?
- What tests are added?
- Do not mix unrelated domains in one PR (e.g., auth + UI + CI changes should be separate).
- Risky changes require tests before code movement — see Testing Model.
- Architecture changes require an ADR — add to
docs/adr/following the template.
Issue Intake
Use the appropriate issue template:
| Template | Use When |
|---|---|
| Bug | Something is broken |
| Feature | New functionality request |
| Refactor | Internal improvement with no behavior change |
| Test Gap | Missing test coverage |
| Security Concern | Potential vulnerability |
| Documentation Gap | Missing or outdated docs |
Pull Request Process
- Create a branch from
main - Implement the smallest safe change
- Add/update tests (see Testing Model)
- Update docs if structure changed
- Fill in the PR template completely
- Request review from the appropriate code owner (see Ownership Map)
- Address review comments
- Merge only after all checks pass and review is approved
Required Status Checks
All PRs must pass:
backend-ci— Rust tests, clippy, formattingfrontend-ci— TypeScript/Vue tests, lintingMM-Mobile Compatibility— Mattermost API contract tests
Good First Issues
Issues marked good-first-issue meet these criteria:
- Scope is small and well-defined
- Acceptance criteria are clear
- An owner is available for review
- Relevant files are known
- No risky behavior is involved
Look for these labels in the issue tracker.
Coding Conventions
Rust (Backend)
- Formatting:
cargo fmt— enforced in CI - Linting:
cargo clippy -- -D warnings— enforced in CI - Naming: Follow Rust RFC 430 (
snake_casefor fns/vars,CamelCasefor types) - Error handling: Use
thiserrorfor error types,Result<T, AppError>pattern - Async: Tokio runtime, prefer
async fnfor IO-bound work
TypeScript/Vue (Frontend)
- Formatting: Prettier with 2-space indent
- Linting: ESLint with Vue 3 recommended rules
- Naming:
camelCasefor functions/variables,PascalCasefor components/types - Components: Composition API with
<script setup> - State: Pinia stores in
features/[domain]/stores/
General
- Keep functions small and focused
- Prefer explicit over implicit
- Add comments only when logic is non-obvious
- Write tests that fail before implementing fixes
Testing Instructions
Backend Tests
bash
cd backend
# Run all tests (requires Postgres, Redis, S3 running)
cargo test
# Run specific test
cargo test test_name -- --exact
# Run integration tests only
cargo test --test integration
# Run contract validation tests
cargo test contractFrontend Tests
bash
cd frontend
# Unit tests
npm run test
# E2E tests (requires backend running)
npx playwright test
# Update E2E snapshots
npx playwright test --update-snapshotsCompatibility Tests
bash
cd backend
# Validate Mattermost API contract
cargo test --test mattermost_contract_testsPre-commit Checklist
bash
# Backend
cd backend && cargo fmt --check && cargo clippy -- -D warnings && cargo test
# Frontend
cd frontend && npm run lint && npm run type-checkSee Testing Model for complete testing strategy.
Where to Get Help
- Architecture questions: See Architecture Overview
- Agent/LLM workflow: See Agent Operating Model
- Mattermost compatibility: See Compatibility Scope
- Code ownership: See Ownership Map