# ashraf20001/spring-boot-study architecture

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

- Interactive diagram: https://gitdiagram.com/ashraf20001/spring-boot-study
- Repository: https://github.com/ashraf20001/spring-boot-study

## Overview

##### Main Components Structure
a) REST API Service (01-rest-api-starting-code)
b) Basic Web Application (basicwebApp)
c) LDAP Authentication Service (ldap)
d) AOP Learning Module (learn-spring-aop)
e) Email Scheduler Service (email-schedular)

##### Core Components

a) REST API Service:
- Controllers Layer (HelloWorld, Todo, JWT Authentication)
- Service Layer (TodoService)
- Repository Layer (JPA Repositories)
- Security Components (JWT Configuration)
- Domain Models (Todo, User)

b) LDAP Service:
- Authentication Controller
- Security Layer (JWT + LDAP)
- User Management
- Repository Layer

c) AOP Module:
- Aspect Configurations
- Business Layer
- Data Layer
- Functional Programming Components

##### Interaction Flows
- HTTP request flows through controllers
- Service layer interactions
- Database operations
- Authentication flows
- AOP cross-cutting concerns

##### Specific Implementation Details

a) Security Flow:
- Client -> JWT Filter -> Authentication Controller -> LDAP/Security Service -> JWT Token Generation

b) REST API Flow:
- Client -> Controller -> Service Layer -> Repository -> Database

c) AOP Structure:
- Aspects -> Business Logic -> Data Access

##### Technical Specifications
- Spring Boot framework
- JPA/Hibernate
- JWT Authentication
- LDAP Integration
- Spring AOP
- Email Scheduling

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph REST_API_Service
        HC["HelloWorld Controller"]:::controller
        TC["Todo Controller"]:::controller
        JAC["JWT Auth Controller"]:::security
        TS["Todo Service"]:::service
        TJPA["Todo JPA Repository"]:::repository
        JSC["JWT Security Config"]:::security
        TM["Todo Model"]:::model
        DB1[(Database)]:::database
    end

    subgraph LDAP_Service
        AC["Auth Controller"]:::controller
        SC["Security Config"]:::security
        JU["JWT Utils"]:::security
        US["User Service"]:::service
        LR["LDAP Repository"]:::repository
        DB2[(LDAP Store)]:::database
    end

    subgraph AOP_Module
        ASP["Aspect Configurations"]:::aspect
        BL["Business Layer"]:::service
        DL["Data Layer"]:::repository
        FP["Functional Programming"]:::service
        DB3[(Database)]:::database
    end

    subgraph Email_Scheduler
        ES["Email Service"]:::service
        ST["Scheduler Tasks"]:::service
        DB4[(Email Store)]:::database
    end

    %% REST API Service Flows
    Client1-->HC
    Client1-->TC
    Client1-->JAC
    TC-->TS
    TS-->TJPA
    TJPA-->DB1
    JAC-->JSC

    %% LDAP Service Flows
    Client2-->AC
    AC-->SC
    SC-->JU
    AC-->US
    US-->LR
    LR-->DB2

    %% AOP Module Flows
    ASP-.->BL
    ASP-.->DL
    BL-->DL
    DL-->DB3
    ASP-.->FP

    %% Email Scheduler Flows
    ST-->ES
    ES-->DB4

    %% Click Events
    click HC "https://github.com/Ashraf20001/spring-boot-study/blob/main/01-rest-api-starting-code/src/main/java/com/rest/webservices/restfulwebservices/helloworld/HelloWorldController.java"
    click TC "https://github.com/Ashraf20001/spring-boot-study/blob/main/01-rest-api-starting-code/src/main/java/com/rest/webservices/restfulwebservices/todo/TodoController.java"
    click JAC "https://github.com/Ashraf20001/spring-boot-study/blob/main/01-rest-api-starting-code/src/main/java/com/rest/webservices/restfulwebservices/jwt/JwtAuthenticationController.java"
    click TJPA "https://github.com/Ashraf20001/spring-boot-study/blob/main/01-rest-api-starting-code/src/main/java/com/rest/webservices/restfulwebservices/todo/TodoJPARepository.java"
    click JSC "https://github.com/Ashraf20001/spring-boot-study/blob/main/01-rest-api-starting-code/src/main/java/com/rest/webservices/restfulwebservices/jwt/JwtSecurityConfig.java"
    click TM "https://github.com/Ashraf20001/spring-boot-study/blob/main/01-rest-api-starting-code/src/main/java/com/rest/webservices/restfulwebservices/todo/Todo.java"
    click AC "https://github.com/Ashraf20001/spring-boot-study/blob/main/ldap/ldap/src/main/java/com/demo/ldap/controller/AuthController.java"
    click SC "https://github.com/Ashraf20001/spring-boot-study/blob/main/ldap/ldap/src/main/java/com/demo/ldap/security/SecurityConfig.java"
    click JU "https://github.com/Ashraf20001/spring-boot-study/blob/main/ldap/ldap/src/main/java/com/demo/ldap/utils/JwtUtils.java"
    click US "https://github.com/Ashraf20001/spring-boot-study/blob/main/ldap/ldap/src/main/java/com/demo/ldap/service/UserService.java"
    click LR "https://github.com/Ashraf20001/spring-boot-study/blob/main/ldap/ldap/src/main/java/com/demo/ldap/sql/repository/LdapRepository.java"
    click ASP "https://github.com/Ashraf20001/spring-boot-study/tree/main/learn-spring-aop/learn-spring-aop/src/main/java/com/demo/learnspringaop/aspects"
    click BL "https://github.com/Ashraf20001/spring-boot-study/tree/main/learn-spring-aop/learn-spring-aop/src/main/java/com/demo/learnspringaop/business"
    click DL "https://github.com/Ashraf20001/spring-boot-study/tree/main/learn-spring-aop/learn-spring-aop/src/main/java/com/demo/learnspringaop/datalayer"
    click FP "https://github.com/Ashraf20001/spring-boot-study/tree/main/learn-spring-aop/learn-spring-aop/src/main/java/com/demo/learnspringaop/functional"

    %% Styling
    classDef controller fill:#2196F3,stroke:#000,stroke-width:1px;
    classDef service fill:#4CAF50,stroke:#000,stroke-width:1px;
    classDef repository fill:#607D8B,stroke:#000,stroke-width:1px;
    classDef security fill:#FFC107,stroke:#000,stroke-width:1px;
    classDef database fill:#9E9E9E,stroke:#000,stroke-width:1px;
    classDef model fill:#E91E63,stroke:#000,stroke-width:1px;
    classDef aspect fill:#FF5722,stroke:#000,stroke-width:1px;

    %% Legend
    subgraph Legend
        L1["Controller"]:::controller
        L2["Service"]:::service
        L3["Repository"]:::repository
        L4["Security"]:::security
        L5["Database"]:::database
        L6["Model"]:::model
        L7["Aspect"]:::aspect
    end
```
