This app aims to show how to design a simple CRUD application using Play framework (and Scala) for a REST API backend and AngularJS for the frontend. It uses news tools for productivity such as grunt and bower.
This project is using a lot of tools. All should be installed before starting to run it.
- MongoDB 2.4.8
- Scala 2.10.0
- Play framework 2.2.1
- nodejs 0.10.26 and npm 1.3.11
- bower 1.3.2 (
sudo npm install -g bower
) - grunt-cli 0.1.13 (
sudo npm install -g grunt-cli
)
Versions of used libraries :
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
mkdir app/views
to create the folder views for Playcd ui
go to ui/ folder to setup frontend toolsnpm install
to install all grunt dependenciesbower install
to install all bower dependenciesgrunt play
to build project and generate play files- Start mongodb
cd ..
go to root folderplay run
to launch the application in play server- Go to localhost:9000 to see the application
When you develop with this configuration, you should have at least two terminals opened. One for play (backend) and one for grunt (frontend).
- 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...)
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