Development Guide
Workspace Layout
Section titled “Workspace Layout”crates/octofhir-core: core types (ResourceEnvelope/meta, FhirVersion/DateTime, errors)crates/octofhir-storage: theFhirStoragetraitcrates/octofhir-db-postgres: PostgreSQL storage, query filters, transactionscrates/octofhir-search: query parsing/validation, enginecrates/octofhir-api: OperationOutcome, CapabilityStatement, Bundle helperscrates/octofhir-server: HTTP server (Axum), routes, middleware, config, observabilitycrates/octofhir-auth: OAuth 2.0 / SMART on FHIR authenticationcrates/octofhir-auth-postgres: PostgreSQL storage for auth entitiescrates/octofhir-config: configuration management with hot reloadcrates/octofhir-graphql: GraphQL APIcrates/octofhir-notifications: notification service and providerscrates/octofhir-cql-service: CQL evaluationcrates/octofhir-notebook:.fhirnbnotebook model and converterscrates/octofhir-cli: CLI tool for interacting with FHIR servers
Prerequisites
Section titled “Prerequisites”# Install Rustcurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Install just (command runner)brew install justLinux (Ubuntu/Debian)
Section titled “Linux (Ubuntu/Debian)”# Install Rustcurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Install build dependenciessudo apt-get updatesudo apt-get install -y \ build-essential \ pkg-config \ libssl-dev
# Install just (command runner)cargo install justLinux (Fedora/RHEL)
Section titled “Linux (Fedora/RHEL)”# Install Rustcurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Install build dependenciessudo dnf install -y \ gcc \ gcc-c++ \ pkg-config \ openssl-devel
# Install just (command runner)cargo install justCommon Tasks
Section titled “Common Tasks”just build # cargo buildjust test # cargo test --all --all-featuresjust lint # cargo clippy --all-targets --all-features -- -D warningsjust fmt # cargo fmt --alljust dev # cargo watch -x run (auto-reload on changes)Building from Source
Section titled “Building from Source”Debug Build (Recommended for Development)
Section titled “Debug Build (Recommended for Development)”# Start dependencies (PostgreSQL, Redis)docker compose up -d
# Build and runcargo runRelease Build
Section titled “Release Build”# Build release binary (takes 5-10 minutes)cargo build --release
# Run release binary./target/release/octofhir-serverDocker Build
Section titled “Docker Build”# Build Docker imagedocker build -t octofhir-server .
# Run containerdocker run -p 8888:8888 octofhir-serverTesting
Section titled “Testing”- Unit tests inside crates
- Integration tests in
crates/octofhir-server/testscover HTTP flows
Contributing
Section titled “Contributing”- Keep PRs small and focused; follow Conventional Commits
- Fix all clippy warnings; run
just lint