Skip to content

A powerful, reusable Java library for Spring Boot applications, providing out-of-the-box configurations for security, Kafka, error handling, OpenAPI, MapStruct, custom annotations, and utility classes to streamline development and standardize core functionalities.

Notifications You must be signed in to change notification settings

AshishBagdane/ash-core-lib

Repository files navigation

ASH Core Library

Maven Central License Build Status Quality Gate Status

A comprehensive Spring Boot library providing standardized configurations and reusable components for enterprise applications.

Overview

ASH Core Library is a modular enterprise-grade library designed to streamline the development of Spring Boot applications by providing pre-configured components, standardized configurations, and reusable utilities. The library emphasizes maintainability, flexibility, and adherence to best practices.

Features

  • Security Configuration: Pre-configured security settings with flexible authentication and authorization
  • Kafka Integration: Standardized messaging configuration with error handling and retry mechanisms
  • Exception Handling: Centralized error management with consistent response structures
  • Aspect-Oriented Programming: Reusable aspects for logging, monitoring, and transactions
  • OpenAPI Documentation: Automated API documentation generation
  • Object Mapping: Pre-configured MapStruct settings with common mapping patterns
  • Custom Annotations: Simplified configuration through custom annotations
  • Utility Classes: Common utilities for everyday development tasks

Project Structure

ash-core-lib/
├── bom/                    # Bill of Materials for version management
├── base/                   # Common functionality and core dependencies
├── core-config/           # Base configurations and properties
├── security/              # Authentication and authorization
├── messaging/             # Kafka configuration and components
├── error-handling/        # Exception handling and error responses
├── aspects/               # AOP components
├── documentation/         # OpenAPI configuration
├── mapper-config/         # MapStruct configuration
├── annotations/           # Custom annotations
└── utils/                 # Utility classes

Requirements

  • Java 21 or higher
  • Spring Boot 3.4.1 or higher
  • Maven 3.8.1 or higher

Installation

Add the following to your pom.xml:

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>com.ashishbagdane.lib</groupId>
      <artifactId>ash-core-lib-bom</artifactId>
      <version>${ash-core-lib.version}</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>
  </dependencies>
</dependencyManagement>

Then add specific modules as needed:

<dependencies>
  <dependency>
    <groupId>com.ashishbagdane.lib</groupId>
    <artifactId>security</artifactId>
  </dependency>
  <dependency>
    <groupId>com.ashishbagdane.lib</groupId>
    <artifactId>messaging</artifactId>
  </dependency>
  <!-- Add other modules as needed -->
</dependencies>

Quick Start

  1. Add Dependencies: Include required modules in your project
  2. Configure Properties: Set up necessary properties in application.yml
  3. Enable Features: Use provided annotations to enable specific features

Example configuration:

@SpringBootApplication
@EnableAshSecurity
@EnableAshMessaging
public class Application {

  public static void main(String[] args) {
    SpringApplication.run(Application.class, args);
  }
}

Module Documentation

Each module has its own detailed documentation:

Configuration

The library uses Spring Boot's configuration mechanism. Common properties can be set in application.yml:

ash:
  security:
    enabled: true
    jwt:
      secret: your-secret-key
      expiration: 86400000

  messaging:
    kafka:
      bootstrap-servers: localhost:9092
      consumer:
        group-id: my-group

  # Other module configurations

Best Practices

  1. Module Independence
  • Use only required modules
  • Follow module-specific guidelines
  • Maintain loose coupling
  1. Configuration Management
  • Override default configurations when needed
  • Use environment-specific properties
  • Document custom configurations
  1. Extension and Customization
  • Extend base classes for custom behavior
  • Use provided interfaces for implementations
  • Follow the extension guidelines

Contributing

We welcome contributions to ASH Core Library! Please read our CONTRIBUTING.md file for guidelines on how to contribute to this project, including:

  • Code of Conduct
  • Development Setup
  • Contribution Process
  • Pull Request Guidelines
  • Coding Standards
  • Testing Requirements

Development Setup

# Clone the repository
git clone https://github.com/AshishBagdane/ash-core-lib.git

# Build the project
mvn clean install

# Run tests
mvn test

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Support

Versioning

This project follows Calendar Versioning (CalVer):

  • Format: YYYY.MINOR.PATCH
  • Example: 2025.1.0

Authors

Acknowledgments

  • Spring Boot team for the excellent framework
  • All contributors who have helped shape this library

About

A powerful, reusable Java library for Spring Boot applications, providing out-of-the-box configurations for security, Kafka, error handling, OpenAPI, MapStruct, custom annotations, and utility classes to streamline development and standardize core functionalities.

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages