Skip to content

Latest commit

 

History

History
99 lines (70 loc) · 4.17 KB

File metadata and controls

99 lines (70 loc) · 4.17 KB

Contributing to RushTalk

Thanks for your interest. This guide covers how to set up the project locally, the conventions we follow, and how to get changes reviewed.

Local development

Prerequisites

  • Rust 1.75+ (rustup default stable)
  • Go 1.24+
  • Node.js 22+
  • Docker + Docker Compose

First-time setup

git clone https://github.com/yourusername/rushtalk.git
cd rushtalk
make dev-up                          # Postgres, Redis, MinIO, LiveKit
make migrate-up                      # apply DB migrations

cp apps/api/.env.example apps/api/.env

cd apps/api && go run ./cmd/server   # backend on :8080
# in another terminal:
cd apps/desktop && npm install && npm run tauri dev

OAuth (optional)

OAuth is gated on configured credentials — leave the env vars blank to skip it. If you want to test the flows, see the OAuth section in the README.

Repo layout

apps/api/        # Go backend (Echo, pgx, Redis)
apps/desktop/    # Svelte 5 + Tauri 2 desktop client
crates/          # Rust workspace — audio engine, LiveKit bridge, shared protocol
deploy/          # Docker Compose, K8s manifests, Prometheus
docs/            # Architecture deep-dives

Inside the API:

  • internal/domain/ — entities + repository interfaces (no external deps)
  • internal/application/ — use-case services that compose repos
  • internal/infrastructure/ — Postgres / Redis / S3 / LiveKit adapters
  • internal/interface/ — HTTP handlers, WebSocket hub, middleware
  • pkg/ — small, dependency-free utilities (jwt, audit, metrics)

Conventions

Go

  • Errors flow up wrapped with fmt.Errorf("%s: %w", ctx, err). Domain layer errors (e.g. user.ErrEmailTaken) are sentinel errors.New values that handlers map to HTTP codes.
  • Comments explain why, not what. Don't restate the code.
  • Repositories keep SQL strings inline; we don't use an ORM.
  • Sensitive operations (kicks, role changes, permission edits) call audit.Log after the mutation succeeds.
  • Custom Prometheus metrics live in pkg/metrics. Use route templates as labels — never raw URLs (cardinality blow-up).

Svelte / TypeScript

  • Stores live in apps/desktop/src/lib/stores/ and expose a subscribe plus narrow mutators. Components never call set on a store directly.
  • WebSocket events fan out via wsClient.on(op, handler). Stores listening on the WS bus self-init from services/events.ts so a single initEvents() wires everything.
  • Optimistic updates (reactions, friendships) revert on API failure.
  • Type-check with npm run check before pushing — zero errors required.

Rust (audio + Tauri)

  • Hot-path code (processing/, mixer.rs, playback.rs) is zero-allocation. Pre-size buffers; never Vec::new() per frame.
  • cargo test for the audio crate must stay green; jitter buffer + pipeline coverage is the safety net.

Tests

make test                                            # all suites
go test -buildvcs=false ./...                        # Go (apps/api)
cargo test -p rushtalk-audio -p rushtalk-protocol    # Rust
cd apps/desktop && npm test                          # Vitest
cd apps/desktop && npm run check                     # svelte-check

A PR may not regress: any of the suites failing blocks merge.

Commit + PR style

  • Conventional-style prefixes are encouraged but not enforced: feat:, fix:, refactor:, test:, docs:.
  • One logical change per commit. If you're touching backend + frontend for one feature, split them by side so reviewers can reason in chunks.
  • PR description: what changed, why, and how it was tested. If you added an endpoint, paste a curl example.

Reporting bugs / asking questions

  • Bug reports → GitHub Issues with reproduction steps, expected vs actual, and the relevant log slice (%APPDATA%/rushtalk/rushtalk.log on Windows, stdout in dev).
  • Security issues → email the maintainer privately first; do not open a public issue.

Things not to do

  • Don't commit .env, key files, or anything under keys/.
  • Don't bypass the pre-commit hooks (--no-verify); fix what they report.
  • Don't skip writing a test for a bug fix — without coverage, the regression will come back.