Liking cljdoc? Tell your friends :D

Boundary Framework

Boundary brings Django's productivity and Rails' conventions to Clojure — with functional programming rigor. It is a batteries-included web framework that enforces the Functional Core / Imperative Shell (FC/IS) pattern: pure business logic in core/, side effects in shell/, and clean interfaces through ports.clj protocols.


Why Boundary?

For developers: 20 independently-publishable libraries on Clojars — use just boundary-core for validation utilities, or go full-stack with JWT + MFA auth, auto-generated CRUD UIs, background jobs, multi-tenancy, real-time WebSockets, and more. Every library follows the same FC/IS structure, making any Boundary codebase instantly familiar.

Ship faster: The scaffolder generates production-ready modules (entity + routes + tests) in seconds. The admin UI auto-generates CRUD interfaces from your schema — no manual forms. Built-in observability, RFC 5988 pagination, and declarative interceptors mean you write business logic, not plumbing.

Zero lock-in: Each library is a standard deps.edn dependency. Swap what doesn't fit.


Install Prerequisites

You need curl, tar, and Babashka (bb) for starter bootstrap.

macOS

brew install babashka
# curl and tar are preinstalled on macOS

Linux (Debian/Ubuntu)

sudo apt-get update
sudo apt-get install -y curl tar
bash < <(curl -s https://raw.githubusercontent.com/babashka/babashka/master/install)

Windows (PowerShell + Scoop)

scoop install curl tar babashka

Quick Start

Get started with your Boundary project.

curl -fsSL https://raw.githubusercontent.com/thijs-creemers/boundary-starter/main/scripts/bootstrap.sh | bash
cd boundary-starter

bb setup

This downloads only starter essentials into boundary-starter/.

If you prefer to use the full repository, from the repo root:

export JWT_SECRET="change-me-dev-secret-min-32-chars"
export BND_ENV="development"
clojure -M:repl-clj

You get: SQLite database (zero-config), HTTP server on port 3000, a complete Integrant system, REPL-driven development, and a production-ready Dockerfile.


Documentation

ResourceDescription
DocumentationArchitecture guides, tutorials, library reference (Antora)
AGENTS.mdCommands, conventions, common pitfalls, debugging
dev-docs/adr/Architecture Decision Records

Each library also has its own AGENTS.md with library-specific documentation.


Libraries

Boundary is a monorepo of 20 independently publishable libraries:

LibraryDescription
coreFoundation: validation, utilities, interceptor pipeline, feature flags
observabilityLogging, metrics, error reporting (Datadog, Sentry)
platformHTTP, database, CLI infrastructure
userAuthentication, authorization, MFA, session management
adminAuto-generated CRUD admin UI (Hiccup + HTMX)
storageFile storage: local filesystem and S3
scaffolderInteractive module code generator
cacheDistributed caching: Redis and in-memory
jobsBackground job processing with retry logic
emailProduction-ready email: SMTP, async, jobs integration
tenantMulti-tenancy with PostgreSQL schema-per-tenant isolation
realtimeWebSocket / SSE for real-time features
externalExternal service adapters: Stripe, Twilio, IMAP
reportsPDF, Excel, and Word (DOCX) generation via defreport
calendarRecurring events, iCal export/import, conflict detection
workflowDeclarative state machine workflows with audit trail
searchFull-text search: PostgreSQL FTS with LIKE fallback for H2/SQLite
geoGeocoding (OSM/Google/Mapbox), DB cache, Haversine distance
aiFramework-aware AI tooling: NL scaffolding, error explainer, test generator, SQL copilot, docs wizard
ui-styleShared UI style bundles, design tokens, CSS/JS assets

Architecture

Boundary enforces the Functional Core / Imperative Shell pattern throughout:

libs/{library}/src/boundary/{library}/
├── core/       # Pure functions only — no I/O, no logging, no exceptions
├── shell/      # All side effects: persistence, services, HTTP handlers
├── ports.clj   # Protocol definitions (interfaces for dependency injection)
└── schema.clj  # Malli validation schemas

Dependency rules (strictly enforced):

  • Shell → Core (allowed)
  • Core → Ports (allowed)
  • Core → Shell (never — this violates FC/IS)

This keeps business logic fast to test (no mocks needed), easy to reason about, and safe to refactor.

Case conventions — a frequent source of bugs:

BoundaryConvention
Clojure codekebab-case (:password-hash, :created-at)
Databasesnake_case
API (JSON)camelCase

Use boundary.core.utils.case-conversion for conversions. Never convert manually.


Essential Commands

# Testing (Kaocha, H2 in-memory DB)
clojure -M:test:db/h2                                    # All tests
clojure -M:test:db/h2 :core                              # Single library
clojure -M:test:db/h2 --focus-meta :unit                 # Unit tests only
clojure -M:test:db/h2 --focus-meta :integration          # Integration tests only
clojure -M:test:db/h2 --watch :core                      # Watch mode
JWT_SECRET="dev-secret-32-chars-minimum" clojure -M:test:db/h2

# Linting
clojure -M:clj-kondo --lint src test libs/*/src libs/*/test

# REPL (nREPL on port 7888)
clojure -M:repl-clj
# In REPL: (ig-repl/go) | (ig-repl/reset) | (ig-repl/halt)

# Build
clojure -T:build clean && clojure -T:build uber

# Database migrations
clojure -M:migrate up

# Scaffolding
bb scaffold   # Interactive module wizard
bb scaffold ai "product module with name, price, stock"  # NL scaffolding via AI (interactive confirm)
bb scaffold ai "product module with name, price, stock" --yes  # Non-interactive generation

# AI tooling
bb ai explain --file stacktrace.txt  # Explain error
bb ai gen-tests libs/user/src/boundary/user/core/validation.clj  # Generate tests
bb ai sql "find active users with orders in last 7 days"          # HoneySQL from NL
bb ai docs --module libs/user --type agents                       # Generate AGENTS.md

See AGENTS.md for the complete command reference, common pitfalls, and debugging strategies.


Using Individual Libraries

;; Validation utilities only
{:deps {org.boundary-app/boundary-core {:mvn/version "1.0.0-alpha"}}}

;; Full web application stack
{:deps {org.boundary-app/boundary-platform {:mvn/version "1.0.0-alpha"}
        org.boundary-app/boundary-user     {:mvn/version "1.0.0-alpha"}
        org.boundary-app/boundary-admin    {:mvn/version "1.0.0-alpha"}}}

Website

https://boundary-app.org


License

Copyright 2024–2026 Thijs Creemers. All rights reserved.

Can you improve this documentation? These fine people already did:
thijscreemers & Thijs Creemers
Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close