# temporalio/samples-java architecture

> Architecture diagram of the GitHub repository temporalio/samples-java, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/temporalio/samples-java
- Repository: https://github.com/temporalio/samples-java

## Overview

##### Main Components Identification

The system consists of three main modules:
- Core Module (Temporal SDK Features)
- SpringBoot Module (Full Integration)
- SpringBoot Basic Module (Minimal Integration)

**┌─────────────────────────────────────────────────────────────┐**
- Temporal Java SDK Samples                   │
- ┬─────────────────────┬──────────────────────┤
- Core Module  │  SpringBoot Module  │ SpringBoot Basic     │
- ┴─────────────────────┴──────────────────────┘

##### Detailed Component Breakdown

Core Module:
**┌─────────────────────────────────────────┐**
- Core Samples                            │
- ┬───────────────────────┤
- Hello Samples   │ Scenario Samples      │
- ┼───────────────────────┤
- API Demos       │ Infrastructure        │
- ┴───────────────────────┘

SpringBoot Integration:
**┌─────────────────────────────────────────┐**
- SpringBoot Integration                  │
- ┬───────────────────────┤
- Web Layer       │ Service Layer         │
- ┼───────────────────────┤
- Temporal Client │ External Integrations │
- ┴───────────────────────┘

##### Important Elements

- Temporal Server Connection
- Task Queues
- Workflow State Management
- Error Handling Patterns
- Monitoring & Metrics
- Security Components (SSL/mTLS)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph SDK["Temporal Java SDK Samples"]
        direction TB
        
        subgraph Core["Core Module"]
            direction TB
            HelloSamples["Hello Samples"]:::core
            APIDemos["API Demos"]:::core
            Infrastructure["Infrastructure"]:::core
            
            subgraph CoreComponents["Core Components"]
                Workflows[("Workflows")]:::workflow
                Activities[("Activities")]:::activity
                Workers[("Workers")]:::worker
            end
            
            HelloSamples --> CoreComponents
            APIDemos --> CoreComponents
            Infrastructure --> CoreComponents
        end
        
        subgraph SpringBoot["SpringBoot Module"]
            direction TB
            WebLayer["Web Controller"]:::web
            ServiceLayer["Service Layer"]:::service
            
            subgraph Integrations["External Integrations"]
                KafkaInt["Kafka Integration"]:::integration
                CamelInt["Camel Integration"]:::integration
            end
            
            subgraph Monitoring["Monitoring & Metrics"]
                Metrics["Metrics System"]:::monitoring
                Actuator["Actuator"]:::monitoring
            end
            
            WebLayer --> ServiceLayer
            ServiceLayer --> Integrations
            ServiceLayer --> Monitoring
        end
        
        subgraph SpringBootBasic["SpringBoot Basic Module"]
            direction TB
            BasicController["Web Controller"]:::web
            BasicIntegration["Basic Integration"]:::service
            
            BasicController --> BasicIntegration
        end
        
        subgraph Security["Security Components"]
            SSL["SSL/mTLS"]:::security
        end
    end
    
    %% Click Events
    click HelloSamples "https://github.com/temporalio/samples-java/tree/main/core/src/main/java/io/temporal/samples/hello/"
    click APIDemos "https://github.com/temporalio/samples-java/tree/main/core/src/main/java/io/temporal/samples/metrics/"
    click Infrastructure "https://github.com/temporalio/samples-java/tree/main/core/src/main/java/io/temporal/samples/ssl/"
    click WebLayer "https://github.com/temporalio/samples-java/blob/main/springboot/src/main/java/io/temporal/samples/springboot/SamplesController.java"
    click KafkaInt "https://github.com/temporalio/samples-java/tree/main/springboot/src/main/java/io/temporal/samples/springboot/kafka/"
    click CamelInt "https://github.com/temporalio/samples-java/tree/main/springboot/src/main/java/io/temporal/samples/springboot/camel/"
    click Metrics "https://github.com/temporalio/samples-java/tree/main/springboot/src/main/java/io/temporal/samples/springboot/metrics/"
    click Actuator "https://github.com/temporalio/samples-java/tree/main/springboot/src/main/java/io/temporal/samples/springboot/actuator/"
    click BasicController "https://github.com/temporalio/samples-java/blob/main/springboot-basic/src/main/java/io/temporal/samples/springboot/SamplesController.java"
    click BasicIntegration "https://github.com/temporalio/samples-java/tree/main/springboot-basic/src/main/java/io/temporal/samples/springboot/hello/"
    click SSL "https://github.com/temporalio/samples-java/tree/main/core/src/main/java/io/temporal/samples/ssl/"
    
    %% Styling
    classDef core fill:#2196F3,stroke:#1565C0,color:white
    classDef workflow fill:#4CAF50,stroke:#388E3C,color:white
    classDef activity fill:#8BC34A,stroke:#689F38,color:white
    classDef worker fill:#FFC107,stroke:#FFA000,color:black
    classDef web fill:#9C27B0,stroke:#7B1FA2,color:white
    classDef service fill:#3F51B5,stroke:#303F9F,color:white
    classDef integration fill:#FF9800,stroke:#F57C00,color:white
    classDef monitoring fill:#009688,stroke:#00796B,color:white
    classDef security fill:#F44336,stroke:#D32F2F,color:white
    
    %% Legend
    subgraph Legend
        L1["Core Component"]:::core
        L2["Workflow"]:::workflow
        L3["Activity"]:::activity
        L4["Worker"]:::worker
        L5["Web Layer"]:::web
        L6["Service Layer"]:::service
        L7["Integration"]:::integration
        L8["Monitoring"]:::monitoring
        L9["Security"]:::security
    end
```
