create-java-fullstack
v1.0.0
Published
CLI to scaffold a Java Spring Boot + React fullstack project
Maintainers
Readme
create-java-fullstack
A Node.js CLI that scaffolds a fullstack project with:
backend/-> Spring Boot (Maven)frontend/-> React (Create React App)
It behaves similarly to Django's startproject style command.
Installation (local development)
- Install dependencies for this CLI package (none currently, but command is standard):
npm install
- Link globally:
npm link
Then run from anywhere:
create-java-fullstack my-app
Usage
create-java-fullstack <project-name>Example:
create-java-fullstack demo-fullstackGenerated structure:
<project-name>/
backend/
frontend/What it generates
Backend
- Downloads Spring Boot Maven project from
https://start.spring.io - Includes dependency:
spring-boot-starter-web - Package:
com.example.project - Creates layered package folders:
controller,service,repository,model,dto,config,exception
- Adds:
ProjectApplication.javaApiController.javawithGET /apireturningHello from Backend
Frontend
- Creates React app in
frontend/viacreate-react-app - Auto installs frontend dependencies (CRA default behavior)
- Replaces
src/App.jswith a sample fetch call to backend/api
Notes
- Ensure you have:
- Node.js + npm
- Java + Maven (for running backend later)
- On Linux/macOS, if needed:
chmod +x index.js
Run generated apps
Backend
cd <project-name>/backend
mvn spring-boot:runFrontend
cd <project-name>/frontend
npm startThe frontend sample calls http://localhost:8080/api.
If backend connectivity fails in non-proxy setups, set an explicit backend URL before starting frontend:
# Linux/macOS
export REACT_APP_BACKEND_URL=http://localhost:8080
# Windows PowerShell
$env:REACT_APP_BACKEND_URL = "http://localhost:8080"