rename wanijo.infrastructure to wanijo.infra

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

@ -16,16 +16,16 @@ You'll need:
- start a neo4j database with `lein neo4j`
- 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
- run `wanijo.infrastructure.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/create-user!` using the desired username and password as parameters to create an application user
- run `wanijo.infra.repl/run-migrations!` to create desireable database constraints and structures
### Launch the application server
- start a repl
- import `wanijo.infrastructure.repl`
- run `wanijo.infrastructure.repl/dev-server!`
- import `wanijo.infra.repl`
- run `wanijo.infra.repl/dev-server!`
- the application is available on port `8080`
## 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.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
[lein-less "1.7.5"]
[joshavg/lein-neo4j "0.5.0"]
;; code quality
[lein-ancient "LATEST"]
[jonase/eastwood "LATEST"]
@ -62,7 +64,7 @@
:main wanijo.main}}
:neo4j {:path "neo4j"}
:repl-options {:init-ns wanijo.infrastructure.repl}
:repl-options {:init-ns wanijo.infra.repl}
:less {:source-paths ["resources/app/stylesheets"]
:target-path "resources/public/css"}
:aliases {"uberjar" ["do" ["less" "once"] "uberjar"]}

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

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

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

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

@ -1,5 +1,5 @@
(ns wanijo.home.view
(:require [wanijo.infrastructure.view :as view]))
(:require [wanijo.infra.view :as view]))
(defn root! [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]]
[ring.util.response :refer [redirect]]
[ring.util.anti-forgery :refer [anti-forgery-field]]
[buddy.hashers :as hashers]
[hiccup.form :as hform]
[wanijo.infrastructure.view :as view]
[wanijo.infrastructure.routing :refer [register! path]]
[wanijo.infra.view :as view]
[wanijo.infra.routing :refer [register! path]]
[wanijo.user.db :as user-domain]))
(defn- login-check! [req]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -1,6 +1,6 @@
(ns wanijo.specs
(: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 ::updated_at ::neo4j/date-str)

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

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

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

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

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

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

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

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

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

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

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