# rahulkharapkar/inofficemarketplace architecture

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

- Interactive diagram: https://gitdiagram.com/rahulkharapkar/inofficemarketplace
- Repository: https://github.com/rahulkharapkar/inofficemarketplace

## Overview

##### Main Components

A. Application Layers (Use vertical layering):
- Controllers Layer (Entry point)
- Service Layer (Business Logic)
- Repository Layer (Data Access)
- Model Layer (Domain Objects)

B. External Systems:
- MySQL Database
- Security Components
- API Documentation (Swagger)

**┌─ Client Tier ─────────────────────────┐**
- Web Browsers / API Clients            │
- ┬────────────────────┘
- ↓
**┌─ API Layer ──────────────────────────────────────────┐**
- OpenAPI/Swagger (OpenAPIConfiguration)               │
- Controllers:                                         │
- EmployeeController    - RequirementController      │
- OfferController      - ResourceController          │
- ProposalController   - UserController              │
- ┬────────────────────────────────┬──┘
- ↓                                │
**┌─ Security Layer ─────────────────┐               │**
- SecurityConfig                   │               │
- ┬──────────────────┘               │
- ↓                                   ↓
**┌─ Service Layer ──────────────────────────────────┐**
- Business Logic:                                  │
- EmployeeService    - RequirementService        │
- OfferService      - ResourceService            │
- ProposalService   - UserService                │
- ┬────────────────────────────┬──┘
- ↓                            ↓
**┌─ Repository Layer ────────────────────────────────┐**
- Data Access:                                      │
- EmployeeRepository    - RequirementRepository   │
- OfferRepository      - ResourceRepository       │
- ProposalRepository   - UserRepository           │
- ┬────────────────────────────────┘
- ↓
**┌─ Database ──────────────────────────┐**
- MySQL Database                      │
- ┘

##### Important Elements to Highlight

A. Cross-Cutting Concerns:
- Exception Handling (InvalidEmployeeException, etc.)
- Configuration (JasyptEncryptorConfig)
- Utilities (ConstantRepo, RequestValidation)

B. Domain Models:
- Employee
- Offer
- Proposal
- Requirement
- Resource
- User

##### Key Interactions to Illustrate

- Authentication flow through the security layer
- CRUD operations flow from controller to database
- Exception handling paths
- API documentation generation flow

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Client
        Browser["Web Browsers / API Clients"]:::client
    end

    subgraph API
        OpenAPI["OpenAPI/Swagger"]:::api
        click OpenAPI "https://github.com/rahulkharapkar/InOfficeMarketplace/blob/master/src/main/java/com/rk/iom/util/OpenAPIConfiguration.java"
        
        subgraph Controllers
            EC["EmployeeController"]:::controller
            click EC "https://github.com/rahulkharapkar/InOfficeMarketplace/blob/master/src/main/java/com/rk/iom/controller/EmployeeController.java"
            OC["OfferController"]:::controller
            click OC "https://github.com/rahulkharapkar/InOfficeMarketplace/blob/master/src/main/java/com/rk/iom/controller/OfferController.java"
            PC["ProposalController"]:::controller
            click PC "https://github.com/rahulkharapkar/InOfficeMarketplace/blob/master/src/main/java/com/rk/iom/controller/ProposalController.java"
            RQC["RequirementController"]:::controller
            click RQC "https://github.com/rahulkharapkar/InOfficeMarketplace/blob/master/src/main/java/com/rk/iom/controller/RequirementController.java"
            RC["ResourceController"]:::controller
            click RC "https://github.com/rahulkharapkar/InOfficeMarketplace/blob/master/src/main/java/com/rk/iom/controller/ResourceController.java"
            UC["UserController"]:::controller
            click UC "https://github.com/rahulkharapkar/InOfficeMarketplace/blob/master/src/main/java/com/rk/iom/controller/UserController.java"
        end
    end

    subgraph Security
        SC["SecurityConfig"]:::security
        click SC "https://github.com/rahulkharapkar/InOfficeMarketplace/blob/master/src/main/java/com/rk/iom/config/SecurityConfig.java"
    end

    subgraph Services
        ES["EmployeeService"]:::service
        click ES "https://github.com/rahulkharapkar/InOfficeMarketplace/blob/master/src/main/java/com/rk/iom/service/EmployeeService.java"
        OS["OfferService"]:::service
        click OS "https://github.com/rahulkharapkar/InOfficeMarketplace/blob/master/src/main/java/com/rk/iom/service/OfferService.java"
        PS["ProposalService"]:::service
        click PS "https://github.com/rahulkharapkar/InOfficeMarketplace/blob/master/src/main/java/com/rk/iom/service/ProposalService.java"
        RQS["RequirementService"]:::service
        click RQS "https://github.com/rahulkharapkar/InOfficeMarketplace/blob/master/src/main/java/com/rk/iom/service/RequirementService.java"
        RS["ResourceService"]:::service
        click RS "https://github.com/rahulkharapkar/InOfficeMarketplace/blob/master/src/main/java/com/rk/iom/service/ResourceService.java"
        US["UserService"]:::service
        click US "https://github.com/rahulkharapkar/InOfficeMarketplace/blob/master/src/main/java/com/rk/iom/service/UserService.java"
    end

    subgraph Repositories
        ER["EmployeeRepository"]:::repository
        click ER "https://github.com/rahulkharapkar/InOfficeMarketplace/blob/master/src/main/java/com/rk/iom/repository/EmployeeRepository.java"
        OR["OfferRepository"]:::repository
        click OR "https://github.com/rahulkharapkar/InOfficeMarketplace/blob/master/src/main/java/com/rk/iom/repository/OfferRepository.java"
        PR["ProposalRepository"]:::repository
        click PR "https://github.com/rahulkharapkar/InOfficeMarketplace/blob/master/src/main/java/com/rk/iom/repository/ProposalRepository.java"
        RQR["RequirementRepository"]:::repository
        click RQR "https://github.com/rahulkharapkar/InOfficeMarketplace/blob/master/src/main/java/com/rk/iom/repository/RequirementRepository.java"
        RR["ResourceRepository"]:::repository
        click RR "https://github.com/rahulkharapkar/InOfficeMarketplace/blob/master/src/main/java/com/rk/iom/repository/ResourceRepository.java"
        UR["UserRepository"]:::repository
        click UR "https://github.com/rahulkharapkar/InOfficeMarketplace/blob/master/src/main/java/com/rk/iom/repository/UserRepository.java"
    end

    subgraph Models
        EM["Employee"]:::model
        click EM "https://github.com/rahulkharapkar/InOfficeMarketplace/blob/master/src/main/java/com/rk/iom/model/Employee.java"
        OM["Offer"]:::model
        click OM "https://github.com/rahulkharapkar/InOfficeMarketplace/blob/master/src/main/java/com/rk/iom/model/Offer.java"
        PM["Proposal"]:::model
        click PM "https://github.com/rahulkharapkar/InOfficeMarketplace/blob/master/src/main/java/com/rk/iom/model/Proposal.java"
        RQM["Requirement"]:::model
        click RQM "https://github.com/rahulkharapkar/InOfficeMarketplace/blob/master/src/main/java/com/rk/iom/model/Requirement.java"
        RM["Resource"]:::model
        click RM "https://github.com/rahulkharapkar/InOfficeMarketplace/blob/master/src/main/java/com/rk/iom/model/Resource.java"
        UM["User"]:::model
        click UM "https://github.com/rahulkharapkar/InOfficeMarketplace/blob/master/src/main/java/com/rk/iom/model/User.java"
    end

    subgraph Config
        JC["JasyptEncryptorConfig"]:::config
        click JC "https://github.com/rahulkharapkar/InOfficeMarketplace/blob/master/src/main/java/com/rk/iom/config/JasyptEncryptorConfig.java"
        AppConfig["Application Configs"]:::config
        click AppConfig "https://github.com/rahulkharapkar/InOfficeMarketplace/blob/master/src/main/resources/application.yml"
    end

    subgraph Utils
        CR["ConstantRepo"]:::util
        click CR "https://github.com/rahulkharapkar/InOfficeMarketplace/blob/master/src/main/java/com/rk/iom/util/ConstantRepo.java"
        RV["RequestValidation"]:::util
        click RV "https://github.com/rahulkharapkar/InOfficeMarketplace/blob/master/src/main/java/com/rk/iom/util/RequestValidation.java"
    end

    subgraph Exceptions
        EX["Exception Handlers"]:::exception
        click EX "https://github.com/rahulkharapkar/InOfficeMarketplace/tree/master/src/main/java/com/rk/iom/exception"
    end

    DB[(MySQL Database)]:::database

    Browser --> OpenAPI
    Browser --> Controllers
    
    Controllers --> SC
    SC --> Services
    
    Services --> Repositories
    Services --> Models
    
    Repositories --> DB
    Repositories --> Models
    
    Utils --> Services
    Config --> Services
    
    Services --> EX

    classDef client fill:#E1F5FE,stroke:#01579B
    classDef api fill:#E8F5E9,stroke:#2E7D32
    classDef controller fill:#B3E5FC,stroke:#0288D1
    classDef service fill:#C8E6C9,stroke:#388E3C
    classDef repository fill:#FFE0B2,stroke:#F57C00
    classDef model fill:#F8BBD0,stroke:#C2185B
    classDef security fill:#FFCDD2,stroke:#D32F2F
    classDef config fill:#E1BEE7,stroke:#7B1FA2
    classDef util fill:#D1C4E9,stroke:#512DA8
    classDef exception fill:#FFCCBC,stroke:#E64A19
    classDef database fill:#CFD8DC,stroke:#455A64
```
