Home

Awesome

MIT License

Java Play React Seed

java-play-vue-seed project illustrates how Play Framework can be used to develop backend/services along with vue to develop the front-end/ui.

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

Used Versions

How to use it?

Prerequisites

Let's get started,

    sbt clean           # Clear existing build files
    
    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
    
    sbt test            # Run both backend and frontend unit tests 

Complete Directory Layout

├── /app/                           # The backend (java) application sources (controllers, models, views, assets)
├── /conf/                          # Configurations files and other non-compiled resources (on classpath)
│     ├── application.conf          # Builds the project from source to output(lib and bower) folder
│     ├── logback.xml               # Logging configuration
│     └── routes                    # Routes definition
├── /logs/                          # Logs folder
│     └── application.log           # Default log file
├── /project/                       # Sbt configuration files
│     ├── FrontendCommands.scala    # Frontend build commands
│     ├── 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/                        # Generated stuff
│     ├── /universal/               # Application packaging
│     └── /web/                     # Compiled web assets
├── /test/                          # Contains unit tests for java play sources
├── /ui/                            # Vue front end sources
│     ├── /build/                  # Webpack configs and dev server
│     ├── /config/                 # Webpack configuration
│     ├── /node_modules/           # imported node modules
│     ├── /src/                    # The frontend source code (modules, componensts, models, directives, services etc.) of the application
│     ├── /static/                  # Static assets (images, dependencies loaded directly by html
│     ├── /test/                    # Client side tests
│     ├── /.babelrc/                # Transpiler config
│     ├── .editorconfig             # Define and maintain consistent coding styles between different editors and IDEs
│     ├── .eslintignore             # Files to not lint
│     ├── .postcssrc                # Post CSS config
│     ├── index.html                # Page index  
│     ├── package.json              # Holds various metadata configuration relevant to the ui
│     ├── package-lock.json         # Dependency version lock
│     └── README.md                 # Contains ui build command instructions├── .gitignore                      # Contains files to be ignored when pushing to git
├── build.sbt                       # Play application build script
├── LICENSE                         # Contains License Agreement file
├── README.md                       # Contains all user guide details for the application
└── ui-build.sbt                    # Associated frontend build scripts with sbt

What is new in here?

FrontendCommands.scala

    ├── /project/
    │     ├── FrontendCommands.scala

FrontendRunHook.scala

    ├── /project/
    │     ├── FrontendRunHook.scala

ui-build.sbt

npm run commands

├── /ui/                       
│     ├── package.json          

Routes

├── /conf/      
│     ├── routes 
GET        /             controllers.Assets.at(path="/public", file="index.html")
GET        /*file        controllers.Assets.at(path="/public", file)

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

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

Looking for some other frontend framework or language choice

Contributors

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<img src="https://avatars2.githubusercontent.com/u/5279079?s=400&v=4" width="100px;"/><br /><sub>Yohan Gomez</sub><img src="https://avatars2.githubusercontent.com/u/6312524?s=400&u=efc9267c6f903c379fafaaf7b3b0d9a939474c01&v=4" width="100px;"/><br /><sub>Lahiru Jayamanna</sub><br /><img src="https://avatars0.githubusercontent.com/u/3881403?s=400&v=4" width="100px;"/><br /><sub>Gayan Attygalla</sub><img src="https://avatars2.githubusercontent.com/u/15961875?s=400&u=d620bff166db429ba9e682e9a371852eb4493390&v=4" width="100px;"/><br /><sub>Duncan Nevin</sub>
<!-- ALL-CONTRIBUTORS-LIST:END -->

License

This software is licensed under the MIT license