A quick way to start a full-stack Clojure app with server-side rendering. Built on a powerful yet lightweight stack featuring SQLite, HTMX, AlpineJS, and TailwindCSS v4.
This template is designed to be lightweight and easy to use, with a focus on rapid development and deployment. Minimal distraction and sane defaults. Everything is streamlined to give you a solid foundation for building modern web applications.
Get started building your new Clojure application in seconds and be productive!
-
Create a new Clojure project using Clojure CLI:
clojure -Ttools install-latest :lib io.github.seancorfield/deps-new :as new clojure -Sdeps '{:override-deps {org.clojure/clojure {:mvn/version "1.12.0"}}}' -Tnew create :template io.github.abogoyavlensky/clojure-stack-lite :name myprojectOr alternatively using neil:
brew install babashka/brew/neil neil new io.github.abogoyavlensky/clojure-stack-lite myproject
-
Start development (with mise):
cd myproject mise trust && mise install bb clj-repl (reset)
The server should be available at
http://localhost:8000. Check out project's README.md and template documentation for more information on how to use the project.
Tip
Edit some details before going to production: label in Dockerfile,
domain in resources/public/manifest.json and description in README.md
- ๐๏ธ Robust Clojure stack powered by Integrant and Reitit/Ring
- ๐จ Lightweight frontend using HTMX, AlpineJS and TailwindCSS v4 (with optional DaisyUI components)
- ๐ฆ SQLite/PostgreSQL database (you choose)
- ๐ Zero-downtime deployment via Kamal
- โก GitHub Actions CI/CD pipeline
- ๐งช Integration and unit testing setup with coverage
- ๐ Linting, formatting and deps version management
- โ๏ธ deps.edn and Babashka Tasks for efficient project management
- ๐ฑ Basic PWA support out of the box (without service worker)
- Integrant: Component lifecycle management for application
- Reitit: Fast data-driven routing
- Ring/Jetty: HTTP server adapter
- Hiccup: HTML generation from Clojure data structures
- Malli: Data validation and specification
- SQLite/PostgreSQL: Choose between file-based SQLite or enterprise-grade PostgreSQL
- next.jdbc: JDBC-based database access
- HoneySQL: SQL as Clojure data structures
- Ragtime: Database migrations
- HTMX 2: HTML extensions for AJAX without writing JavaScript
- AlpineJS 3: Lightweight JavaScript framework for adding behavior
- TailwindCSS 4: Utility-first CSS framework
- [OPTIONAL] DaisyUI: A UI Component library (Add
:daisyui truewhile generating template)
- Babashka: Project management with tasks
- clj-kondo: Static analyzer and linter
- cljfmt: Code formatter
- eftest/cloverage: Testing and code coverage
- Docker: Containerization
- Kamal: Zero-downtime deployments
- GitHub Actions: CI/CD workflows
The template generates a Clojure project with the following structure:
โโโ .clj-kondo/ # Clojure linting configuration
โโโ .github/ # GitHub Actions workflows and configurations
โโโ .kamal/ # Kamal deployment configuration (only used with Kamal)
โโโ db/ # Empty database directory for database files (only used with SQLite)
โโโ dev/ # Development configuration directory
โ โโโ user.clj # User-specific development configuration
โโโ resources/ # Static resources and configuration files
โ โโโ public/ # Public assets (CSS, JS, images)
โ โโโ migrations/ # Database migration files
โ โโโ config.edn # Main configuration file for the application
โ โโโ config.dev.edn # Development-specific configuration
โ โโโ logback.xml # Logging configuration file
โโโ src/ # Source code directory
โ โโโ {{name}} # Main namespace directory
โ โโโ core.clj # Application entry point
โ โโโ db.clj # Database system component and main operations
โ โโโ handlers.clj # HTTP request handlers
โ โโโ routes.clj # Route definitions
โ โโโ server.clj # Server system component
โ โโโ views.clj # HTML templates and components with Hiccup
โโโ test/ # Test files directory
โ โโโ {{name}} # Test namespace directory
โ โโโ home_test.clj # Example test for home page
โ โโโ test_utils.clj # Test utilities
โโโ .cljfmt.edn # Formatting configuration
โโโ .gitignore # Git ignore rules
โโโ .mise.toml # mise-en-place configuration with system dependencies
โโโ bb.edn # Babashka tasks configuration for managing application
โโโ deps.edn # Clojure dependencies and aliases
โโโ Dockerfile # Dockerfile for building the application image
โโโ docker-compose.yaml # Run PostgreSQL database for local development (only used with PostgreSQL)
โโโ LICENSE # License file, AGPLv3 by default, for motivation check: https://plausible.io/blog/open-source-licenses
โโโ README.md # Project documentation
The template offers customization options for generating your project:
:daisyui- Include DaisyUI, a component library for TailwindCSS (Default:false)
Possible values: false | true
Usage example:
clojure -Tnew create :template io.github.abogoyavlensky/clojure-stack-lite :name myproject :daisyui true- DaisyUI support
- PostgreSQL support
- Fly.io as a deployment option
- Register/Auth flow
- Sentry support
- More frontend tool options (TwinSpark, Datastar)
- Railway as a deployment option
- Queue support
- Websocket support
- Integrant + Aero
- Start TailwindCSS as part of the app system
- Auto-reloading Ring/Reitit
- Sessions with Ring/Reitit
- Clojure + Kamal
- CI with Kamal
To work with this template, you need:
- mise (recommended) or manual installation of:
- Java
- Clojure
- Babashka
All management tasks:
bb tasks
The following tasks are available:
test Run tests for the template config
new Create a new project
release Create and push a new git tag based on provided versionAfter you updated the template and ran tests bb test, you can create a new project to check if everything works as expected:
bb newThe new project will be created in the tmpl directory at the root that is ignored by git.
Once you are ready to release a new version of the template, bump version in deps.edn:
:aliases -> :build -> :exec-args -> :version -> "0.1.1
and then run the following command:
bb release A new git tag based on latest version will be created and pushed to the repository.
MIT License Copyright (c) 2025 Andrey Bogoyavlenskiy