This is a simple Spring Boot project demonstrating Spring Security integration with Thymeleaf and Spring Data JPA. It uses MySQL as the database and includes basic authentication and authorization features.
This project is based on concepts from Spring Security in Action and enhanced with modern practices.
- User authentication using Spring Security
- Role-based authorization (basic setup)
- Thymeleaf integration for secure web pages
- CRUD operations with Spring Data JPA
- MySQL database connection
- Lombok for boilerplate code reduction
- Java 17+
- Spring Boot 3.x
- Spring Security 6
- Spring Data JPA
- Thymeleaf 3.x
- MySQL 8.x
- Lombok
- Java 17 or higher installed
- MySQL server running
- Maven installed (or use Spring Boot Wrapper)
- Clone the repository:
git clone https://github.com/your-username/your-project.git
cd your-project- Configure your MySQL database connection in
application.propertiesorapplication.yml:
spring.datasource.url=jdbc:mysql://localhost:3306/your_database
spring.datasource.username=root
spring.datasource.password=your_password
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true- Build and run the project:
mvn clean install
mvn spring-boot:run- Open your browser at
http://localhost:8080
- Register new users or use default users (if configured)
- Access restricted pages based on user roles
- Explore CRUD operations on entities via web interface
- This is a learning/demo project. Not production-ready.
- Some features are simplified for educational purposes.
- Modern Spring Security practices are applied, but older examples from books may differ slightly.
- Fork the project
- Create a feature branch (
git checkout -b feature/YourFeature) - Commit your changes (
git commit -m 'Add some feature') - Push to the branch (
git push origin feature/YourFeature) - Open a pull request