# weigandf/notarization-objecthash architecture

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

- Interactive diagram: https://gitdiagram.com/weigandf/notarization-objecthash
- Repository: https://github.com/weigandf/notarization-objecthash

## Overview

##### Main Components

a. API Layer
- Two main controllers: ObjectHashController and ObjectRedactionController
- Their respective endpoints

b. Service Layer
- Four key services:
- ObjectHashImplementation
- ObjectRedactionImplementation
- EvaluateCommandsImplementation
- GenerateSaltsImplementation

c. Models Layer
- Request/Response Models
- Core Domain Models (ObjectHash and ObjectRedaction)

d. Utility Components
- Exception Handling
- Hex Conversion
- JToken Extensions

**[Client Applications]**
- ↓
**[API Gateway/Load Balancer]**
- ↓
**[ASP.NET Core Web API]**
- Controllers Layer
- Service Layer
- Models Layer
- Utils Layer

##### Specific Implementation Details

- Rectangles: Major system components
- Rounded rectangles: Controllers
- Hexagons: Services
- Ovals: Utility classes

- Blue: API/Controller layer
- Green: Service layer
- Yellow: Models
- Gray: Utilities
- Red: Exception handling components

##### Flow Representation

Following flows:
**Client → API Controllers**
- ↓
**Request Models → Service Layer**
- ↓
**Service Implementation → Domain Models**
- ↓
**Response Models → Client**

##### Important Elements to Highlight

a. Exception Handling Flow:
- How BaseException, BadRequestException, and NotFoundException are used
- ExceptionHandlerFilterAttribute in the flow

b. Model Transformations:
- Relationship between request/response models
- How ObjectHash and ObjectRedaction models interact with their respective services

##### Deployment Aspects

Deployment-related components:
- Docker container (reference Dockerfile)
- GitHub Actions workflows (test-staging, test-production, release-production)

For this specific project, focus on:
##### The testing and deployment pipeline

- Any abbreviations used

This will provide a comprehensive view of the system while maintaining clarity and usefulness for development and maintenance purposes.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        CL[Client Applications]
    end

    subgraph Gateway
        GW[API Gateway/Load Balancer]
    end

    subgraph "API Controllers"
        OHC["Object Hash Controller"]:::controller
        ORC["Object Redaction Controller"]:::controller
    end

    subgraph "Service Layer"
        OHS["Object Hash Service"]:::service
        ORS["Object Redaction Service"]:::service
        ECS["Evaluate Commands Service"]:::service
        GSS["Generate Salts Service"]:::service
    end

    subgraph "Models Layer"
        subgraph "Domain Models"
            OH["Object Hash"]:::model
            OR["Object Redaction"]:::model
        end
        
        subgraph "API Models"
            RM["Request Models"]:::model
            RSM["Response Models"]:::model
        end
    end

    subgraph "Utility Layer"
        EH["Exception Handler"]:::util
        HC["Hex Converter"]:::util
        JTE["JToken Extensions"]:::util
    end

    subgraph "Exception Handling"
        BE["Base Exception"]:::exception
        BRE["Bad Request Exception"]:::exception
        NFE["Not Found Exception"]:::exception
    end

    subgraph "Configuration"
        MC["Main Config"]:::config
        PC["Production Config"]:::config
    end

    subgraph "Deployment"
        DC["Docker Config"]:::deploy
        CICD["CI/CD Workflows"]:::deploy
    end

    CL --> GW
    GW --> OHC & ORC
    OHC & ORC --> RM
    RM --> OHS & ORS
    OHS & ORS --> ECS
    ECS --> GSS
    OHS & ORS --> OH & OR
    OH & OR --> RSM
    RSM --> OHC & ORC
    
    EH --> BE
    BE --> BRE & NFE
    
    classDef controller fill:#3498db
    classDef service fill:#2ecc71
    classDef model fill:#f1c40f
    classDef util fill:#95a5a6
    classDef exception fill:#e74c3c
    classDef config fill:#9b59b6
    classDef deploy fill:#34495e

    %% Click events for component mapping
    click OHC "https://github.com/weigandf/notarization-objecthash/blob/master/ObjectHashServer/src/Controllers/ObjectHashController.cs"
    click ORC "https://github.com/weigandf/notarization-objecthash/blob/master/ObjectHashServer/src/Controllers/ObjectRedactionController.cs"
    click OHS "https://github.com/weigandf/notarization-objecthash/blob/master/ObjectHashServer/src/Services/Implementations/ObjectHashImplementation.cs"
    click ORS "https://github.com/weigandf/notarization-objecthash/blob/master/ObjectHashServer/src/Services/Implementations/ObjectRedactionImplementation.cs"
    click ECS "https://github.com/weigandf/notarization-objecthash/blob/master/ObjectHashServer/src/Services/Implementations/EvaluateCommandsImplementation.cs"
    click GSS "https://github.com/weigandf/notarization-objecthash/blob/master/ObjectHashServer/src/Services/Implementations/GenerateSaltsImplementation.cs"
    click OH "https://github.com/weigandf/notarization-objecthash/blob/master/ObjectHashServer/src/Models/ObjectHash.cs"
    click OR "https://github.com/weigandf/notarization-objecthash/blob/master/ObjectHashServer/src/Models/ObjectRedaction.cs"
    click RM "https://github.com/weigandf/notarization-objecthash/tree/master/ObjectHashServer/src/Models/Api/Request"
    click RSM "https://github.com/weigandf/notarization-objecthash/tree/master/ObjectHashServer/src/Models/Api/Response"
    click EH "https://github.com/weigandf/notarization-objecthash/blob/master/ObjectHashServer/src/Utils/ExceptionHandlerFilterAttribute.cs"
    click HC "https://github.com/weigandf/notarization-objecthash/blob/master/ObjectHashServer/src/Utils/HexConverter.cs"
    click JTE "https://github.com/weigandf/notarization-objecthash/blob/master/ObjectHashServer/src/Models/Extensions/JTokenExtension.cs"
    click BE "https://github.com/weigandf/notarization-objecthash/blob/master/ObjectHashServer/src/Exceptions/BaseException.cs"
    click BRE "https://github.com/weigandf/notarization-objecthash/blob/master/ObjectHashServer/src/Exceptions/BadRequestException.cs"
    click NFE "https://github.com/weigandf/notarization-objecthash/blob/master/ObjectHashServer/src/Exceptions/NotFoundException.cs"
    click MC "https://github.com/weigandf/notarization-objecthash/blob/master/ObjectHashServer/src/appsettings.json"
    click PC "https://github.com/weigandf/notarization-objecthash/blob/master/ObjectHashServer/src/appsettings.Production.json"
    click DC "https://github.com/weigandf/notarization-objecthash/tree/master/Dockerfile"
    click CICD "https://github.com/weigandf/notarization-objecthash/tree/master/.github/workflows"
```
