Quick reference for setting up your Synapse DB development environment.
./scripts/setup.sh
This automated script handles everything you need to start developing.
target/debug/)target/release/)If the automated script fails or you prefer manual setup:
Linux/macOS:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
Windows: Download from rustup.rs
# Essential tools
cargo install mdbook git-cliff cargo-audit
# Optional but recommended
cargo install cargo-watch
./scripts/install-hooks.sh
# Build and test
cargo build
cargo test
# Build documentation
mdbook build
cargo doc --no-deps --all-features
Check that everything is installed correctly:
# Rust toolchain
rustc --version
cargo --version
# Development tools
mdbook --version
git-cliff --version
cargo audit --version
cargo watch --version
# Build status
cargo build
cargo test
Add Cargo to your PATH:
# Bash/Zsh
echo 'source $HOME/.cargo/env' >> ~/.bashrc
source ~/.bashrc
# Fish
echo 'source $HOME/.cargo/env.fish' >> ~/.config/fish/config.fish
Update Rust and clean build:
rustup update stable
cargo clean
cargo build
Manually copy hooks:
cp hooks/pre-commit .git/hooks/
cp hooks/commit-msg .git/hooks/
cp hooks/prepare-commit-msg .git/hooks/
chmod +x .git/hooks/*
Ensure ~/.cargo/bin is in your PATH:
export PATH="$HOME/.cargo/bin:$PATH"
Make scripts executable:
chmod +x scripts/*.sh
chmod +x hooks/*
After setup completes, you can:
# Run the application
cargo run
# Auto-rebuild on changes
cargo watch -x run
# Run tests continuously
cargo watch -x test
# Serve with live reload
mdbook serve
# Open http://localhost:3000
# Open API docs
cargo doc --open
# Run all checks
./scripts/pre-push-check.sh
# Or manually
cargo fmt
cargo clippy
cargo test
git checkout -b feature/my-feature
./scripts/pre-push-check.sh
git push origin feature/my-feature
cargo fmt # Format code
cargo clippy # Lint code
cargo test # Run tests
cargo check # Quick compile check
mdbook serve # User guide (live reload)
mdbook build # Build user guide
cargo doc --open # API documentation
./scripts/generate-changelog.sh # Update changelog
cargo build --release # Optimized build
cargo bench # Run benchmarks (if configured)
cargo audit # Security vulnerabilities
cargo outdated # Outdated dependencies
The setup script respects these environment variables:
RUSTUP_HOME - Rustup installation directoryCARGO_HOME - Cargo installation directory (default: ~/.cargo)To remove Synapse DB development environment:
# Remove Rust (if desired)
rustup self uninstall
# Remove development tools
cargo uninstall mdbook git-cliff cargo-audit cargo-watch
# Remove repository
cd ..
rm -rf synapse-db
After setup:
Setup Time: ~10-15 minutes depending on internet speed
Questions? Open an issue or discussion on GitHub!