Contributing Guide
Thank you for your interest in contributing to ChronDB! This guide will help you get started.
Prerequisites
Java / GraalVM
17+
Runtime and native-image compilation
Clojure CLI
1.11+
Build tool and dependency management
Git
2.25+
Required by ChronDB's storage engine
Install Clojure CLI: https://clojure.org/guides/install_clojure
Development Setup
# Clone the repository
git clone https://github.com/avelino/chrondb.git
cd chrondb
# Download dependencies
clojure -P
# Run the full server (REST + Redis + SQL)
clojure -M:run
# Run individual protocols
clojure -M:run-rest # REST API only (port 3000)
clojure -M:run-redis # Redis only (port 6379)
clojure -M:run-sql # PostgreSQL only (port 5432)Verify it's working:
Running Tests
Linting and Formatting
Run both lint and format checks before submitting a PR.
Project Structure
For a detailed architecture overview, see Architecture.
Code Style
Naming:
kebab-casefor all vars and namespacesNamespaces: follow
chrondb.*conventionDocstrings: required for all public functions
Functions: should do one thing well, max ~50 lines
Error handling: fail fast with structured context (include what, where, and relevant data)
Formatting: enforced by
cljfmt— runclojure -M:fmt-fixbefore committingImmutability: never rewrite Git commits; create new ones
Making Changes
Common Patterns
Adding a Redis command:
Add the handler function in
src/chrondb/api/redis/core.cljRegister it in the command dispatcher
Add tests in
test/chrondb/api/redis/Update
docs/protocols.mdwith the new command
Adding a SQL feature:
Extend the parser in
src/chrondb/api/sql/parser/Add execution logic in
src/chrondb/api/sql/execution/Add tests in
test/chrondb/api/sql/Update
docs/protocols.mdwith the new syntax
Adding a REST endpoint:
Add the handler in
src/chrondb/api/v1.cljAdd the route in
src/chrondb/api/v1/routes.cljAdd tests in
test/chrondb/api/Update
docs/protocols.mdanddocs/examples-rest.md
Adding an FFI operation:
Add the Clojure function in
src/chrondb/lib/core.cljAdd the Java bridge method in
java/chrondb/lib/ChronDBLib.javaUpdate the UniFFI definition in
bindings/uniffi/src/chrondb.udlUpdate each binding (Rust, Python, Node.js)
Add tests in binding test directories
Building Native Image
Pull Request Process
Create a feature branch from
mainMake your changes with clear, focused commits
Ensure all tests pass:
clojure -M:testEnsure code is formatted:
clojure -M:fmtEnsure linting passes:
clojure -M:lintOpen a PR with a clear description of what changed and why
Link any related issues
PR Checklist
Questions?
Issues: https://github.com/avelino/chrondb/issues
Discussions: https://github.com/avelino/chrondb/discussions
Documentation: https://chrondb.avelino.run
Last updated
Was this helpful?