diff --git a/README.md b/README.md new file mode 100644 index 00000000..5130f583 --- /dev/null +++ b/README.md @@ -0,0 +1,28 @@ +# 4Clojure + +An interactive problem website for Clojure beginners +[https://www.4clojure.com](https://www.4clojure.com). + +## Setup instructions for running locally + +* Download and install [leiningen](https://github.com/technomancy/leiningen). +* Download and install [mongodb](http://www.mongodb.org/). +* The project uses [clojail](https://github.com/Raynes/clojail) That +requires a security policy setup in your home directory. Setup a file +called .java.policy in your home directory. The contents should +look like this + grant { + permission java.security.AllPermission; + }; + +* CD in the project and run "lein deps". +* Start up your mongodb, if you don't have autostart + mongod +* For the first time use, you will need to load the problem data run +* the script load-data.sh + ./load-data.sh +* Run lein ring server and the browser should open for you. + lein ring server + + + diff --git a/load-data.sh b/load-data.sh new file mode 100755 index 00000000..b4371fb6 --- /dev/null +++ b/load-data.sh @@ -0,0 +1,3 @@ +project_classpath=`lein classpath` +echo $project_classpath +java -cp $project_classpath clojure.main ./src/foreclojure/data-set.clj diff --git a/project.clj b/project.clj index 77585563..18bc0dfb 100644 --- a/project.clj +++ b/project.clj @@ -9,5 +9,7 @@ [congomongo "0.1.3-SNAPSHOT"] [org.jasypt/jasypt "1.7"] [amalloy/utils "[0.3.7,)"]] - :dev-dependencies [[lein-ring "0.4.0"]] - :main foreclojure.core) + :dev-dependencies [[lein-ring "0.4.0"] + [swank-clojure "1.2.1"]] + :main foreclojure.core + :ring {:handler foreclojure.core/app}) diff --git a/src/foreclojure/data_set.clj b/src/foreclojure/data_set.clj index e3595fce..50c33baf 100644 --- a/src/foreclojure/data_set.clj +++ b/src/foreclojure/data_set.clj @@ -3,7 +3,7 @@ (defn load-problems [] (do - + (mongo! :db :mydb) (insert! :problems {:_id 1 :title "Nothing but the Truth"