├── .github ├── dependabot.yml ├── release-drafter.yml └── workflows │ ├── gradle.yml │ ├── release-notes.yml │ └── release.yml ├── .gitignore ├── README.md ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── profile.yml ├── settings.gradle └── skeleton ├── client ├── .gitignore ├── README.md ├── build.gradle ├── package.json ├── public │ ├── favicon.ico │ ├── favicon16.png │ ├── favicon32.png │ ├── favicon48.png │ ├── index.html │ └── manifest.json ├── src │ ├── App.js │ ├── App.test.js │ ├── AppNav.js │ ├── Footer.js │ ├── config.js │ ├── css │ │ ├── App.css │ │ ├── bootstrap.css │ │ ├── errors.css │ │ ├── grails.css │ │ ├── index.css │ │ ├── main.css │ │ └── mobile.css │ ├── images │ │ ├── advancedgrails.svg │ │ ├── apple-touch-icon-retina.png │ │ ├── apple-touch-icon.png │ │ ├── documentation.svg │ │ ├── favicon.ico │ │ ├── favicon16.png │ │ ├── favicon32.png │ │ ├── favicon48.png │ │ ├── grails-cupsonly-logo-white.svg │ │ ├── grails.png │ │ ├── grails.svg │ │ ├── logo.png │ │ ├── logo.svg │ │ ├── skin │ │ │ ├── database_add.png │ │ │ ├── database_delete.png │ │ │ ├── database_edit.png │ │ │ ├── database_save.png │ │ │ ├── database_table.png │ │ │ ├── exclamation.png │ │ │ ├── house.png │ │ │ ├── information.png │ │ │ ├── sorted_asc.gif │ │ │ └── sorted_desc.gif │ │ ├── slack.svg │ │ └── spinner.gif │ ├── index.js │ └── serviceWorker.js └── yarn.lock ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── server ├── gradle.properties └── grails-app │ └── conf │ └── application.yml └── settings.gradle /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: gradle 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | open-pull-requests-limit: 10 8 | target-branch: master 9 | labels: 10 | - "type: dependency upgrade" 11 | -------------------------------------------------------------------------------- /.github/release-drafter.yml: -------------------------------------------------------------------------------- 1 | name-template: $NEXT_PATCH_VERSION 2 | tag-template: v$NEXT_PATCH_VERSION 3 | version-resolver: 4 | major: 5 | labels: 6 | - 'type: major' 7 | minor: 8 | labels: 9 | - 'type: minor' 10 | patch: 11 | labels: 12 | - 'type: patch' 13 | default: patch 14 | categories: 15 | - title: 🚀 Features 16 | labels: 17 | - "type: enhancement" 18 | - "type: new feature" 19 | - "type: major" 20 | - title: 🚀 Bug Fixes/Improvements 21 | labels: 22 | - "type: improvement" 23 | - "type: bug" 24 | - "type: minor" 25 | - title: 🛠 Dependency upgrades 26 | labels: 27 | - "type: dependency upgrade" 28 | - "dependencies" 29 | change-template: '- $TITLE @$AUTHOR (#$NUMBER)' 30 | template: | 31 | ## Changes 32 | 33 | $CHANGES 34 | 35 | ## Contributors 36 | 37 | $CONTRIBUTORS 38 | -------------------------------------------------------------------------------- /.github/workflows/gradle.yml: -------------------------------------------------------------------------------- 1 | name: Java CI 2 | on: 3 | push: 4 | branches: 5 | - '[1-9]+.[0-9]+.x' 6 | - master 7 | pull_request: 8 | branches: 9 | - '[1-9]+.[0-9]+.x' 10 | - master 11 | jobs: 12 | build: 13 | runs-on: ubuntu-latest 14 | strategy: 15 | matrix: 16 | java: ['17'] 17 | env: 18 | WORKSPACE: ${{ github.workspace }} 19 | GRADLE_OPTS: -Xmx1500m -Dfile.encoding=UTF-8 20 | MAVEN_PUBLISH_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} 21 | MAVEN_PUBLISH_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} 22 | MAVEN_PUBLISH_URL: 'https://repo.grails.org/grails/libs-snapshots-local' 23 | steps: 24 | - uses: actions/checkout@v2 25 | - uses: actions/cache@v2 26 | with: 27 | path: ~/.gradle/caches 28 | key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} 29 | restore-keys: | 30 | ${{ runner.os }}-gradle- 31 | - name: Set up JDK 32 | uses: actions/setup-java@v1 33 | with: 34 | java-version: ${{ matrix.java }} 35 | - name: Run Assemble 36 | if: success() && github.event_name == 'push' && matrix.java == '17' 37 | run: ./gradlew assemble 38 | - name: Publish to repo.grails.org 39 | if: success() && github.event_name == 'push' && matrix.java == '17' 40 | run: | 41 | ./gradlew publish 42 | -------------------------------------------------------------------------------- /.github/workflows/release-notes.yml: -------------------------------------------------------------------------------- 1 | name: Changelog 2 | on: 3 | issues: 4 | types: [closed,reopened] 5 | push: 6 | branches: 7 | - '[1-9]+.[0-9]+.x' 8 | - master 9 | workflow_dispatch: 10 | jobs: 11 | release_notes: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v2 15 | - name: Check if it has release drafter config file 16 | id: check_release_drafter 17 | run: | 18 | has_release_drafter=$([ -f .github/release-drafter.yml ] && echo "true" || echo "false") 19 | echo ::set-output name=has_release_drafter::${has_release_drafter} 20 | 21 | # If it has release drafter: 22 | - uses: release-drafter/release-drafter@v5.15.0 23 | if: steps.check_release_drafter.outputs.has_release_drafter == 'true' 24 | # env: 25 | # GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} 26 | with: 27 | prerelease: false 28 | commitish: master 29 | # Otherwise: 30 | - name: Export Gradle Properties 31 | if: steps.check_release_drafter.outputs.has_release_drafter == 'false' 32 | uses: micronaut-projects/github-actions/export-gradle-properties@master 33 | - uses: micronaut-projects/github-actions/release-notes@master 34 | if: steps.check_release_drafter.outputs.has_release_drafter == 'false' 35 | id: release_notes 36 | # with: 37 | # token: ${{ secrets.GH_TOKEN }} 38 | - uses: ncipollo/release-action@v1 39 | if: steps.check_release_drafter.outputs.has_release_drafter == 'false' && steps.release_notes.outputs.generated_changelog == 'true' 40 | with: 41 | allowUpdates: true 42 | commit: ${{ steps.release_notes.outputs.current_branch }} 43 | draft: true 44 | name: ${{ env.title }} ${{ steps.release_notes.outputs.next_version }} 45 | tag: v${{ steps.release_notes.outputs.next_version }} 46 | bodyFile: CHANGELOG.md 47 | # token: ${{ secrets.GH_TOKEN }} 48 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | on: 3 | release: 4 | types: [published] 5 | jobs: 6 | release: 7 | runs-on: ubuntu-latest 8 | strategy: 9 | matrix: 10 | java: ['17'] 11 | env: 12 | GIT_USER_NAME: 'grails-build' 13 | GIT_USER_EMAIL: 'grails-build@users.noreply.github.com' 14 | steps: 15 | - name: Checkout repository 16 | uses: actions/checkout@v2 17 | with: 18 | token: ${{ secrets.GH_TOKEN }} 19 | - uses: gradle/wrapper-validation-action@v1 20 | - name: Set up JDK 21 | uses: actions/setup-java@v1 22 | with: 23 | java-version: ${{ matrix.java }} 24 | - name: Extract Target Branch 25 | id: extract_branch 26 | run: | 27 | echo "Determining Target Branch" 28 | TARGET_BRANCH=`cat $GITHUB_EVENT_PATH | jq '.release.target_commitish' | sed -e 's/^"\(.*\)"$/\1/g'` 29 | echo $TARGET_BRANCH 30 | echo ::set-output name=value::${TARGET_BRANCH} 31 | - name: Set the current release version 32 | id: release_version 33 | run: echo ::set-output name=release_version::${GITHUB_REF:11} 34 | - name: Run pre-release 35 | uses: micronaut-projects/github-actions/pre-release@master 36 | with: 37 | token: ${{ secrets.GITHUB_TOKEN }} 38 | - name: Publish to Sonatype OSSRH 39 | env: 40 | NEXUS_PUBLISH_USERNAME: ${{ secrets.SONATYPE_USERNAME }} 41 | NEXUS_PUBLISH_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} 42 | NEXUS_PUBLISH_URL: ${{ secrets.SONATYPE_NEXUS_URL }} 43 | NEXUS_PUBLISH_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }} 44 | SIGNING_KEY: ${{ secrets.SIGNING_KEY }} 45 | SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }} 46 | SECRING_FILE: ${{ secrets.SECRING_FILE }} 47 | run: | 48 | echo $SECRING_FILE | base64 -d > secring.gpg 49 | echo "Publishing Artifacts" 50 | (set -x; ./gradlew -Psigning.secretKeyRingFile="${GITHUB_WORKSPACE}/secring.gpg" publishToSonatype closeAndReleaseSonatypeStagingRepository --no-daemon) 51 | (set -x; ./gradlew assemble --no-daemon) 52 | - name: Export Gradle Properties 53 | uses: micronaut-projects/github-actions/export-gradle-properties@master 54 | - name: Run post-release 55 | if: success() 56 | uses: micronaut-projects/github-actions/post-release@master 57 | with: 58 | token: ${{ secrets.GITHUB_TOKEN }} 59 | env: 60 | SNAPSHOT_SUFFIX: -SNAPSHOT 61 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | .idea 3 | *.iml 4 | build 5 | **/node_modules/ 6 | **/.DS_Store 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Relocated to 2 | 3 | https://github.com/grails/grails-profiles 4 | 5 | # Grails React Profile 6 | A profile for creating Grails applications with a React frontend 7 | 8 | [![Build Status](https://travis-ci.org/grails-profiles/react.svg?branch=master)](https://travis-ci.org/grails-profiles/react) 9 | 10 | [Documentation](https://grails-profiles.github.io/react/latest/guide/index.html) 11 | 12 | To improve the documentation edit the [docs branch](https://github.com/grails-profiles/react/tree/docs). 13 | 14 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | gradlePluginPortal() 4 | mavenCentral() 5 | maven { url "https://repo.grails.org/grails/core" } 6 | // mavenLocal() // for local testing, do not commit uncommented 7 | } 8 | dependencies { 9 | classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion" 10 | classpath 'io.spring.gradle:dependency-management-plugin' 11 | } 12 | } 13 | 14 | apply plugin: "org.grails.grails-profile" 15 | apply plugin: "io.spring.dependency-management" 16 | 17 | ext.mavenPublishUrl = 'https://repo.grails.org/grails/libs-snapshots-local' 18 | 19 | group 'org.grails.profiles' 20 | version project.projectVersion 21 | 22 | apply plugin: "org.grails.grails-profile-publish" 23 | grailsPublish { 24 | githubSlug = 'grails-profiles/react' 25 | license = 'Apache-2.0' 26 | title = "React Profile" 27 | desc = "A profile for creating Grails applications with React" 28 | developers = [zacharyklein:"Zachary Klein"] 29 | } 30 | 31 | repositories { 32 | mavenCentral() 33 | maven { url "https://repo.grails.org/grails/core" } 34 | // mavenLocal() // for local testing, do not commit uncommented 35 | } 36 | 37 | dependencies { 38 | profileRuntimeOnly "org.grails.profiles:rest-api:$restApiProfileVersion" 39 | } -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | restApiProfileVersion=7.0.1 2 | projectVersion=7.0.2-SNAPSHOT 3 | grailsGradlePluginVersion=7.0.0-M2 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grails-profiles/react/6384668633ecbde4c6847f83a4460ce0c0bfeea5/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # SPDX-License-Identifier: Apache-2.0 19 | # 20 | 21 | ############################################################################## 22 | # 23 | # Gradle start up script for POSIX generated by Gradle. 24 | # 25 | # Important for running: 26 | # 27 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 28 | # noncompliant, but you have some other compliant shell such as ksh or 29 | # bash, then to run this script, type that shell name before the whole 30 | # command line, like: 31 | # 32 | # ksh Gradle 33 | # 34 | # Busybox and similar reduced shells will NOT work, because this script 35 | # requires all of these POSIX shell features: 36 | # * functions; 37 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 38 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 39 | # * compound commands having a testable exit status, especially «case»; 40 | # * various built-in commands including «command», «set», and «ulimit». 41 | # 42 | # Important for patching: 43 | # 44 | # (2) This script targets any POSIX shell, so it avoids extensions provided 45 | # by Bash, Ksh, etc; in particular arrays are avoided. 46 | # 47 | # The "traditional" practice of packing multiple parameters into a 48 | # space-separated string is a well documented source of bugs and security 49 | # problems, so this is (mostly) avoided, by progressively accumulating 50 | # options in "$@", and eventually passing that to Java. 51 | # 52 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 53 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 54 | # see the in-line comments for details. 55 | # 56 | # There are tweaks for specific operating systems such as AIX, CygWin, 57 | # Darwin, MinGW, and NonStop. 58 | # 59 | # (3) This script is generated from the Groovy template 60 | # https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 61 | # within the Gradle project. 62 | # 63 | # You can find Gradle at https://github.com/gradle/gradle/. 64 | # 65 | ############################################################################## 66 | 67 | # Attempt to set APP_HOME 68 | 69 | # Resolve links: $0 may be a link 70 | app_path=$0 71 | 72 | # Need this for daisy-chained symlinks. 73 | while 74 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 75 | [ -h "$app_path" ] 76 | do 77 | ls=$( ls -ld "$app_path" ) 78 | link=${ls#*' -> '} 79 | case $link in #( 80 | /*) app_path=$link ;; #( 81 | *) app_path=$APP_HOME$link ;; 82 | esac 83 | done 84 | 85 | # This is normally unused 86 | # shellcheck disable=SC2034 87 | APP_BASE_NAME=${0##*/} 88 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) 89 | APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s 90 | ' "$PWD" ) || exit 91 | 92 | # Use the maximum available, or set MAX_FD != -1 to use that value. 93 | MAX_FD=maximum 94 | 95 | warn () { 96 | echo "$*" 97 | } >&2 98 | 99 | die () { 100 | echo 101 | echo "$*" 102 | echo 103 | exit 1 104 | } >&2 105 | 106 | # OS specific support (must be 'true' or 'false'). 107 | cygwin=false 108 | msys=false 109 | darwin=false 110 | nonstop=false 111 | case "$( uname )" in #( 112 | CYGWIN* ) cygwin=true ;; #( 113 | Darwin* ) darwin=true ;; #( 114 | MSYS* | MINGW* ) msys=true ;; #( 115 | NONSTOP* ) nonstop=true ;; 116 | esac 117 | 118 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 119 | 120 | 121 | # Determine the Java command to use to start the JVM. 122 | if [ -n "$JAVA_HOME" ] ; then 123 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 124 | # IBM's JDK on AIX uses strange locations for the executables 125 | JAVACMD=$JAVA_HOME/jre/sh/java 126 | else 127 | JAVACMD=$JAVA_HOME/bin/java 128 | fi 129 | if [ ! -x "$JAVACMD" ] ; then 130 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 131 | 132 | Please set the JAVA_HOME variable in your environment to match the 133 | location of your Java installation." 134 | fi 135 | else 136 | JAVACMD=java 137 | if ! command -v java >/dev/null 2>&1 138 | then 139 | die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 140 | 141 | Please set the JAVA_HOME variable in your environment to match the 142 | location of your Java installation." 143 | fi 144 | fi 145 | 146 | # Increase the maximum file descriptors if we can. 147 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 148 | case $MAX_FD in #( 149 | max*) 150 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. 151 | # shellcheck disable=SC2039,SC3045 152 | MAX_FD=$( ulimit -H -n ) || 153 | warn "Could not query maximum file descriptor limit" 154 | esac 155 | case $MAX_FD in #( 156 | '' | soft) :;; #( 157 | *) 158 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. 159 | # shellcheck disable=SC2039,SC3045 160 | ulimit -n "$MAX_FD" || 161 | warn "Could not set maximum file descriptor limit to $MAX_FD" 162 | esac 163 | fi 164 | 165 | # Collect all arguments for the java command, stacking in reverse order: 166 | # * args from the command line 167 | # * the main class name 168 | # * -classpath 169 | # * -D...appname settings 170 | # * --module-path (only if needed) 171 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 172 | 173 | # For Cygwin or MSYS, switch paths to Windows format before running java 174 | if "$cygwin" || "$msys" ; then 175 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 176 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 177 | 178 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 179 | 180 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 181 | for arg do 182 | if 183 | case $arg in #( 184 | -*) false ;; # don't mess with options #( 185 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 186 | [ -e "$t" ] ;; #( 187 | *) false ;; 188 | esac 189 | then 190 | arg=$( cygpath --path --ignore --mixed "$arg" ) 191 | fi 192 | # Roll the args list around exactly as many times as the number of 193 | # args, so each arg winds up back in the position where it started, but 194 | # possibly modified. 195 | # 196 | # NB: a `for` loop captures its iteration list before it begins, so 197 | # changing the positional parameters here affects neither the number of 198 | # iterations, nor the values presented in `arg`. 199 | shift # remove old arg 200 | set -- "$@" "$arg" # push replacement arg 201 | done 202 | fi 203 | 204 | 205 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 206 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 207 | 208 | # Collect all arguments for the java command: 209 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, 210 | # and any embedded shellness will be escaped. 211 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be 212 | # treated as '${Hostname}' itself on the command line. 213 | 214 | set -- \ 215 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 216 | -classpath "$CLASSPATH" \ 217 | org.gradle.wrapper.GradleWrapperMain \ 218 | "$@" 219 | 220 | # Stop when "xargs" is not available. 221 | if ! command -v xargs >/dev/null 2>&1 222 | then 223 | die "xargs is not available" 224 | fi 225 | 226 | # Use "xargs" to parse quoted args. 227 | # 228 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 229 | # 230 | # In Bash we could simply go: 231 | # 232 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 233 | # set -- "${ARGS[@]}" "$@" 234 | # 235 | # but POSIX shell has neither arrays nor command substitution, so instead we 236 | # post-process each arg (as a line of input to sed) to backslash-escape any 237 | # character that might be a shell metacharacter, then use eval to reverse 238 | # that process (while maintaining the separation between arguments), and wrap 239 | # the whole thing up as a single "set" statement. 240 | # 241 | # This will of course break if any of these variables contains a newline or 242 | # an unmatched quote. 243 | # 244 | 245 | eval "set -- $( 246 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 247 | xargs -n1 | 248 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 249 | tr '\n' ' ' 250 | )" '"$@"' 251 | 252 | exec "$JAVACMD" "$@" 253 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | @rem SPDX-License-Identifier: Apache-2.0 17 | @rem 18 | 19 | @if "%DEBUG%"=="" @echo off 20 | @rem ########################################################################## 21 | @rem 22 | @rem Gradle startup script for Windows 23 | @rem 24 | @rem ########################################################################## 25 | 26 | @rem Set local scope for the variables with windows NT shell 27 | if "%OS%"=="Windows_NT" setlocal 28 | 29 | set DIRNAME=%~dp0 30 | if "%DIRNAME%"=="" set DIRNAME=. 31 | @rem This is normally unused 32 | set APP_BASE_NAME=%~n0 33 | set APP_HOME=%DIRNAME% 34 | 35 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 36 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 37 | 38 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 39 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 40 | 41 | @rem Find java.exe 42 | if defined JAVA_HOME goto findJavaFromJavaHome 43 | 44 | set JAVA_EXE=java.exe 45 | %JAVA_EXE% -version >NUL 2>&1 46 | if %ERRORLEVEL% equ 0 goto execute 47 | 48 | echo. 1>&2 49 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 50 | echo. 1>&2 51 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 52 | echo location of your Java installation. 1>&2 53 | 54 | goto fail 55 | 56 | :findJavaFromJavaHome 57 | set JAVA_HOME=%JAVA_HOME:"=% 58 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 59 | 60 | if exist "%JAVA_EXE%" goto execute 61 | 62 | echo. 1>&2 63 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 64 | echo. 1>&2 65 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 66 | echo location of your Java installation. 1>&2 67 | 68 | goto fail 69 | 70 | :execute 71 | @rem Setup the command line 72 | 73 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 74 | 75 | 76 | @rem Execute Gradle 77 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 78 | 79 | :end 80 | @rem End local scope for the variables with windows NT shell 81 | if %ERRORLEVEL% equ 0 goto mainEnd 82 | 83 | :fail 84 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 85 | rem the _cmd.exe /c_ return code! 86 | set EXIT_CODE=%ERRORLEVEL% 87 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 88 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 89 | exit /b %EXIT_CODE% 90 | 91 | :mainEnd 92 | if "%OS%"=="Windows_NT" endlocal 93 | 94 | :omega 95 | -------------------------------------------------------------------------------- /profile.yml: -------------------------------------------------------------------------------- 1 | description: A profile for creating a Grails application with a React frontend 2 | instructions: | 3 | 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: 4 | 5 | ./gradlew server:bootRun 6 | 7 | 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): 8 | 9 | ./gradlew client:start 10 | 11 | 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 12 | 13 | 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 14 | 15 | skeleton: 16 | excludes: 17 | - gradlew 18 | - gradlew.bat 19 | - gradle/ 20 | parent: 21 | target: server 22 | features: 23 | defaults: 24 | - hibernate5 25 | required: 26 | - json-views 27 | build: 28 | repositories: 29 | - "https://plugins.gradle.org/m2/" 30 | plugins: 31 | - war 32 | - org.grails.grails-web 33 | - com.github.node-gradle.node 34 | excludes: 35 | - org.grails.grails-core 36 | dependencies: 37 | - scope: build 38 | coords: "com.github.node-gradle:gradle-node-plugin:1.3.0" 39 | 40 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | import org.apache.tools.ant.DirectoryScanner 2 | 3 | rootProject.name="react" 4 | 5 | // Include .gitignore and other config files 6 | for(String file in DirectoryScanner.defaultExcludes) { 7 | DirectoryScanner.removeDefaultExclude(file) 8 | } -------------------------------------------------------------------------------- /skeleton/client/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | node_modules 5 | 6 | # testing 7 | coverage 8 | 9 | # production 10 | build 11 | 12 | # misc 13 | .DS_Store 14 | .env 15 | npm-debug.log 16 | -------------------------------------------------------------------------------- /skeleton/client/README.md: -------------------------------------------------------------------------------- 1 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 2 | 3 | ## Available Scripts 4 | 5 | In the project directory, you can run: 6 | 7 | ### `npm start` 8 | 9 | Runs the app in the development mode.
10 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 11 | 12 | The page will reload if you make edits.
13 | You will also see any lint errors in the console. 14 | 15 | ### `npm test` 16 | 17 | Launches the test runner in the interactive watch mode.
18 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 19 | 20 | ### `npm run build` 21 | 22 | Builds the app for production to the `build` folder.
23 | It correctly bundles React in production mode and optimizes the build for the best performance. 24 | 25 | The build is minified and the filenames include the hashes.
26 | Your app is ready to be deployed! 27 | 28 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 29 | 30 | ### `npm run eject` 31 | 32 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** 33 | 34 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 35 | 36 | Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. 37 | 38 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. 39 | 40 | ## Learn More 41 | 42 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 43 | 44 | To learn React, check out the [React documentation](https://reactjs.org/). 45 | 46 | ### Code Splitting 47 | 48 | This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting 49 | 50 | ### Analyzing the Bundle Size 51 | 52 | This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size 53 | 54 | ### Making a Progressive Web App 55 | 56 | This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app 57 | 58 | ### Advanced Configuration 59 | 60 | This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration 61 | 62 | ### Deployment 63 | 64 | This section has moved here: https://facebook.github.io/create-react-app/docs/deployment 65 | 66 | ### `npm run build` fails to minify 67 | 68 | This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify 69 | -------------------------------------------------------------------------------- /skeleton/client/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "com.github.node-gradle.node" version "3.5.1" 3 | } 4 | 5 | node { 6 | version = '10.15.0' // https://nodejs.org/en/ 7 | yarnVersion = '1.13.0' // https://yarnpkg.com/en/ 8 | download = true 9 | } 10 | 11 | task bootRun(dependsOn: 'start') { 12 | group = 'application' 13 | description = 'Run the client app (for use with gradle bootRun -parallel' 14 | } 15 | 16 | task start(type: YarnTask, dependsOn: 'yarn') { 17 | group = 'application' 18 | description = 'Run the client app' 19 | args = ['run', 'start'] 20 | } 21 | 22 | task build(type: YarnTask, dependsOn: 'yarn') { 23 | group = 'build' 24 | description = 'Build the client bundle' 25 | args = ['run', 'build'] 26 | } 27 | 28 | task test(type: YarnTask, dependsOn: 'yarn') { 29 | group = 'verification' 30 | description = 'Run the client tests' 31 | args = ['run', 'test'] 32 | } 33 | 34 | task eject(type: YarnTask, dependsOn: 'yarn') { 35 | group = 'other' 36 | description = 'Eject from the create-react-app scripts' 37 | args = ['run', 'eject'] 38 | } 39 | -------------------------------------------------------------------------------- /skeleton/client/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "client", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "react": "^16.8.2", 7 | "react-dom": "^16.8.2", 8 | "react-scripts": "^3.2.0", 9 | "bootstrap": "^5.0.0", 10 | "reactstrap": "^6.5.0" 11 | }, 12 | "scripts": { 13 | "start": "react-scripts start", 14 | "build": "react-scripts build", 15 | "test": "react-scripts test", 16 | "eject": "react-scripts eject" 17 | }, 18 | "eslintConfig": { 19 | "extends": "react-app" 20 | }, 21 | "browserslist": [ 22 | ">0.2%", 23 | "not dead", 24 | "not ie <= 11", 25 | "not op_mini all" 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /skeleton/client/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grails-profiles/react/6384668633ecbde4c6847f83a4460ce0c0bfeea5/skeleton/client/public/favicon.ico -------------------------------------------------------------------------------- /skeleton/client/public/favicon16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grails-profiles/react/6384668633ecbde4c6847f83a4460ce0c0bfeea5/skeleton/client/public/favicon16.png -------------------------------------------------------------------------------- /skeleton/client/public/favicon32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grails-profiles/react/6384668633ecbde4c6847f83a4460ce0c0bfeea5/skeleton/client/public/favicon32.png -------------------------------------------------------------------------------- /skeleton/client/public/favicon48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grails-profiles/react/6384668633ecbde4c6847f83a4460ce0c0bfeea5/skeleton/client/public/favicon48.png -------------------------------------------------------------------------------- /skeleton/client/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 10 | 11 | 15 | 16 | 25 | Welcome to Grails + React 26 | 27 | 28 | 29 |
30 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /skeleton/client/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": ".", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /skeleton/client/src/App.js: -------------------------------------------------------------------------------- 1 | import React, {Component} from 'react'; 2 | import AppNav from './AppNav'; 3 | import {Row} from 'reactstrap' 4 | 5 | import grailsLogo from './images/grails-cupsonly-logo-white.svg'; 6 | import reactLogo from './images/logo.svg'; 7 | import {CLIENT_VERSION, REACT_VERSION, SERVER_URL} from './config'; 8 | import 'whatwg-fetch'; 9 | import Footer from "./Footer"; 10 | 11 | class App extends Component { 12 | 13 | state = { 14 | serverInfo: {}, 15 | clientInfo: { 16 | version: CLIENT_VERSION, 17 | react: REACT_VERSION 18 | }, 19 | collapse: false 20 | } 21 | 22 | toggle = () => { 23 | this.setState({collapse: !!this.state.collapse}) 24 | } 25 | 26 | componentDidMount() { 27 | fetch(SERVER_URL + '/application') 28 | .then(r => r.json()) 29 | .then(json => this.setState({serverInfo: json})) 30 | .catch(error => console.error('Error connecting to server: ' + error)); 31 | 32 | } 33 | 34 | render() { 35 | const {serverInfo, clientInfo, collapse} = this.state; 36 | 37 | return [ 38 | , 39 |
40 | Grails 41 | + 42 | React 43 |
, 44 | 45 | 46 |
47 |
48 |

Welcome to Grails

49 |
50 |

51 | Congratulations, you have successfully started your Grails & React application! While in 52 | development mode, changes will be loaded automatically when you edit your React app, 53 | without even refreshing the page. 54 | Below is a list of controllers that are currently deployed in 55 | this application, click on each to execute its default action: 56 |

57 | 58 | 68 |
69 | 70 |
71 | 72 |
, 73 |