A small Grain + Datastar todo app experiment.
The project intentionally avoids a Polylith layout. Application code should stay small and local:
src/cjbarre/grain_todo_list.clj- backend, Integrant system, Grain primitivessrc/cjbarre/grain_todo_list/ui.clj- pure Hiccup UIcss/main.css- Tailwind/DaisyUI inputresources/public/css/main.css- generated CSS served by the app
- Clojure CLI
- Node.js and npm
The :dev alias is required when starting the app because LMDB needs Java module opens.
npm installOne-shot build:
npm run css:buildWatch mode while developing UI:
npm run css:devThe CSS build writes to resources/public/css/main.css.
Start an nREPL:
./scripts/nrepl.shThen evaluate:
(require '[cjbarre.grain-todo-list :as app])
(def system (app/start))Open:
http://localhost:8080/
Stop the app:
(app/stop system)Typical local loop:
npm run css:devIn another terminal:
./scripts/nrepl.shThen work from the REPL. Reload namespaces after edits and restart the Integrant system as needed:
(require 'cjbarre.grain-todo-list.ui :reload)
(require 'cjbarre.grain-todo-list :reload)
(app/stop system)
(def system (app/start))Run tests:
clojure -T:build testRun clj-kondo:
clj-kondo --lint src test- Datastar pages are generated from Grain query metadata via
ds/routes. - The home page is currently a minimal smoke-test page at
/. - For Datastar or frontend issues, check the Datastar version in use and read the Grain Datastar adapter source before guessing.
