https://github.com/marky-mark/play-basic
https://github.com/marky-mark/play-basic
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/marky-mark/play-basic
- Owner: marky-mark
- Created: 2017-05-29T17:37:37.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-02-13T18:41:25.000Z (over 8 years ago)
- Last Synced: 2025-06-19T05:38:52.661Z (12 months ago)
- Language: Scala
- Size: 182 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://travis-ci.org/marky-mark/play-basic)
Basic Scala Api Application
============================
## Starting Locally
### Docker Compose
#### Prerequisites
* Docker for Mac (`brew cask install docker`)
* (Docker compose should be installed already)[https://docs.docker.com/compose/install/#prerequisites]
#### Start
Can start by using docker compose, but the issue here is that the schema might not be applied. This is due to the limitations of docker compose not waiting for the db to be up applying flyway.
```bash
docker-compose up
```
Alternatively use (SBT Docker Compose Plugin)[https://github.com/Tapad/sbt-docker-compose]
```bash
sbt dockerComposeUp
```
#### Stop
```bash
docker-compose down --volumes
```
```bash
sbt dockerComposeStop
```
### Starting Manually
#### Prerequisites
* Postgres 9.4+
* Follow [flyway instructions to install schema](https://github.com/marky-mark/play-basic/tree/master/flyway)
```bash
sbt run
```
### Tests
```bash
sbt test dockerComposeTest
```
If the integration tests are broken and you want to debug [see here](https://github.com/Tapad/sbt-docker-compose)
### Generate Swagger Json
* TODO: Create SBT Plugin
```bash
brew install swagger-codegen
swagger-codegen generate -i swagger/api.yaml -l swagger -o public/
```
### Some Useful Docker Commands
#### Clear out old docker images
```bash
docker rmi $(docker images --filter "dangling=true" -q --no-trunc)
```
```
docker system prune
```
```
docker images prune
```
#### Clear out the exited containers
```bash
docker rm -v $(docker ps -a -q -f status=exited)
```
#### List docker images
```bash
docker images -a
```
#### List docker containers
```bash
docker ps -a
```
#### Docker Volume
```
docker volume ls
```
```
docker volume prune
```
#### Docker network
```
docker network ls
```
```
docker inspect
```
### Test Coverage
Investigate if IT tests are covered as part of it.
https://github.com/scoverage/sbt-scoverage
```sbt coverage test dockerComposeTest coverageReport```
### TODO - Upgrades
* Play 2.6
* Akka 2.5
* SBT 1.X
* Scala 2.12
* codahale 4.X