# ebubekiryzc/recapproject architecture

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

- Interactive diagram: https://gitdiagram.com/ebubekiryzc/recapproject
- Repository: https://github.com/ebubekiryzc/recapproject

## Overview

##### Main Architectural Components

a) Presentation Layer:
- WebAPI (REST API endpoints)
- ConsoleUI (Development/Testing interface)

b) Business Layer:
- Business Logic
- Validation Rules
- Authentication/Authorization
- Cross-cutting Concerns

c) Data Access Layer:
- Entity Framework Implementation
- In-Memory Repository Implementation

d) Core Layer:
- Base Classes and Interfaces
- Utilities
- Cross-cutting Concerns
- Security Infrastructure

##### Component Relationships

a) Top Level (Client Interaction):
- REST API Controllers (WebAPI)
- Authentication Controller
- Resource Controllers (Cars, Rentals, etc.)

b) Business Services Layer:
- Service Interfaces (ICarService, IRentalService, etc.)
- Concrete Managers (CarManager, RentalManager, etc.)
- Business Rules
- Validation Rules

c) Data Access Layer:
- Repository Interfaces (ICarDal, IRentalDal, etc.)
- Entity Framework Implementations
- In-Memory Implementations
- Database Context

d) Cross-cutting Concerns:
- Caching
- Validation
- Authentication/Authorization
- Exception Handling
- Transaction Management

##### Specific Elements

a) Components:
- Controllers (Purple rectangles)
- Business Services (Blue rectangles)
- Data Access Repositories (Green rectangles)
- Entities (Yellow rectangles)
- Cross-cutting Concerns (Orange hexagons)

b) Connections:

##### Important Architectural Patterns to Highlight

- Repository Pattern (data access layer)
- Factory Pattern (for creating instances)
- Aspect-Oriented Programming (cross-cutting concerns)

##### Key Technologies

- .NET Core
- Entity Framework Core
- Autofac (IoC Container)
- JWT Authentication
- FluentValidation
- Memory Cache

##### Additional Details

Specialized components:
- File Operations (CarImage handling)
- Payment Processing
- Credit Card Management
- Customer Management

##### Notes Section

Notes explaining:
- Security implementation
- Caching strategy
- Transaction management
- Error handling approach

Remember to emphasize the N-Layer architecture pattern and how each layer communicates only with adjacent layers through well-defined interfaces.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Client Layer"
        API[REST API Controllers]
        Console[Console UI]
    end

    subgraph "Business Layer"
        BServices[Business Services]
        BInterfaces[Service Interfaces]
        VRules[Validation Rules]
        BRules[Business Rules]
    end

    subgraph "Data Access Layer"
        EFRepo[Entity Framework Repos]
        InMemRepo[In-Memory Repos]
        RepoInterfaces[Repository Interfaces]
        DB[(Database)]
    end

    subgraph "Core Layer"
        subgraph "Security"
            Auth[Authentication]
            JWT[JWT Handler]
        end

        subgraph "Cross-cutting Concerns"
            Cache[Caching]
            ExHandler[Exception Handling]
            Trans[Transaction Management]
            Perf[Performance Monitor]
        end

        subgraph "Utilities"
            DI[Dependency Injection]
            FileOps[File Operations]
        end
    end

    subgraph "Entity Layer"
        Entities[Entity Models]
        DTOs[Data Transfer Objects]
    end

    %% Relationships
    API --> BServices
    Console --> BServices
    BServices --> BInterfaces
    BServices --> VRules
    BServices --> BRules
    BServices --> RepoInterfaces
    EFRepo --> RepoInterfaces
    InMemRepo --> RepoInterfaces
    EFRepo --> DB
    BServices --> Auth
    Auth --> JWT
    BServices --> Cache
    BServices --> Trans
    API --> ExHandler
    BServices --> FileOps
    BServices --> Perf
    RepoInterfaces --> Entities
    API --> DTOs

    %% Styling
    classDef controller fill:#9370DB
    classDef business fill:#4682B4
    classDef data fill:#3CB371
    classDef entity fill:#FFD700
    classDef core fill:#FFA500
    classDef utility fill:#20B2AA

    %% Apply styles
    class API,Console controller
    class BServices,BInterfaces,VRules,BRules business
    class EFRepo,InMemRepo,RepoInterfaces data
    class Entities,DTOs entity
    class Auth,JWT,Cache,ExHandler,Trans,Perf core
    class DI,FileOps utility

    %% Click events
    click API "https://github.com/Ebubekiryzc/ReCapProject/tree/master/WebAPI/Controllers/"
    click Console "https://github.com/Ebubekiryzc/ReCapProject/tree/master/ConsoleUI/"
    click BServices "https://github.com/Ebubekiryzc/ReCapProject/tree/master/Business/Concrete/"
    click BInterfaces "https://github.com/Ebubekiryzc/ReCapProject/tree/master/Business/Abstract/"
    click VRules "https://github.com/Ebubekiryzc/ReCapProject/tree/master/Business/ValidationRules/FluentValidation/"
    click BRules "https://github.com/Ebubekiryzc/ReCapProject/blob/master/Core/Utilities/Business/BusinessRules.cs"
    click EFRepo "https://github.com/Ebubekiryzc/ReCapProject/tree/master/DataAccess/Concrete/EntityFramework/"
    click InMemRepo "https://github.com/Ebubekiryzc/ReCapProject/tree/master/DataAccess/Concrete/InMemory/"
    click RepoInterfaces "https://github.com/Ebubekiryzc/ReCapProject/tree/master/DataAccess/Abstract/"
    click Auth "https://github.com/Ebubekiryzc/ReCapProject/tree/master/Core/Utilities/Security/"
    click JWT "https://github.com/Ebubekiryzc/ReCapProject/tree/master/Core/Utilities/Security/JWT/"
    click Cache "https://github.com/Ebubekiryzc/ReCapProject/tree/master/Core/CrossCuttingConcerns/Caching/"
    click ExHandler "https://github.com/Ebubekiryzc/ReCapProject/blob/master/Core/Extensions/ExceptionMiddleware.cs"
    click Trans "https://github.com/Ebubekiryzc/ReCapProject/tree/master/Core/Aspects/Autofac/Transaction/"
    click Perf "https://github.com/Ebubekiryzc/ReCapProject/tree/master/Core/Aspects/Autofac/Performance/"
    click DI "https://github.com/Ebubekiryzc/ReCapProject/tree/master/Core/Utilities/IoC/"
    click FileOps "https://github.com/Ebubekiryzc/ReCapProject/blob/master/Core/Utilities/Helpers/FileHelper.cs"
    click Entities "https://github.com/Ebubekiryzc/ReCapProject/tree/master/Entities/Concrete/"
    click DTOs "https://github.com/Ebubekiryzc/ReCapProject/tree/master/Entities/DTOs/"
```
