{"id":20773948,"url":"https://github.com/indoorvivants/scala-cli-smithy4s-fullstack-template","last_synced_at":"2025-08-01T16:44:17.129Z","repository":{"id":262986346,"uuid":"823238983","full_name":"indoorvivants/scala-cli-smithy4s-fullstack-template","owner":"indoorvivants","description":"Full stack Scala 3 with Smithy4s","archived":false,"fork":false,"pushed_at":"2024-11-18T13:19:11.000Z","size":52,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T17:11:23.809Z","etag":null,"topics":["scala","scala-cli","scalajs","smithy","smithy4s","tailwindcss","vite"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/indoorvivants.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-02T16:40:04.000Z","updated_at":"2024-11-24T19:11:16.000Z","dependencies_parsed_at":"2024-11-15T12:43:12.431Z","dependency_job_id":null,"html_url":"https://github.com/indoorvivants/scala-cli-smithy4s-fullstack-template","commit_stats":null,"previous_names":["indoorvivants/scala-cli-smithy4s-fullstack-template"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indoorvivants%2Fscala-cli-smithy4s-fullstack-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indoorvivants%2Fscala-cli-smithy4s-fullstack-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indoorvivants%2Fscala-cli-smithy4s-fullstack-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indoorvivants%2Fscala-cli-smithy4s-fullstack-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/indoorvivants","download_url":"https://codeload.github.com/indoorvivants/scala-cli-smithy4s-fullstack-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251728727,"owners_count":21634269,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["scala","scala-cli","scalajs","smithy","smithy4s","tailwindcss","vite"],"created_at":"2024-11-17T12:27:47.873Z","updated_at":"2025-04-30T15:08:54.575Z","avatar_url":"https://github.com/indoorvivants.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Full stack Scala 3\n\n\u003c!--toc:start--\u003e\n- [Full stack Scala 3](#full-stack-scala-3)\n  - [Pre-requisites](#pre-requisites)\n  - [Development workflow](#development-workflow)\n    - [Setting up build definitions for Metals](#setting-up-build-definitions-for-metals)\n    - [Updating protocol definitions](#updating-protocol-definitions)\n    - [Frontend live server](#frontend-live-server)\n    - [Backend live server](#backend-live-server)\n    - [Packaging as docker container](#packaging-as-docker-container)\n    \u003c!--toc:end--\u003e\n\n**Frontend**: [Scala.js](https://www.scala-js.org/) and [Laminar](https://laminar.dev) | **Backend**: [Scala JVM](https://www.scala-lang.org/) and [Http4s](https://http4s.org/) | **Protocol**: [Smithy4s](https://disneystreaming.github.io/smithy4s/) | **Build system**: [Scala CLI](https://scala-cli.virtuslab.org/) and [Vite](https://vitejs.dev/) | **Packaging**: [Docker](https://hub.docker.com/) | **Web server**: [NGINX](https://nginx.org/)\n\nThis is an opinionated fullstack scala template:\n\n- The frontend-backend interaction layer is handled through **Smithy4s** protocol definition – this ensures shared modelling and keeps all definitions in sync, additionally allowing for code sharing between frontend and backend\n- **Scala CLI** is used everywhere. While it doesn't have multi-module support \n- **NGINX** is used as a web server. Using a very configurable and battle-tested server from the very beginning can help implementing more complicated features later as the app grows. We also use it to serve static assets separately from the JVM backend.\n- **Vite and TailwindCSS** are used on the frontend. Bundling a CSS framework can be helpful to get the styling off the ground for people not usually involved in frontend design work.\n\n## Pre-requisites\n\n1. **Frontend**: Node.js and NPM, Scala CLI\n2. **Backend**: Scala CLI\n3. **Protocol code**: [Coursier](https://get-coursier.io/docs/overview), Scala CLI\n\n## Development workflow\n\n### Setting up build definitions for Metals\n\nScala CLI doesn't have any support for multi-module projects, so to make sure we can work with this codebase in Metals we need to generate BSP definitions manually.\n\n1. Run `make setup-ide` and then cross your fingers that Metals will pick everything up correctly\n\nIf you have [mprocs](https://github.com/pvolok/mprocs) enabled, you can just run `mprocs` at\nthe root of this project and it will start:\n\n1. Live reload of backend\n2. Live reload of frontend\n3. Live regeneration of smithy files\n\nNote that when Scala CLI runs in watch mode it will not pick up _new_ files that you add - \nwhich will be the case with new smithy4s definitions. So if you get compilation errors, just restart \nthe relevant process so it can pick up new files.\n\n### Updating protocol definitions\n\n1. Make changes to `shared/protocol.smithy`\n2. Run `make smithy4s`\n3. This will regenerate all the code that can be used by both backend and frontend\n\n### Frontend live server\n\n1. Run `make run-frontend`\n2. Note that to perform any actions that execute API calls, you need to have backend running as well \n\n### Backend live server\n\n1. Run `make run-backend`\n2. This will run the backend server on port 9999 – which is where Vite's frontend tooling expects it to be\n\n### Packaging as docker container\n\n1. Run `make docker`\n2. Note that this project is organised as a self-contained docker image - just running `docker build .` will produce a working docker image. This is particularly useful for services like [Fly.io](https://fly.io/) which detect a Dockerfile and can build and deploy app directly from it\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findoorvivants%2Fscala-cli-smithy4s-fullstack-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Findoorvivants%2Fscala-cli-smithy4s-fullstack-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findoorvivants%2Fscala-cli-smithy4s-fullstack-template/lists"}