Skip to content

irumiha/bareplay

Repository files navigation

BarePlay

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?

Dependencies are declared explicitely.

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.

Standard project structure.

Project structure is the usual src/{main,test}/{scala,resources} structure you know and love.

There is no code generation step.

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

There is no Dev server.

We use play.core.server.ProdServerStart for both dev and prod. sbt-revolver plugin is included so just run ~ reStart and have fun!

Dependency injection

Here we use compile-time dependency injection with MacWire. It should be fairly simple to continue using Guice if you feel like it.

Keycloak dev realm

Users

  1. dev_admin_user/devadmin
  2. dev_regular_user/devregular

About

An example Playframework project without the bells

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published