# omerkurgun/staffmanagementprojects architecture

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

- Interactive diagram: https://gitdiagram.com/omerkurgun/staffmanagementprojects
- Repository: https://github.com/omerkurgun/staffmanagementprojects

## Overview

##### Project Type and Purpose
- This is a multi-tier, full-stack ASP.NET staff management system.
- It consists of:
- A UI layer (Web – ASP.NET MVC) for staff and department management pages
- A Web API layer (WebApi – ASP.NET Web API) exposing REST endpoints
- A Business Logic Layer (BLL) encapsulating domain rules and workflows
- A Data Access Layer (DLL) containing entity models and ORM mappings
- A relational database (SQL Server) storing staff, department, city, country and user data

##### File Structure Analysis
- Top-level solution file: StaffManagementProjects.sln
- BLL/ – Business rules, validation & services (references DLL)
- DLL/ – Entity classes (StaffDBModel, staff, department, city, country, users) – likely Entity Framework models
- Web/ – ASP.NET MVC project with Controllers, Views, client assets (CSS, JS, images)
- WebApi/ – ASP.NET Web API project with controllers under /Controllers and HelpPage area

##### Key Insights from README
- Both Web and WebApi have an ApplicationSettings.config for:
- ConnectionString (to the SQL database)
- WebApiUrl (Web project calls the API)
- Build/publish instructions – confirms separate deployment targets for Web and API

a. Main Components
1. Client Browser / UI
2. ASP.NET MVC Web App (Web)
3. ASP.NET Web API (WebApi)
4. Business Logic Layer (BLL)
5. Data Access Layer / ORM Models (DLL)
6. SQL Server Database
7. (Optional) Static file store for staff images

b. Relationships & Data Flows
- Browser → HTTP(S) → MVC Controllers (Web)
- MVC Controllers call REST endpoints on WebApi (configured via WebApiUrl)
- WebApi Controllers invoke BLL services
- BLL calls DLL methods/entities to query/update the DB
- DLL interacts with SQL Server via ADO.NET/Entity Framework
- BLL returns DTOs/models → WebApi → JSON → Web UI
- User uploads (e.g., StaffImage) stored on disk or blob storage referenced by Web

c. Architectural Patterns & Principles
- Layered Architecture (Presentation → API → Business → Data)
- Separation of Concerns (UI vs. API vs. BLL vs. DAL)
- Repository/ORM pattern in DLL using EF model classes
- Configuration-driven endpoints and connection strings

d. Technologies & Frameworks
- ASP.NET MVC 5
- ASP.NET Web API 2
- C# .NET Framework projects (DLL, BLL, Web, WebApi)
- Entity Framework (or custom ORM) in DLL
- Client assets: Bootstrap, jQuery, FastClick, FontAwesome

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Global entities
    Browser["Client Browser"]:::external
    Solution["StaffManagementProjects.sln"]:::external

    %% Presentation Layer
    subgraph "Web (UI Layer)"
        direction TB
        WebUI["ASP.NET MVC Web App"]:::presentation
        ControllersUI["Controllers"]:::presentation
        ViewsUI["Views"]:::presentation
        AssetsUI["Static Assets"]:::presentation
        ConfigWeb["ApplicationSettings.config"]:::presentation
    end

    %% API Layer
    subgraph "WebApi (API Layer)"
        direction TB
        WebAPI["ASP.NET Web API"]:::api
        ControllersAPI["Controllers"]:::api
        AppStart["App_Start"]:::api
        HelpPage["Areas/HelpPage"]:::api
        ConfigAPI["ApplicationSettings.config"]:::api
    end

    %% Business Logic Layer
    subgraph "BLL (Business Logic Layer)"
        direction TB
        BLLComp["BLL"]:::logic
        DataOps["DataOperations.cs"]:::logic
        ConfigBLL["App.config"]:::logic
    end

    %% Data Access Layer
    subgraph "DLL (Data Access Layer)"
        direction TB
        DLLComp["DLL"]:::data
        StaffModel["StaffDBModel.cs"]:::data
        staffEnt["staff.cs"]:::data
        deptEnt["department.cs"]:::data
        cityEnt["city.cs"]:::data
        countryEnt["country.cs"]:::data
        usersEnt["users.cs"]:::data
        ConfigDLL["App.config"]:::data
    end

    %% Database and Storage
    Database[(SQL Server Database)]:::db
    StaticStore["Static File Store (Staff Images)"]:::presentation

    %% Connections
    Browser -->|"HTTP(S) Request"| WebUI
    WebUI -->|"calls REST API"| WebAPI
    WebUI -->|"uploads images"| StaticStore
    WebAPI -->|"invokes services"| BLLComp
    BLLComp -->|"uses ORM models"| DLLComp
    DLLComp -->|"queries/updates"| Database

    Database -->|"response data"| DLLComp
    DLLComp -->|"returns entities"| BLLComp
    BLLComp -->|"returns DTOs"| WebAPI
    WebAPI -->|"JSON response"| WebUI

    %% Click Events
    click Solution "https://github.com/omerkurgun/staffmanagementprojects/blob/master/StaffManagementProjects.sln"
    click WebUI "https://github.com/omerkurgun/staffmanagementprojects/tree/master/Web/"
    click ControllersUI "https://github.com/omerkurgun/staffmanagementprojects/tree/master/Web/Controllers/"
    click ViewsUI "https://github.com/omerkurgun/staffmanagementprojects/tree/master/Web/Views/"
    click AssetsUI "https://github.com/omerkurgun/staffmanagementprojects/tree/master/Web/Contents/StaffImage/"
    click ConfigWeb "https://github.com/omerkurgun/staffmanagementprojects/blob/master/Web/ApplicationSettings.config"
    click WebAPI "https://github.com/omerkurgun/staffmanagementprojects/tree/master/WebApi/"
    click ControllersAPI "https://github.com/omerkurgun/staffmanagementprojects/tree/master/WebApi/Controllers/"
    click AppStart "https://github.com/omerkurgun/staffmanagementprojects/tree/master/WebApi/App_Start/"
    click HelpPage "https://github.com/omerkurgun/staffmanagementprojects/tree/master/WebApi/Areas/HelpPage/"
    click ConfigAPI "https://github.com/omerkurgun/staffmanagementprojects/blob/master/WebApi/ApplicationSettings.config"
    click BLLComp "https://github.com/omerkurgun/staffmanagementprojects/tree/master/BLL/"
    click DataOps "https://github.com/omerkurgun/staffmanagementprojects/blob/master/BLL/DataOperations.cs"
    click ConfigBLL "https://github.com/omerkurgun/staffmanagementprojects/blob/master/BLL/App.config"
    click DLLComp "https://github.com/omerkurgun/staffmanagementprojects/tree/master/DLL/"
    click StaffModel "https://github.com/omerkurgun/staffmanagementprojects/blob/master/DLL/StaffDBModel.cs"
    click staffEnt "https://github.com/omerkurgun/staffmanagementprojects/blob/master/DLL/staff.cs"
    click deptEnt "https://github.com/omerkurgun/staffmanagementprojects/blob/master/DLL/department.cs"
    click cityEnt "https://github.com/omerkurgun/staffmanagementprojects/blob/master/DLL/city.cs"
    click countryEnt "https://github.com/omerkurgun/staffmanagementprojects/blob/master/DLL/country.cs"
    click usersEnt "https://github.com/omerkurgun/staffmanagementprojects/blob/master/DLL/users.cs"
    click ConfigDLL "https://github.com/omerkurgun/staffmanagementprojects/blob/master/DLL/App.config"
    click StaticStore "https://github.com/omerkurgun/staffmanagementprojects/tree/master/Web/Contents/StaffImage/"

    %% Styles
    classDef presentation fill:#D6EAF8,stroke:#1B4F72,color:#1B2631;
    classDef api fill:#D5F5E3,stroke:#145A32,color:#0B5345;
    classDef logic fill:#FCF3CF,stroke:#7D6608,color:#7D6608;
    classDef data fill:#FADBD8,stroke:#943126,color:#641E16;
    classDef db fill:#ABEBC6,stroke:#196F3D,color:#145A32;
    classDef external fill:#E8E8E8,stroke:#555555,color:#333333,stroke-dasharray: 5 5;
```
