# sunlangorn/oauth2-authorization-code architecture

> Architecture diagram of the GitHub repository sunlangorn/oauth2-authorization-code, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sunlangorn/oauth2-authorization-code
- Repository: https://github.com/sunlangorn/oauth2-authorization-code

## Overview

The tree identifies a Spring-based client service, with presentation, application, domain, persistence, Elasticsearch, and shared-support code. Its likely user workflow is managing registered clients, but no README or source excerpts were provided, so runtime calls, data flow, and integrations cannot be verified. The graph therefore maps the visible responsibilities without asserting relationships between them.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Presentation"]
  node_controller["Client API"]
  node_httpmapper["HTTP Mapper"]
  node_httpmodels["HTTP Models"]
end

subgraph group_application["Application"]
  node_appservice["Application Service"]
  node_clientdto["Client DTO<br/>[ClientDTO.java]"]
  node_dtomapper["DTO Mapper"]
end

subgraph group_domain["Client Domain"]
  node_clientdomain["Client Model<br/>[Client.java]"]
  node_createrequest["Client Creation"]
  node_domainservice["Client Service<br/>[ClientService.java]"]
  node_domainrepo["Client Repository"]
  node_syncdomain["Search Sync Handler"]
end

subgraph group_infrastructure["Infrastructure"]
  node_jparepo["JPA Repository"]
  node_jpaentity["Database Mapping"]
  node_datasourcerepo["Datasource Adapter"]
  node_searchservice["Elasticsearch Service"]
  node_searchfacade["Search Facade"]
  node_searchdocument["Search Document"]
  node_syncaspect["Sync Aspect"]
  node_security["Security Config"]
end

subgraph group_shared["Shared Support"]
  node_jwt["JWT Service"]
  node_secrets["Secret Generator"]
  node_paging["Paging Responses"]
  node_errors["Exception Handler"]
  node_redirectvalidation["Redirect Validation"]
end

click node_controller "https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/presentation/controller/ClientController.java"
click node_httpmapper "https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/presentation/mapper/RegisteredClientHttpMapper.java"
click node_httpmodels "https://github.com/sunlangorn/oauth2-authorization-code/tree/main/src/main/java/com/example/clientservice/presentation/model"
click node_appservice "https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/application/service/ApplicationClientService.java"
click node_clientdto "https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/application/dto/ClientDTO.java"
click node_dtomapper "https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/application/mapper/ClientDtoMapper.java"
click node_clientdomain "https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/domain/entity/Client.java"
click node_createrequest "https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/domain/entity/ClientCreateRequest.java"
click node_domainservice "https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/domain/service/ClientService.java"
click node_domainrepo "https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/domain/repository/ClientRepository.java"
click node_syncdomain "https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/domain/handler/ClientElasticsearchSync.java"
click node_jparepo "https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/infrastructure/database/entity/JpaClientRepository.java"
click node_jpaentity "https://github.com/sunlangorn/oauth2-authorization-code/tree/main/src/main/java/com/example/clientservice/infrastructure/database/entity"
click node_datasourcerepo "https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/infrastructure/repository/DatasourceClientRepository.java"
click node_searchservice "https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/infrastructure/elasticsearch/ClientElasticsearchService.java"
click node_searchfacade "https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/infrastructure/elasticsearch/ClientElasticsearchServiceFacade.java"
click node_searchdocument "https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/infrastructure/elasticsearch/ClientElasticDocument.java"
click node_syncaspect "https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/infrastructure/elasticsearch/ClientSyncAspect.java"
click node_security "https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/infrastructure/config/SecurityConfig.java"
click node_jwt "https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/_shared/jwt/JwtTokenService.java"
click node_secrets "https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/_shared/generator/SecretGenerator.java"
click node_paging "https://github.com/sunlangorn/oauth2-authorization-code/tree/main/src/main/java/com/example/clientservice/_shared/paging"
click node_errors "https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/_shared/exception/GlobalExceptionHandler.java"
click node_redirectvalidation "https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/_shared/validator/RedirectUriValidator.java"

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_controller,node_httpmapper,node_httpmodels toneBlue
class node_appservice,node_clientdto,node_dtomapper toneAmber
class node_clientdomain,node_createrequest,node_domainservice,node_domainrepo,node_syncdomain toneMint
class node_jparepo,node_jpaentity,node_datasourcerepo,node_searchservice,node_searchfacade,node_searchdocument,node_syncaspect,node_security toneRose
class node_jwt,node_secrets,node_paging,node_errors,node_redirectvalidation toneIndigo
```

## Components

### Presentation

- [Client API](https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/presentation/controller/ClientController.java): `src/main/java/com/example/clientservice/presentation/controller/ClientController.java`
- [HTTP Mapper](https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/presentation/mapper/RegisteredClientHttpMapper.java): `src/main/java/com/example/clientservice/presentation/mapper/RegisteredClientHttpMapper.java`
- [HTTP Models](https://github.com/sunlangorn/oauth2-authorization-code/tree/main/src/main/java/com/example/clientservice/presentation/model): `src/main/java/com/example/clientservice/presentation/model`

### Application

- [Application Service](https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/application/service/ApplicationClientService.java): `src/main/java/com/example/clientservice/application/service/ApplicationClientService.java`
- [Client DTO](https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/application/dto/ClientDTO.java): `src/main/java/com/example/clientservice/application/dto/ClientDTO.java`
- [DTO Mapper](https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/application/mapper/ClientDtoMapper.java): `src/main/java/com/example/clientservice/application/mapper/ClientDtoMapper.java`

### Client Domain

- [Client Model](https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/domain/entity/Client.java): `src/main/java/com/example/clientservice/domain/entity/Client.java`
- [Client Creation](https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/domain/entity/ClientCreateRequest.java): `src/main/java/com/example/clientservice/domain/entity/ClientCreateRequest.java`
- [Client Service](https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/domain/service/ClientService.java): `src/main/java/com/example/clientservice/domain/service/ClientService.java`
- [Client Repository](https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/domain/repository/ClientRepository.java): `src/main/java/com/example/clientservice/domain/repository/ClientRepository.java`
- [Search Sync Handler](https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/domain/handler/ClientElasticsearchSync.java): `src/main/java/com/example/clientservice/domain/handler/ClientElasticsearchSync.java`

### Infrastructure

- [JPA Repository](https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/infrastructure/database/entity/JpaClientRepository.java): `src/main/java/com/example/clientservice/infrastructure/database/entity/JpaClientRepository.java`
- [Database Mapping](https://github.com/sunlangorn/oauth2-authorization-code/tree/main/src/main/java/com/example/clientservice/infrastructure/database/entity): `src/main/java/com/example/clientservice/infrastructure/database/entity`
- [Datasource Adapter](https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/infrastructure/repository/DatasourceClientRepository.java): `src/main/java/com/example/clientservice/infrastructure/repository/DatasourceClientRepository.java`
- [Elasticsearch Service](https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/infrastructure/elasticsearch/ClientElasticsearchService.java): `src/main/java/com/example/clientservice/infrastructure/elasticsearch/ClientElasticsearchService.java`
- [Search Facade](https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/infrastructure/elasticsearch/ClientElasticsearchServiceFacade.java): `src/main/java/com/example/clientservice/infrastructure/elasticsearch/ClientElasticsearchServiceFacade.java`
- [Search Document](https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/infrastructure/elasticsearch/ClientElasticDocument.java): `src/main/java/com/example/clientservice/infrastructure/elasticsearch/ClientElasticDocument.java`
- [Sync Aspect](https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/infrastructure/elasticsearch/ClientSyncAspect.java): `src/main/java/com/example/clientservice/infrastructure/elasticsearch/ClientSyncAspect.java`
- [Security Config](https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/infrastructure/config/SecurityConfig.java): `src/main/java/com/example/clientservice/infrastructure/config/SecurityConfig.java`

### Shared Support

- [JWT Service](https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/_shared/jwt/JwtTokenService.java): `src/main/java/com/example/clientservice/_shared/jwt/JwtTokenService.java`
- [Secret Generator](https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/_shared/generator/SecretGenerator.java): `src/main/java/com/example/clientservice/_shared/generator/SecretGenerator.java`
- [Paging Responses](https://github.com/sunlangorn/oauth2-authorization-code/tree/main/src/main/java/com/example/clientservice/_shared/paging): `src/main/java/com/example/clientservice/_shared/paging`
- [Exception Handler](https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/_shared/exception/GlobalExceptionHandler.java): `src/main/java/com/example/clientservice/_shared/exception/GlobalExceptionHandler.java`
- [Redirect Validation](https://github.com/sunlangorn/oauth2-authorization-code/blob/main/src/main/java/com/example/clientservice/_shared/validator/RedirectUriValidator.java): `src/main/java/com/example/clientservice/_shared/validator/RedirectUriValidator.java`
