# yashpatel-250702/bitlabs-application-be architecture

> Architecture diagram of the GitHub repository yashpatel-250702/bitlabs-application-be, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yashpatel-250702/bitlabs-application-be
- Repository: https://github.com/yashpatel-250702/bitlabs-application-be

## Overview

##### And Define Main Components
- External Clients: Represent the front-end (web/mobile clients or any other user interfaces) as the entry point that makes RESTful API calls to the backend.
- Service Layer: Represent the business logic with a “Services” block where you have classes like ApplicantProfileService, JobService, EmailService, ZohoAuthService, and others. This is where business rules and orchestration happen.
- Data Access / Repository Layer: Illustrate a DAO or repository block that handles database interactions with entities (for example, Applicant, CompanyProfile, Job, etc.). The repositories (like ApplicantRepository, JobRepository, etc.) connect the service layer with the underlying database.
- Database & Persistence: Although not explicitly visible in the file tree other than configuration (DatabaseConfig), add a “Database” component to show where persistent data resides.
- External Integrations:
- AWS Secrets Manager: Indicate this service as a component from which configuration secrets are retrieved (see AwsSecretsManagerUtil.java).
- RabbitMQ: Add a messaging component to show asynchronous messaging or event handling (linked with RabbitMQConfig.java).
- Payment Gateway: Include an integration component for Razorpay (RazorpayConfig.java, RazorPayService, RazorPayController).
- Email Service: You might also show an email delivery component linked via EmailConfigure/EmailService.
- Zoho Integration: Include ZohoAuthService, ZohoCRMService, and ZohoService as a block representing connections to Zoho CRM (or similar external systems).

##### Internal Architectural Layers and Their Interactions
- At the top, show the External Clients interacting with the API Layer (Controllers).
- That configuration components (found under the config package) initialize components like security (SpringSecurityConfiguration, JwtRequestFilter) and integration setups (RabbitMQConfig, RazorpayConfig, etc.).

- API / Controllers (perhaps a light blue),
- Services (green),
- Repositories and Data layer (orange),
- Utility and configuration components as side-notes or sub-components within the main application.

##### Architectural Patterns
- Model-View-Controller (MVC) pattern. Though there isn’t a full-fledged front-end in the file tree (apart from static resources for images), the design still clearly segregates Controllers, Services, and Repository layers.
- Use of cross-cutting concerns like AOP by marking the presence of aspects (e.g., AspectAop.java) for logging, caching, or security.
- Message-driven interactions (RabbitMQ) to denote asynchronous processing when handling operations or notifications.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Level 1: External Clients
    EC["External Clients"]:::external

    %% Level 2: Docker Container
    DC["Docker Container"]:::utility

    %% Level 3: API Layer / Controllers
    subgraph "API Layer / Controllers"
        CT1["REST Controllers\n(ApplicantProfile,Job,Register)"]:::controllers
        CT2["RazorPayController"]:::controllers
        CT3["ZohoController"]:::controllers
        CT4["HealthController"]:::controllers
    end

    %% Level 4: Service Layer
    subgraph "Service Layer"
        S1["Core Business Services"]:::services
        S2["RazorPayService"]:::services
        S3["EmailService"]:::services
        S4a["ZohoAuthService"]:::services
        S4b["ZohoCRMService"]:::services
        S4c["ZohoService"]:::services
        S5["HealthCheckService"]:::services
        S6["HealthCheckScheduler"]:::services
    end

    %% Level 5: Repository Layer and Database
    subgraph "Data Access Layer"
        R1["Repositories"]:::repository
        D["Database"]:::repository
    end

    %% External Integrations
    subgraph "External Integrations"
        EX1["AWS Secrets Manager"]:::external
        EX2["RabbitMQ Broker"]:::external
        EX3["RazorpayConfig"]:::external
        EX4["EmailConfigure"]:::external
        EX5["Zoho Integration Endpoint"]:::external
    end

    %% Supporting Utility Components
    subgraph "Utility Components"
        U1["AspectAop"]:::utility
        U2["MultipartFileUtils"]:::utility
        U3["Applicant Profile Images"]:::utility
    end

    %% Security Configuration
    subgraph "Security"
        SEC1["SpringSecurityConfiguration"]:::security
        SEC2["JwtRequestFilter"]:::security
    end

    %% Connections from External Clients to Docker Container to Controllers
    EC --> DC
    DC --> CT1
    DC --> CT2
    DC --> CT3
    DC --> CT4

    %% Controllers call Service Layer
    CT1 -->|"calls"| S1
    CT2 -->|"calls"| S2
    CT3 -->|"calls"| S4a
    CT3 -->|"calls"| S4b
    CT3 -->|"calls"| S4c
    CT4 -->|"calls"| S5

    %% Service Layer interactions
    S1 -->|"uses"| R1
    R1 -->|"persists to"| D

    %% Service Layer calling External Integrations
    S1 -->|"config lookup"| EX1
    S1 -->|"pub/sub"| EX2
    S2 -->|"payment config"| EX3
    S3 -->|"email config"| EX4
    S4a -->|"zoho call"| EX5
    S4b -->|"zoho call"| EX5
    S4c -->|"zoho call"| EX5

    %% HealthCheck components internal interaction
    S5 -->|"schedules"| S6

    %% Controllers interacting with Security
    CT1 --- SEC1
    CT1 --- SEC2
    CT2 --- SEC1
    CT2 --- SEC2
    CT3 --- SEC1
    CT3 --- SEC2
    CT4 --- SEC1
    CT4 --- SEC2

    %% Utility usage (dashed connections indicate cross-cutting concerns)
    S1 --- U1
    S2 --- U1
    S3 --- U1
    S4a --- U1
    S4b --- U1
    S4c --- U1
    S5 --- U1
    S6 --- U1
    S1 --- U2

    %% Click Events
    click CT1 "https://github.com/yashpatel-250702/bitlabs-application-be/tree/main/src/main/java/com/talentstream/controller"
    click CT2 "https://github.com/yashpatel-250702/bitlabs-application-be/blob/main/src/main/java/com/talentstream/controller/RazorPayController.java"
    click CT3 "https://github.com/yashpatel-250702/bitlabs-application-be/blob/main/src/main/java/com/talentstream/controller/ZohoController.java"
    click CT4 "https://github.com/yashpatel-250702/bitlabs-application-be/blob/main/src/main/java/com/talentstream/controller/HealthController.java"
    click S1 "https://github.com/yashpatel-250702/bitlabs-application-be/tree/main/src/main/java/com/talentstream/service"
    click S2 "https://github.com/yashpatel-250702/bitlabs-application-be/blob/main/src/main/java/com/talentstream/service/RazorPayService.java"
    click S3 "https://github.com/yashpatel-250702/bitlabs-application-be/blob/main/src/main/java/com/talentstream/service/EmailService.java"
    click S4a "https://github.com/yashpatel-250702/bitlabs-application-be/blob/main/src/main/java/com/talentstream/service/ZohoAuthService.java"
    click S4b "https://github.com/yashpatel-250702/bitlabs-application-be/blob/main/src/main/java/com/talentstream/service/ZohoCRMService.java"
    click S4c "https://github.com/yashpatel-250702/bitlabs-application-be/blob/main/src/main/java/com/talentstream/service/ZohoService.java"
    click S5 "https://github.com/yashpatel-250702/bitlabs-application-be/blob/main/src/main/java/com/talentstream/healthcheck/HealthCheckService.java"
    click S6 "https://github.com/yashpatel-250702/bitlabs-application-be/blob/main/src/main/java/com/talentstream/healthcheck/HealthCheckScheduler.java"
    click R1 "https://github.com/yashpatel-250702/bitlabs-application-be/tree/main/src/main/java/com/talentstream/repository"
    click D "https://github.com/yashpatel-250702/bitlabs-application-be/blob/main/src/main/java/com/talentstream/config/DatabaseConfig.java"
    click EX1 "https://github.com/yashpatel-250702/bitlabs-application-be/blob/main/src/main/java/com/talentstream/AwsSecretsManagerUtil.java"
    click EX2 "https://github.com/yashpatel-250702/bitlabs-application-be/blob/main/src/main/java/com/talentstream/config/RabbitMQConfig.java"
    click EX3 "https://github.com/yashpatel-250702/bitlabs-application-be/blob/main/src/main/java/com/talentstream/config/RazorpayConfig.java"
    click EX4 "https://github.com/yashpatel-250702/bitlabs-application-be/blob/main/src/main/java/com/talentstream/config/EmailConfigure.java"
    click U1 "https://github.com/yashpatel-250702/bitlabs-application-be/blob/main/src/main/java/com/talentstream/aop/AspectAop.java"
    click U2 "https://github.com/yashpatel-250702/bitlabs-application-be/blob/main/src/main/java/com/talentstream/util/MultipartFileUtils.java"
    click U3 "https://github.com/yashpatel-250702/bitlabs-application-be/tree/main/applicantprofileimages"
    click SEC1 "https://github.com/yashpatel-250702/bitlabs-application-be/blob/main/src/main/java/com/talentstream/config/SpringSecurityConfiguration.java"
    click SEC2 "https://github.com/yashpatel-250702/bitlabs-application-be/blob/main/src/main/java/com/talentstream/filter/JwtRequestFilter.java"

    %% Styles
    classDef controllers fill:#add8e6,stroke:#000,stroke-width:1px
    classDef services fill:#90ee90,stroke:#000,stroke-width:1px
    classDef repository fill:#ffa500,stroke:#000,stroke-width:1px
    classDef external fill:#d3d3d3,stroke:#000,stroke-width:1px
    classDef utility fill:#ffff99,stroke:#000,stroke-width:1px
    classDef security fill:#ffb6c1,stroke:#000,stroke-width:1px
```
