Skip to content

Latest commit

Β 

History

History
100 lines (76 loc) Β· 3.37 KB

File metadata and controls

100 lines (76 loc) Β· 3.37 KB

Spring Boot Blogging Application

Author: NikStack20
Contact: codingnik20@gmail.com
Live Demo: Swagger UI
License: Apache License 2.0


πŸ“– Description

A Spring Boot-based backend blogging application built with industry-grade tech stack and deployed live for seamless testing.
Implements Layered Architecture with DTOs for clean data flow, secure JWT Authentication, and complete REST API support for blog operations.


βš™οΈ Tech Stack & Dependencies

  • Spring Boot
  • Spring Web
  • Spring Data JPA
  • Hibernate
  • MySQL Database
  • Lombok
  • Spring Security + JWT Authentication
  • Swagger UI (for API documentation)
  • Layered Architecture (Controllers β†’ Services β†’ Repositories)
  • Global Exception Handling
  • Bean Configuration
  • DTOs (Data Transfer Objects) for seamless mapping

Architecture Overview

This application follows a Layered Architecture ensuring:

  • Controller Layer: Handles incoming API requests and delegates to services.
  • Service Layer: Business logic implementation through service interfaces and their impl classes.
  • Repository Layer: Database interaction via Spring Data JPA.
  • Security Layer: JWT-based authentication and authorization.
  • DTOs: Used to maintain separation between API layer and entity layer.
  • Exception Handling: Centralized error responses with GlobalExceptionHandler.

Controllers Implemented

  • Auth Controller: User registration and login (JWT token generation)
  • User Controller: Manage users (CRUD)
  • Category Controller: Manage blog categories
  • Post Controller: Create, update, delete, view blog posts
  • Comment Controller: Add/delete comments on posts
  • SavePost Controller: Save posts for later by logged-in users
  • Image Upload Controller: Upload images for blog posts

πŸ” Security

  • JWT Authentication for securing APIs
  • Spring Security integration
  • Token-based access to protected routes

Entity Relationships

  • User ↔ Post: One-to-Many
  • Post ↔ Comment: One-to-Many
  • Category ↔ Post: One-to-Many
  • User ↔ SavePost: Many-to-Many (saved posts feature)

Entity Relationship Diagram available in ApplicationPreview folder.


πŸ–Ό Application Preview

  • Swagger UI screenshot for API testing
  • Entity Relationship Diagram
    (All available in ApplicationPreview folder alongside src, .gitignore, .classpath etc.)

πŸš€ Deployment

  • Live on Render: Swagger UI
  • Accessible via browser for API testing
  • JWT Auth enabled on Swagger UI

🀝 API Testing

  • Can be tested using Swagger UI or Postman
  • Swagger UI allows live interaction with APIs (requires JWT authentication)

πŸ“Œ Notes

  • Works seamlessly with MySQL (local or cloud-hosted).
  • Can be extended to other databases like PostgreSQL.

πŸ”— Links