Git Product home page Git Product logo

flyioscalajsdemo's Introduction

Full Stack Scala (with Node Backend) on fly.io demo

This repository is an example of an application with backend and frontend both in Scala that can be deployed easily on fly.io.

It features:

  • frontend with Laminar
  • frontend web-component library with UI5
  • frontend packaging with vitejs
  • backend (on NodeJS) with express
  • backend hot reload with nodemon
  • JSON serialization with circe

If you prefer an example with a backend on the JVM, see this repo instead.

Dev setup

To run this project, you will need installed

  • npm (v16)
  • sbt
  • a jdk 11

The first time, run in one terminal:

cd frontend
npm ci
cd ..
cd server
npm ci

Then, in one terminal:

sbt
~fastLinkJS

(If you prefer to separate backend and frontend compilation, you can do ~server/fastLinkJS and ~frontend/fastLinkJS in two different terminals.)

In another terminal

cd server
npm run dev

In a third (last) terminal

cd frontend
npm run dev

Then you can go to localhost:3000/static.

Prod setup

You can package the whole application into the deploy folder with

sbt packageApplication

Then you can run it with cd deploy/dist && npm ci && npm run prod then go to localhost:9000.

You can also build a Docker image for the app with (note that the tag name does not matter)

cd deploy
docker build --tag demoscalaflyio .

Then run it with

docker run --rm -p 9000:8080 demoscalaflyio

and then go to localhost:9000.

Deploy to fly.io

The project contains a fly.toml file in the deploy directory generated via fly launch.

You can apply it to your account via fly deploy and then see that it's live with fly open. (If not logged in already, you need to fly auth login.)

You need to have flyctl installed for this to work.

You can see more complete instructions here.

flyioscalajsdemo's People

Contributors

sherpal avatar

Watchers

 avatar

Forkers

sahataba

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.