yohangz / Scala Play React Seed
Licence: mit
❄️ Java Play 2.7.x + React seed project with full-fledged build process
Stars: ✭ 180
Labels
Projects that are alternatives of or similar to Scala Play React Seed
play-angular-typescript.g8
A giter8 template for a Play Angular 4 Typescript application
Stars: ✭ 91 (-49.44%)
Mutual labels: sbt, play-framework
sbt-sass
A fork of the sbt-sass repository which seems to be abandoned.
Stars: ✭ 32 (-82.22%)
Mutual labels: sbt, play-framework
java-play-react-seed
🌀 Java Play 2.7.x + React seed project with full-fledged build process
Stars: ✭ 43 (-76.11%)
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 (-70.56%)
Mutual labels: sbt, play-framework
Sbt Ignore Play Generated
Configure linters and coverage tools to ignore Play's generated source files.
Stars: ✭ 10 (-94.44%)
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 (-77.78%)
Mutual labels: sbt, play-framework
Scala Play Angular Seed
🍀 Scala Play 2.7.x + Angular 8 with Angular CLI seed project with full-fledged build process
Stars: ✭ 85 (-52.78%)
Mutual labels: sbt, play-framework
Setup Scala
GitHub Action to install any version of Java (GraalVM, Java 8, Java 11, Java 14, ...) via Jabba. Works for any JVM language including Java, Scala and Kotlin.
Stars: ✭ 123 (-31.67%)
Mutual labels: sbt
Sample Projects
Sample project files for JavaCPP, JavaCPP Presets, and JavaCV
Stars: ✭ 160 (-11.11%)
Mutual labels: sbt
Play Guard
Play2 module for rate limiting, based on token bucket algorithm
Stars: ✭ 123 (-31.67%)
Mutual labels: play-framework
Jitpack.io
Documentation and issues of https://jitpack.io
Stars: ✭ 2,156 (+1097.78%)
Mutual labels: sbt
Sbt Docker Compose
Integrates Docker Compose functionality into sbt
Stars: ✭ 168 (-6.67%)
Mutual labels: sbt
Scala Play React Seed
Use play framework to develop the web application backend/services and frontend using React Create App, 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/2A1AzEq
Version Summary
How to use it?
Prerequisites
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 React code base under
ui
directory.
Complete Directory Layout
├── /app/ # The backend (scala play) sources (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)
│ ├── /public/ # Contains the index.html file
│ ├── /node_modules/ # 3rd-party frontend libraries and utilities
│ ├── /src/ # The frontend source codebase of the application
│ ├── .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 configuration of frontend source
│ ├── README.md # Contains all user guide details for the ui
│ └── yarn.lock # Yarn lock file
├── .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
onsbt 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 run commands
- New and modified npm scripts of Create React App generated package.json.
- Check UI README.md to see all available frontend build tasks.
├── /ui/
│ ├── package.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 prefixapiPrefix = "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 React build artifacts will be copied to the public
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
- Java Play React Seed
- Scala Play Angular Seed
- Java Play Angular Seed
- Scala Play Vuejs Seed by Duncan Nevin
- Java Play Vuejs Seed by Duncan Nevin
Contributors
Yohan Gomez |
Lahiru Jayamanna |
Gayan Attygalla |
---|
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].