This is a complete application built with Java Spring Boot, designed to demonstrate the capabilities of Spring Data JPA, Thymeleaf, and Spring Security. The application follows the Model-View-Controller (MVC) architecture and provides a platform for users to create, read, update, and delete blog posts.
- User authentication and authorization
- Role-based access control (User and Admin roles)
- CRUD operations for blog posts
- H2 database for development and PostgreSQL for production
- Responsive web interface using Thymeleaf
- RESTful API for image handling
- Java 21
- Spring Boot 3.1.5
- Spring Data JPA
- Thymeleaf
- Spring Security
- PostgreSQL
- Maven
-
Clone the Repository:
git clone https://github.com/yourusername/spring-boot-blog-application.git cd spring-boot-blog-application
-
Build the Application: You can build the application using Maven. Make sure you have Maven installed on your machine.
mvn clean package
-
Run the Application: You can run the application using the following command:
mvn spring-boot:run
-
Access the Application: Open your web browser and navigate to
http://localhost:8080
to access the application.
-
User Account:
- Email:
[email protected]
- Password:
password
- Permissions: Can create, read, and update posts.
- Email:
-
Admin Account:
- Email:
[email protected]
- Password:
password
- Permissions: Can create, read, update, and delete posts.
- Email:
-
Anonymous Account:
- Permissions: Can only read posts.
The application uses PostgreSQL for production. You can configure the database connection in the src/main/resources/application.properties
file. For development, the H2 database is enabled.