# team-dodn/spring-boot-kotlin-template architecture

> Architecture diagram of the GitHub repository team-dodn/spring-boot-kotlin-template, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/team-dodn/spring-boot-kotlin-template
- Repository: https://github.com/team-dodn/spring-boot-kotlin-template

## Overview

##### Project type and purpose
- This is a modular Kotlin/Spring Boot “template” monorepo designed to jump-start a microservice or API service.
- It provides a core executable service (core-api), shared enums (core-enum), example external client integrations (clients), database integration (storage), cross-cutting support (logging, monitoring), and test-support modules.

##### File structure
- Top-level modules:
- core/core-api – the main Spring Boot application providing REST APIs and domain services
- core/core-enum – reusable enum definitions shared across modules
- clients/client-example – sample OpenFeign HTTP client integration
- storage/db-core – Spring Data JPA integration with MySQL (entities, repositories, datasource configs)
- support/logging – centralized logging and distributed tracing setup (Sentry, Logback)
- support/monitoring – application monitoring configuration
- tests/api-docs – Spring REST Docs integration for API documentation
- Standard Gradle multi-module layout with build scripts, resources, and test suites under each module.
- Profiles and configuration files (application.yml, module-specific yml, gradle.properties).

##### README for additional insights
- Modules map to domain boundaries and cross-cutting concerns.
- Dependency versions are managed centrally in gradle.properties.
- Runtime profiles (local, dev, staging, live) align with external environment deployments.
- CI tasks and test tags indicate modular test strategies: unitTest, contextTest, restDocsTest, developTest.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Core Module
    subgraph "Core Module" 
        direction TB
        CoreAPI["Core API Service\n(Spring Boot)"]:::core
        Domain["Domain Layer\n(services, DTOs)"]:::core
        API["API Controllers & Config"]:::core
    end

    %% Shared Library
    SharedEnum["Shared Enums Library"]:::enum

    %% Persistence Layer
    subgraph "Data Persistence Layer" 
        direction TB
        Repository["Repositories & Entities"]:::storage
        MySQL[(MySQL Database)]:::external
    end

    %% Clients Module
    ClientExample["External Clients Layer\n(OpenFeign)"]:::client
    ExternalService[(External HTTP Service)]:::external

    %% Support Modules
    subgraph "Cross-Cutting Support"
        direction TB
        Logging["Logging Module"]:::support
        Monitoring["Monitoring Module"]:::support
    end

    %% Tests & Docs
    Tests["Testing & Documentation\n(Spring REST Docs)"]:::test

    %% Data Flows
    CoreAPI -->|"uses"| Domain
    CoreAPI -->|"exposes REST APIs"| API
    Domain -->|"persists via"| Repository
    Repository -->|"connects to"| MySQL
    CoreAPI -->|"calls client"| ClientExample
    ClientExample -->|"invokes"| ExternalService
    CoreAPI -->|"loads configs from"| Logging
    CoreAPI -->|"loads configs from"| Monitoring
    CoreAPI -->|"tested by"| Tests
    CoreAPI -->|"depends on"| SharedEnum
    ClientExample -->|"depends on"| SharedEnum

    %% Click Events
    click CoreAPI "https://github.com/team-dodn/spring-boot-kotlin-template/tree/main/core/core-api"
    click Domain "https://github.com/team-dodn/spring-boot-kotlin-template/tree/main/core/core-api/src/main/kotlin/io/dodn/springboot/core/domain"
    click API "https://github.com/team-dodn/spring-boot-kotlin-template/tree/main/core/core-api/src/main/kotlin/io/dodn/springboot/core/api"
    click SharedEnum "https://github.com/team-dodn/spring-boot-kotlin-template/tree/main/core/core-enum"
    click Repository "https://github.com/team-dodn/spring-boot-kotlin-template/tree/main/storage/db-core"
    click ClientExample "https://github.com/team-dodn/spring-boot-kotlin-template/tree/main/clients/client-example"
    click Logging "https://github.com/team-dodn/spring-boot-kotlin-template/tree/main/support/logging"
    click Monitoring "https://github.com/team-dodn/spring-boot-kotlin-template/tree/main/support/monitoring"
    click Tests "https://github.com/team-dodn/spring-boot-kotlin-template/tree/main/tests/api-docs"

    %% Styles
    classDef core fill:#D0E8FF,stroke:#003366,color:#003366,stroke-width:1px;
    classDef enum fill:#EAD1DC,stroke:#660033,color:#660033,stroke-width:1px;
    classDef storage fill:#FFE5CC,stroke:#CC5200,color:#CC5200,stroke-width:1px;
    classDef client fill:#D5E8D4,stroke:#267326,color:#267326,stroke-width:1px;
    classDef support fill:#FFF2CC,stroke:#996600,color:#996600,stroke-width:1px;
    classDef test fill:#F2F2F2,stroke:#666666,color:#666666,stroke-width:1px;
    classDef external fill:#FFFFFF,stroke:#666666,stroke-dasharray: 5 5,color:#666666,stroke-width:1px;
```
