# Local Development Setup

**When to use:** Setting up StemeDB for local development.

## Prerequisites

- Rust 1.75+ (2024 edition)
- `cargo` and `rustup`

## Quick Start

```bash
# Clone and enter
cd stemedb

# Build everything
cargo build --workspace

# Run tests
cargo test --workspace

# Run lints (must pass)
cargo clippy --workspace -- -D warnings
cargo fmt --check
```

## IDE Setup

### VS Code

Install extensions:
- rust-analyzer
- Even Better TOML
- Error Lens (optional, shows inline errors)

Settings (`.vscode/settings.json`):
```json
{
  "rust-analyzer.check.command": "clippy",
  "rust-analyzer.check.allTargets": true
}
```

### JetBrains (RustRover/CLion)

- Enable Clippy as default checker
- Set rustfmt on save

## Project Structure

```
stemedb/
  CLAUDE.md           # AI router (start here)
  CODING_GUIDELINES.md # Rust standards
  Cargo.toml          # Workspace root
  crates/
    stemedb-core/     # Core types and storage
  .claude/
    agents/           # Specialized AI agents
    commands/         # Slash commands
    skills/           # Reusable procedures
    guides/           # You are here
```

## Troubleshooting

### Build fails with missing dependencies

```bash
rustup update
cargo clean
cargo build
```

### Clippy warnings

Run with `--fix` for auto-corrections:
```bash
cargo clippy --workspace --fix --allow-dirty
```

## Related

- [Testing Guide](./testing.md)
- [Rust Guidelines](../backend/rust-guidelines.md)
