Skip to content
AngularJS in the front, Clojure in the back.
Clojure CoffeeScript JavaScript CSS Shell
Failed to load latest commit information.
bin Declare dependency on bower; use local bower in bootstrap.sh. Jan 17, 2014
resources
spec add protractor tests Dec 9, 2013
src/cljang
test/cljang/test
.bowerrc initial commit. Dec 7, 2013
.gitignore use clj-time Jan 16, 2014
Procfile initial commit. Dec 7, 2013
README.md really hate getting the link syntax wrong Jan 29, 2014
bower.json Update dependency versions; test:all stil passes. Jan 17, 2014
gruntfile.coffee
package.json
project.clj bump to verion 0.1.7 Jan 16, 2014

README.md

THIS PROJECT IS DEPRECATED

We've moved this project to a leiningen template: lein-angular . You should use that instead, look, it's easy:

$ lein new angular <project-name>

clojure-angular-seed

A seed project for getting started fast with Clojure and AngularJS.

What?

A quick and easy way to get off the ground with a Clojure and AngularJS. This project provides a minimal Clojure web server which serves up a single-page AngularJS application and provides the beginnings of a RESTful backend API. It also uses bower to manage front-end dependencies and grunt to orchestrate coffee-script and sass compilation, copying files around, starting the dev server and watching for changes to source files.

Why?

Because it takes a while to get up and running with a Clojure/Angular/CoffeeScript/Sass app in the first place, and that's before you've even started to build the actual functionality of your cool new app. This repo provides a minimal setup useful for getting straight to work rather than spending two hours just getting to square one.

How?

This project was set up by first generating a bare-bones luminus app, then generating yeoman angular app and selectivly moving the good parts of the angular app over to the clojure project. The gruntfile was built from scratch to provide only the functionality that was needed to get the basic app working, consider it a base from which to start work rather than a finished 'framework'.

Prerequisites

You will need Leiningen 2.0 or above installed.

You will also need to have nodejs and ruby installed.

Running

To set up the project, install grunt-cli if you haven't already:

$ npm install -g grunt-cli

depending on how you installed nodejs, you may need root permissions for the above command. Subsequent commands should not be run with root permissions.

Install the Sass ruby gem:

$ gem install sass

Then run the bootstrapper script, which will install npm and bower packages, and also install the webdriver binaries needed to run the protractor tests:

$ ./bin/bootstrap.sh

Finally, to run the development server:

$ grunt server

To make the process of starting your new project easier, you can instantly change the name of the project by running:

$ ./bin/change-project-name.sh <name>

You can also blow away the existing git repository (which would just point to this repo) and start fresh with:

$ ./bin/git-reinit.sh

For example: $ ./bin/change-project-name.sh wibble will change your project and its clojure modules to be called 'wibble' rather than the default 'cljang'.

Testing

Run the protractor end-to-end tests:

$ grunt test:e2e

This will run the tests against the currently running server.

Run the clojure tests of the web service:

$ grunt test:ring

Or, run all tests in sequence:

$ grunt test:all

Note, that as the protractor tests are run against the currently running server, you may wish to set up a separate grunt task to run the server with the 'testing' profile (perhaps you'd like to use a different database for testing). Left as an exercise for the reader ;)

Future

In future, expect to see:

  • tests, both for the angular frontend and for the clojure api
  • easy deployment/packaging
  • other tiny improvements
  • relentless yak shaving

License

Copyright © 2013 Shane Kilkelly, MIT License

Something went wrong with that request. Please try again.