Bootstrap a rest service with Play2, isolated Slick and isolated Flyway
This project is built with:
- Play Framework 2.8.1
- Slick 3.3.2
- Flyway-sbt & Flyway-Core 6.2.3
A PostgreSQL Database with activated postgis extensions is needed (for geolocation queries)
Swagger.json is available at /v1/swagger.json
- Play2-Bootstrap
- Status
- Getting Started
- Documentation
- Dependencies
- Miscellaneous
- Licenses
- Changes
- Contributors
-
Configure Environment in Insomnia to match with local or prod/staging services
- Install Docker
- Install sbt
- Install openJDK 11
- firebase.json (Firebase Service-Account-Access json with firebase-admin-sdk rights) in ./conf/
If prerequisites are met, the service can be started with:
cd ./local-runner
./runFor.sh- Name mentioned in logs:
./local-runner/runFor.sh -n Name
- Remove docker container volume mounted at ./local-runner/postigs:
./local-runner/runFor.sh -r
Service is then locally available at: http://localhost:9000
- Sorry, no out of the box solution
Service Account from Google Cloud for the Firebase Admin Sdk. Needs Editor role.
- PostgresQl Database with Password and User set. Needs Postgis Plugin fully installed.
- 1. Filter ()
- 2. Controller (Http Request Handling)
- 3. Repository (Data handling)
- 4. DAOs (Database Access)
See here for Deployment and Environment Documentation
- Some requests will require a Firebase JWT Token in the Authorization Header
- The Firebase.json file has to be present and filled at ./conf/firebase.json
This has to be run first
sbt flyway/flywayMigrateYou will need to run the flywayMigrate task first, and then you will be able to generate tables using slickGen.
sbt slickGenafter that you will have to mark the folder target/scala-x.xx/scr_managed as "generated sources root"
You can run functional tests against an in memory database and Slick easily with Play from a clean slate:
For local Testing:
./deployment/runtest.shA Postgis Database has to be available to run:
sbt ciTestsTo run the project, start up Play:
sbt runAnd that's it!
The service locally aviable at: http://localhost:9000
Liceses Markdown: Last updated (18.06.2020)
Changes Markdown: Changes
