This is just a toy project to explore ZIO's potential.
Set up the project with the following features:
- HTTP (zio-http)
- Configuration (zio-config)
- Logs (zio-logging)
- JSON parser (zio-json)
- Database (Quill) https://www.youtube.com/watch?v=SmBpGkIsJIU
- GraphQL (Caliban) https://www.youtube.com/watch?v=mzqsXklbmfM
- Authentication (OAuth???, Okta???)
Bonus
- Scala 3
- ZIO 2.0
- Dockerize
- Kubernetes (basic)
- Setup GitHub Actions
- Metrics (zio-metrics, zio-zmx) https://www.youtube.com/watch?v=oMJ1RMdR7wg
To install the dependencies run the following command:
sbt update
Development
To initialize the project, the first step is running sbt shell with the command sbt
.
Once in sbt shell, run the command ~reStart
. This will make the project to be initialized in watch mode. If a change is detected SBT recompiles the required classes and sbt-revolver automatically
restarts your application.
Kubernetes (for learning purposes only)
-
Create a docker image:
chmod +x bin/create-docker-image && \ ./bin/create-docker-image -v develop-SNAPSHOT
NOTE: The output will show a lot of
[error]
. Just ignore it if there's no apparent error at the end of the command. -
Install the chart running the following command:
chmod +x ./helm/scripts/* && ./helm/scripts/install
Run
./helm/scripts/uninstall
to uninstall the chart. -
To access the app, run the following command:
chmod +x ./bin/port-forward && ./bin/port-forward <LOCALHOST-PORT>