Fork me on GitHub

Introduction

This documentation contains README’s examples from grails-examples repository

1. grails with react profile

project quick start
grails create-app grails-react --profile=react

# output:
| Application created at /path/to/grails-examples/grails-react
| This profile provides a client/server multi-project build structure. The server Grails app is using the rest-api profile with CORS enabled. It can be started using 'grails run-app' or using the Gradle wrapper:

  ./gradlew server:bootRun

The React client app has been built using the create-react-app CLI. It can be started via 'npm start' (in which case you will need to run 'npm install' to install npm dependencies) or using the Gradle wrapper (which will install npm dependencies automatically if needed):

  ./gradlew client:bootRun

The client app's build.gradle defines other tasks to test and build the app using react-scripts. Please see create-react-app's documentation for more information: https://github.com/facebookincubator/create-react-app

To run both client & server projects in parallel, use the Gradle wrapper:

 ./gradlew bootRun -parallel

For support, please use the Groovy Community Slack (https://groovycommunity.slack.com/) or open an issue on Github: https://github.com/grails-profiles/react/issues
install current gradle wrapper
gradle wrapper --gradle-version=4.2.1 --distribution-type=all
build project
bash gradlew clean build
run
bash gradlew bootRun

2. grails with angular profile

project quick start
grails create-app grails-angular --profile=angular

#output
| Application created at /path/to/grails-examples/grails-angular
|
This profile has created a multi-project build where the "server" module contains the Grails application and the "client" module contains the Angular 2 application.

To start the Grails application separately, execute `./gradlew server:bootRun`
To start the client side application separately, execute `./gradlew client:bootRun`
To start both the client and server applications simultaneously, execute `./gradlew bootRun --parallel`

Run the front-end unit tests and grails unit tests simultaneously with `./gradlew test`
Run the front-end e2e and grails integration tests simultaneously with `./gradlew integrationTest`

No need to install Node, though we would recommend doing so if you'll be working with the front-end directly often!
install current gradle wrapper
gradle wrapper --gradle-version=4.2.1 --distribution-type=all
build project
bash gradlew clean build
run
bash gradlew bootRun

3. grails with angularjs profile

project quick start
grails create-app grails-angularjs --profile=angularjs

#output
| Application created at /path/to/grails-examples/grails-angularjs
build project
bash gradlew clean build
run
bash gradlew bootRun

5. Enjoy! :)