Development Setup
This guide covers setting up a development environment for contributing to Shard.
Repository Structure
shard/
├── launcher/ # Core Rust library + CLI
│ ├── src/
│ └── Cargo.toml
├── desktop/ # Tauri desktop application
│ ├── src/ # React frontend
│ ├── src-tauri/ # Tauri Rust backend
│ └── package.json
├── web/ # Website + documentation
│ ├── app/
│ ├── content/
│ └── package.json
├── companion/ # Future companion mode (placeholder)
└── Cargo.toml # Workspace manifestQuick Start
# Clone the repo
git clone https://github.com/Th0rgal/shard.git
cd shard
# Install frontend dependencies
cd desktop && bun install && cd ..
cd web && bun install && cd ..
# Start desktop app in dev mode
cd desktop && cargo tauri devCore Library Development
The core library (launcher/) contains all the business logic:
# Type checking
cargo check -p shard
# Run tests
cargo test -p shard
# Run the CLI
cargo run -p shard -- --help
# Run with specific command
cargo run -p shard -- profile listKey Files
| File | Purpose |
|---|---|
src/lib.rs | Library entry point |
src/main.rs | CLI entry point |
src/profile.rs | Profile management |
src/store.rs | Content store operations |
src/minecraft.rs | Version/asset downloads |
src/modrinth.rs | Modrinth API client |
src/auth.rs | Microsoft OAuth |
Desktop App Development
The desktop app uses Tauri 2 + React:
cd desktop
# Start dev server with hot reload
cargo tauri dev
# Frontend only (no Tauri)
bun run dev
# Type check frontend
bunx tsc --noEmitKey Files
| File | Purpose |
|---|---|
src/App.tsx | Main app component |
src/store/index.ts | Zustand state |
src/components/ | UI components |
src-tauri/src/lib.rs | Tauri commands |
Website Development
The website uses Next.js + Nextra:
cd web
# Start dev server
bun run dev
# Build for production
bun run buildTesting
Rust Tests
# Run all tests
cargo test
# Run specific test
cargo test profile::tests::test_create
# Run with output
cargo test -- --nocaptureFrontend Tests
cd desktop
bun run test # Run Playwright tests
bun run test:ui # Test with UIDebugging
Rust
Use RUST_LOG for logging:
RUST_LOG=debug cargo run -p shard -- profile listTauri DevTools
In dev mode, press Cmd+Shift+I to open DevTools.
React DevTools
Install the browser extension and use it in the Tauri WebView.
Code Style
- Rust: Follow
rustfmtdefaults - TypeScript: Follow ESLint + Prettier config
- Commits: Conventional commits (feat:, fix:, docs:, etc.)
Format before committing:
# Rust
cargo fmt
# TypeScript
cd desktop && bunx prettier --write src/Last updated on