A simple full-stack CRUD application built with Spring Boot (backend), Next.js (frontend), and MySQL database.
This project demonstrates a layered architecture with RESTful APIs, JPA/Hibernate, DTOs, and a modern React-based frontend.
- Create, Read, Update, Delete (CRUD) operations for products
- Backend: Spring Boot with Maven, JPA/Hibernate, layered architecture (Controller, Service, Repository, Model, DTO)
- Frontend: Next.js with Tailwind CSS for responsive styling
- Database: MySQL for persistent storage
- CORS support for frontend-backend communication
- Backend: Java 17+, Spring Boot 3.x, Maven, JPA/Hibernate, MySQL
- Frontend: Next.js (React)
- Database: MySQL
src/
├── main/java/com/products/productmanager/
│ ├── config/
│ ├── controller/
│ ├── dto/
│ ├── model/
│ ├── repository/
│ ├── service/
│ └── ProductManagerApplication.java
└── resources/
├── application.properties
frontend/
├── app/
│ ├── layout.js
│ ├── page.jsx
│ ├── add-product/
│ │ └── page.js
│ └── edit-product/
│ └── [id]/
│ └── page.jsx
└── globals.css
- Java 17+
- Node.js 16+
- MySQL 8+
- Maven
- npm/yarn
git clone https://github.com/nipun-munasinghe/productManager-springboot.git
cd productManager-springboot- Configure MySQL in
src/main/resources/application.properties
spring.datasource.url=jdbc:mysql://localhost:3306/product_db
spring.datasource.username=your_username
spring.datasource.password=your_password
spring.jpa.hibernate.ddl-auto=update- Build and run the backend
The backend will start at http://localhost:8080.
- Install dependencies
cd frontend
npm install- Start the frontend
npm run devThe frontend will start at http://localhost:3000.
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/products | Create a product |
| GET | /api/products | Get all products |
| GET | /api/products/{id} | Get a product by ID |
| PUT | /api/products/{id} | Update a product |
| DELETE | /api/products/{id} | Delete a product |
Happy coding!
If you have any questions or suggestions, feel free to open an issue or submit a pull request.