Initial Kit project with PostgreSQL, HTMX, Hiccup, and Tailwind
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
(ns pmagnus.elprice.dev-middleware)
|
||||
|
||||
(defn wrap-dev [handler _opts]
|
||||
(-> handler
|
||||
))
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
(ns pmagnus.elprice.env
|
||||
(:require
|
||||
[clojure.tools.logging :as log]
|
||||
[pmagnus.elprice.dev-middleware :refer [wrap-dev]]))
|
||||
|
||||
(def defaults
|
||||
{:init (fn []
|
||||
(log/info "\n-=[elprice starting using the development or test profile]=-"))
|
||||
:start (fn []
|
||||
(log/info "\n-=[elprice started successfully using the development or test profile]=-"))
|
||||
:stop (fn []
|
||||
(log/info "\n-=[elprice has shut down successfully]=-"))
|
||||
:middleware wrap-dev
|
||||
:opts {:profile :dev}})
|
||||
Vendored
+59
@@ -0,0 +1,59 @@
|
||||
(ns user
|
||||
"Userspace functions you can run by default in your local REPL."
|
||||
(:require
|
||||
[clojure.pprint]
|
||||
[clojure.spec.alpha :as s]
|
||||
[clojure.tools.namespace.repl :as repl]
|
||||
[criterium.core :as c] ;; benchmarking
|
||||
[expound.alpha :as expound]
|
||||
[integrant.core :as ig]
|
||||
[integrant.repl :refer [clear go halt prep init reset reset-all]]
|
||||
[integrant.repl.state :as state]
|
||||
[kit.api :as kit]
|
||||
[lambdaisland.classpath.watch-deps :as watch-deps] ;; hot loading for deps
|
||||
[pmagnus.elprice.core :refer [start-app]]))
|
||||
|
||||
;; uncomment to enable hot loading for deps
|
||||
(watch-deps/start! {:aliases [:dev :test]})
|
||||
|
||||
(alter-var-root #'s/*explain-out* (constantly expound/printer))
|
||||
|
||||
(add-tap (bound-fn* clojure.pprint/pprint))
|
||||
|
||||
(defn dev-prep!
|
||||
[]
|
||||
(integrant.repl/set-prep! (fn []
|
||||
(-> (pmagnus.elprice.config/system-config {:profile :dev})
|
||||
(ig/expand)))))
|
||||
|
||||
(defn test-prep!
|
||||
[]
|
||||
(integrant.repl/set-prep! (fn []
|
||||
(-> (pmagnus.elprice.config/system-config {:profile :test})
|
||||
(ig/expand)))))
|
||||
|
||||
;; Can change this to test-prep! if want to run tests as the test profile in your repl
|
||||
;; You can run tests in the dev profile, too, but there are some differences between
|
||||
;; the two profiles.
|
||||
(dev-prep!)
|
||||
|
||||
(repl/set-refresh-dirs "src/clj")
|
||||
|
||||
(def refresh repl/refresh)
|
||||
|
||||
|
||||
(defn reset-db []
|
||||
(migratus.core/reset (:db.sql/migrations state/system)))
|
||||
|
||||
(defn rollback []
|
||||
(migratus.core/rollback (:db.sql/migrations state/system)))
|
||||
|
||||
(defn migrate []
|
||||
(migratus.core/migrate (:db.sql/migrations state/system)))
|
||||
|
||||
(def query-fn (:db.sql/query-fn state/system))
|
||||
|
||||
|
||||
(comment
|
||||
(go)
|
||||
(reset))
|
||||
Reference in New Issue
Block a user