Define a idiomatic struct of dir
about the beckend App of ZIO.
- zio, function program
- zio-quill, database access
- zio-http, restful server or whatever
- zio-json, encode/decode
src/resources
- application.conf / .properties
src/main/scala/your-project
- db
- model
- User.scala // case class, for model
- xx.scala
- table
- Users.scala // crud prue access, with quill
- xxs.scala
- QuillContext.scala // Quill Context
- http
- UserPartial.scala // define routes, partially
- xxPartial.scala
- service
- business
- Notifications.scala // for app use case
- common
- EmailService.scala // some common use case
- MainApp.scala // entry point
There are two different way to define routes:
- Http ++ Http, eg.
EventRoute
- ParticalFunction#orElse, like
UserPartial
andRsvpPartial
sbt -Dquill.macro.log.pretty=true
sbt -Dquill.macro.log=false
Loads the following (first-listed are higher priority)
- system properties
- application.conf (all resources on classpath with this name)
- application.json (all resources on classpath with this name)
- application.properties (all resources on classpath with this name)
- reference.conf (all resources on classpath with this name)
sbt universal:packageBin
Please share with us, for free.
zio-http
is not relase with zio for this writing. You can get some help from here.