Skip to content

odenktools/playframework-sakila

Repository files navigation

Java Playframework Hackathon

What's inside ?

  • We use playframework 2.6.x
  • We use Beautiful UI powered by AdminLTE
  • We use Ebean
  • We use MySQL 5.x
  • Integrated with Swagger and SwaggerUI
  • Bootstrap Table
  • Rest API Examples
  • CRUD Examples
  • Server Side Validation
  • Server Side Sorting and Filtering
  • Cross Site Request Forgery aka CSRF Filter
  • Cross-Origin Resource Sharing aka CORS Filter
  • OneToMany Relation
  • Play Evolution Examples

How to run

git clone https://github.com/odenktools/playframework-sakila.git

cd playframework-sakila/

cp conf/application.txt conf/application.conf

mysql -u root -p -e "CREATE database odenktools_play;"

sbt compile

Import Data

cd playframework-sakila/

mysql -uroot -P -f odenktools_play < conf/data.sql

After that run a projects with

sbt -jvm-debug 9898 "run 9000"

OR

sbt "run 9000"

Now open your browser then navigate to http://localhost:9000 then apply the script

Building

sbt clean stage
target/universal/stage/bin/odenktools-play -Dhttp.address=127.0.0.1 -Dhttp.port=9000

Swagger UI

SEE UI

TESTING

List of actors

curl -X GET \
  'http://localhost:9000/api/v1/actors?offset=0&limit=10&sortBy=first_name&orderBy=asc' \
  -H 'cache-control: no-cache'

Find an actors

curl -X GET \
  'http://localhost:9000/api/v1/actors?offset=0&limit=10&sortBy=first_name&orderBy=asc&search=ADAM' \
  -H 'cache-control: no-cache'

List of films

curl -X GET \
  'http://localhost:9000/api/v1/films?offset=0&limit=10&sortBy=title&orderBy=asc' \
  -H 'cache-control: no-cache'

Find an films

curl -X GET \
  'http://localhost:9000/api/v1/films?search=ACADEMY%20DINOSAUR' \
  -H 'cache-control: no-cache'

References

What’s new in Play 2.6

Template

Ebean

Form

Custom Logging

Bootstrap Table

Evolution On Production

Play With Boxfuse

Microservices Architecture

Somoso Play CI

Sphere Snowflake

Travis CI ScalaOnPlay

SpringBoot 5 CI

CircleCI SpringBoot