rename wanijo.infrastructure to wanijo.infra

alfred
Josha von Gizycki 3 years ago
parent 5e28072b24
commit d81106b7c3

@ -16,16 +16,16 @@ You'll need:
- start a neo4j database with `lein neo4j` - start a neo4j database with `lein neo4j`
- start a repl with `lein repl` or similar - start a repl with `lein repl` or similar
- import `wanijo.infrastructure.repl` - import `wanijo.infra.repl`
- if you use leiningen for launching the repl, this will be your init-ns - if you use leiningen for launching the repl, this will be your init-ns
- run `wanijo.infrastructure.repl/create-user!` using the desired username and password as parameters to create an application user - run `wanijo.infra.repl/create-user!` using the desired username and password as parameters to create an application user
- run `wanijo.infrastructure.repl/run-migrations!` to create desireable database constraints and structures - run `wanijo.infra.repl/run-migrations!` to create desireable database constraints and structures
### Launch the application server ### Launch the application server
- start a repl - start a repl
- import `wanijo.infrastructure.repl` - import `wanijo.infra.repl`
- run `wanijo.infrastructure.repl/dev-server!` - run `wanijo.infra.repl/dev-server!`
- the application is available on port `8080` - the application is available on port `8080`
## Launch as a standalone ## Launch as a standalone
@ -54,4 +54,4 @@ The first level of structure are the building blocks of the domain, e.g. `instan
`wanijo.handler` collects all routes and passes them to ring. `wanijo.handler` collects all routes and passes them to ring.
`wanijo.infrastructure` contains the namespaces needed for technical code that do not belong to any domain, like database access, routing or similars. `wanijo.infra` contains the namespaces needed for technical code that do not belong to any domain, like database access, routing or similars.

@ -52,6 +52,8 @@
:profiles {:dev {:plugins [;; web stuff :profiles {:dev {:plugins [;; web stuff
[lein-less "1.7.5"] [lein-less "1.7.5"]
[joshavg/lein-neo4j "0.5.0"]
;; code quality ;; code quality
[lein-ancient "LATEST"] [lein-ancient "LATEST"]
[jonase/eastwood "LATEST"] [jonase/eastwood "LATEST"]
@ -62,7 +64,7 @@
:main wanijo.main}} :main wanijo.main}}
:neo4j {:path "neo4j"} :neo4j {:path "neo4j"}
:repl-options {:init-ns wanijo.infrastructure.repl} :repl-options {:init-ns wanijo.infra.repl}
:less {:source-paths ["resources/app/stylesheets"] :less {:source-paths ["resources/app/stylesheets"]
:target-path "resources/public/css"} :target-path "resources/public/css"}
:aliases {"uberjar" ["do" ["less" "once"] "uberjar"]} :aliases {"uberjar" ["do" ["less" "once"] "uberjar"]}

@ -1,5 +1,5 @@
(ns wanijo.attribute.db (ns wanijo.attribute.db
(:require [wanijo.infrastructure.neo4j :as neo4j])) (:require [wanijo.infra.neo4j :as neo4j]))
(neo4j/defquery findy-by-schema (neo4j/defquery findy-by-schema
"MATCH (a:attribute)-->(s:schema) "MATCH (a:attribute)-->(s:schema)

@ -3,7 +3,7 @@
[clojure.pprint :refer [pprint]] [clojure.pprint :refer [pprint]]
[ring.util.response :as resp] [ring.util.response :as resp]
[formulare.core :as form] [formulare.core :as form]
[wanijo.infrastructure.routing :refer [register! path]] [wanijo.infra.routing :refer [register! path]]
[wanijo.attribute.db :as domain] [wanijo.attribute.db :as domain]
[wanijo.schema [wanijo.schema
[routes :as schema-routes] [routes :as schema-routes]

@ -18,7 +18,7 @@
[wanijo.instance.routes :as instance-routes] [wanijo.instance.routes :as instance-routes]
[wanijo.visualisation.routes :as vis-routes] [wanijo.visualisation.routes :as vis-routes]
[wanijo.tag.routes :as tag-routes] [wanijo.tag.routes :as tag-routes]
[wanijo.infrastructure [wanijo.infra
[auth :as auth] [auth :as auth]
[routing :refer [path]] [routing :refer [path]]
[gzip :as gzip] [gzip :as gzip]

@ -1,6 +1,6 @@
(ns wanijo.home.routes (ns wanijo.home.routes
(:require [compojure.core :refer [defroutes GET]] (:require [compojure.core :refer [defroutes GET]]
[wanijo.infrastructure.routing :refer [register!]] [wanijo.infra.routing :refer [register!]]
[wanijo.home.view :as home-view])) [wanijo.home.view :as home-view]))
(defroutes routes (defroutes routes

@ -1,5 +1,5 @@
(ns wanijo.home.view (ns wanijo.home.view
(:require [wanijo.infrastructure.view :as view])) (:require [wanijo.infra.view :as view]))
(defn root! [req] (defn root! [req]
(view/layout :session (:session req))) (view/layout :session (:session req)))

@ -1,11 +1,11 @@
(ns wanijo.infrastructure.auth (ns wanijo.infra.auth
(:require [compojure.core :refer [POST GET defroutes]] (:require [compojure.core :refer [POST GET defroutes]]
[ring.util.response :refer [redirect]] [ring.util.response :refer [redirect]]
[ring.util.anti-forgery :refer [anti-forgery-field]] [ring.util.anti-forgery :refer [anti-forgery-field]]
[buddy.hashers :as hashers] [buddy.hashers :as hashers]
[hiccup.form :as hform] [hiccup.form :as hform]
[wanijo.infrastructure.view :as view] [wanijo.infra.view :as view]
[wanijo.infrastructure.routing :refer [register! path]] [wanijo.infra.routing :refer [register! path]]
[wanijo.user.db :as user-domain])) [wanijo.user.db :as user-domain]))
(defn- login-check! [req] (defn- login-check! [req]

@ -1,4 +1,4 @@
(ns wanijo.infrastructure.common) (ns wanijo.infra.common)
(defn in? [coll x] (defn in? [coll x]
(some? (some (partial = x) coll))) (some? (some (partial = x) coll)))

@ -1,4 +1,4 @@
(ns wanijo.infrastructure.gzip (ns wanijo.infra.gzip
(:require [clojure.java.io :as io]) (:require [clojure.java.io :as io])
(:import (java.io InputStream (:import (java.io InputStream
Closeable Closeable

@ -1,4 +1,4 @@
(ns wanijo.infrastructure.neo4j (ns wanijo.infra.neo4j
(:require [neo4j-clj.core :as db] (:require [neo4j-clj.core :as db]
[neo4j-clj.in-memory :as db-inm] [neo4j-clj.in-memory :as db-inm]
[clj-time.format :as time-format] [clj-time.format :as time-format]

@ -1,7 +1,7 @@
(ns wanijo.infrastructure.repl (ns wanijo.infra.repl
(:require [buddy.hashers :as hashers] (:require [buddy.hashers :as hashers]
[wanijo.main :as main] [wanijo.main :as main]
[wanijo.infrastructure.neo4j :as neo4j])) [wanijo.infra.neo4j :as neo4j]))
(neo4j/defquery create-user (neo4j/defquery create-user
"CREATE (n:user) "CREATE (n:user)

@ -1,4 +1,4 @@
(ns wanijo.infrastructure.routing (ns wanijo.infra.routing
(:require [clojure.string :as string])) (:require [clojure.string :as string]))
(def all-routes (def all-routes

@ -1,4 +1,4 @@
(ns wanijo.infrastructure.time (ns wanijo.infra.time
(:require [clj-time.format :as format])) (:require [clj-time.format :as format]))
(defn prettify-dt [date-str] (defn prettify-dt [date-str]

@ -1,8 +1,8 @@
(ns wanijo.infrastructure.view (ns wanijo.infra.view
(:require [hiccup (:require [hiccup
[page :refer [html5 include-js include-css]] [page :refer [html5 include-js include-css]]
[core :refer [h]]] [core :refer [h]]]
[wanijo.infrastructure.routing :refer [path]])) [wanijo.infra.routing :refer [path]]))
(defn btnlink (defn btnlink
([target caption] ([target caption]

@ -1,6 +1,6 @@
(ns wanijo.instance.db (ns wanijo.instance.db
(:require [clojure.spec.alpha :as spec] (:require [clojure.spec.alpha :as spec]
[wanijo.infrastructure.neo4j :as neo4j] [wanijo.infra.neo4j :as neo4j]
[wanijo.instance.domain :as domain-instance] [wanijo.instance.domain :as domain-instance]
[wanijo.tag.db :as db-tag])) [wanijo.tag.db :as db-tag]))

@ -16,7 +16,7 @@
[wanijo.schema.db :as domain-schema] [wanijo.schema.db :as domain-schema]
[wanijo.schema.middleware :as middleware-schema] [wanijo.schema.middleware :as middleware-schema]
[wanijo.link.db :as domain-link] [wanijo.link.db :as domain-link]
[wanijo.infrastructure.routing :refer [register! path]] [wanijo.infra.routing :refer [register! path]]
[wanijo.attribute.db :as db-attr])) [wanijo.attribute.db :as db-attr]))
(defn route-list! [schema-uuid req] (defn route-list! [schema-uuid req]

@ -1,9 +1,9 @@
(ns wanijo.instance.view.bulk-link-selection (ns wanijo.instance.view.bulk-link-selection
(:require [hiccup.form :as hform] (:require [hiccup.form :as hform]
[hiccup.core :refer [h]] [hiccup.core :refer [h]]
[wanijo.infrastructure.view :as view] [wanijo.infra.view :as view]
[wanijo.infrastructure.routing :refer [path]] [wanijo.infra.routing :refer [path]]
[wanijo.infrastructure.time :refer [prettify-dt]] [wanijo.infra.time :refer [prettify-dt]]
[wanijo.instance.view.view [wanijo.instance.view.view
:refer [req-attrs-headings :refer [req-attrs-headings
req-attrs-cells req-attrs-cells

@ -2,9 +2,9 @@
(:require [hiccup.form :as hform] (:require [hiccup.form :as hform]
[hiccup.core :refer [h]] [hiccup.core :refer [h]]
[ring.util.anti-forgery :refer [anti-forgery-field]] [ring.util.anti-forgery :refer [anti-forgery-field]]
[wanijo.infrastructure.view :as view] [wanijo.infra.view :as view]
[wanijo.infrastructure.routing :refer [path]] [wanijo.infra.routing :refer [path]]
[wanijo.infrastructure.time :refer [prettify-dt]] [wanijo.infra.time :refer [prettify-dt]]
[wanijo.tag.view :as view-tag] [wanijo.tag.view :as view-tag]
[formulare.core :as form])) [formulare.core :as form]))

@ -3,9 +3,9 @@
[hiccup.core :refer [h]] [hiccup.core :refer [h]]
[formulare.core :as form] [formulare.core :as form]
[wanijo.instance.view.view :as view-instance] [wanijo.instance.view.view :as view-instance]
[wanijo.infrastructure.view :as view] [wanijo.infra.view :as view]
[wanijo.infrastructure.routing :refer [path]] [wanijo.infra.routing :refer [path]]
[wanijo.infrastructure.time :refer [prettify-dt]])) [wanijo.infra.time :refer [prettify-dt]]))
(defn instances [schema instances new-form req] (defn instances [schema instances new-form req]
(view/layout (view/layout

@ -1,8 +1,8 @@
(ns wanijo.instance.view.link-selection (ns wanijo.instance.view.link-selection
(:require [hiccup.form :as hform] (:require [hiccup.form :as hform]
[hiccup.core :refer [h]] [hiccup.core :refer [h]]
[wanijo.infrastructure.view :as view] [wanijo.infra.view :as view]
[wanijo.infrastructure.routing :refer [path]] [wanijo.infra.routing :refer [path]]
[formulare.core :as form])) [formulare.core :as form]))
(defn link-selection [instance schema form req] (defn link-selection [instance schema form req]

@ -2,9 +2,9 @@
(:require [hiccup.form :as hform] (:require [hiccup.form :as hform]
[hiccup.core :refer [h]] [hiccup.core :refer [h]]
[ring.util.anti-forgery :refer [anti-forgery-field]] [ring.util.anti-forgery :refer [anti-forgery-field]]
[wanijo.infrastructure.view :as view] [wanijo.infra.view :as view]
[wanijo.infrastructure.routing :refer [path]] [wanijo.infra.routing :refer [path]]
[wanijo.infrastructure.time :refer [prettify-dt]] [wanijo.infra.time :refer [prettify-dt]]
[wanijo.instance.view.view :as view-instance] [wanijo.instance.view.view :as view-instance]
[wanijo.tag.view :as view-tag] [wanijo.tag.view :as view-tag]
[markdown.core :as md] [markdown.core :as md]

@ -1,8 +1,8 @@
(ns wanijo.instance.view.starred (ns wanijo.instance.view.starred
(:require [hiccup.core :refer [h]] (:require [hiccup.core :refer [h]]
[wanijo.infrastructure.view :as view] [wanijo.infra.view :as view]
[wanijo.infrastructure.routing :refer [path]] [wanijo.infra.routing :refer [path]]
[wanijo.infrastructure.time :refer [prettify-dt]])) [wanijo.infra.time :refer [prettify-dt]]))
(defn starred [instances req] (defn starred [instances req]
(view/layout (view/layout

@ -1,7 +1,7 @@
(ns wanijo.link.db (ns wanijo.link.db
(:require [clojure.spec.alpha :as spec] (:require [clojure.spec.alpha :as spec]
[wanijo.specs :as specs] [wanijo.specs :as specs]
[wanijo.infrastructure.neo4j :as neo4j])) [wanijo.infra.neo4j :as neo4j]))
(spec/def ::link (spec/def ::link
(spec/keys :req-un [::neo4j/uuid (spec/keys :req-un [::neo4j/uuid

@ -1,5 +1,5 @@
(ns wanijo.schema.db (ns wanijo.schema.db
(:require [wanijo.infrastructure.neo4j :as neo4j] (:require [wanijo.infra.neo4j :as neo4j]
[wanijo.schema.domain :as domain] [wanijo.schema.domain :as domain]
[clojure.spec.alpha :as spec])) [clojure.spec.alpha :as spec]))

@ -2,7 +2,7 @@
(:require [clojure.spec.alpha :as spec] (:require [clojure.spec.alpha :as spec]
[wanijo.specs :as specs] [wanijo.specs :as specs]
[wanijo.attribute.domain :as domain-attr] [wanijo.attribute.domain :as domain-attr]
[wanijo.infrastructure.neo4j :as neo4j])) [wanijo.infra.neo4j :as neo4j]))
(spec/def ::name (spec/def ::name
(spec/and ::specs/name (complement empty?))) (spec/and ::specs/name (complement empty?)))

@ -1,6 +1,6 @@
(ns wanijo.schema.middleware (ns wanijo.schema.middleware
(:require [ring.util.response :as resp] (:require [ring.util.response :as resp]
[wanijo.infrastructure.routing :refer [path]] [wanijo.infra.routing :refer [path]]
[wanijo.schema.db :as db])) [wanijo.schema.db :as db]))
(defn wrap-user-schemas! [handler] (defn wrap-user-schemas! [handler]

@ -2,7 +2,7 @@
(:require [compojure.core :refer [defroutes GET POST DELETE] :as comp] (:require [compojure.core :refer [defroutes GET POST DELETE] :as comp]
[ring.util.response :as resp] [ring.util.response :as resp]
[formulare.core :as form] [formulare.core :as form]
[wanijo.infrastructure.routing :refer [register! path]] [wanijo.infra.routing :refer [register! path]]
[wanijo.user.db :as domain-user] [wanijo.user.db :as domain-user]
[wanijo.schema [wanijo.schema
[view :as schema-view] [view :as schema-view]

@ -4,9 +4,9 @@
[core :refer [h]]] [core :refer [h]]]
[ring.util.anti-forgery :refer [anti-forgery-field]] [ring.util.anti-forgery :refer [anti-forgery-field]]
[formulare.core :as form] [formulare.core :as form]
[wanijo.infrastructure.view :as view] [wanijo.infra.view :as view]
[wanijo.infrastructure.routing :refer [path]] [wanijo.infra.routing :refer [path]]
[wanijo.infrastructure.time :refer [prettify-dt]] [wanijo.infra.time :refer [prettify-dt]]
[wanijo.schema.db :as domain] [wanijo.schema.db :as domain]
[wanijo.schema.forms :as forms])) [wanijo.schema.forms :as forms]))

@ -1,6 +1,6 @@
(ns wanijo.specs (ns wanijo.specs
(:require [clojure.spec.alpha :as spec] (:require [clojure.spec.alpha :as spec]
[wanijo.infrastructure.neo4j :as neo4j])) [wanijo.infra.neo4j :as neo4j]))
(spec/def ::created_at ::neo4j/date-str) (spec/def ::created_at ::neo4j/date-str)
(spec/def ::updated_at ::neo4j/date-str) (spec/def ::updated_at ::neo4j/date-str)

@ -1,7 +1,7 @@
(ns wanijo.tag.db (ns wanijo.tag.db
(:require [clojure.spec.alpha :as spec] (:require [clojure.spec.alpha :as spec]
[wanijo.specs :as specs] [wanijo.specs :as specs]
[wanijo.infrastructure.neo4j :as neo4j])) [wanijo.infra.neo4j :as neo4j]))
(spec/def ::name (spec/def ::name
(spec/and ::specs/name (spec/and ::specs/name

@ -2,7 +2,7 @@
(:require [compojure.core :refer [defroutes POST DELETE]] (:require [compojure.core :refer [defroutes POST DELETE]]
[ring.util.response :as resp] [ring.util.response :as resp]
[formulare.core :as form] [formulare.core :as form]
[wanijo.infrastructure.routing :refer [register! path]] [wanijo.infra.routing :refer [register! path]]
[wanijo.schema.db :as domain-schema] [wanijo.schema.db :as domain-schema]
[wanijo.instance.db :as db-instance] [wanijo.instance.db :as db-instance]
[wanijo.instance.view.show :refer [show]] [wanijo.instance.view.show :refer [show]]

@ -4,7 +4,7 @@
[ring.util.anti-forgery :refer [anti-forgery-field]] [ring.util.anti-forgery :refer [anti-forgery-field]]
[formulare.core :as form] [formulare.core :as form]
[wanijo.tag.forms :as forms] [wanijo.tag.forms :as forms]
[wanijo.infrastructure [wanijo.infra
[routing :refer [path]] [routing :refer [path]]
[view :as view] [view :as view]
[time :refer [prettify-dt]]])) [time :refer [prettify-dt]]]))

@ -1,6 +1,6 @@
(ns wanijo.user.db (ns wanijo.user.db
(:require [clojure.spec.alpha :as spec] (:require [clojure.spec.alpha :as spec]
[wanijo.infrastructure.neo4j :as neo4j])) [wanijo.infra.neo4j :as neo4j]))
(spec/def ::ident (spec/def ::ident
(spec/and string? not-empty)) (spec/and string? not-empty))

@ -1,7 +1,7 @@
(ns wanijo.user.routes (ns wanijo.user.routes
(:require [compojure.core :refer [defroutes GET POST]] (:require [compojure.core :refer [defroutes GET POST]]
[ring.util.response :as resp] [ring.util.response :as resp]
[wanijo.infrastructure.routing :refer [register!]] [wanijo.infra.routing :refer [register!]]
[wanijo.user.view :as view-user] [wanijo.user.view :as view-user]
[wanijo.user.db :as domain])) [wanijo.user.db :as domain]))

@ -2,8 +2,8 @@
(:require [hiccup.form :as hform] (:require [hiccup.form :as hform]
[ring.util.anti-forgery :refer [anti-forgery-field]] [ring.util.anti-forgery :refer [anti-forgery-field]]
[formulare.core :as form] [formulare.core :as form]
[wanijo.infrastructure.view :as view] [wanijo.infra.view :as view]
[wanijo.infrastructure.routing :refer [path]] [wanijo.infra.routing :refer [path]]
[wanijo.user.db :as domain])) [wanijo.user.db :as domain]))
(def edit-form (def edit-form

@ -1,6 +1,6 @@
(ns wanijo.visualisation.db (ns wanijo.visualisation.db
(:require [clojure.spec.alpha :as spec] (:require [clojure.spec.alpha :as spec]
[wanijo.infrastructure.neo4j :as neo4j] [wanijo.infra.neo4j :as neo4j]
[wanijo.instance.db :as db-instance] [wanijo.instance.db :as db-instance]
[wanijo.instance.domain :as domain-instance])) [wanijo.instance.domain :as domain-instance]))

@ -1,7 +1,7 @@
(ns wanijo.visualisation.routes (ns wanijo.visualisation.routes
(:require [compojure.core :refer [defroutes wrap-routes (:require [compojure.core :refer [defroutes wrap-routes
GET POST DELETE]] GET POST DELETE]]
[wanijo.infrastructure [wanijo.infra
[routing :refer [register! path]] [routing :refer [register! path]]
[view :as view]] [view :as view]]
[wanijo.instance.db :as db-instance] [wanijo.instance.db :as db-instance]

@ -2,8 +2,8 @@
(:require [hiccup.page :refer [include-js include-css]] (:require [hiccup.page :refer [include-js include-css]]
[hiccup.form :as hform] [hiccup.form :as hform]
[hiccup.core :refer [h]] [hiccup.core :refer [h]]
[wanijo.infrastructure.routing :refer [path]] [wanijo.infra.routing :refer [path]]
[wanijo.infrastructure.view :as view])) [wanijo.infra.view :as view]))
(defn index [instance req] (defn index [instance req]
(view/layout (view/layout

@ -3,7 +3,7 @@
[dorothy [dorothy
[core :as dot] [core :as dot]
[jvm :as doro-jvm]] [jvm :as doro-jvm]]
[wanijo.infrastructure.routing :refer [path]])) [wanijo.infra.routing :refer [path]]))
(defn node->label (defn node->label
([node] ([node]

@ -1,6 +1,6 @@
(ns wanijo.infrastructure.routing-test (ns wanijo.infra.routing-test
(:require [clojure.test :refer :all] (:require [clojure.test :refer :all]
[wanijo.infrastructure.routing :refer [parse-path]])) [wanijo.infra.routing :refer [parse-path]]))
(deftest test-parse-path (deftest test-parse-path
(testing "no params in path" (testing "no params in path"
Loading…
Cancel
Save