This project aims to show how to get started with Play / Scala and some nice features and boilerplate code.
It integrate several ways to use Play such as Standard Application (using Play templates) and Single Page Application (using AngularJS, Grunt and Bower).
Before start using this project, you must install this tools :
- MongoDB 2.4.8
- Scala 2.10.2
- Play framework 2.2.3
- nodejs 0.10.26 and npm 1.3.11
- bower 1.3.3 (
sudo npm install -g bower
) - grunt-cli 0.1.13 (
sudo npm install -g grunt-cli
)
Here is a list of used libraries (with their version) :
Feel free to send a pull request to upgrade versions...
(I will try to stay as up to date as possible)
- Open a terminal and go to the root app folder
- Create the view folder for Play (
mkdir app/views
) - Go to frontend folder to setup tools (
cd ui
) - Install grunt dependencies (
npm install
) - Install bower dependencies (
bower install
) - Build front-end code (
grunt play
) - Start MongoDB on your machine on port 27017 (default)
- Return to root folder (
cd ..
) - Run play server (
play run
) - Open application : localhost:9000
When you develop with this configuration, you should have at least two terminals opened. One to run Play server (backend) and one for compiling frontend assets with grunt.
- Go to folder ui/ and run
grunt dev
. It will launch a watch to sync your frontend files in play. - Go to root folder and run
play run
. It will start the play server.
- write tests !!! (Scala & AngularJS)
- finalize scala rest apis (improve actual code, remove deprecated code)
- add a REST api with play-autosource
- work with more complex objects (nested objects, arrays, options) & add metadata (createDate...)
- improve REST apis & UI (pagination, searches...)
- add global CRUD actions (delete all / delete selected...)
- add authentication and private views
I take some code & inspiration in various projects and articles. Bests are :
- Eventual activator from Typesafe
- Reactive app from Stephane Godbillon
- JSON Coast-to-Coast Design from Mandubian
- angular-play-mongo-sample from Loïc Descotte
- SSE chat from Matthias Nehlsen