{"id":15642472,"url":"https://github.com/keynmol/http4s-laminar-stack","last_synced_at":"2025-04-09T14:07:45.914Z","repository":{"id":43548405,"uuid":"281346772","full_name":"keynmol/http4s-laminar-stack","owner":"keynmol","description":"A complete example of a fullstack (I actually don't know what this means) Scala application, using http4s on the backend and Laminar and Scala.js on the frontend","archived":false,"fork":false,"pushed_at":"2025-02-04T20:02:36.000Z","size":108,"stargazers_count":66,"open_issues_count":19,"forks_count":11,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T12:08:04.081Z","etag":null,"topics":["http4s","laminar","scala","scalajs"],"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/keynmol.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":"2020-07-21T08:56:27.000Z","updated_at":"2025-01-17T00:09:39.000Z","dependencies_parsed_at":"2024-12-09T16:21:35.078Z","dependency_job_id":"808e8d7d-5686-4419-a3d9-aa96627bf3f2","html_url":"https://github.com/keynmol/http4s-laminar-stack","commit_stats":{"total_commits":66,"total_committers":5,"mean_commits":13.2,"dds":0.2272727272727273,"last_synced_commit":"006c083fcb57eca0a60ee8f537535f7a4f091311"},"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keynmol%2Fhttp4s-laminar-stack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keynmol%2Fhttp4s-laminar-stack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keynmol%2Fhttp4s-laminar-stack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keynmol%2Fhttp4s-laminar-stack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keynmol","download_url":"https://codeload.github.com/keynmol/http4s-laminar-stack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248054207,"owners_count":21039952,"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":["http4s","laminar","scala","scalajs"],"created_at":"2024-10-03T11:56:21.919Z","updated_at":"2025-04-09T14:07:45.895Z","avatar_url":"https://github.com/keynmol.png","language":"Scala","readme":"# http4s-laminar-stack ![build](https://github.com/keynmol/http4s-laminar-stack/workflows/build/badge.svg)\n\n\nThis is an example of a full-stack application with the following features:\n\n- Scala 3 on both frontend and backend \n- [Laminar](https://github.com/raquo/Laminar) as a frontend library\n- [Http4s](https://http4s.org/) as a backend HTTP server library \n- Shared code with **protocol** definitions\n- Gzip compression on the server side\n- Docker packaging of the full application\n- Tests for the client with simulated DOM using [jsdom](https://github.com/scala-js/scala-js-env-jsdom-nodejs)\n\n_**Note**_: this is a very basic setup, for a more complicated template (with Postgres,\nAPI spec using Smithy, etc.) please see [Smithy4s Fullstack template](https://github.com/indoorvivants/smithy4s-fullstack-template)\n\nAdditionally, you can check out my blog series about fullstack Scala 3:\n\n- [Twotm8](https://blog.indoorvivants.com/tags/series:twotm8) - building and deploying a full-stack \n  Scala application using Scala Native and Scala.js \n\n- [Smithy4s](https://blog.indoorvivants.com/tags/series:smithy4s) - building and \n  deploying a full-stack Scala app with Smithy4s and Scala.js\n\n_**Note**_: this version of the template uses the latest and greatest from Cats Effect, http4s, Scala, etc. If you would like, please see the [last commit](https://github.com/keynmol/http4s-laminar-stack/commit/9d2078e0da73192be6d16d20ecaec1ee783db842) that referenced old versions of the libraries. Apart from Scala 3 (which is still wonky around IntelliJ support), I **highly** recommend sticking with the latest versions of the libraries. \n\n## Development mode\n\nRun in SBT (uses fast JS compilation, not optimized):\n\n```\nsbt\u003e ~runDev\n```\n\nAnd open http://localhost:9000/frontend\n\nThis will restart the server on any changes: shared code, client/server, assets.\n\n## Tests\nIt is a prerequisite to have jsdom installed, in order for the frontend tests to run. Proposal:\n```\nyarn add jsdom\n```\nThen move into an sbt console and run tests as normal\n\n## Production mode\n\nRun in SBT (uses full JS optimization):\n\n```\nsbt\u003e ~runProd\n```\n\n## Docker packaging \n\n```\nsbt\u003e backend/docker:publishLocal\n```\n\nWill publish the docker image with fully optimised JS code, and you can run the container:\n\n```bash\n✗ docker run --rm -p 8080:8080 laminar-http4s-example:0.1.0-SNAPSHOT\n\nSLF4J: Failed to load class \"org.slf4j.impl.StaticLoggerBinder\".\nSLF4J: Defaulting to no-operation (NOP) logger implementation\nSLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.\nRunning server on http://0.0.0.0:8080 (mode: prod)\n```\n\n\nThe interface is fairly simple:\n\n![](https://imgur.com/S0f0i8i.png)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeynmol%2Fhttp4s-laminar-stack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeynmol%2Fhttp4s-laminar-stack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeynmol%2Fhttp4s-laminar-stack/lists"}