# yildiraygemuk/logisticoperationapi architecture

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

- Interactive diagram: https://gitdiagram.com/yildiraygemuk/logisticoperationapi
- Repository: https://github.com/yildiraygemuk/logisticoperationapi

## Overview

##### Main Components

a. API Layer (Entry Point)
- LogisticCompany.API
- Controllers for different entities (Vehicle, Maintenance, User, etc.)
- Authentication/Authorization handling

b. Business Layer
- Business logic implementation
- Service interfaces and implementations
- AutoMapper profiles
- Validation aspects

c. Data Access Layer
- Entity Framework Core context
- Repositories
- Database configurations
- Migrations

d. Core Layer
- Cross-cutting concerns
- Security implementations
- Logging infrastructure
- Generic repository patterns
- Result patterns

e. Entity Layer
- Domain models
- DTOs
- View Models

**[Mobile Clients] ←→ [Web Portal]**
- ↓             ↓
- [API Gateway Layer]
- ↓
**[Authentication/Authorization]**
- ↓
- [Business Layer]
- ↓
- [Data Access Layer]
- ↓
- [Database Layer]

##### Component Relationships

- REST API calls between clients and API
- Service calls between layers
- Database operations
- Cross-cutting concern interactions

##### Specific Implementation Details

- JWT Authentication (shown in Core/Security)
- AutoFac Dependency Injection
- Entity Framework Core
- SeriLog implementation
- AutoMapper profiles

##### Additional Elements

- Maintenance workflow
- Vehicle management
- User management
- Reporting system

##### Technical Specifications

Annotations for:
- .NET 6.0 framework
- Entity Framework Core
- AutoFac
- JWT Authentication
- SeriLog
- AutoMapper

##### Cross-Cutting Concerns

Horizontal layers for:
- Exception handling
- Logging
- Validation
- Authentication
- Authorization

##### The scalable data access layer with Entity Framework Core

Remember to:
- Keep components loosely coupled
- Clear boundaries between layers
- Security boundaries
- Notes for important architectural decisions

This system design should reflect the project's focus on maintenance process management through mobile devices while providing comprehensive reporting capabilities through the web portal.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Clients
        Mobile[Mobile Clients]:::client
        Web[Web Portal]:::client
    end

    subgraph "API Gateway Layer"
        API[API Gateway]:::api
        click API "https://github.com/Yildiraygemuk/LogisticOperationAPI/tree/main/LogisticCompany.API/Controllers/"
        Controllers[Controllers]:::api
        click Controllers "https://github.com/Yildiraygemuk/LogisticOperationAPI/tree/main/LogisticCompany.API/Controllers/"
    end

    subgraph "Security Layer"
        Auth[Authentication/Authorization]:::security
        click Auth "https://github.com/Yildiraygemuk/LogisticOperationAPI/tree/main/LogisticCompany.Core/Middleware/Jwt/"
        JWT[JWT Implementation]:::security
        click JWT "https://github.com/Yildiraygemuk/LogisticOperationAPI/tree/main/LogisticCompany.Core/Utilities/Security/Jwt/"
        Encrypt[Encryption]:::security
        click Encrypt "https://github.com/Yildiraygemuk/LogisticOperationAPI/tree/main/LogisticCompany.Core/Utilities/Security/Encryption/"
    end

    subgraph "Business Layer"
        Services[Service Implementations]:::business
        click Services "https://github.com/Yildiraygemuk/LogisticOperationAPI/tree/main/LogisticCompany.Business/Concrete/"
        ServiceInterfaces[Service Interfaces]:::business
        click ServiceInterfaces "https://github.com/Yildiraygemuk/LogisticOperationAPI/tree/main/LogisticCompany.Business/Abstract/"
        AutoMapperProfiles[AutoMapper Profiles]:::business
        click AutoMapperProfiles "https://github.com/Yildiraygemuk/LogisticOperationAPI/tree/main/LogisticCompany.Business/Profile/"
    end

    subgraph "Cross-Cutting Concerns"
        Logging[Logging System]:::infra
        click Logging "https://github.com/Yildiraygemuk/LogisticOperationAPI/tree/main/LogisticCompany.Core/CrossCuttingConcerns/Logging/"
        SeriLog[SeriLog Implementation]:::infra
        click SeriLog "https://github.com/Yildiraygemuk/LogisticOperationAPI/tree/main/LogisticCompany.Core/CrossCuttingConcerns/Logging/SeriLog/"
        Validation[Validation]:::infra
        click Validation "https://github.com/Yildiraygemuk/LogisticOperationAPI/tree/main/LogisticCompany.Core/CrossCuttingConcerns/Validation/"
        Results[Result Patterns]:::infra
        click Results "https://github.com/Yildiraygemuk/LogisticOperationAPI/tree/main/LogisticCompany.Core/Utilities/Results/"
    end

    subgraph "Data Access Layer"
        EFContext[EF Context]:::data
        click EFContext "https://github.com/Yildiraygemuk/LogisticOperationAPI/blob/main/LogisticCompany.DataAccess/Concrete/Contexts/LogisticContext.cs"
        Repositories[Repositories]:::data
        click Repositories "https://github.com/Yildiraygemuk/LogisticOperationAPI/tree/main/LogisticCompany.DataAccess/Concrete/Repository/"
        DBConfig[Database Configurations]:::data
        click DBConfig "https://github.com/Yildiraygemuk/LogisticOperationAPI/tree/main/LogisticCompany.DataAccess/Concrete/Configuration/"
        GenericRepo[Generic Repository]:::data
        click GenericRepo "https://github.com/Yildiraygemuk/LogisticOperationAPI/tree/main/LogisticCompany.Core/DataAccess/"
    end

    subgraph "Entity Layer"
        DomainModels[Domain Models]:::entity
        click DomainModels "https://github.com/Yildiraygemuk/LogisticOperationAPI/tree/main/LogisticCompany/Entity/"
        DTOs[DTOs]:::entity
        click DTOs "https://github.com/Yildiraygemuk/LogisticOperationAPI/tree/main/LogisticCompany/Dto/"
        ViewModels[View Models]:::entity
        click ViewModels "https://github.com/Yildiraygemuk/LogisticOperationAPI/tree/main/LogisticCompany/Vm/"
    end

    Database[(Database)]:::database

    Mobile & Web --> API
    API --> Controllers
    Controllers --> Auth
    Auth --> JWT
    JWT --> Encrypt
    Auth --> Services
    Services --> ServiceInterfaces
    Services --> AutoMapperProfiles
    Services --> Repositories
    Repositories --> GenericRepo
    Repositories --> EFContext
    EFContext --> DBConfig
    EFContext --> Database
    Services --> DomainModels
    Services --> DTOs
    Services --> ViewModels
    
    %% Cross-cutting concern connections
    Services --> Logging
    Logging --> SeriLog
    Services --> Validation
    Services --> Results

    %% Styling
    classDef client fill:#2196F3,stroke:#1565C0,color:white
    classDef api fill:#4CAF50,stroke:#2E7D32,color:white
    classDef security fill:#FFC107,stroke:#FFA000,color:black
    classDef business fill:#FF9800,stroke:#F57C00,color:white
    classDef infra fill:#9E9E9E,stroke:#616161,color:white
    classDef data fill:#FF5722,stroke:#E64A19,color:white
    classDef entity fill:#673AB7,stroke:#512DA8,color:white
    classDef database fill:#795548,stroke:#5D4037,color:white
```
