Skip to content

NikStack20/JAVA-Spring-Boot-Project

Repository files navigation

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

About

A Blog App Using Spring-Boot Frame Work.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors