synapse-db

Synapse DB

CI Release codecov License: MIT

A high-performance database implementation written in Rust.

Features

Planned Features

Quick Start

For New Developers

Run the automated setup script to install everything you need:

git clone https://github.com/aaronberkhoff/synapse-db.git
cd synapse-db
./scripts/setup.sh

This script will:

📖 For detailed setup instructions and troubleshooting, see SETUP.md

Manual Setup

If you prefer manual setup or the script doesn’t work on your system:

  1. Install Rust from rustup.rs
  2. Clone the repository
  3. Run cargo build and cargo test
  4. Install tools: cargo install mdbook git-cliff cargo-audit
  5. Set up hooks: ./scripts/install-hooks.sh

Project Structure

synapse-db/
├── src/
│   ├── main.rs       # Binary entry point
│   ├── lib.rs        # Library root
│   ├── storage.rs    # Storage layer implementation
│   └── query.rs      # Query engine
├── Cargo.toml        # Project configuration
└── README.md         # This file

Building

Make sure you have Rust installed. If not, install it from rustup.rs.

The project includes a Makefile for convenient development:

make help          # Show all available commands
make build         # Build the project
make test          # Run tests
make run           # Run the application
make doc           # Build documentation
make fmt           # Format code
make lint          # Run linter
make pre-push      # Run all checks before pushing

Using Cargo Directly

# Build the project
cargo build

# Build with optimizations
cargo build --release

# Run the binary
cargo run

# Run tests
cargo test

See make help for all available commands.

Documentation

Comprehensive documentation is available at https://aaronberkhoff.github.io/synapse-db

Building Documentation Locally

# Using Make
make doc           # Build all documentation
make serve         # Serve docs with live reload
make doc-open      # Build and open API docs

# Using tools directly
mdbook serve       # User guide with live reload
cargo doc --open   # API documentation

Documentation source is in the book/ directory.

Development

Quick Commands

# Development workflow
make dev           # Start dev environment (watch + docs)
make watch         # Auto-rebuild on changes
make watch-test    # Auto-run tests on changes

# Code quality
make fmt           # Format code
make lint          # Run linter
make test          # Run tests
make pre-push      # Run all checks

# Before committing
make commit        # Format + lint (then commit manually)

Using Cargo Directly

cargo check        # Quick compile check
cargo fmt          # Format code
cargo clippy       # Run linter
cargo test         # Run tests

CI/CD Pipeline

This project uses GitHub Actions for continuous integration and deployment:

Automated Checks (on every push/PR)

Scheduled Checks (daily)

Release Process

When you push a tag matching v*.*.* (e.g., v0.1.0):

  1. Automatically builds binaries for:
    • Linux (glibc and musl)
    • macOS (Intel and ARM)
    • Windows
  2. Creates a GitHub release with all artifacts
  3. Publishes to crates.io (requires CARGO_REGISTRY_TOKEN secret)

Creating a release:

git tag v0.1.0
git push origin v0.1.0

Dependency Management

Project Documentation

This repository includes comprehensive documentation:

Document Purpose
README.md Project overview (this file)
SETUP.md Detailed setup instructions
MAKEFILE.md Make command reference
CONTRIBUTING.md Contribution guidelines
CHANGELOG.md Auto-generated changelog
DOCUMENTATION.md Documentation system overview
book/ mdBook user guide source
.github/WORKFLOWS.md CI/CD workflows guide
.github/HOOKS.md Git hooks documentation
scripts/README.md Development scripts guide

Contributing

We welcome contributions! Please see:

License

MIT