Giter Site home page Giter Site logo

tambonbon / full-scala-scala-heroku Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sherpal/full-scala-scala-heroku

0.0 0.0 0.0 35 KB

An minimal example for a full stack Scala app on Heroku

Scala 72.21% HTML 6.61% TSQL 0.73% CSS 0.45% JavaScript 20.00%

full-scala-scala-heroku's Introduction

Full Stack Scala on Heroku

This is an example of a full stack Scala application deployed on Heroku. See this blog post.

Stack

The backend uses the Play framework, together with Slick to access a postgres database.

The frontend uses the Laminar framework for UI rendering.

Deploy

The app is hosted on Heroku. In order to deploy,

# Login to Heroku
heroku login

# Make sure to use the same name as in project/BackendSettings.scala
heroku apps:create full-stack-scala-example --region eu
heroku addons:create heroku-postgresql:hobby-dev

# Create a secret for the Play application
heroku config:set APPLICATION_SECRET=mycoolsecret

# Optional
export SBT_OPTS="-Xmx6G -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=6G -Xss2M  -Duser.timezone=GMT"

sbt clean stage backend/deployHeroku

To see the files on the deployed server:

heroku run bash --app APPNAME

Dev environment

In order to run the app locally, you will need to set up a postgres database at localhost:5432 for Slick to connect to.

export JDBC_DATABASE_URL = "jdbc:postgresql://localhost:5432/<db_name>?user=<your_user>&password=<your_password>"

(5432 being the port by default for postgres databases.)

Then, you can use, in one command line (terminal)

# Frontend hot reload only on localhost:8080
sbt dev

and in another,

# Backend hot reload only on localhost:9000
sbt backend/run

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.