IHopeYouCanChangeThis/PathFinder — pull request #18 by gregsexton (2014-08-25 15:31:27+00:00)
Title: Setup a basic dev workflow

This builds on #17. I couldn't figure how to add to that PR because it was created by Alex. Anyone know?

Basically, this gives us the same compojure-based server. Instead of using the lein-ring plugin though we have a more repl-based flow. I found in the past that lein-ring doesn't scale well. I managed to break it pretty easily when I stepped outside the well trodden path. It's stateful and get's confused pretty easily when reloading code. It also doesn't really let you take control of how the app is constructed and the server is started. Annoying when trying to start it in a different way for prod compared to dev etc.

This setup I'm proposing is based on: http://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded It's a little more manual but it's also explicit. It's very nice just to be able to reload everything and know that your repl is in sync with the actual code. As the codebase grows this can become a real headache. Take a look and see what you think. It has worked really well for me in the past.

Highlights:

* Fire up a repl and type `(reset)'. You should now have a server running on port 9400.

* Type `(reset)' again. This will reload any code changes and restart the entire app stack. Should take less than a second.

* Type `(autotest)'. This will run all the tests. Go to a test and edit it so that it breaks. You should get instant feedback in the repl.

* Take a look at the dev/user.clj file. Anything placed in here will be available to you in the repl on startup. I tend to use this as a dumping ground for stuff I hack up while I'm developing something. Particularly impromptu test data. I tend not to commit most of what I put in here. Be aware that every time you run `(reset)' you'll lose everything defined in the repl, but everything defined in user.clj will be available again.