# rafek1241/rest-diploma architecture

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

- Interactive diagram: https://gitdiagram.com/rafek1241/rest-diploma
- Repository: https://github.com/rafek1241/rest-diploma

## Overview

##### Project type and purpose
- The README confirms that this code accompanied a diploma thesis on RESTful API design.

##### File structure
- Top-level solution “Rest.Web.Engineer.sln” contains two projects: the main web app and its corresponding test project.
- The main project folders:
- App_Start, Controllers, Filters, Logic, Models, Migrations, Views, Scripts, Content, Images, fonts
- “App” folder under the project root holds the AngularJS single-page-app modules, controllers, services and templates.
- Tests are organized under Rest.Web.Engineer.Tests, covering Controllers and Logic.
- Configuration and build scripts include Web.config, Web.Debug/Release.config, BundleConfig, RouteConfig, WebApiConfig, plus Gruntfile.js and package.json for front-end task automation.

##### README for additional insights
- Dependencies are standard ASP.NET MVC/Web API + Entity Framework + AngularJS + Grunt.

##### Essential elements to capture
- Component names and technologies
- Data flows and control flows between layers
- Architectural patterns (Layered, REST)
- Build/deploy tools (Grunt, EF Migrations)
- External integrations (SMTP, Application Insights)
- Testing layer as a note or separate module

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Browser / Angular SPA"
        direction TB
        A1["Core Module<br/>(AngularJS)"]:::frontend
        A2["Categories Module"]:::frontend
        A3["Products Module"]:::frontend
        A4["Cart Module"]:::frontend
        A5["Order Module"]:::frontend
        A6["Country Module"]:::frontend
        A7["Shared Components"]:::frontend
    end

    %% API & MVC Layer
    subgraph "Web Server / API Layer"
        direction TB
        B1["CategoryController<br/>(C#, Web API)"]:::backend
        B2["ProductController<br/>(C#, Web API)"]:::backend
        B3["CartController<br/>(C#, Web API)"]:::backend
        B4["OrderController<br/>(C#, Web API)"]:::backend
        B5["CountryController<br/>(C#, Web API)"]:::backend
        B6["MailController<br/>(C#, Web API)"]:::backend
        B7["HomeController<br/>(MVC)"]:::backend
        B8["ErrorFilter"]:::backend
        B9["RouteConfig / WebApiConfig<br/>BundleConfig"]:::backend
    end

    %% Business Logic Layer
    subgraph "Business Logic Layer"
        direction TB
        C1["CategoryLogic"]:::logic
        C2["ProductLogic"]:::logic
        C3["CartLogic"]:::logic
        C4["OrderLogic"]:::logic
        C5["CountryLogic"]:::logic
        C6["MailLogic"]:::logic
        C7["MenuLogic"]:::logic
        C8["LogicBase / Extensions"]:::logic
    end

    %% Data Access Layer
    subgraph "Data Access Layer"
        direction TB
        D1["DbContext (EF)"]:::data
        D2["Entities & Api ViewModels"]:::data
        D3["EF Migrations"]:::data
    end

    %% Data Store
    E1["SQL Database"]:::database

    %% External Services
    subgraph "External Services"
        direction TB
        F1["SMTP / Mail Provider"]:::external
        F2["Application Insights"]:::external
    end

    %% Build & Deployment
    subgraph "Build & Deployment"
        direction TB
        G1["Gruntfile.js / package.json"]:::tools
        G2["ASP.NET Bundling"]:::tools
    end

    %% Testing
    subgraph "Testing"
        direction TB
        H1["Controller Tests"]:::test
        H2["Logic Tests"]:::test
    end

    %% Connections
    A2 -->|REST calls| B1
    A3 -->|REST calls| B2
    A4 -->|REST calls| B3
    A5 -->|REST calls| B4
    A6 -->|REST calls| B5
    A7 -->|uses| A1
    A1 -->|bootstraps| B7
    B1 -->|calls| C1
    B2 -->|calls| C2
    B3 -->|calls| C3
    B4 -->|calls| C4
    B5 -->|calls| C5
    B6 -->|calls| C6
    B7 -->|serves index| A1
    B1 -->|uses| B8
    B2 -->|uses| B8
    B3 -->|uses| B8
    B4 -->|uses| B8
    B5 -->|uses| B8
    B6 -->|uses| B8
    C1 -->|queries| D1
    C2 -->|queries| D1
    C3 -->|queries| D1
    C4 -->|queries| D1
    C5 -->|queries| D1
    C6 -->|queries| D1
    D1 -->|migrates schema| D3
    D1 -->|maps entities| D2
    D1 -->|reads/writes| E1
    C6 -->|sends mail| F1
    B1 -->|telemetry| F2
    B2 -->|telemetry| F2
    A1 -->|telemetry| F2
    G1 -->|bundles/minifies| A1
    G2 -->|bundles| Scripts/Content
    H1 -->|tests| B1
    H2 -->|tests| C1

    %% Click Events - Frontend
    click A1 "https://github.com/rafek1241/rest-diploma/tree/master/Rest.Web.Engineer/Rest.Web.Engineer/App"
    click A1 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/App/core/core.module.js"
    click A2 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/App/categories/categories.module.js"
    click A2 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/App/categories/categories.controller.js"
    click A2 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/App/categories/categories.service.js"
    click A2 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/App/categories/categories.html"
    click A3 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/App/products/products.module.js"
    click A3 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/App/products/products.controller.js"
    click A3 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/App/products/products.service.js"
    click A3 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/App/products/products.html"
    click A3 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/App/products/product/product.controller.js"
    click A3 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/App/products/product/product.html"
    click A4 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/App/cart/cart.module.js"
    click A4 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/App/cart/cart.controller.js"
    click A4 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/App/cart/cart.service.js"
    click A4 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/App/cart/cart.html"
    click A5 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/App/order/order.module.js"
    click A5 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/App/order/order.controller.js"
    click A5 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/App/order/order.service.js"
    click A5 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/App/order/order.html"
    click A6 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/App/country/country.service.js"
    click A6 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/App/country/country.module.js"
    click A7 "https://github.com/rafek1241/rest-diploma/tree/master/Rest.Web.Engineer/Rest.Web.Engineer/App/shared"

    %% Click Events - Server
    click B1 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/Controllers/CategoryController.cs"
    click B2 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/Controllers/ProductController.cs"
    click B3 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/Controllers/CartController.cs"
    click B4 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/Controllers/OrderController.cs"
    click B5 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/Controllers/CountryController.cs"
    click B6 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/Controllers/MailController.cs"
    click B7 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/Controllers/HomeController.cs"
    click B8 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/Filters/ErrorFilter.cs"
    click B9 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/App_Start/WebApiConfig.cs"

    %% Click Events - Logic
    click C1 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/Logic/CategoryLogic.cs"
    click C2 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/Logic/ProductLogic.cs"
    click C3 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/Logic/CartLogic.cs"
    click C4 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/Logic/OrderLogic.cs"
    click C5 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/Logic/CountryLogic.cs"
    click C6 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/Logic/MailLogic.cs"

    %% Click Events - Data Access
    click D1 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/Models/DbContext.cs"
    click D2 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/Models/Api/ProductViewModel.cs"
    click D3 "https://github.com/rafek1241/rest-diploma/tree/master/Rest.Web.Engineer/Rest.Web.Engineer/Migrations"

    %% Click Events - Build & Test
    click G1 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/Gruntfile.js"
    click G1 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer/package.json"
    click H1 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer.Tests/Tests/Controllers/CategoryControllerTests.cs"
    click H2 "https://github.com/rafek1241/rest-diploma/blob/master/Rest.Web.Engineer/Rest.Web.Engineer.Tests/Tests/Logic/CategoryLogicTests.cs"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#3399FF,color:#000;
    classDef backend fill:#DFFFE0,stroke:#33AA33,color:#000;
    classDef logic fill:#FFF4D6,stroke:#FFAA00,color:#000;
    classDef data fill:#FFEFDB,stroke:#FF8800,color:#000;
    classDef database fill:#FFE0E0,stroke:#FF3333,color:#000;
    classDef external fill:#F0E0FF,stroke:#9933FF,color:#000;
    classDef tools fill:#E0E0E0,stroke:#666666,color:#000;
    classDef test fill:#FFDDE0,stroke:#FF3366,color:#000;
```
