A comprehensive multi-module Java application featuring Spring Boot backend, React frontend, and SQL schema management.
java-sql-app/
├── app-backend/ # Spring Boot REST API
├── app-frontend/ # React web application
├── app-sql/ # SQL schemas and migrations
└── pom.xml # Parent POM for multi-module build
Spring Boot REST API providing user management endpoints.
Key Features:
- REST API with Spring Web
- JPA/Hibernate for data persistence
- In-memory H2 database (dev)
- User entity and CRUD operations
Endpoints:
GET /api/users- Get all usersGET /api/users/{id}- Get user by IDPOST /api/users- Create new userPUT /api/users/{id}- Update userDELETE /api/users/{id}- Delete user
React frontend for user management interface.
Features:
- User list display
- Create new users
- Delete users
- Responsive design
- Real-time updates
Database schema and migration artifacts packaged separately.
Contents:
- Schema definitions (users, posts tables)
- Database migrations
- Index definitions
- Documentation
mvn clean install
mvn clean install -pl app-backend
mvn clean install -DskipFrontend
After building, two main artifacts are generated:
-
Backend JAR (
app-backend/target/app-backend-1.0.0.jar)- Executable Spring Boot application
- Contains REST API and embedded server
-
SQL Bundle (
app-sql/target/app-sql-1.0.0-sql-bundle.zip)- Database schemas and migrations
- Documentation and setup guides
java -jar app-backend/target/app-backend-1.0.0.jar
The application will start on http://localhost:8080
- Web UI:
http://localhost:8080 - API:
http://localhost:8080/api - H2 Console:
http://localhost:8080/h2-console
The application uses H2 in-memory database by default. To use PostgreSQL or MySQL:
- Add database driver to
app-backend/pom.xml - Update
application.propertieswith connection details - Rebuild
- URL:
jdbc:h2:mem:testdb - Username:
sa - Password: (empty)
cd app-frontend/src/main/app
npm install
npm startFrontend runs on http://localhost:3000 with proxy to http://localhost:8080
cd app-backend
mvn spring-boot:run- id (BIGINT PRIMARY KEY)
- username (VARCHAR 255 UNIQUE)
- email (VARCHAR 255 UNIQUE)
- password (VARCHAR 255)
- created_at (BIGINT)
- updated_at (BIGINT)
- id (BIGINT PRIMARY KEY)
- user_id (BIGINT FOREIGN KEY)
- title (VARCHAR 500)
- content (LONGTEXT)
- status (VARCHAR 50)
- created_at (BIGINT)
- updated_at (BIGINT)
# Run all tests mvn test # Run specific module tests mvn test -pl app-backend
- Backend: Spring Boot 2.7.0, Java 11
- Frontend: React 18, Axios
- Database: H2 (H2), PostgreSQL/MySQL compatible
- Build: Maven 3.6+
- Node: v16+ (for frontend build)
MIT