full-zio-stack
A template for client/server apps with a full Scala 3 / ZIO 2 stack.
These are some of the technologies I'm using, I briefly describe why and mention some options in case my choices are not yours.
One of the most difficult thing in our field is to be able to choose a set of technologies for a project that fit well together
(or can be easily made to fit), are well supported, are easy to find developers who know them (or easy to train in them), modern, etc.
Generate a project with the stack below, your choice of HTTP server, database and database layer, and a working CRUD
screen, tests and CI included.
Create a project
You need Copier 9.4+ (pipx install copier, or run it with uvx copier), a JDK
17+ and sbt. For the Scala.js client you also need Node.js and npm; for MariaDB, MySQL or PostgreSQL, Docker (for the
development database and the database tests).
copier copy --trust gh:rleibman/full-zio-stack my-app
Copier asks a few questions; every one has a default, so Enter all the way through gives the recommended stack:
| Question | Choices (default first) |
|---|
| What to generate | server and Scala.js client, or server only |
| HTTP server | zio-http, http4s |
| Database | MariaDB, MySQL, PostgreSQL, SQLite |
| Database layer | Quill, doobie, Slick |
| AI | none, langchain4j (Anthropic, OpenAI or Ollama, chosen by configuration) |
| Authentication | none, zio-auth (needs zio-http and a GitHub Packages token) |
| Packaging | Docker image, Debian package with a systemd service, none |
| CI | GitHub Actions, none |
| License | MIT, Apache-2.0, BSD-3-Clause, GPL-3.0, proprietary |
plus the project's name, organization, package, author and ports. To skip the questions, pass the answers:
copier copy --trust --defaults \
--data project_name="Acme Orders" --data organization=com.acme --data author_name="Jane Doe" \
--data http_server=http4s --data db_layer=doobie --data database=postgres \
gh:rleibman/full-zio-stack acme-orders
(--trust lets the template run its one post-generation task, git init.)
What you get: a Scala 3 / ZIO 2 project whose sample entity, ModelObject, is wired through every layer (model,
Flyway migration, database layer, Caliban GraphQL API, and a Material UI CRUD screen), with tests that run against
a real database, a README, and an AGENTS.md that describes the project for people and AI agents. Its README says
how to run it.
The client's facades. The client uses ScalablyTyped facades for React
and MUI, built by the generated project's stLib/ with a locally published fork of the converter, until the sbt 2
support it relies on is released upstream. On a machine without that converter, generate a server-only project.
Updating. Projects remember their answers (.copier-answers.yml). With a clean working tree,
copier update --trust --defaults brings in the template's later improvements as a merge; resolve any conflicts and
run the tests. CHANGELOG.md lists what each version changes.
With Claude Code
This repository is also a Claude Code plugin. Install it once:
/plugin marketplace add rleibman/full-zio-stack
/plugin install full-zio-stack@full-zio-stack
Then ask for what you want, e.g. "build a full stack app called Acme Orders with Postgres and http4s": Claude
confirms the answers with you, generates the project with Copier, checks that it builds, runs and answers requests,
and builds your features on top. Generated projects carry their own AGENTS.md and an add-entity skill, so asking
to "add a Customer entity" adds it through every layer, following the project's conventions.
Currently on the stack
ZIO Based
zio-http
Caliban
zio-config
zio-logging
langchain4j
Optional AI: a service and a GraphQL mutation that asks an LLM (Anthropic, OpenAI or Ollama) for a description. The
provider is configuration, so it can change without regenerating.
zio-auth
Optional authentication: login, registration with an emailed confirmation, password recovery and JWT sessions, over a
UserStore that keeps users and PBKDF2 password hashes. Its routes are zio-http routes, so it needs that server; it
is published to GitHub Packages, so building a project that uses it needs a GITHUB_TOKEN with read:packages.
zio-telemetry
OpenTelemetry tracing for the server: a span per GraphQL operation, exported over OTLP when an endpoint is configured,
and a no-op tracer otherwise.
zio-test
zio-json
quill
The default database layer (quill-jdbc-zio): queries are checked and turned into SQL at compile time.
doobie, Slick
The alternative database layers (template choices). doobie isn't strictly zio, but with the cats zio interop, it's
super easy to combine.