Skip to content

kyledinh/zio-petclinic-scala-3

Repository files navigation

ZIO Pet Clinic: An sample application written with ZIO 2, Scala 3 and ScalaJS.

This is repo is taking the zio/zio-petclinic project and building it with Scala 3.1.3

Changes from the original repo with:

  • Update from Scala 2 to Scala 3.1.3
  • Docker for Postgres Database
  • Update Tests
  • Tools
  • Deploy with Kubernetes
  • CI pipeline
  • Metrics

Product Name Screen Shot




Software Versions

Software Version Install
JVM openjdk 17.0.4 https://sdkman.io/install
Scala 3.1.3 https://www.scala-lang.org/download
sbt 1.7.1 https://www.scala-sbt.org/download.html
Zio 2.0.2 https://zio.dev/getting_started
Postgres 14 https://hub.docker.com/_/postgres
Docker Desktop 4.3.x https://www.docker.com/products/docker-desktop




Running localdev with Docker

Requires Docker to be running

Setup

  • make check
  • make setup

Run the local database, start backend server in Terminal 1

Start the database

  • make postgres-up
  • make postgres-init-migrate (do this only on first time to seed the database)
  • make postgres-down (to stop and remove the database container)

To run the backend API server (With sbt server)

  • make backend-compile
  • make backend-up

Run the frontend in a separate Terminal 2

  • make frontend-up
  • open http://localhost:3000

Tools

  • make status




Project Outline

A good starting point to understand this repo is with the Makefile. It will have the most common commands to check, setup, compile and build the project.

.
├── LICENSE
├── Makefile                   Commands to build/develop this project 
├── README.md
├── backend                    Scala code for RESTful api 
│   └── src
│       ├── main
│       └── test
│
├── build.sbt                  Dependency manager 
├── docker_pg_vol              Docker volume for Postgres DB
├── frontend                   Scala code that generates `main.js` for the webserver
│   ├── src
│   │   └── main
│   └── target
│       └── scala-3.1.3        main.js will be generated here
│
├── js-frontend                Javasript webserver using vite/Node
│   ├── index.html
│   ├── main.js
│   ├── main.scss
│   ├── node_modules/
│   ├── package.json
│   ├── postcss.config.js
│   ├── tailwind.config.js
│   ├── vite.config.js
│   └── yarn.lock
│
├── project                    The only project directory to be concerned with
│   ├── build.properties       sbt version  
│   └── plugins.sbt            plugins
│
├── sem-version                x.x.x
└── shared                     Scala code shared by backend and frontend, models 
    └── src
        ├── main
        └── test

About

Updated zio-petclinic example app to use Scala 3

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published