https://github.com/youhad08/product-springboot-mvc-app
A Spring Boot MVC web application for managing products with secure login, product search, and CRUD functionality using Thymeleaf, Spring Security, and JPA.
https://github.com/youhad08/product-springboot-mvc-app
bootstrap5 java jpa jpa-entities jpa-entity-manager jpa-hibernate jpa-repository lombock maven spring-boot spring-data spring-data-jpa spring-mvc spring-security thymeleaf thymeleaf-java thymeleaf-layout thymeleaf-template-engine
Last synced: 2 months ago
JSON representation
A Spring Boot MVC web application for managing products with secure login, product search, and CRUD functionality using Thymeleaf, Spring Security, and JPA.
- Host: GitHub
- URL: https://github.com/youhad08/product-springboot-mvc-app
- Owner: YOUHAD08
- Created: 2025-06-25T23:36:18.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-06-25T23:40:01.000Z (12 months ago)
- Last Synced: 2025-09-13T09:09:38.568Z (9 months ago)
- Topics: bootstrap5, java, jpa, jpa-entities, jpa-entity-manager, jpa-hibernate, jpa-repository, lombock, maven, spring-boot, spring-data, spring-data-jpa, spring-mvc, spring-security, thymeleaf, thymeleaf-java, thymeleaf-layout, thymeleaf-template-engine
- Language: Java
- Homepage:
- Size: 187 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🛒 Product-Spring-MVC - Product Management Web App
A complete **Spring Boot MVC** application that allows users to **manage products** securely with **authentication**, using **Spring Boot**, **Spring Security**, **Thymeleaf**, and **Spring Data JPA** for database interactions.
---
## 🔧 Features
- ✅ User login with Spring Security
- 📋 View list of all products
- ➕ Add a new product (secured)
- 🔒 Access control with role-based authorization
- 🖼️ Responsive web UI using Thymeleaf templates
- 💾 Persistent data storage via JPA (H2/MySQL/PostgreSQL adaptable)
---
## 🧠 Application Architecture
## 🛠️ Tech Stack
- Java 17+
- Spring Boot
- Spring MVC
- Spring Data JPA
- Spring Security
- Thymeleaf
- Maven
## 📁 Project Structure
```
product-spring-mcv/
│
├── .idea/
├── .mvn/
│
├── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── ma.youhad.productspringmcv/
│ │ │ ├── entities/
│ │ │ │ ├── Product.java
│ │ │ │ └── ...
│ │ │ ├── repository/
│ │ │ │ ├── ProductRepository.java
│ │ │ │ └── ...
│ │ │ ├── security/
│ │ │ │ ├── SecurityConfig.java
│ │ │ │ └── ...
│ │ │ ├── web/
│ │ │ │ ├── ProductController.java
│ │ │ │ ├── ProductSpringMcvApplication.java
│ │ │ │ └── ...
│ │ │
│ │ └── resources/
│ │ ├── static/
│ │ └── templates/
│ │ ├── layout1.html
│ │ ├── login.html
│ │ ├── new-product.html
│ │ ├── notAuthorized.html
│ │ └── products.html
│ │
│ └── test/
│
├── application.properties
├── target/
├── .gitattributes
├── .gitignore
├── HELP.md
├── mvnw
├── mvnw.cmd
├── pom.xml
└── README.md
```
## 📸 UI Preview
### 🔐 Login Page

### 🛍️ Products List

### ➕ Add / Update Product Page

### 🔍 Product Search Feature

## ⚙️ Configuration (`application.properties`)
```properties
spring.datasource.url=jdbc:h2:mem:testdb
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
spring.h2.console.enabled=true
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=update
```
## 🔐 Security Overview
- Spring Security is configured in SecurityConfig.java
- Basic login authentication
- Only authenticated users (ADMIN) can access protected routes like adding products
- Default user/password can be customized in config or initialized in code
## 📦 Dependencies (from pom.xml)
- Spring Boot Starter Web
- Spring Boot Starter Thymeleaf
- Spring Boot Starter Data JPA
- Spring Boot Starter Security
- H2 Database (can be replaced with MySQL/PostgreSQL)
- Spring Boot DevTools
## 🔌 Endpoints
| URL | Description | Access |
| ---------------- | -------------------------------- | ------------- |
| `/login` | Login page | Public |
| `/products` | View product list | Authenticated |
| `/products/new` | Add new product | Authenticated |
| `/notAuthorized` | Shown when user lacks permission | Authenticated |
## ✅ Future Improvements
- Add user registration and roles (admin/user)
- Upload product images
- Improve UI with Bootstrap
- Add pagination/search features
- Deploy to cloud (Heroku, AWS, etc.)
## ✅ Author
**YOUHAD AYOUB**