What you are looking at here is an example of a minimal approach to building a Playframework application.
Playframework is for some reason regarded as a heawyweight framework. I think much of that perception comes from the use of Sbt play plugin which promotes unusual project structure and gives us Twirl templates, the routes file, and a complicated dev mode.
However, Playframework is a very flexible piece of software. You don't need to use all that is prescribed by the default setup you get when checking out the playframework seed project.
What happens when we remove the Play Sbt plugin?
Play Sbt plugin injects several default dependencies and allows you to include additional modules such as
ws
, cache
etc. These are now declared explicitely. Use Maven search to find out what is available.
Project structure is the usual src/{main,test}/{scala,resources}
structure you know and love.
routes
file is replaced with a SIRD router
definition, and Twirl templates are replaced with ScalaTags.
Everything that was in the conf
directory has moved to src/main/resources
.
All assets are in src/main/resources/public
We use play.core.server.ProdServerStart
for both dev and prod.
sbt-revolver
plugin is included so just run ~ reStart
and have fun!
Here we use compile-time dependency injection with MacWire. It should be fairly simple to continue using Guice if you feel like it.
- dev_admin_user/devadmin
- dev_regular_user/devregular