Git Product home page Git Product logo

zio-scalajs-stack's Introduction

Full Stack Scala 3 + ZIO + Scala.js

An experimental stack built with Scala 3 and composed of a ZIO backend and a Scala.js frontend. The backend includes logging and metrics for observability.

Libraries used:

  • Scala 3
  • ZIO
    • zio-http
    • zio-logging
    • zio-metrics
    • zio-test
  • Scala.js
  • scalajsdom
  • scalatest for the frontend
  • Nodejs
    • jsdom
    • Vite

Build

The build process supports the following targets:

Backend:

  • Generate Native Image (GraalVM) binary for current platform with locally installed GraalVM: ./mill backend.nativeImage
  • Generate Native Image (GraalVM) Linux binary in Docker container: ./mill backend.dockerNative.buildBin
  • Generate Docker Image with Native Image binary (for Linux in Docker): mill backend.dockerNative.build
  • Generate Docker Image with a JVM base and .jar app: mill backend.docker.build

If GraalVM fails building the binary on Linux, install libz-dev (Eg. sudo apt-get install libz-dev on Ubuntu/Debian or sudo dnf install zlib-devel on Fedora).

Frontend:

  • Build application for deployment (install nodejs, npm and npm i first): npm run build

Development

  1. Install a JDK in your path
  2. Install Node.js and npm
  3. Install NPM dependencies with npm install
  4. To start the development server, run npm run start, it will build the Scala.js Javascript files, start the ZIO backend and run Vite dev server. The Scala.js files are not automatically generated and reloaded. For this to work, open another shell and run ./mill -w frontend.fastLinkJS.

Open http://localhost:5173 or http://localhost:5173/?name=Yourname for testing.

zio-scalajs-stack's People

Contributors

carlosedp avatar dependabot[bot] avatar lolgab avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.