# speriyasamyind/spring-boot-lcs architecture

> Architecture diagram of the GitHub repository speriyasamyind/spring-boot-lcs, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/speriyasamyind/spring-boot-lcs
- Repository: https://github.com/speriyasamyind/spring-boot-lcs

## Overview

This is a small Spring Boot REST service for finding the longest common substring. Its documented user workflow is to submit inputs through REST or Swagger UI and receive a result; the README also advertises Actuator health and info endpoints. The source excerpts do not include application code, so internal dispatch and data-flow links are shown only as unverified dashed edges, rather than inferred as fact.

Main entry points: [`src/main/java/com/example/lcs/controller/LcsController.java`](https://github.com/speriyasamyind/spring-boot-lcs/blob/main/src/main/java/com/example/lcs/controller/LcsController.java) (LCS endpoint), [`src/main/java/com/example/lcs/exception/AppExceptionHandler.java`](https://github.com/speriyasamyind/spring-boot-lcs/blob/main/src/main/java/com/example/lcs/exception/AppExceptionHandler.java) (Exception handler), [`src/main/java/com/example/lcs/service/LcsService.java`](https://github.com/speriyasamyind/spring-boot-lcs/blob/main/src/main/java/com/example/lcs/service/LcsService.java) (LCS service), [`src/main/java/com/example/lcs/config/SwaggerConfig.java`](https://github.com/speriyasamyind/spring-boot-lcs/blob/main/src/main/java/com/example/lcs/config/SwaggerConfig.java) (Swagger config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application and API"]
  node_application["Spring Boot app"]
  node_controller["LCS endpoint<br/>[LcsController.java]"]
  node_input["Request DTO<br/>[LcsInput.java]"]
  node_output["Response DTO<br/>[LcsOutput.java]"]
  node_exception["Application exception<br/>[AppException.java]"]
  node_exception_handler["Exception handler"]
  node_exception_detail["Error detail DTO"]
end

subgraph group_logic["Substring computation"]
  node_service["LCS service<br/>[LcsService.java]"]
end

subgraph group_operations["API discovery and operations"]
  node_swagger["Swagger config<br/>[SwaggerConfig.java]"]
  node_actuator["Actuator endpoints"]
end

node_user(("API user"))

node_user -->|"submits REST request"| node_controller
node_controller -.->|"accepts input"| node_input
node_controller -.->|"invokes"| node_service
node_service -.->|"produces result"| node_output
node_user -->|"opens Swagger UI"| node_swagger
node_swagger -.->|"documents API"| node_controller
node_application -->|"exposes health and info"| node_actuator
node_exception_handler -.->|"formats errors"| node_exception_detail
node_exception_handler -.->|"handles"| node_exception

click node_application "https://github.com/speriyasamyind/spring-boot-lcs/blob/main/src/main/java/com/example/lcs/LcsApplication.java"
click node_controller "https://github.com/speriyasamyind/spring-boot-lcs/blob/main/src/main/java/com/example/lcs/controller/LcsController.java"
click node_input "https://github.com/speriyasamyind/spring-boot-lcs/blob/main/src/main/java/com/example/lcs/dto/LcsInput.java"
click node_output "https://github.com/speriyasamyind/spring-boot-lcs/blob/main/src/main/java/com/example/lcs/dto/LcsOutput.java"
click node_service "https://github.com/speriyasamyind/spring-boot-lcs/blob/main/src/main/java/com/example/lcs/service/LcsService.java"
click node_exception "https://github.com/speriyasamyind/spring-boot-lcs/blob/main/src/main/java/com/example/lcs/exception/AppException.java"
click node_exception_handler "https://github.com/speriyasamyind/spring-boot-lcs/blob/main/src/main/java/com/example/lcs/exception/AppExceptionHandler.java"
click node_exception_detail "https://github.com/speriyasamyind/spring-boot-lcs/blob/main/src/main/java/com/example/lcs/dto/ExceptionDetail.java"
click node_swagger "https://github.com/speriyasamyind/spring-boot-lcs/blob/main/src/main/java/com/example/lcs/config/SwaggerConfig.java"
click node_actuator "https://github.com/speriyasamyind/spring-boot-lcs/blob/main/src/main/resources/application.properties"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_application,node_controller,node_input,node_output,node_exception,node_exception_handler,node_exception_detail,node_user toneBlue
class node_service toneAmber
class node_swagger,node_actuator toneMint
```

## Components

### Application and API

- [Spring Boot app](https://github.com/speriyasamyind/spring-boot-lcs/blob/main/src/main/java/com/example/lcs/LcsApplication.java): `src/main/java/com/example/lcs/LcsApplication.java`
- [LCS endpoint](https://github.com/speriyasamyind/spring-boot-lcs/blob/main/src/main/java/com/example/lcs/controller/LcsController.java): `src/main/java/com/example/lcs/controller/LcsController.java`
- [Request DTO](https://github.com/speriyasamyind/spring-boot-lcs/blob/main/src/main/java/com/example/lcs/dto/LcsInput.java): `src/main/java/com/example/lcs/dto/LcsInput.java`
- [Response DTO](https://github.com/speriyasamyind/spring-boot-lcs/blob/main/src/main/java/com/example/lcs/dto/LcsOutput.java): `src/main/java/com/example/lcs/dto/LcsOutput.java`
- [Application exception](https://github.com/speriyasamyind/spring-boot-lcs/blob/main/src/main/java/com/example/lcs/exception/AppException.java): `src/main/java/com/example/lcs/exception/AppException.java`
- [Exception handler](https://github.com/speriyasamyind/spring-boot-lcs/blob/main/src/main/java/com/example/lcs/exception/AppExceptionHandler.java): `src/main/java/com/example/lcs/exception/AppExceptionHandler.java`
- [Error detail DTO](https://github.com/speriyasamyind/spring-boot-lcs/blob/main/src/main/java/com/example/lcs/dto/ExceptionDetail.java): `src/main/java/com/example/lcs/dto/ExceptionDetail.java`

### Substring computation

- [LCS service](https://github.com/speriyasamyind/spring-boot-lcs/blob/main/src/main/java/com/example/lcs/service/LcsService.java): `src/main/java/com/example/lcs/service/LcsService.java`

### API discovery and operations

- [Swagger config](https://github.com/speriyasamyind/spring-boot-lcs/blob/main/src/main/java/com/example/lcs/config/SwaggerConfig.java): `src/main/java/com/example/lcs/config/SwaggerConfig.java`
- [Actuator endpoints](https://github.com/speriyasamyind/spring-boot-lcs/blob/main/src/main/resources/application.properties): `src/main/resources/application.properties`

### Other components

- **API user**

## Connections

- API user → LCS endpoint: submits REST request (evidence: `README.md`)
- LCS endpoint → Request DTO: accepts input
- LCS endpoint → LCS service: invokes
- LCS service → Response DTO: produces result
- API user → Swagger config: opens Swagger UI (evidence: `README.md`)
- Swagger config → LCS endpoint: documents API
- Spring Boot app → Actuator endpoints: exposes health and info (evidence: `README.md`)
- Exception handler → Error detail DTO: formats errors
- Exception handler → Application exception: handles
