project-templates icon indicating copy to clipboard operation
project-templates copied to clipboard

Clojure CLI Production level templates for seancorfield/deps-new

Practicalli project templates

██████╗ ██████╗  █████╗  ██████╗████████╗██╗ ██████╗ █████╗ ██╗     ██╗     ██╗
██╔══██╗██╔══██╗██╔══██╗██╔════╝╚══██╔══╝██║██╔════╝██╔══██╗██║     ██║     ██║
██████╔╝██████╔╝███████║██║        ██║   ██║██║     ███████║██║     ██║     ██║
██╔═══╝ ██╔══██╗██╔══██║██║        ██║   ██║██║     ██╔══██║██║     ██║     ██║
██║     ██║  ██║██║  ██║╚██████╗   ██║   ██║╚██████╗██║  ██║███████╗███████╗██║
╚═╝     ╚═╝  ╚═╝╚═╝  ╚═╝ ╚═════╝   ╚═╝   ╚═╝ ╚═════╝╚═╝  ╚═╝╚══════╝╚══════╝╚═╝

Overview

Create new projects with a REPL driven development focus, including production level features where relevant. The templates are used by deps-new via a user or project alias.

Templates provide

  • :practicalli/minimal essential tools, libraries and example code
  • :practicalli/service production level web services with http-kit, reitit and swagger. Optional :component management with :donut or :integrant

Configuration

Latest Release

io.github.practicalli/project-templates {:git/tag "2024-04-08" :git/sha "386e562"}

Add alias

:project/create alias is provided by Practicalli Clojure CLI Config.

The project/create alias definition combines seancorfield/deps-new and practicalli/project-templates so that all Practicalli templates are available within one alias.

  :project/create
  {:replace-deps {io.github.seancorfield/deps-new
                  {:git/tag "v0.7.0" :git/sha "58f2c19"}
                  io.github.practicalli/project-templates
                  {:git/tag "2024-04-08" :git/sha "386e562"}}
   :exec-fn      org.corfield.new/create
   :exec-args    {:template practicalli/application
                  :name practicalli/playground}}

Latest Release page includes the release :git/tag and :git/sha values for io.github.practicalli/project-templates

Usage

Create a new project using the :project/create alias from Practicalli Clojure CLI Config, using practicalli/minimal template by default

clojure -T:project/create

Override the defaults used to create a project using command line options

  • :template to specify a different template to create the project from, e.g. :template practicalli/service
  • :name and value to create a project with a different name, e.g. github-org/project-name
  • :target-dir to specify a directory to create the project in
  • :overwrite an existing project with the same :target-dir name, true updates, :delete deletes existing project and replaces it with new project
clojure -T:project/create :template practicalli/service \
:name practicalli/gameboard :target-dir gameboard-service

Templates Roadmap

🧰 General purpose

  • practicalli/service - production grade HTTP service, basic routing (reitit-ring & middleware)
    • :component :donut argument to manage system with donut-party/system
    • :component :integrant argument to manage system with Integrant and Integrant REPL
  • practicalli/application - general application, limited code
  • practicalli/minimal - Clojure CLI project, tools-build, kaocha test runner alias, Make tasks, GitHub quality checks workflow
  • TODO: practicalli/api - production grade API service (reitit-ring, clojure.spec validation)
  • TODO: practicalli/library - general library, deploymnent to Maven/Clojars
  • TODO: practicalli/blog - cryogen project with Practicalli Customisation
  • TODO: practicalli/jetty - basic web server
  • TODO: practicalli/httpkit - basic web server

🕸️ Web UI

  • DONE: #15 practicalli/landing-page - a simple landing page with figwheel and Bulma.io CSS
  • TODO: practicalli/single-page-app - a simple landing page with figwheel and Bulma.io CSS
  • TODO: practicalli/catalog - a catalog front-end webapp with firebase persistence, user OAuth authentication, figwheel, Reagent, Bulma.io CSS
  • TODO: practicalli/store-front - a catalog front-end webapp with stripe integration, firebase persistence, OAuth authentication, figwheel, Reagent, Bulma.io CSS

🔬 Data Science ‍

  • TODO: practicalli/notebook - clerk or notespace projects
  • TODO: practicalli/dashboard - visualising data sources to communicate information and concepts
  • TODO: practicalli/visualisation - oz or hanami projects
  • TODO: practicalli/data-transform - tablecloth & code for data set manipulation

🐈 Miscellaneous

  • TODO: practicalli/zulip-bot
  • TODO: practicalli/slack-bot
  • TODO: practicalli/mastodon-bot

3rd party templates

Sponsor Practicalli

Sponsor practicalli-johnny

The majority of my work is focused on the Practicalli series of books and videos and supporting projects.

Thank you to Cognitect, Nubank and a wide range of other sponsors for your continued support

Development

List all the available project tasks using the make help

make

This project uses make tasks to run the Clojure tests, kaocha test runner and package the service into an uberjar. The Makefile uses clojure commands and arguments that can be used directly if not using make.

Start a Clojure REPL process with a rich terminal UI, nREPL server for editor connection and including the build.clj script on the class path

make repl

Run kaocha unit test runner to check the template configuration against the seancorfield/deps-new template specification

make test

Run tests when ever there are file changes using kaocha watch (requires :test/watch from Practicalli Clojure CLI Config)

make test-watch

Practicalli Blog: Create deps-new template for Clojure CLI projects

License

Copyright © 2023 Practicalli

Creative Commons Attribution Share-Alike 4.0 International