Nucleus Framework

Production-ready microservices foundation for Java / Spring Boot

Nucleus is a modular platform layer that provides the infrastructure every enterprise microservices application needs -- authentication, audit trails, messaging, monitoring, email, storage, and more. Add it as a Maven dependency and start building business logic on day one.

Quick Start

1. Add the parent POM

<parent>
    <groupId>com.nucleus</groupId>
    <artifactId>nucleus-parent</artifactId>
    <version>0.0.1</version>
</parent>

2. Pick your modules

<dependencies>
    <dependency>
        <groupId>com.nucleus</groupId>
        <artifactId>nucleus-core</artifactId>
        <version>0.0.1</version>
    </dependency>
    <dependency>
        <groupId>com.nucleus</groupId>
        <artifactId>nucleus-audit-core</artifactId>
        <version>0.0.1</version>
    </dependency>
</dependencies>

3. Configure

spring:
  config:
    import: configserver:https://your-config-server
  application:
    name: my-service
  profiles:
    active: monitoring

Architecture

nucleus-parent (Maven parent POM)
  nucleus-bom (Bill of Materials)

nucleus-core (foundation: security, JWT, pagination, reports)
  nucleus-connectors (Kafka messaging abstraction)
    nucleus-monitoring-client (self-registration, remote logging)
  nucleus-audit-core (@AuditAction declarative audit)
  nucleus-storage (MinIO/S3 file storage)
  nucleus-execution-events (async job framework)
  nucleus-authentication (OAuth2/OIDC server)

nucleus-mail-common (shared DTOs)
  nucleus-mail (rendering + sending + step tracking)
  nucleus-mail-renderer (Thymeleaf template engine)
  nucleus-mail-sender (SMTP delivery)

nucleus-ui-message-broker (SSE with role-based delivery)
nucleus-config (Spring Cloud Config Server)
nucleus-user (user management + roles)
nucleus-address (Google Maps integration)

nucleus-core

Foundation

The base layer every Nucleus service extends. Provides security filters, JWT validation, pagination, error handling, and report generation.

nucleus-authentication

Security

Full OAuth2/OIDC authorization server built on Spring Authorization Server.

nucleus-audit-core

Compliance

Add audit trails to any service method with a single annotation.

@AuditAction(
    action = "Update Expense",
    entityName = "Expense",
    description = "Updated expense #{#result.id} for #{#result.vendor}"
)
public Expense updateExpense(ExpenseDTO dto) { ... }

nucleus-connectors

Messaging

Pluggable messaging abstraction. Currently backed by Apache Kafka, designed for multiple backends.

nucleus-monitoring-client

Observability

Lightweight service monitoring. Add the dependency, enable the monitoring profile, and your service self-registers.

FeatureEndpointDescription
Self-registrationAutomatic (Kafka)REGISTER / HEARTBEAT (30s) / DEREGISTER
Instance identity--Short UUID + readable displayName (service:port:id)
Remote loggingPOST /remote-logging?enabled=trueToggle Kafka log streaming per instance
Remote shutdownPOST /remote-management/shutdownGraceful shutdown (systemd auto-restarts)
Instance infoGET /remote-management/infoService name, instance, status

Remote Logging Setup

Add to logback-spring.xml:

<appender name="REMOTE" class="com.nucleus.monitoring.client.KafkaLogAppender" />
<root level="INFO">
    <appender-ref ref="CONSOLE" />
    <appender-ref ref="REMOTE" />
</root>

The appender is inactive by default. Toggle at runtime via the REST endpoint. All endpoints require ROLE_ADMIN.

nucleus-ui-message-broker

Real-time

Server-Sent Events (SSE) with role-based delivery for real-time UI updates.

nucleus-mail

Communication

Kafka-driven email pipeline with three stages: render, send, track.

nucleus-storage

Storage

MinIO/S3-compatible object storage abstraction.

nucleus-execution-events

Processing

Async job execution framework for long-running processes.

nucleus-config

Configuration

Spring Cloud Config Server backed by MySQL database.

nucleus-user

Identity

User management, role assignment, and access request workflows.

nucleus-address

Integration

Google Maps Places API integration for address autocomplete and validation.

Dependency Map

nucleus-parent  -->  nucleus-bom
nucleus-bom     -->  All modules (version management)

nucleus-core  -->  nucleus-connectors
              -->  nucleus-storage
              -->  nucleus-audit-core
              -->  nucleus-authentication
              -->  nucleus-execution-events

nucleus-connectors  -->  nucleus-monitoring-client
                    -->  nucleus-ui-message-broker

nucleus-mail-common  -->  nucleus-mail
                     -->  nucleus-mail-renderer
                     -->  nucleus-mail-sender

nucleus-audit-core  -->  All application services (transitive)

Configuration Properties

PropertyDefaultModule
kafka.service.registry.topic.namebookwise.service.registrymonitoring-client
kafka.remote.logging.topic.namebookwise.remote.logsmonitoring-client
monitoring.heartbeat.interval-ms30000monitoring-client
spring.config.import--All services
spring.profiles.active--All services

Tech Stack

LayerTechnology
BackendJava 17, Spring Boot 3.5, Spring Security, Spring Cloud Config
MessagingPluggable: Apache Kafka, RabbitMQ, or custom (swap by annotation)
DatabaseSpring Data JPA / Hibernate (database-agnostic: MySQL, PostgreSQL, Oracle, SQL Server)
StorageMinIO (S3-compatible object storage)
Real-timeServer-Sent Events (SSE) with role-based delivery
TestingSpock 2.4 / Groovy 4.x, JaCoCo coverage, 866+ tests
CI/CDJenkins pipelines, Artifactory, Bitbucket webhooks
APIOpenAPI 3.0 with generated TypeScript + Java WebClient clients