All Projects β†’ yohangz β†’ Scala Play Angular Seed

yohangz / Scala Play Angular Seed

Licence: mit
πŸ€ Scala Play 2.7.x + Angular 8 with Angular CLI seed project with full-fledged build process

Programming Languages

typescript
32286 projects
scala
5932 projects

Projects that are alternatives of or similar to Scala Play Angular Seed

sbt-sass
A fork of the sbt-sass repository which seems to be abandoned.
Stars: ✭ 32 (-62.35%)
Mutual labels:  sbt, play-framework
Play Reactive Slick
This is Play Template with a nice User Interface. If you want to use Play as web framework and Postgres as Database then this demo project can be used as a starting point for your application.
Stars: ✭ 40 (-52.94%)
Mutual labels:  sbt, play-framework
Scala Play React Seed
❄️ Java Play 2.7.x + React seed project with full-fledged build process
Stars: ✭ 180 (+111.76%)
Mutual labels:  sbt, play-framework
Play Spark Scala
Stars: ✭ 51 (-40%)
Mutual labels:  sbt, play-framework
java-play-react-seed
πŸŒ€ Java Play 2.7.x + React seed project with full-fledged build process
Stars: ✭ 43 (-49.41%)
Mutual labels:  sbt, play-framework
java-play-angular-seed
🍁 Java Play 2.7.x + Angular 8 with Angular CLI seed project with full-fledged build process
Stars: ✭ 53 (-37.65%)
Mutual labels:  sbt, play-framework
play-angular-typescript.g8
A giter8 template for a Play Angular 4 Typescript application
Stars: ✭ 91 (+7.06%)
Mutual labels:  sbt, play-framework
Sbt Ignore Play Generated
Configure linters and coverage tools to ignore Play's generated source files.
Stars: ✭ 10 (-88.24%)
Mutual labels:  sbt, play-framework
Finagle Metrics
Easy way to send Finagle metrics to Codahale Metrics library
Stars: ✭ 41 (-51.76%)
Mutual labels:  sbt
Scala Native.g8
Giter8 template for a minimal project that uses Scala Native.
Stars: ✭ 61 (-28.24%)
Mutual labels:  sbt
Rhodddoobie
My little sandbox for playing around with the FP + OOP + DDD combination, in particular using Rho, doobie, Docker, testing, etc in a project.
Stars: ✭ 38 (-55.29%)
Mutual labels:  sbt
Ore
Repository software for Sponge plugins and Forge mods
Stars: ✭ 63 (-25.88%)
Mutual labels:  sbt
Scala Cypher Dsl
A type-safe Cypher Query Language DSL for Scala.
Stars: ✭ 34 (-60%)
Mutual labels:  sbt
Sbt Play Gulp
Gulp asset pipeline for Play Framework
Stars: ✭ 38 (-55.29%)
Mutual labels:  sbt
Lila
β™ž lichess.org: the forever free, adless and open source chess server β™ž
Stars: ✭ 10,315 (+12035.29%)
Mutual labels:  play-framework
Play26 Swagger Reactivemongo
A fully featured CRUD app built with Play 2.6, Swagger and ReactiveMongo
Stars: ✭ 36 (-57.65%)
Mutual labels:  play-framework
Proscalafx
Pro JavaFX2 book source codes translated to ScalaFX
Stars: ✭ 83 (-2.35%)
Mutual labels:  sbt
Scala Js Chrome
ScalaJS bindings for Chrome Extention/App and ChromeOS APIs
Stars: ✭ 73 (-14.12%)
Mutual labels:  sbt
Spark Submit Ui
This is a based on playframwork for submit spark app
Stars: ✭ 53 (-37.65%)
Mutual labels:  play-framework
Crypto Coin Alerts
An application that let you set alerts for the prices of several cryptocurrencies
Stars: ✭ 72 (-15.29%)
Mutual labels:  play-framework

MIT License

Scala Play Angular Seed

Use play framework to develop the web application backend/services and frontend using Angular CLI, all in a totally integrated workflow and single unified console. This approach will deliver perfect development experience without CORS hassle.

Read more @ http://bit.ly/2AStvhK

Scala Play Angular Seed

Used Summary

How to use it?

Prerequisites

  • Node.js (version 10 or higher)
  • JDK (recommend version 1.8 or higher)
  • scala

Let's get started,

  • Fork or clone this repository.

  • Used any of the following SBT commands which will intern trigger frontend associated npm scripts.

    sbt clean           # Clean existing build artifacts

    sbt stage           # Build your application from your project’s source directory

    sbt run             # Run both backend and frontend builds in watch mode

    sbt dist            # Build both backend and frontend sources into a single distribution artifact

    sbt test            # Run both backend and frontend unit tests
  • This seed is not using scala play views. All the views and frontend associated routes are served via Angular code base under ui directory.

Complete Directory Layout

β”œβ”€β”€ /app/                                 # The backend source (controllers, models, services)
β”‚     └── /controllers/                   # Backend controllers
β”‚           └── FrontendController.scala  # Asset controller wrapper serving frontend assets and artifacts
β”œβ”€β”€ /conf/                                # Configurations files and other non-compiled resources (on classpath)
β”‚     β”œβ”€β”€ application.conf                # Play application configuratiion file.
β”‚     β”œβ”€β”€ logback.xml                     # Logging configuration
β”‚     └── routes                          # Routes definition file
β”œβ”€β”€ /logs/                                # Log directory
β”‚     └── application.log                 # Application log file
β”œβ”€β”€ /project/                             # Contains project build configuration and plugins
β”‚     β”œβ”€β”€ FrontendCommands.scala          # Frontend build command mapping configuration
β”‚     β”œβ”€β”€ FrontendRunHook.scala           # Forntend build PlayRunHook (trigger frontend serve on sbt run)
β”‚     β”œβ”€β”€ build.properties                # Marker for sbt project
β”‚     └── plugins.sbt                     # SBT plugins declaration
β”œβ”€β”€ /public/                              # Frontend build artifacts will be copied to this directory
β”œβ”€β”€ /target/                              # Play project build artifact directory
β”‚     β”œβ”€β”€ /universal/                     # Application packaging
β”‚     └── /web/                           # Compiled web assets
β”œβ”€β”€ /test/                                # Contains unit tests of backend sources
β”œβ”€β”€ /ui/                                  # React frontend source (based on Create React App)
β”‚     β”œβ”€β”€ /e2e/                           # End to end tests folder
β”‚     β”œβ”€β”€ /node_modules/                  # 3rd-party frontend libraries and utilities
β”‚     β”œβ”€β”€ /src/                           # The frontend source code (modules, componensts, models, directives, services etc.) of the application
β”‚     β”‚     β”œβ”€β”€ karma.conf.js             # Karma configuration file
β”‚     β”‚     └── proxy.conf.json           # UI proxy configuration      
β”‚     β”œβ”€β”€ .angular.json                   # Angular CLI configuration
β”‚     β”œβ”€β”€ .editorconfig                   # Define and maintain consistent coding styles between different editors and IDEs
β”‚     β”œβ”€β”€ .gitignore                      # Contains ui files to be ignored when pushing to git
β”‚     β”œβ”€β”€ package.json                    # NPM package configuration.
β”‚     β”œβ”€β”€ README.md                       # Contains all user guide details for the ui
β”‚     β”œβ”€β”€ tsconfig.json                   # Contains typescript compiler options
β”‚     └── tslint.json                     # Lint rules for the ui
β”œβ”€β”€ .gitignore                            # Contains files to be ignored when pushing to git
β”œβ”€β”€ build.sbt                             # Play application SBT configuration
β”œβ”€β”€ LICENSE                               # License Agreement file
β”œβ”€β”€ README.md                             # Application user guide
└── ui-build.sbt                          # SBT command hooks associated with frontend npm scripts 

What is new in here?

FrontendCommands.scala

  • Frontend build command mapping configuration.
    β”œβ”€β”€ /project/
    β”‚     β”œβ”€β”€ FrontendCommands.scala

FrontendRunHook.scala

  • PlayRunHook implementation to trigger npm run start on sbt run.
    β”œβ”€β”€ /project/
    β”‚     β”œβ”€β”€ FrontendRunHook.scala

FrontendController.scala

  • Asset controller wrapper serving frontend assets and artifacts.
    β”œβ”€β”€ /app/                                 
    β”‚     └── /controllers/                   
    β”‚           └── FrontendController.scala

ui-build.sbt

  • This file contains the build task hooks to trigger frontend npm scripts on sbt command execution.

npm scripts

  • New and modified npm scripts of Angular CLI generated package.json.
  • Check UI README.md to see all available frontend build tasks.
β”œβ”€β”€ /ui/
β”‚     β”œβ”€β”€ package.json

proxy.conf.json

  • Used to proxy play backend API when running the project on watch mode.
β”œβ”€β”€ /ui/
β”‚     β”œβ”€β”€ proxy.conf.json

Routes

β”œβ”€β”€ /conf/      
β”‚     β”œβ”€β”€ routes
  • The following route configuration map index.html to entry route (root). This should be placed as the initial route.
GET        /             controllers.FrontendController.index()
  • All API routes should be prefixed with API prefix defined under application.conf (Default prefix apiPrefix = "api")

Example API route:

GET        /api/summary  controllers.HomeController.appSummary
  • The following route is being used to serve frontend associated build artifacts (css, js) and static assets (images, etc.). This should be placed as the final route.
GET        /*file        controllers.FrontendController.assetOrDefault(file)

Note: On production build all the front end Angular build artifacts will be copied to the public/ui folder.

Can be used to implement any front end/ui build!

  • Simply replace the ui directory with the build of your choice
  • Make output directory ROOT/public/
  • Implement a proxy to localhost:9000

Looking for some other frontend framework or language choice

Contributors


Yohan Gomez

Lahiru Jayamanna


Gayan Attygalla

Anuradha Gunasekara

License

This software is licensed under the MIT license

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].