Contributing¶
Thank you for your interest in contributing to CongraphDB!
Getting Started¶
Prerequisites¶
- Rust 1.70 or later
- Node.js 20 or later
- Git
Build from Source¶
# Clone the repository
git clone https://github.com/congraph-ai/congraphdb.git
cd congraphdb
# Install dependencies
npm install
# Build the native module
npm run build
# Run tests
npm test
Development Workflow¶
Making Changes¶
- Fork the repository
- Create a branch:
git checkout -b feature/my-feature - Make your changes
- Run tests:
npm test - Commit:
git commit -m "Add my feature" - Push:
git push origin feature/my-feature - Open a pull request
Code Style¶
- Rust: Follow
rustfmtandclippyrecommendations - JavaScript/TypeScript: Follow ESLint configuration
- Commits: Use conventional commit messages
# Format Rust code
cargo fmt
# Lint Rust code
cargo clippy -- -D warnings
# Lint JavaScript
npm run lint
Project Structure¶
congraphdb/
├── src/
│ ├── lib.rs # napi-rs bindings
│ ├── core/ # Core engine
│ ├── storage/ # Storage engine
│ ├── query/ # Query engine
│ ├── table/ # Table management
│ ├── index/ # Index structures
│ └── types/ # Shared types
├── test/ # Integration tests
├── benches/ # Benchmarks
└── npm/ # npm package files
Testing¶
Unit Tests (Rust)¶
# Run all tests
npm run test:rust
# Run specific test
cargo test test_name
# Run with output
cargo test -- --nocapture
Integration Tests (JavaScript)¶
Adding Tests¶
Tests go in:
- src/ for Rust unit tests (#[test])
- test/ for JavaScript integration tests
Documentation¶
Rust Documentation¶
/// Adds two numbers together.
///
/// # Examples
///
/// ```
/// let result = add(2, 3);
/// assert_eq!(result, 5);
/// ```
pub fn add(a: i32, b: i32) -> i32 {
a + b
}
API Documentation¶
Update the docs repo:
Benchmarks¶
Run benchmarks:
Pull Request Guidelines¶
PR Checklist¶
- Tests pass (
npm test) - Documentation updated
- Commit messages follow convention
- No merge conflicts
- Code formatted (
cargo fmt) - No clippy warnings
PR Description¶
Include: - Summary of changes - Motivation for the change - Breaking changes (if any) - Related issues
Areas to Contribute¶
High Priority¶
- Complete Cypher query support
- Improve test coverage
- Documentation improvements
- Performance benchmarks
Medium Priority¶
- Additional index types (B-tree, full-text)
- Query optimization rules
- Async iteration for QueryResult
- Better error messages
Low Priority¶
- Graph analytics algorithms
- GraphQL endpoint
- WebAssembly support
- Language drivers (Python, Go, etc.)
Getting Help¶
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Discord: (coming soon)
License¶
By contributing, you agree that your contributions will be licensed under the MIT License.
Code of Conduct¶
Be respectful, inclusive, and constructive. We're all here to build something great together.
Thank you for contributing! :tada: