# yazan26/projectmap architecture

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

- Interactive diagram: https://gitdiagram.com/yazan26/projectmap
- Repository: https://github.com/yazan26/projectmap

## Overview

##### Main Components
- Web API Entry Point: Represent the initialization via Program.cs and Startup configuration (including settings loaded from appsettings.json and appsettings.Development.json).
- Controllers: Include AccountController, Environment2DController, Object2DController, WeatherForecastController. These components manage incoming HTTP requests, perform routing, and delegate to services.
- Services Layer: Show the authentication service (e.g., AspNetIdentityAuthenticationService) and any business logic services. This layer implements interfaces (IAuthentiticationService) to abstract authentication and authorization logic.
- Repository/Data Access Layer: Highlight the repositories – Environment2DRepository and Object2DRepository – that implement their respective interfaces (IEnvironment2DRepository, IObject2DRepository). They are responsible for interacting with the database using Dapper.
- Models/Domain Layer: Include the domain Entities or Models such as Environment2D and Object2D, which encapsulate the data structures that are passed between layers.

##### Relationships and Interactions
- That the API controllers are the front face of your application, receiving requests and forwarding them to appropriate services.
- Services layer which contains application logic (e.g., authentication) that in turn calls the repository layer.
- Repositories to the database to indicate data persistence and retrieval.

##### Important Architectural Patterns
- Separation of Concerns: Each layer (controllers, services, repositories, models) has a distinct responsibility.
- Repository Pattern: Abstracting data access logic with interfaces and separate repository implementations.
- Dependency Injection: Likely used to inject repositories and services into controllers, ensuring loosely coupled components.
- Security: Authentication and authorization are explicitly addressed via the dedicated authentication service.

##### Putting It All Together
- From each controller, show connections to the service layer.
- Finally, illustrate a connection from the repository layer to the database, symbolizing your data persistence via Dapper.
- Ancillary components such as configuration files and workflow definitions (.github folders) if they are significant for deployment pipelines.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Configuration/Infrastructure
    subgraph "Configuration/Infrastructure"
        p1("Program.cs")
        w1("Web.config")
        a1("appsettings.json")
        a2("appsettings.Development.json")
    end

    %% API Controller Layer
    subgraph "API Controllers"
        c1("AccountController")
        c2("Environment2DController")
        c3("Object2DController")
        c4("WeatherForecastController")
    end

    %% Services Layer
    subgraph "Services Layer"
        s1("AspNetIdentityAuthenticationService")
        s2("IAuthentiticationService")
    end

    %% Repository/Data Access Layer
    subgraph "Repository/Data Access Layer"
        r1("Environment2DRepository")
        r2("IEnvironment2DRepository")
        r3("Object2DRepository")
        r4("IObject2DRepository")
    end

    %% Models/Domain Layer
    subgraph "Models/Domain Layer"
        m1("Environment2D")
        m2("Object2D")
    end

    %% External System (Database)
    Database["Database (Dapper)"]

    %% Connections from Entry Point to Controllers
    p1 --> c1
    p1 --> c2
    p1 --> c3
    p1 --> c4

    %% Connections from Controllers to Services
    c1 --> s1
    c2 --> s1
    c3 --> s1
    c4 --> s1

    %% Service implements its Interface
    s1 -->|"implements"| s2

    %% Connections from Service to Repositories
    s1 --> r1
    s1 --> r3

    %% Repository implementations to their interfaces
    r1 -->|"implements"| r2
    r3 -->|"implements"| r4

    %% Repositories to Database using Dapper
    r1 -->|"Dapper_Access"| Database
    r3 -->|"Dapper_Access"| Database

    %% Repositories mapping to Models
    r1 -->|"maps_to"| m1
    r3 -->|"maps_to"| m2

    %% Styles
    classDef config fill:#ffcc99,stroke:#333,stroke-width:2px;
    classDef controller fill:#cce5ff,stroke:#333,stroke-width:2px;
    classDef service fill:#d4edda,stroke:#333,stroke-width:2px;
    classDef repository fill:#ffeeba,stroke:#333,stroke-width:2px;
    classDef model fill:#f8d7da,stroke:#333,stroke-width:2px;
    classDef external fill:#d1ecf1,stroke:#333,stroke-width:2px;

    %% Applying styles to nodes
    class p1,w1,a1,a2 config;
    class c1,c2,c3,c4 controller;
    class s1,s2 service;
    class r1,r2,r3,r4 repository;
    class m1,m2 model;
    class Database external;

    %% Click Events for Configuration/Infrastructure
    click p1 "https://github.com/yazan26/projectmap/blob/main/MijnWebApi.WebApi/Program.cs"
    click w1 "https://github.com/yazan26/projectmap/blob/main/MijnWebApi.WebApi/Web.config"
    click a1 "https://github.com/yazan26/projectmap/blob/main/MijnWebApi.WebApi/appsettings.json"
    click a2 "https://github.com/yazan26/projectmap/blob/main/MijnWebApi.WebApi/appsettings.Development.json"

    %% Click Events for Controllers
    click c1 "https://github.com/yazan26/projectmap/blob/main/MijnWebApi.WebApi/Controllers/AccountController.cs"
    click c2 "https://github.com/yazan26/projectmap/blob/main/MijnWebApi.WebApi/Controllers/Environment2DController.cs"
    click c3 "https://github.com/yazan26/projectmap/blob/main/MijnWebApi.WebApi/Controllers/Object2DController.cs"
    click c4 "https://github.com/yazan26/projectmap/blob/main/MijnWebApi.WebApi/Controllers/WeatherForecastController.cs"

    %% Click Events for Services Layer
    click s1 "https://github.com/yazan26/projectmap/blob/main/MijnWebApi.WebApi/Classes/Services/AspNetIdentityAuthenticationServic.cs"
    click s2 "https://github.com/yazan26/projectmap/blob/main/MijnWebApi.WebApi/Classes/Services/IAuthentiticationService.cs"

    %% Click Events for Repository/Data Access Layer
    click r1 "https://github.com/yazan26/projectmap/blob/main/MijnWebApi.WebApi/Classes/Repositories/Environment2DRepository.cs"
    click r2 "https://github.com/yazan26/projectmap/blob/main/MijnWebApi.WebApi/Classes/Interfaces/IEnvironment2DRepository.cs"
    click r3 "https://github.com/yazan26/projectmap/blob/main/MijnWebApi.WebApi/Classes/Repositories/Object2DRepository.cs"
    click r4 "https://github.com/yazan26/projectmap/blob/main/MijnWebApi.WebApi/Classes/Interfaces/IObject2DRepository.cs"

    %% Click Events for Models/Domain Layer
    click m1 "https://github.com/yazan26/projectmap/blob/main/MijnWebApi.WebApi/Classes/Models/Enviroment2D.cs"
    click m2 "https://github.com/yazan26/projectmap/blob/main/MijnWebApi.WebApi/Classes/Models/Object2D.cs"
```
