Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 1.36 KB

File metadata and controls

33 lines (24 loc) · 1.36 KB

Coding Style And Conventions

Privacy Copilot is a Rust-first local desktop app with a React/Vite frontend.

Rust

  • Prefer small modules with clear ownership boundaries.
  • Return Result for fallible work; avoid panics in application paths.
  • Keep domain types explicit and boring.
  • Use traits only when there is more than one implementation or a clear testing boundary.
  • Do not store raw secrets in files or frontend-accessible state.
  • Run cargo fmt --all, cargo check --workspace, and cargo test --workspace.

Architecture Principles

  • SOLID where it helps readability and testability.
  • KISS: choose the simplest implementation that satisfies the current product need.
  • YAGNI: avoid framework-level abstractions before the app has multiple real implementations.
  • Local-first: user data remains local by default.
  • Secure-by-default: no telemetry by default, no frontend secrets, bounded file/artifact handling.

TypeScript And React

  • Keep UI state close to the component using it.
  • Put desktop/Rust command access behind a small bridge layer.
  • Do not use browser storage for production secrets.
  • Avoid raw DOM injection and dangerouslySetInnerHTML.
  • Run npm --prefix frontend run build before merging frontend changes.

Git

  • Use focused commits.
  • Prefer conventional commit prefixes when practical, such as feat:, fix:, docs:, and chore:.