§Play Tutorials
Play’s documentation shows the available features and how to use them, but the documentation will not show how to create an application from start to finish. This is where tutorials come in.
Tutorials are useful for showing a single application at work, especially when it comes to integrating with other systems such as databases or Javascript frameworks.
§Activator Templates
Many Activator templates come with comprehensive tutorials that guide you to creating an application using the technologies featured by that template.
A full list of templates can be discovered in the Activator Web Interface.
Additionally, templates are also published on the Lightbend website, a full list of both official and community contributed templates for Play can be found here.
Lightbend maintains a number of Activator templates. These have built-in tutorials that you can see by running the application with activator ui
and then opening the web interface at http://127.0.0.1:8888/ and clicking on the Tutorial tab.
§Introduction
This is where you should start with Play to see a simple example CRUD application.
- Play Intro in Scala with video
- Play Intro in Java with video
§Reactive Stocks
Reactive Stocks shows several stock prices displayed on a single page web application.
§Reactive Maps
Reactive Maps shows the Lightbend Platform with a series of moving actors updated in real time.
§Database
- Play Java with Spring Data JPA: This is a Play example that uses Spring Data JPA.
- Play Scala with Slick: This template combines Play Framework with Slick.
- Play Scala with Isolated Slick: This template creates module that hides Slick behind a DAO object.
- Play Java with Ebean: This is a Play example that uses EBean.
- Play Scala with Anorm: This is a Play example that uses Anorm.
§Third Party Tutorials
The Play community also has a number of tutorials that cover aspects of Play than the documentation can, or has a different angle. This is an incomplete list of several helpful blog posts.
Because some of the blog posts have been written a while ago, this section is organized by Play version.
§2.5.x
§Dependency Injection
- Dependency Injection in Play Framework using Scala by Krzysztof Pado.
§Akka Streams
- Akka Streams integration in Play Framework 2.5 by Loïc Descotte.
- Playing with Akka Streams and Twitter by Loïc Descotte.
§2.4.x
§Semisafe
Semisafe has an excellent series on Play in general:
- Templates, Routes and AJAX
- Upgrading the Framework
- Database Access
- Async Futures and Actors
- Optimistic Future Composition
- React UI Coffeescript
- CSRF Protection
§Minimal Play
- A Play Application in 38 Lines by Lloyd Chan, showing a “Sinatra” style of Play application.
§Dependency Injection
- Playframework 2.4 Dependency Injection (DI) by Marius Soutier.
- Testing with Dependency Injection by Michael Pollmeier.
- Compile Time Dependency Injection with Play 2.4 by Loïc Descotte.
§REST APIs
Justin Rodenbostel of SPR Consulting also has two blog posts on building REST APIs in Play:
- Building a Simple REST API with Scala & Play (PART 1)
- Building a simple REST API with Scala & Play! (PART 2)
§Slick
- Play framework, Slick and MySQL Tutorial by Pedro Rijo.
§RethinkDB
§Forms
- How to add a form to a Play application by Chris Birchall of the Guardian.
§EmberJS
- HTML 5 Device Orientation with play, ember and websockets by Cake Solutions (with activator template)
§AngularJS, RequireJS and sbt-web
Marius Soutier has an excellent series on setting up a Javascript interface using AngularJS with Play and sbt-web. It was originally written for Play 2.1.x, but has been updated for Play 2.4.x
- RequireJS Optimization with Play 2.1 and WebJars
- Intro to sbt-web
- Understanding sbt and sbt-web settings
- Play Angular Require Seed Updates
§React JS
- ReactJS Tutorial with Play, Scala and WebJars by Fabio Tiriticco.
- A basic example to render UI using ReactJS with Play 2.4.x, Scala and Anorm by Knoldus /
activator template
§2.3.x
§REST APIs
- Playing with Play Framework 2.3.x: REST, pipelines, and Scala by Sampson Oliver.
§Anorm
Knoldus has a nice series of blog posts on Anorm:
- Employee-Self-Service – Building Reactive Play application with Anorm SQL data access – (Part-1)
- Employee-Self-Service – Building Reactive Play application with Anorm SQL data access – (Part-2)
- Employee-Self-Service: Reactive and Non-Blocking Database Access using Play Framework and Anorm – (Part-3)
- Employee-Self-Service: Reactive and Non-Blocking Database Access using Play Framework and Anorm – (Part-4)
§Forms
- Example form including multiple checkboxes and selection by Philip Johnson.
- UX-friendly conditional form mapping in Play by the VOA
§2.2.x
§Advanced Routing
- Advanced routing in Play Framework by James Roper.
- Play Routes – Part 1, Basics by Marius Soutier.
- Play Routes – Part 2, Advanced Use Cases by Marius Soutier.
§Path Bindables
- How to implement a custom PathBindable with Play 2 by Julien Richard-Foy.
§Templates
- Play Framework 2.0 Templates – Part 1, Parameters by Marius Soutier.
§User Interface
- Composite user interface without boilerplate using Play 2 by Julien Foy.
§Play in Practice
- Play in Practice by Will Sargent.
Next: Working with Play