# akshay-9189/sbwithjunit5 architecture

> Architecture diagram of the GitHub repository akshay-9189/sbwithjunit5, 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/akshay-9189/sbwithjunit5
- Repository: https://github.com/akshay-9189/sbwithjunit5

## Overview

This is a Spring Boot employee-record REST API. Its main workflow accepts and validates employee requests, converts DTO input into employee entities, delegates CRUD operations through the service and DAO layers, and persists records through Spring Data JPA. It also exposes employee-not-found and request-validation errors through a global response handler. The excerpts show the controller-to-service-to-DAO-to-repository calls; the datasource configuration and database wiring are not shown, so that connection is marked unverified.

Main entry points: [`src/main/java/com/csi/service/impl/EmployeeServiceImpl.java`](https://github.com/akshay-9189/sbwithjunit5/blob/main/src/main/java/com/csi/service/impl/EmployeeServiceImpl.java) (Employee service), [`src/main/java/com/csi/dao/impl/EmployeeDaoImpl.java`](https://github.com/akshay-9189/sbwithjunit5/blob/main/src/main/java/com/csi/dao/impl/EmployeeDaoImpl.java) (Employee DAO), [`src/main/java/com/csi/controller/EmployeeController.java`](https://github.com/akshay-9189/sbwithjunit5/blob/main/src/main/java/com/csi/controller/EmployeeController.java) (Employee endpoints), [`src/main/java/com/csi/repository/EmployeeRepository.java`](https://github.com/akshay-9189/sbwithjunit5/blob/main/src/main/java/com/csi/repository/EmployeeRepository.java) (JPA repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_app["Spring Boot app"]
  node_controller["Employee endpoints"]
  node_dto["Request DTO<br/>[EmployeeDTO.java]"]
  node_handler["Error responses"]
end

subgraph group_domain["Employee domain"]
  node_notfound["Not-found exception"]
  node_service["Employee service"]
  node_serviceapi["Service contract"]
  node_employee["Employee entity<br/>[Employee.java]"]
end

subgraph group_persistence["Persistence"]
  node_dao["Employee DAO"]
  node_daoapi["DAO contract<br/>[EmployeeDao.java]"]
  node_repository["JPA repository"]
  node_config["Datasource settings<br/>[application.yml]"]
end

node_client(("HTTP client"))
node_mysql[("MySQL")]

node_client -->|"sends requests"| node_controller
node_app -.->|"hosts endpoints"| node_controller
node_controller -->|"calls operations"| node_service
node_controller -->|"accepts input"| node_dto
node_controller -->|"uses contract"| node_serviceapi
node_service -->|"implements"| node_serviceapi
node_service -->|"calls operations"| node_dao
node_service -->|"maps input"| node_dto
node_service -->|"creates and updates"| node_employee
node_dao -->|"implements"| node_daoapi
node_dao -->|"calls queries"| node_repository
node_dao -->|"reads and writes"| node_employee
node_repository -->|"persists entity"| node_employee
node_dao -->|"throws on missing"| node_notfound
node_handler -->|"handles exception"| node_notfound
node_config -.->|"configures connection"| node_mysql
node_repository -.->|"queries database"| node_mysql

click node_app "https://github.com/akshay-9189/sbwithjunit5/blob/main/src/main/java/com/csi/SbJunit5Application.java"
click node_controller "https://github.com/akshay-9189/sbwithjunit5/blob/main/src/main/java/com/csi/controller/EmployeeController.java"
click node_dto "https://github.com/akshay-9189/sbwithjunit5/blob/main/src/main/java/com/csi/dto/EmployeeDTO.java"
click node_handler "https://github.com/akshay-9189/sbwithjunit5/blob/main/src/main/java/com/csi/exception/GlobalExceptionalHandler.java"
click node_notfound "https://github.com/akshay-9189/sbwithjunit5/blob/main/src/main/java/com/csi/exception/EmployeeNotFound.java"
click node_service "https://github.com/akshay-9189/sbwithjunit5/blob/main/src/main/java/com/csi/service/impl/EmployeeServiceImpl.java"
click node_serviceapi "https://github.com/akshay-9189/sbwithjunit5/blob/main/src/main/java/com/csi/service/EmployeeService.java"
click node_employee "https://github.com/akshay-9189/sbwithjunit5/blob/main/src/main/java/com/csi/model/Employee.java"
click node_dao "https://github.com/akshay-9189/sbwithjunit5/blob/main/src/main/java/com/csi/dao/impl/EmployeeDaoImpl.java"
click node_daoapi "https://github.com/akshay-9189/sbwithjunit5/blob/main/src/main/java/com/csi/dao/EmployeeDao.java"
click node_repository "https://github.com/akshay-9189/sbwithjunit5/blob/main/src/main/java/com/csi/repository/EmployeeRepository.java"
click node_config "https://github.com/akshay-9189/sbwithjunit5/blob/main/src/main/resources/application.yml"

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_app,node_controller,node_dto,node_handler,node_client toneBlue
class node_notfound,node_service,node_serviceapi,node_employee,node_mysql toneAmber
class node_dao,node_daoapi,node_repository,node_config toneMint
```

## Components

### HTTP API

- [Spring Boot app](https://github.com/akshay-9189/sbwithjunit5/blob/main/src/main/java/com/csi/SbJunit5Application.java): `src/main/java/com/csi/SbJunit5Application.java`
- [Employee endpoints](https://github.com/akshay-9189/sbwithjunit5/blob/main/src/main/java/com/csi/controller/EmployeeController.java): `src/main/java/com/csi/controller/EmployeeController.java`
- [Request DTO](https://github.com/akshay-9189/sbwithjunit5/blob/main/src/main/java/com/csi/dto/EmployeeDTO.java): `src/main/java/com/csi/dto/EmployeeDTO.java`
- [Error responses](https://github.com/akshay-9189/sbwithjunit5/blob/main/src/main/java/com/csi/exception/GlobalExceptionalHandler.java): `src/main/java/com/csi/exception/GlobalExceptionalHandler.java`

### Employee domain

- [Not-found exception](https://github.com/akshay-9189/sbwithjunit5/blob/main/src/main/java/com/csi/exception/EmployeeNotFound.java): `src/main/java/com/csi/exception/EmployeeNotFound.java`
- [Employee service](https://github.com/akshay-9189/sbwithjunit5/blob/main/src/main/java/com/csi/service/impl/EmployeeServiceImpl.java): `src/main/java/com/csi/service/impl/EmployeeServiceImpl.java`
- [Service contract](https://github.com/akshay-9189/sbwithjunit5/blob/main/src/main/java/com/csi/service/EmployeeService.java): `src/main/java/com/csi/service/EmployeeService.java`
- [Employee entity](https://github.com/akshay-9189/sbwithjunit5/blob/main/src/main/java/com/csi/model/Employee.java): `src/main/java/com/csi/model/Employee.java`

### Persistence

- [Employee DAO](https://github.com/akshay-9189/sbwithjunit5/blob/main/src/main/java/com/csi/dao/impl/EmployeeDaoImpl.java): `src/main/java/com/csi/dao/impl/EmployeeDaoImpl.java`
- [DAO contract](https://github.com/akshay-9189/sbwithjunit5/blob/main/src/main/java/com/csi/dao/EmployeeDao.java): `src/main/java/com/csi/dao/EmployeeDao.java`
- [JPA repository](https://github.com/akshay-9189/sbwithjunit5/blob/main/src/main/java/com/csi/repository/EmployeeRepository.java): `src/main/java/com/csi/repository/EmployeeRepository.java`
- [Datasource settings](https://github.com/akshay-9189/sbwithjunit5/blob/main/src/main/resources/application.yml): `src/main/resources/application.yml`

### Other components

- **HTTP client**
- **MySQL**

## Connections

- HTTP client → Employee endpoints: sends requests (evidence: `src/main/java/com/csi/controller/EmployeeController.java`)
- Spring Boot app → Employee endpoints: hosts endpoints
- Employee endpoints → Employee service: calls operations (evidence: `src/main/java/com/csi/controller/EmployeeController.java`)
- Employee endpoints → Request DTO: accepts input (evidence: `src/main/java/com/csi/controller/EmployeeController.java`)
- Employee endpoints → Service contract: uses contract (evidence: `src/main/java/com/csi/controller/EmployeeController.java`)
- Employee service → Service contract: implements (evidence: `src/main/java/com/csi/service/impl/EmployeeServiceImpl.java`)
- Employee service → Employee DAO: calls operations (evidence: `src/main/java/com/csi/service/impl/EmployeeServiceImpl.java`)
- Employee service → Request DTO: maps input (evidence: `src/main/java/com/csi/service/impl/EmployeeServiceImpl.java`)
- Employee service → Employee entity: creates and updates (evidence: `src/main/java/com/csi/service/impl/EmployeeServiceImpl.java`)
- Employee DAO → DAO contract: implements (evidence: `src/main/java/com/csi/dao/impl/EmployeeDaoImpl.java`)
- Employee DAO → JPA repository: calls queries (evidence: `src/main/java/com/csi/dao/impl/EmployeeDaoImpl.java`)
- Employee DAO → Employee entity: reads and writes (evidence: `src/main/java/com/csi/dao/impl/EmployeeDaoImpl.java`)
- JPA repository → Employee entity: persists entity (evidence: `src/main/java/com/csi/repository/EmployeeRepository.java`)
- Employee DAO → Not-found exception: throws on missing (evidence: `src/main/java/com/csi/dao/impl/EmployeeDaoImpl.java`)
- Error responses → Not-found exception: handles exception (evidence: `src/main/java/com/csi/exception/GlobalExceptionalHandler.java`)
- Datasource settings → MySQL: configures connection
- JPA repository → MySQL: queries database
