                            "Thank you for your vote!"
                            (page-vote)))))
 
+(defn reset-state []
+  "Reset GM, teams, votes etc. to be able to start from scratch. CAVEATS: Stuff saved in people's session won't be reset."
+  ;; => Consider using a random string as part of the session key
+  (reset! state :not-started)
+  (reset! team-counter 1)
+  (reset! teams {})
+  (reset! votes {})
+  (reset! voter-ips #{})
+  (clojure.pprint/pprint @session-atom)
+  (reset! session-atom {}))
+
 (defroutes app-routes
   "/ - depending on the current stage, show either game master's page, team-registration page, or voting page
    /team - new team registration, idea publication

           #_(POST "/start-brainstorming" [] (str (compare-and-set! state :oldstate :newstate))) ;; CURRENTLY NOT NEEDED
           (POST "/start-voting" [] (str (compare-and-set! state :brainstorming :voting)))
           (POST "/show-voting-results" [] (str (compare-and-set! state :voting :voting-finished))))
  (route/resources "/")
  (route/not-found "Not Found"))

(def app
  (-> (handler/site app-routes)
      wrap-session))

;; TIME USED: 3.5 + 1h

            [hiccup.page :refer [html5]]
            [ring.util.response :refer [redirect]]
            [ring.middleware.session :refer [wrap-session]]
            [ring.middleware.session.memory :refer [memory-store]]
            [clojure.pprint]))

(def state (atom :not-started))
