Contributing
How to contribute to Rustrak.
Setup
Prerequisites
- Rust 1.75+
- Node.js 20+
- pnpm 9+
- PostgreSQL 15+
- Docker (optional)
Clone and install
git clone https://github.com/AbianS/rustrak.git
cd rustrak
pnpm installStart development
# Start PostgreSQL
docker compose -f docker-compose.dev.yml up -d postgres
# Run server
cd apps/server && cargo run
# Run dashboard (separate terminal)
cd apps/webview-ui && pnpm devProject structure
rustrak/
├── apps/
│ ├── server/ # Rust API server
│ ├── webview-ui/ # Next.js dashboard
│ └── docs/ # Documentation
├── packages/
│ ├── client/ # TypeScript API client
│ └── test-sentry/ # Test CLI tool
└── docker-compose.ymlWorkflow
Branches
main– Stable releasefeat/*– New featuresfix/*– Bug fixes
Commits
Use conventional commits:
feat: Add issue muting
fix: Correct rate limit calculation
docs: Update deployment guidePull requests
- Create feature branch
- Make changes
- Run tests
- Submit PR
- Address feedback
Server (Rust)
Tests
cd apps/server
cargo testStyle
cargo fmt
cargo clippyMigrations
sqlx migrate add description
sqlx migrate runDashboard (Next.js)
Tests
cd apps/webview-ui
pnpm test
pnpm lintStrings and translations
Every user-facing sentence lives in src/shared/i18n/messages/, one JSON dictionary per locale, and nowhere else. A new string goes into both en.json and zh.json, and is read through a translator rather than written inline.
Dates, numbers and percentages are never formatted by hand. toLocaleString() resolves the locale of whatever process runs it, which on a Server Component is the container’s, so it disagrees with the browser that hydrates it. Use next-intl’s useFormatter or getFormatter with one of the named formats. The architecture suites fail the build on all of this.
Adding a language
The server needs no change: it accepts any well-formed language tag, so a locale is added entirely in the dashboard.
- Copy
src/shared/i18n/messages/en.jsonto your locale’s tag, for examplefr.json, and translate the values. Keep every key: a missing one renders as the raw key, not as English - Add the tag to
LOCALESinsrc/shared/i18n/routing.ts - Extend the dictionary parity check in
src/__tests__/architecture/message-keys.test.ts, which today compares English against Chinese, so your locale is held to the same rule - Run
pnpm test
Documentation
Run locally
cd apps/docs
pnpm devAdd pages
- Create
.mdxincontent/ - Add to
_meta.js - Link from related pages
Getting help
- Issues: Report bugs
- Discussions: Ask questions
- Docs: Check documentation first
Thanks for contributing!