Something New I learnt In Spring Boot REST API Application

Photo by Clark Tibbs on Unsplash

Something New I learnt In Spring Boot REST API Application

ยท

2 min read


Overview :

  • Centralized Dependency Management (parent POM/BOM)

  • Configuration * Basic security

  • Global Error Handling

  • Actuator endpoints for monitoring

  • Health checks for application status

  • JWT-based security

  1. Spring Boot Starter:

    The core module that initializes and configures the Spring Boot application, providing the framework for developing REST APIs efficiently.

    Auto-configuration

    Embedded Tomcat server

    Dependency management

  2. Spring Web :

    This module provides the necessary components to create RESTful web services using Spring MVC.

    DispatcherServlet for handling requests

    RESTful endpoint creation using @RestController

    JSON (de)serialization with Jackson

  3. Spring Data JPA :

    This module simplifies data access and persistence using Java Persistence API (JPA) and Hibernate.

    Repository pattern implementation

    Simplified CRUD operations

    Pagination and sorting

  4. Spring Security with JWT :

    This module secures the REST API endpoints using JSON Web Tokens (JWT) for authentication and authorization.

    User authentication using JWT tokens .

    Secured endpoints with role-based access control .

    Token generation and validation .

    SecurityConfig: Configures security settings, corsConfig and JWT filter . Class OncePerRequestFilter: Filter base class that aims to guarantee single- execution per request dispatch, on any servlet container .

  5. Health Checks :

    Includes endpoints to provide health status of the application, ensuring it is running properly.

    Built-in /actuator/health endpoint

    Customizable endpoints

    CustomHealthIndicator: Example of a custom health check to monitor specific components or services.

So, this is something very important and useful for building any Spring boot Applications.

Thank You!!!

ย