             [pfrt.web :refer [web-server]]
             [pfrt.core.app :as app]
             [pfrt.settings :as settings])
+  (:use clojure.tools.namespace.repl)
   (:gen-class))
 
 ;; Global var, only used for store

;; Helper function that executes
;; stop and start.
(defn restart []
  (start)
  (stop))

;; Main entry point
(defn -main

;; System private constructor with
;; clear and explicit dependency injection
;; on each app components.
(defn- make-app
  []
  (let [config    (settings/cfg)
        pf        (packet-filter config)
        webserver (web-server config pf)]
    (-> (app/->App [pf webserver])
        (app/init))))

;; Start function that should
;; only be used from REPL.
(defn start
  []
  (alter-var-root #'main-app (constantly (make-app)))
  (app/start main-app))

;; Stop function that should
;; only be used from REPL.
