28
play framework anatomy of a play project

Play Framework (anatomy of a play application) @ Codacy

Embed Size (px)

Citation preview

play frameworkanatomy of a play project

• Master student of Information Systems and Computer @ IST !

• 2 years of experience developing in Scala !

• Currently doing awesome stuff @ Codacy

Who am I?

Rodrigo Fernandes

@rtfpessoa

SBTScala (Simple) Build Tool

SBT

• Play Framework seamlessly integrated with SBT

• Play Framework is an SBT plugin (since v2.3.x)

How to integrate?

SBT• build.sbt — define the project

and sub-projects relation and configuration!

• project — root project plugins and extra definitions!

• plugins.sbt

• [Common.scala]

• [Dependencies.scala]

How to configure?

SBT build.sbt

SBTplugins.sbt

SBTCommon.scala

SBTDependencies.scala

Play Frameworkapplication setup

RoutesDefault routes and asset optimisations

Multi Layer Application

rules

services

controllers

models components/database (Slick)

components/rulescomponents/services

fram

ewor

k

root application

Multi Layer Application

rules

services

controllers

models

Native UI (C#) API (REST)

HTML

Service Level Permissionsservices.account.AccountServices

Response

FormsFrontend

FormsBackend

Controller Authentication

DatabaseSlick — Scala Language Integrated Connection Kit

Features•fully type-checked

•no SQL-injections

•no typos

•code completion

•can still crash in runtime :’(

Example Table

Base Table

Security

SecuritySecureString

Questions?

Thank you

For more info check out:!https://github.com/codacy/codacy-playframework-seed https://www.playframework.com/documentation/2.3.x/Home http://www.scala-sbt.org/0.13/tutorial/index.html

@codacy @rtfpessoa