Skip to content

Latest commit

 

History

History
111 lines (80 loc) · 3.59 KB

File metadata and controls

111 lines (80 loc) · 3.59 KB

Contributing to Vitrine

Thanks for your interest in contributing! Vitrine is an open-source system monitoring dashboard for the HYTE Y70 Touch Infinite display on Linux. We welcome bug reports, feature requests, and code contributions.

Getting Started

Prerequisites

You'll need these installed on your system:

  • Rust (1.70 or newer) — rustup.rs
  • Node.js (18 or newer) — nodejs.org
  • pnpmnpm install -g pnpm
  • Tauri CLIcargo install tauri-cli --version "^2"
  • Linux system libraries (for building on Linux):
    # Fedora / Bazzite
    sudo dnf install webkit2gtk4.1-devel gtk3-devel libappindicator-gtk3-devel librsvg2-devel pango-devel
    
    # Ubuntu / Debian
    sudo apt install libwebkit2gtk-4.1-dev libgtk-3-dev libappindicator3-dev librsvg2-dev libpango1.0-dev

Clone and Run

git clone https://github.com/AppSprout-dev/vitrine.git
cd vitrine
pnpm install
pnpm tauri dev

This starts both the Vite dev server (frontend hot-reload) and the Rust backend. A window will open with the dashboard running on mock sensor data.

On Linux with real hardware, sensor data comes from sysfs automatically. To force mock data on Linux:

VITRINE_MOCK_SENSORS=1 pnpm tauri dev

Run Checks

Before submitting a PR, make sure everything passes:

pnpm lint                      # ESLint (frontend)
npx tsc --noEmit               # TypeScript type check
cd src-tauri && cargo clippy    # Rust lints

How to Contribute

Reporting Bugs

Open an issue with:

  • What you expected to happen
  • What actually happened
  • Your distro and desktop environment (e.g., Bazzite KDE, Fedora GNOME)
  • Relevant log output (run with RUST_LOG=vitrine_lib=debug pnpm tauri dev)

Suggesting Features

Open an issue describing:

  • What the feature does
  • Why it would be useful
  • Any ideas for how it might work

Submitting Code

  1. Fork the repo and create a branch from main
  2. Make your changes
  3. Run all checks (lint, typecheck, clippy)
  4. Open a pull request against main

Keep PRs focused — one feature or fix per PR is ideal.

Code Style

  • Rust: Follow standard Rust formatting (cargo fmt). Use snake_case for fields.
  • TypeScript: ESLint handles formatting. TypeScript types use snake_case to match Rust serde output.
  • CSS: Tailwind utility classes. Use CSS variables (var(--vitrine-*)) for theme values.
  • D3: "D3 owns the ref" pattern — use useRef + D3 selections, not React state for animations.

Project Structure

src-tauri/src/           # Rust backend
  sensors/               # Hardware sensor reading (sysfs on Linux, mock on other OS)
  advisor/               # AI advisor module (LM Studio integration)
  config.rs              # TOML config schema
  commands.rs            # Tauri IPC command handlers
  lib.rs                 # App setup, polling loop

src/                     # React frontend
  components/widgets/    # Dashboard widgets (CpuMonitor, GpuMonitor, etc.)
  components/visualizations/  # D3 chart components
  components/settings/   # Settings drawer tabs
  hooks/                 # React hooks (sensor data, config, theme)
  lib/                   # Types, constants, formatters

Adding a New Widget

  1. Create src/components/widgets/YourWidget.tsx
  2. Register it in src/lib/widgetRegistry.ts
  3. Add the widget type string to src-tauri/src/config.rs (if it needs backend data)
  4. Add it to a page in your config.toml

License

By contributing, you agree that your contributions will be licensed under the GPL v3 license that covers this project.