Revisited Baeldung Tutorial CRUD Application with React and Spring Boot — see https://www.baeldung.com/spring-boot-react-crud
The original article is ~4 years old and mixes libraries whose majors changed since.
I migrated the initial tutorial to the Vite starter Template Vitamin 2.0 to use:
- Vite 6 with React 19, TypeScript 5 and absolute imports.
- Tailwind CSS v4 for easy stylization.
- Biome V2 for linting, formatting and automatic import sorting.
- Vitest 3 and Testing Library 16 for teasting
- Playwright 1.52 to write Integrationtests.
reactboot/ # Maven Spring Boot backend
└── frontend/ # React app (npm)
Running the Application as Single Artifact with Spring Boot
./mvnw clean spring-boot:run -Psingle-artBackend (Spring Boot)
./mvnw clean spring-boot:run -Dspring-boot.run.profiles=devFrontend (port 5173, proxies to 8080):
Change in file .env.development VITE_USE_MOCK=false
cd frontend
pnpm devFrontend (port 5173)
Change in file .env.development VITE_USE_MOCK=true
cd frontend
pnpm dev- Implement all CRUD calls aligned with Spring Boot endpoints:
- Include
credentials: 'include'for session support
- Add CUD (Create , Update , Delete) Actions
- Validate payloads
- Tenant scoping already active via Hibernate filter
- Extend
ClientRepositorywithdeleteByTenantId()
- Convert forms to controlled inputs or use
react-hook-form - Add simple client-side checks (e.g. name required, valid email)
- Later integrate Valibot/Zod with
@hookform/resolvers - Provide visual feedback (e.g. Tailwind form styling)
- Use Spring Session JDBC
- Store
TENANT_IDin session (anon:<sessionId>or username) - Enable
tenantFilterfor all Hibernate sessions - On session timeout: delete rows by tenant id
- On logout (if added): wipe tenant’s rows
- Optional janitor job for stale tenants
- Add GitHub Actions:
- Java 21 + pnpm setup
- Cache Maven + pnpm deps
- Run backend & frontend tests
- Publish JAR / Docker image
- Dockerfile:
- Multi-stage build
- Deployable to Render or Fly.io or Cloud Run
-
SPRING_PROFILES_ACTIVE=demo
- Add header bar with "Reset Demo" + "Logout" buttons
- Add loading spinners, empty states, and error boundaries
- Pagination & search
- Toast notifications for CRUD actions
- Login / per-user tenants
- Automated cleanup job (
@Scheduled) - E2E tests (Playwright)
- Modern component refactor (Hooks + Context)
- Deploy live demo