Skip to content

subhashkrkushwaha/blog-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blog App Backend

Overview

Blog App Backend is a Spring Boot-based RESTful application that provides a secure, scalable, and role-based API for managing blogs. It supports user registration, authentication, blog creation, retrieval, and deletion with role-based access control.

The application uses MySQL for persistent storage, Redis caching for performance, and includes Swagger API documentation along with unit tests using JUnit and Mockito.

Key Features

User Management

  • User registration and login with secure password handling.
  • JWT-based authentication for stateless security.
  • Role-based authorization: USER and ADMIN.

Blog Management

  • Create your own blog posts.
  • View blogs created by others.
  • Delete only your own blogs (enforced by security rules).

Security

  • Spring Security integration with JWT authentication.
  • Fine-grained role-based access control for sensitive operations.

Caching

  • Redis caching for frequently accessed blog data to improve performance.

API Documentation

  • Swagger UI for easy API testing and documentation.

Testing

  • Unit tests using JUnit.
  • Mockito for mocking dependencies in service and controller layers.

Technology Stack

Layer Technology
Backend Spring Boot
Security Spring Security, JWT
Database MySQL (local)
Caching Redis
ORM Spring Data JPA / Hibernate
API Docs Swagger
Testing JUnit, Mockito
Build Tool Maven

Setup Instructions

  1. Clone the repository:
    git clone <your-repo-url>
  2. Configure MySQL database:
    • Create a database (e.g., blog_db).
    • Update application.properties with your MySQL credentials.
  3. Run Redis locally or via Docker:
    docker run --name redis -p 6379:6379 -d redis
  4. Start the application:
    mvn spring-boot:run
  5. Access Swagger UI:
    http://localhost:8080/swagger-ui/index.html

About

Blog App Backend – Built a secure RESTful backend with Spring Boot, Spring Security, JPA, MySQL, and Redis. Implemented JWT authentication, role-based authorization, and CRUD operations for blogs. Documented APIs with Swagger and ensured code quality using JUnit and Mockito.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors