{"id":16541653,"url":"https://github.com/itzg/spring-boot-with-reactjs","last_synced_at":"2026-06-09T05:04:25.244Z","repository":{"id":145318030,"uuid":"376182969","full_name":"itzg/spring-boot-with-reactjs","owner":"itzg","description":null,"archived":false,"fork":false,"pushed_at":"2021-06-12T02:11:47.000Z","size":411,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-20T13:44:29.447Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itzg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-12T02:11:26.000Z","updated_at":"2021-06-13T15:53:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"951f952f-a470-438e-98ed-4374765d2968","html_url":"https://github.com/itzg/spring-boot-with-reactjs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/itzg/spring-boot-with-reactjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itzg%2Fspring-boot-with-reactjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itzg%2Fspring-boot-with-reactjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itzg%2Fspring-boot-with-reactjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itzg%2Fspring-boot-with-reactjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itzg","download_url":"https://codeload.github.com/itzg/spring-boot-with-reactjs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itzg%2Fspring-boot-with-reactjs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34092285,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T18:55:34.066Z","updated_at":"2026-06-09T05:04:25.213Z","avatar_url":"https://github.com/itzg.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"This is a sample project that goes along with [my Medium article](https://medium.com/@itzgeoff/including-react-in-your-spring-boot-maven-build-ae3b8f8826e) that shows how to build a [ReactJS](https://reactjs.org/) UI and Spring Boot backend with Maven. [This Spring Guide](https://spring.io/guides/tutorials/react-and-spring-data-rest/) provides a similar description of a hybrid technology/build.\n\n## Build\n\nTo build a jar that includes the production build of the ReactJS code, run\n\n```shell\n./mvnw package\n```\n\n## Bootstrapping your own project like this one\n\n### Spring Boot + Maven content\n\nInitialize your project with [Spring Initializr](https://start.spring.io/) or the integration thereof in your favorite IDE.\n\n### ReactJS module setup\n\nFrom a terminal, go into the `src/main` directory of this project and use [create-react-app](https://create-react-app.dev/) to bootstrap the ReactJS content:\n\n```shell\nnpx create-react-app ui\n```\n\nIn the created `ui` directory, create the file `.env` with the content\n\n```\nBUILD_PATH = ../../../target/classes/public\n```\n\n### Frontend Maven Plugin setup\n\nIn the `pom.xml` add the following two properties where `node.version` should be changed to the desired NodeJS version:\n\n```xml\n    \u003cui.directory\u003e${project.basedir}/src/main/ui\u003c/ui.directory\u003e\n    \u003cnode.version\u003e16.1.0\u003c/node.version\u003e\n```\n\nIn the build-\u003eplugins section of the `pom.xml` add [the frontend maven plugin](https://github.com/eirslett/frontend-maven-plugin) with the version updated to the latest:\n\n```xml\n      \u003cplugin\u003e\n        \u003cartifactId\u003efrontend-maven-plugin\u003c/artifactId\u003e\n        \u003cgroupId\u003ecom.github.eirslett\u003c/groupId\u003e\n        \u003c!-- update this version to the latest --\u003e\n        \u003cversion\u003e1.12.0\u003c/version\u003e\n  \n        \u003cexecutions\u003e\n          \n          \u003cexecution\u003e\n            \u003cid\u003einstall node and npm\u003c/id\u003e\n            \u003cgoals\u003e\n              \u003cgoal\u003einstall-node-and-npm\u003c/goal\u003e\n            \u003c/goals\u003e\n          \u003c/execution\u003e\n          \n          \u003cexecution\u003e\n            \u003cid\u003ereact test\u003c/id\u003e\n            \u003cgoals\u003e\n              \u003cgoal\u003enpm\u003c/goal\u003e\n            \u003c/goals\u003e\n            \u003cphase\u003etest\u003c/phase\u003e\n            \u003cconfiguration\u003e\n              \u003carguments\u003etest\u003c/arguments\u003e\n              \u003cworkingDirectory\u003e${ui.directory}\u003c/workingDirectory\u003e\n              \u003cenvironmentVariables\u003e\n                \u003c!-- Enable non-watch mode --\u003e\n                \u003cCI\u003etrue\u003c/CI\u003e\n              \u003c/environmentVariables\u003e\n            \u003c/configuration\u003e\n          \u003c/execution\u003e\n          \n          \u003cexecution\u003e\n            \u003cid\u003ereact build\u003c/id\u003e\n            \u003cgoals\u003e\n              \u003cgoal\u003enpm\u003c/goal\u003e\n            \u003c/goals\u003e\n            \u003cphase\u003eprepare-package\u003c/phase\u003e\n            \u003cconfiguration\u003e\n              \u003carguments\u003erun build\u003c/arguments\u003e\n              \u003cworkingDirectory\u003e${ui.directory}\u003c/workingDirectory\u003e\n            \u003c/configuration\u003e\n          \u003c/execution\u003e\n          \n        \u003c/executions\u003e\n    \n        \u003cconfiguration\u003e\n          \u003cnodeVersion\u003ev${node.version}\u003c/nodeVersion\u003e\n          \u003cinstallDirectory\u003e${project.build.directory}\u003c/installDirectory\u003e\n        \u003c/configuration\u003e\n      \u003c/plugin\u003e\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitzg%2Fspring-boot-with-reactjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitzg%2Fspring-boot-with-reactjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitzg%2Fspring-boot-with-reactjs/lists"}