Blog Application using Spring Boot Feature : Full Blog functionality with Spring Role Permission Based Security Using JWT
- First clone the project
clone https://github.com/MohosinMiah/Blog-Application-using-Spring-Boot.git
- Then run project http://localhost:8080
https://github.com/MohosinMiah/Blog-Application-using-Spring-Boot/blob/main/necessary_resource/Blog%20Application.postman_collection.json
https://documenter.getpostman.com/view/4954358/2s946k7qun
https://github.com/MohosinMiah/Blog-Application-using-Spring-Boot/blob/main/necessary_resource/blogapplication.sql
This project aims to provide a fully functional blog application with features like creating and managing posts, commenting on posts, and organizing posts by categories. The application is secured using Spring Security with Role-Based Access Control (RBAC) and employs JSON Web Tokens (JWT) for authentication.
-
User Registration and Login: Users can register an account and log in to the application using their credentials.
-
Role-Based Security: The application uses Role-Based Access Control (RBAC) to define different levels of access for users. The roles typically include
ROLE_USER
,ROLE_ADMIN
, etc. -
JSON Web Tokens (JWT) Authentication: JWT is used for authentication, ensuring secure communication between the client and server.
-
Create and Manage Blog Posts: Authenticated users can create, edit, and delete their blog posts.
-
Comments on Posts: Users can add comments to blog posts to engage in discussions.
-
Categorize Posts: Blog posts can be organized into different categories for easy navigation and filtering.
- Spring Boot
- Spring Security
- Spring Data JPA
- MySQL (or any other database of your choice)
- JSON Web Tokens (JWT) for authentication
- Clone the repository:
git clone https://github.com/your-username/spring-blog.git
- Configure the database connection in
application.properties
:
spring.jpa.hibernate.ddl-auto=update
spring.datasource.url=jdbc:mysql://localhost:3306/blogapplication
spring.datasource.username=root
spring.datasource.password=
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.jpa.show-sql: true
- Run the application:
mvn spring-boot:run
The application will be accessible at http://localhost:8080
.
-
Visit the application in your browser.
-
Register a new account or log in if you already have one.
-
Explore the blog posts, create new posts, and add comments.
-
Admin users (with appropriate roles) will have additional privileges, such as managing users and categories.
Thank you Happy coding :)