This project is intended to demonstrate how to approach building a Spray based application which provides both a RESTful programmatic api and a 'user-focused' (ajax) api on which a client-side app can be built.
I get the sense that there is a demand for this kind of thing; the Play book even has a chapter dedicated to single-page apps, but I would have thought this approach is a good fit for Spray too.
The project includes some boilerplate around account management; in particular:
- a generic account type (inspired by Snap)
- sign-in, sign-up an sign-out
- password encryption (using JBCrypt, an open-source implementation of BCrypt)
- session cookies (based on Play session cookies)
- persistent login ('remember-me') cookies (with an approach based on Improved Persistent Login Cookie Best Practice)
The project uses Slick for persistence, an approach demonstrated in the excellent S4 starter project, and Twirl for templating.
The client side app is built with Durandal.js which itself is built on Knockout.js, Require.js and the ubiquitous jQuery. I know next to nothing about javascript MVC frameworks so I took the approach of just picking one and working with it (and Durandal was suprisingly painless).
I would really appreciate feedback/suggestions on the design - I check out the spray-user google group fairly regularly; makes sense to discuss this there.