# mohankumarsl2005/authenticationservice architecture

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

- Interactive diagram: https://gitdiagram.com/mohankumarsl2005/authenticationservice
- Repository: https://github.com/mohankumarsl2005/authenticationservice

## Overview

This is a Spring Boot authentication-service codebase. Its evident sign-in support path loads a user from persistence, then adapts the user and roles into Spring Security details. Separate service code provides JWT parsing/validation and refresh-token creation and expiry checks. The tree and excerpts contain no controller, security configuration, or substantive README, so the request entry point and wiring of token services are not established; those connections are intentionally omitted.

Main entry points: [`src/main/java/com/authService/Service/RefreshTokenService.java`](https://github.com/mohankumarsl2005/authenticationservice/blob/main/src/main/java/com/authService/Service/RefreshTokenService.java) (Refresh tokens), [`src/main/java/com/authService/Service/UserDetailServiceImp.java`](https://github.com/mohankumarsl2005/authenticationservice/blob/main/src/main/java/com/authService/Service/UserDetailServiceImp.java) (User lookup), [`src/main/java/com/authService/repository/UserRepository.java`](https://github.com/mohankumarsl2005/authenticationservice/blob/main/src/main/java/com/authService/repository/UserRepository.java) (User repository), [`src/main/java/com/authService/repository/RefreshTokenRepository.java`](https://github.com/mohankumarsl2005/authenticationservice/blob/main/src/main/java/com/authService/repository/RefreshTokenRepository.java) (Token repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity lookup"]
  node_userdetails["User lookup"]
  node_customdetails["Security user"]
  node_userrepo["User repository"]
end

subgraph group_tokens["Token services"]
  node_refreshservice["Refresh tokens"]
  node_jwtservice["JWT operations<br/>[JwtService.java]"]
  node_refreshtokrepo["Token repository"]
end

subgraph group_model["Identity model"]
  node_userinfo["User record<br/>[UserInfo.java]"]
  node_userrole["User roles<br/>[UserRole.java]"]
  node_refreshtoken["Refresh-token record<br/>[RefreshToken.java]"]
end

node_security(("Security framework"))
node_database[("Relational database")]

node_security -->|"loads user"| node_userdetails
node_userdetails -->|"looks up user"| node_userrepo
node_userdetails -->|"adapts user"| node_customdetails
node_userrepo -->|"reads users"| node_database
node_refreshservice -->|"looks up user"| node_userrepo
node_refreshservice -->|"saves token"| node_refreshtokrepo
node_refreshservice -->|"deletes expired"| node_refreshtokrepo
node_refreshtokrepo -->|"persists tokens"| node_database
node_userinfo -->|"has roles"| node_userrole
node_refreshtoken -->|"references user"| node_userinfo

click node_userdetails "https://github.com/mohankumarsl2005/authenticationservice/blob/main/src/main/java/com/authService/Service/UserDetailServiceImp.java"
click node_customdetails "https://github.com/mohankumarsl2005/authenticationservice/blob/main/src/main/java/com/authService/Service/CustomUserDetails.java"
click node_userrepo "https://github.com/mohankumarsl2005/authenticationservice/blob/main/src/main/java/com/authService/repository/UserRepository.java"
click node_refreshservice "https://github.com/mohankumarsl2005/authenticationservice/blob/main/src/main/java/com/authService/Service/RefreshTokenService.java"
click node_jwtservice "https://github.com/mohankumarsl2005/authenticationservice/blob/main/src/main/java/com/authService/Service/JwtService.java"
click node_refreshtokrepo "https://github.com/mohankumarsl2005/authenticationservice/blob/main/src/main/java/com/authService/repository/RefreshTokenRepository.java"
click node_userinfo "https://github.com/mohankumarsl2005/authenticationservice/blob/main/src/main/java/com/authService/entity/UserInfo.java"
click node_userrole "https://github.com/mohankumarsl2005/authenticationservice/blob/main/src/main/java/com/authService/entity/UserRole.java"
click node_refreshtoken "https://github.com/mohankumarsl2005/authenticationservice/blob/main/src/main/java/com/authService/entity/RefreshToken.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_userdetails,node_customdetails,node_userrepo toneBlue
class node_refreshservice,node_jwtservice,node_refreshtokrepo,node_database toneAmber
class node_userinfo,node_userrole,node_refreshtoken toneMint
class node_security toneIndigo
```

## Components

### Identity lookup

- [User lookup](https://github.com/mohankumarsl2005/authenticationservice/blob/main/src/main/java/com/authService/Service/UserDetailServiceImp.java): `src/main/java/com/authService/Service/UserDetailServiceImp.java`
- [Security user](https://github.com/mohankumarsl2005/authenticationservice/blob/main/src/main/java/com/authService/Service/CustomUserDetails.java): `src/main/java/com/authService/Service/CustomUserDetails.java`
- [User repository](https://github.com/mohankumarsl2005/authenticationservice/blob/main/src/main/java/com/authService/repository/UserRepository.java): `src/main/java/com/authService/repository/UserRepository.java`

### Token services

- [Refresh tokens](https://github.com/mohankumarsl2005/authenticationservice/blob/main/src/main/java/com/authService/Service/RefreshTokenService.java): `src/main/java/com/authService/Service/RefreshTokenService.java`
- [JWT operations](https://github.com/mohankumarsl2005/authenticationservice/blob/main/src/main/java/com/authService/Service/JwtService.java): `src/main/java/com/authService/Service/JwtService.java`
- [Token repository](https://github.com/mohankumarsl2005/authenticationservice/blob/main/src/main/java/com/authService/repository/RefreshTokenRepository.java): `src/main/java/com/authService/repository/RefreshTokenRepository.java`

### Identity model

- [User record](https://github.com/mohankumarsl2005/authenticationservice/blob/main/src/main/java/com/authService/entity/UserInfo.java): `src/main/java/com/authService/entity/UserInfo.java`
- [User roles](https://github.com/mohankumarsl2005/authenticationservice/blob/main/src/main/java/com/authService/entity/UserRole.java): `src/main/java/com/authService/entity/UserRole.java`
- [Refresh-token record](https://github.com/mohankumarsl2005/authenticationservice/blob/main/src/main/java/com/authService/entity/RefreshToken.java): `src/main/java/com/authService/entity/RefreshToken.java`

### Other components

- **Security framework**
- **Relational database**

## Connections

- Security framework → User lookup: loads user
- User lookup → User repository: looks up user
- User lookup → Security user: adapts user
- User repository → Relational database: reads users
- Refresh tokens → User repository: looks up user
- Refresh tokens → Token repository: saves token
- Refresh tokens → Token repository: deletes expired
- Token repository → Relational database: persists tokens
- User record → User roles: has roles
- Refresh-token record → User record: references user
