# pavankumarpk2234/abc-retail-system architecture

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

- Interactive diagram: https://gitdiagram.com/pavankumarpk2234/abc-retail-system
- Repository: https://github.com/pavankumarpk2234/abc-retail-system

## Overview

This is a Spring-based authentication service for retail accounts. Its visible core workflow accepts registration, login, refresh-token, and profile requests; application services apply account and credential rules, use the user repository, and issue or validate JWTs where shown. The source tree also identifies password-management, email, admin, and request-security subsystems, but their implementations were not sampled, so their internal flows are not asserted. Dashed links indicate plausible wiring that the available excerpts do not verify.

Main entry points: [`authentication-service/src/main/java/com/abcretail/authentication_service/presentation/controller/AuthenticationController.java`](https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/presentation/controller/AuthenticationController.java) (Auth endpoints), [`authentication-service/src/main/java/com/abcretail/authentication_service/domain/repository/UserRepository.java`](https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/domain/repository/UserRepository.java) (User repository port), [`authentication-service/src/main/java/com/abcretail/authentication_service/application/usecase/refresh/RefreshTokenService.java`](https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/application/usecase/refresh/RefreshTokenService.java) (Token refresh), [`authentication-service/src/main/java/com/abcretail/authentication_service/application/usecase/login/LoginUserService.java`](https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/application/usecase/login/LoginUserService.java) (Login)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API layer"]
  node_authcontroller["Auth endpoints"]
  node_admin["Admin endpoints"]
end

subgraph group_flows["Account workflows"]
  node_register["Registration"]
  node_login["Login"]
  node_refresh["Token refresh"]
  node_profile["User profile"]
  node_password["Password management"]
  node_user["User domain<br/>[User.java]"]
end

subgraph group_security["Identity security"]
  node_jwtprovider["JWT provider"]
  node_jwtvalidator["JWT validator"]
  node_jwtfilter["JWT request filter"]
  node_securityconfig["Security configuration"]
  node_userdetails["User details loader"]
end

subgraph group_storage["User persistence"]
  node_repoport["User repository port"]
  node_repoimpl["Repository adapter"]
  node_jpa["JPA repository"]
  node_entity["User entity<br/>[UserEntity.java]"]
  node_database[("User database")]
end

subgraph group_support["Account support"]
  node_email["Email delivery"]
  node_errors["Exception mapping"]
end

node_client(("API client"))

node_client -->|"sends requests"| node_authcontroller
node_authcontroller -->|"registers via"| node_register
node_authcontroller -->|"authenticates via"| node_login
node_authcontroller -->|"refreshes via"| node_refresh
node_authcontroller -->|"loads via"| node_profile
node_authcontroller -->|"delegates password actions"| node_password
node_register -->|"checks and saves"| node_repoport
node_login -->|"looks up user"| node_repoport
node_login -->|"generates tokens"| node_jwtprovider
node_refresh -->|"validates token"| node_jwtvalidator
node_refresh -->|"loads user"| node_repoport
node_refresh -->|"issues access token"| node_jwtprovider
node_profile -->|"loads user"| node_repoport
node_userdetails -->|"loads account"| node_repoport
node_repoimpl -.->|"delegates persistence"| node_jpa
node_jpa -->|"uses entity"| node_entity
node_jpa -.->|"reads and writes"| node_database
node_jwtfilter -.->|"loads identity"| node_userdetails
node_securityconfig -.->|"configures filter"| node_jwtfilter
node_password -.->|"may send messages"| node_email

click node_authcontroller "https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/presentation/controller/AuthenticationController.java"
click node_admin "https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/presentation/controller/AdminController.java"
click node_register "https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/application/usecase/register/RegisterUserService.java"
click node_login "https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/application/usecase/login/LoginUserService.java"
click node_refresh "https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/application/usecase/refresh/RefreshTokenService.java"
click node_profile "https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/application/usecase/profile/GetUserProfileService.java"
click node_password "https://github.com/pavankumarpk2234/abc-retail-system/tree/main/authentication-service/src/main/java/com/abcretail/authentication_service/application/usecase"
click node_user "https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/domain/model/User.java"
click node_repoport "https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/domain/repository/UserRepository.java"
click node_repoimpl "https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/infrastructure/persistence/repository/UserRepositoryImpl.java"
click node_jpa "https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/infrastructure/persistence/repository/JpaUserRepository.java"
click node_entity "https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/infrastructure/persistence/entity/UserEntity.java"
click node_jwtprovider "https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/infrastructure/security/jwt/JwtTokenProvider.java"
click node_jwtvalidator "https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/infrastructure/security/jwt/JwtTokenValidator.java"
click node_jwtfilter "https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/infrastructure/security/filter/JwtAuthenticationFilter.java"
click node_securityconfig "https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/infrastructure/security/config/SecurityConfig.java"
click node_userdetails "https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/infrastructure/security/userdetails/CustomUserDetailsService.java"
click node_email "https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/infrastructure/email/EmailServiceImpl.java"
click node_errors "https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/presentation/advice/GlobalExceptionHandler.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_authcontroller,node_admin,node_client toneBlue
class node_register,node_login,node_refresh,node_profile,node_password,node_user toneAmber
class node_jwtprovider,node_jwtvalidator,node_jwtfilter,node_securityconfig,node_userdetails toneMint
class node_repoport,node_repoimpl,node_jpa,node_entity,node_database toneRose
class node_email,node_errors toneIndigo
```

## Components

### API layer

- [Auth endpoints](https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/presentation/controller/AuthenticationController.java): `authentication-service/src/main/java/com/abcretail/authentication_service/presentation/controller/AuthenticationController.java`
- [Admin endpoints](https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/presentation/controller/AdminController.java): `authentication-service/src/main/java/com/abcretail/authentication_service/presentation/controller/AdminController.java`

### Account workflows

- [Registration](https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/application/usecase/register/RegisterUserService.java): `authentication-service/src/main/java/com/abcretail/authentication_service/application/usecase/register/RegisterUserService.java`
- [Login](https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/application/usecase/login/LoginUserService.java): `authentication-service/src/main/java/com/abcretail/authentication_service/application/usecase/login/LoginUserService.java`
- [Token refresh](https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/application/usecase/refresh/RefreshTokenService.java): `authentication-service/src/main/java/com/abcretail/authentication_service/application/usecase/refresh/RefreshTokenService.java`
- [User profile](https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/application/usecase/profile/GetUserProfileService.java): `authentication-service/src/main/java/com/abcretail/authentication_service/application/usecase/profile/GetUserProfileService.java`
- [Password management](https://github.com/pavankumarpk2234/abc-retail-system/tree/main/authentication-service/src/main/java/com/abcretail/authentication_service/application/usecase): `authentication-service/src/main/java/com/abcretail/authentication_service/application/usecase`
- [User domain](https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/domain/model/User.java): `authentication-service/src/main/java/com/abcretail/authentication_service/domain/model/User.java`

### Identity security

- [JWT provider](https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/infrastructure/security/jwt/JwtTokenProvider.java): `authentication-service/src/main/java/com/abcretail/authentication_service/infrastructure/security/jwt/JwtTokenProvider.java`
- [JWT validator](https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/infrastructure/security/jwt/JwtTokenValidator.java): `authentication-service/src/main/java/com/abcretail/authentication_service/infrastructure/security/jwt/JwtTokenValidator.java`
- [JWT request filter](https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/infrastructure/security/filter/JwtAuthenticationFilter.java): `authentication-service/src/main/java/com/abcretail/authentication_service/infrastructure/security/filter/JwtAuthenticationFilter.java`
- [Security configuration](https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/infrastructure/security/config/SecurityConfig.java): `authentication-service/src/main/java/com/abcretail/authentication_service/infrastructure/security/config/SecurityConfig.java`
- [User details loader](https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/infrastructure/security/userdetails/CustomUserDetailsService.java): `authentication-service/src/main/java/com/abcretail/authentication_service/infrastructure/security/userdetails/CustomUserDetailsService.java`

### User persistence

- [User repository port](https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/domain/repository/UserRepository.java): `authentication-service/src/main/java/com/abcretail/authentication_service/domain/repository/UserRepository.java`
- [Repository adapter](https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/infrastructure/persistence/repository/UserRepositoryImpl.java): `authentication-service/src/main/java/com/abcretail/authentication_service/infrastructure/persistence/repository/UserRepositoryImpl.java`
- [JPA repository](https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/infrastructure/persistence/repository/JpaUserRepository.java): `authentication-service/src/main/java/com/abcretail/authentication_service/infrastructure/persistence/repository/JpaUserRepository.java`
- [User entity](https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/infrastructure/persistence/entity/UserEntity.java): `authentication-service/src/main/java/com/abcretail/authentication_service/infrastructure/persistence/entity/UserEntity.java`
- **User database**

### Account support

- [Email delivery](https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/infrastructure/email/EmailServiceImpl.java): `authentication-service/src/main/java/com/abcretail/authentication_service/infrastructure/email/EmailServiceImpl.java`
- [Exception mapping](https://github.com/pavankumarpk2234/abc-retail-system/blob/main/authentication-service/src/main/java/com/abcretail/authentication_service/presentation/advice/GlobalExceptionHandler.java): `authentication-service/src/main/java/com/abcretail/authentication_service/presentation/advice/GlobalExceptionHandler.java`

### Other components

- **API client**

## Connections

- API client → Auth endpoints: sends requests (evidence: `authentication-service/src/main/java/com/abcretail/authentication_service/presentation/controller/AuthenticationController.java`)
- Auth endpoints → Registration: registers via (evidence: `authentication-service/src/main/java/com/abcretail/authentication_service/presentation/controller/AuthenticationController.java`)
- Auth endpoints → Login: authenticates via (evidence: `authentication-service/src/main/java/com/abcretail/authentication_service/presentation/controller/AuthenticationController.java`)
- Auth endpoints → Token refresh: refreshes via (evidence: `authentication-service/src/main/java/com/abcretail/authentication_service/presentation/controller/AuthenticationController.java`)
- Auth endpoints → User profile: loads via (evidence: `authentication-service/src/main/java/com/abcretail/authentication_service/presentation/controller/AuthenticationController.java`)
- Auth endpoints → Password management: delegates password actions (evidence: `authentication-service/src/main/java/com/abcretail/authentication_service/presentation/controller/AuthenticationController.java`)
- Registration → User repository port: checks and saves (evidence: `authentication-service/src/main/java/com/abcretail/authentication_service/application/usecase/register/RegisterUserService.java`)
- Login → User repository port: looks up user (evidence: `authentication-service/src/main/java/com/abcretail/authentication_service/application/usecase/login/LoginUserService.java`)
- Login → JWT provider: generates tokens (evidence: `authentication-service/src/main/java/com/abcretail/authentication_service/application/usecase/login/LoginUserService.java`)
- Token refresh → JWT validator: validates token (evidence: `authentication-service/src/main/java/com/abcretail/authentication_service/application/usecase/refresh/RefreshTokenService.java`)
- Token refresh → User repository port: loads user (evidence: `authentication-service/src/main/java/com/abcretail/authentication_service/application/usecase/refresh/RefreshTokenService.java`)
- Token refresh → JWT provider: issues access token (evidence: `authentication-service/src/main/java/com/abcretail/authentication_service/application/usecase/refresh/RefreshTokenService.java`)
- User profile → User repository port: loads user (evidence: `authentication-service/src/main/java/com/abcretail/authentication_service/application/usecase/profile/GetUserProfileService.java`)
- User details loader → User repository port: loads account (evidence: `authentication-service/src/main/java/com/abcretail/authentication_service/infrastructure/security/userdetails/CustomUserDetailsService.java`)
- Repository adapter → JPA repository: delegates persistence (evidence: `authentication-service/src/main/java/com/abcretail/authentication_service/infrastructure/persistence/repository/UserRepositoryImpl.java`)
- JPA repository → User entity: uses entity (evidence: `authentication-service/src/main/java/com/abcretail/authentication_service/infrastructure/persistence/repository/JpaUserRepository.java`)
- JPA repository → User database: reads and writes
- JWT request filter → User details loader: loads identity (evidence: `authentication-service/src/main/java/com/abcretail/authentication_service/infrastructure/security/filter/JwtAuthenticationFilter.java`)
- Security configuration → JWT request filter: configures filter
- Password management → Email delivery: may send messages
