Add grails-vite-spa v8 guide#500
Merged
jamesfredley merged 1 commit intomasterfrom May 3, 2026
Merged
Conversation
Two-tier integration guide: Grails 8 rest_api JSON backend plus a Vite/React SPA frontend in a single Gradle multi-project, packaged into one bootJar with the SPA served from the same origin as the API. Replaces the long-broken Webpack-era React/Vue profiles. Greenfield - new grails-guides/grails-vite-spa repo created public on the grails8 default branch. The 14 chapters cover the multi-project layout, the JSON backend (Book + RestfulController + JSON views), the SpaController forwarder for client-side routes, the Vite/React frontend, vite.config.js with /api proxy, the dev mode (two servers behind one origin), the prod build (one bootJar), and why CORS never appears. Verified locally: validateGuides -PvalidationMode=both returns 86 guides 0 errors; renderGuide_grails_vite_spa_8 --rerun-tasks --no-configuration-cache renders all 14 chapter HTML pages, no Unresolved directive errors. Assisted-by: claude-code:claude-opus-4-7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Final Grails 8 sample-app-flavour guide in the eight-guide series (PRs #479, #493, #494, #495, #496, #497, #498, #499). Two-tier integration: Grails 8 rest_api JSON backend plus a Vite + React SPA frontend in a single Gradle multi-project, packaged into one bootJar with the SPA served from the same origin as the API. Replaces the long-broken Webpack-era React/Vue profiles.
Greenfield - no upstream rename
New grails-guides/grails-vite-spa repo created public with grails8 as default branch. Vue 3 path is documented as a one-line plugin swap; the existing legacy react/vue repos are left alone.
What's in the PR
Layout
backend/ is a Gradle subproject. frontend/ is plain npm; three root Gradle tasks (npmInstall, frontendBuild, copyFrontendToBackend) bridge the two halves. backend:processResources depends on copyFrontendToBackend, so plain ./gradlew :backend:bootJar produces a single jar serving SPA at / and API at /api/**.
Verification
Series complete
This is the last of eight Grails 8 guides shipped as a stack of independent PRs: Tailwind (#493), Docker bootBuildImage (#494), GitHub Actions CI/CD (#495), REST Library API (#496), HTMX (#497), Multi-project (#498), Spock test tour (#499), and now Vite SPA (this one).