# techoji/educationonline architecture

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

- Interactive diagram: https://gitdiagram.com/techoji/educationonline
- Repository: https://github.com/techoji/educationonline

## Overview

##### Project type and purpose
- This is a full-stack ASP.NET MVC web application (“Education Laboratory | Web site”) designed to support courses, labs, tests and administrative tasks for an online education platform.
- Key features include user authentication (ASP.NET Identity / OWIN), course and lab management, file uploads/downloads, Excel report generation (EPPlus) and data storage (Entity Framework + local SQL .mdf files).

##### File structure
- Top-level directories:
– App_Start: routing (RouteConfig), filters (FilterConfig), bundling (BundleConfig)
– Controllers: MVC controllers (AccountController, AdminController, LabController, PagesController)
– Models: business-domain models, EF contexts (ModelDB.edmx, shema.edmx), DbManager helper
– Views: Razor views (.cshtml) organized by area (Account, Admin, Lab, Pages, Shared)
– Content & Scripts: CSS/JavaScript (jQuery, custom modules, Modernizr)
– App_Data: local .mdf database files
– bin & packages: compiled assemblies and NuGet dependencies (EntityFramework, OWIN, EPPlus, etc.)
- Notice the classic layered MVC pattern and local database files under App_Data.

##### Main components and their interactions
a. Client Layer (Browser)
– HTML/CSS/JS served from the Views, Content, Scripts folders.
– Interacts with the server via HTTP (forms, AJAX calls, file uploads/downloads).
b. Web Server / Application Layer
– IIS / IIS Express hosting the ASP.NET MVC app.
– OWIN middleware pipeline handles authentication, static files, routing.
– Controllers implement endpoints and orchestrate UI and business logic.
c. Business Logic Layer
– Models and DbManager classes contain domain logic, file compression, lab pixel processing.
d. Data Access Layer
– Entity Framework 6 contexts (ModelDB, shema) map to SQL Server .mdf files in App_Data.
– Migrations and database scripts reside in the packages folder (EF tools).
e. External / Supporting Services
– Excel generation via EPPlus.
– Logging (antlR runtime), potential email/OAuth via OWIN security packages.

##### Architectural patterns & design principles
- MVC (Model-View-Controller) separation
- Layered architecture (Presentation → Business → Data)
- Dependency injection through OWIN startup (implicit via NuGet packages)
- Bundling & minification for static resources
- Code-first / Database-first approach via EDMX models

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Layer
    subgraph "Client Layer"
        direction TB
        Browser["Browser (HTML/CSS/JS)"]:::client
        Views["Views Directory"]:::client
        CSS["CSS Files"]:::client
        JS["JavaScript Files"]:::client
        Layout["_Layout.cshtml"]:::client
    end

    %% Server / OWIN Middleware
    subgraph "Web Server / OWIN Middleware"
        direction TB
        IIS["IIS / IIS Express"]:::server
        OWIN["OWIN Middleware Pipeline"]:::server
        Route["RouteConfig"]:::server
        Bundle["BundleConfig"]:::server
        Filter["FilterConfig"]:::server
        GlobalASAX["Global.asax & Global.asax.cs"]:::server
    end

    %% ASP.NET MVC Application
    subgraph "ASP.NET MVC Application"
        direction TB

        subgraph "Controllers (Presentation)"
            AccountCtrl["AccountController"]:::server
            AdminCtrl["AdminController"]:::server
            LabCtrl["LabController"]:::server
            PagesCtrl["PagesController"]:::server
        end

        subgraph "Business Logic Layer"
            DbManager["DbManager Helper"]:::business
            CourseModels["CourseModels"]:::business
            CompressImage["CompressImage"]:::business
            LabPixelModel["LabPixelModel"]:::business
            TestModels["TestModels"]:::business
            TopicFiles["TopicFiles"]:::business
            UserModels["UserModels"]:::business
            TeacherUpdates["TeacherUpdates Models"]:::business
        end

        subgraph "ViewModels"
            AccountVM["Account ViewModels"]:::business
            CourseVM["Course ViewModels"]:::business
            TestVM["Test ViewModels"]:::business
            UserVM["User ViewModels"]:::business
        end
    end

    %% Data Access Layer
    subgraph "Data Access Layer"
        direction TB
        subgraph "ModelDB Context"
            ModelEDMX["ModelDB.edmx"]:::data
            ModelCtx["ModelDB.Context.cs"]:::data
            ModelDesigner["ModelDB.Designer.cs"]:::data
        end
        subgraph "Shema Context"
            ShemaEDMX["shema.edmx"]:::data
            ShemaCtx["shema.Context.cs"]:::data
            ShemaDesigner["shema.Designer.cs"]:::data
        end
    end

    %% Database Storage
    subgraph "Local Database Files"
        DistanceDB["DistanceLearning.mdf/.ldf"]:::data
        DbManagerDB["DistanceLearning.Models.DbManager.mdf/.ldf"]:::data
    end

    %% External / Supporting Services
    subgraph "External Services"
        Excel["EPPlus (Excel Generation)"]:::external
        Identity["OWIN Identity Packages"]:::external
        ScriptsFolder["Scripts Folder"]:::external
        ContentFolder["Content Folder"]:::external
        DebugConfig["Web.Debug.config"]:::external
        ReleaseConfig["Web.Release.config"]:::external
        PublishProfiles["PublishProfiles Folder"]:::external
    end

    %% Connections
    Browser -->|HTTP GET/POST| IIS
    IIS --> OWIN
    OWIN --> Route
    OWIN --> Bundle
    OWIN --> Filter
    OWIN --> GlobalASAX
    Route --> AccountCtrl
    Route --> AdminCtrl
    Route --> LabCtrl
    Route --> PagesCtrl

    AccountCtrl -->|"uses"| DbManager
    AdminCtrl -->|"uses"| CourseModels
    LabCtrl -->|"uses"| LabPixelModel
    LabCtrl -->|"calls"| CompressImage
    LabCtrl -->|"uses"| TopicFiles
    PagesCtrl -->|"uses"| TestModels
    PagesCtrl -->|"uses"| UserModels
    AdminCtrl -->|"uses"| TeacherUpdates

    AccountCtrl --> AccountVM
    AdminCtrl --> CourseVM
    PagesCtrl --> TestVM
    AccountCtrl --> UserVM

    DbManager --> ModelCtx
    CourseModels --> ModelEDMX
    LabPixelModel --> ModelCtx
    TestModels --> ShemaEDMX
    TopicFiles --> ShemaCtx
    UserModels --> ModelCtx
    TeacherUpdates --> ModelEDMX

    ModelCtx --> DistanceDB
    ShemaCtx --> DistanceDB
    DbManager --> DbManagerDB

    AccountCtrl -->|Excel Export| Excel
    AccountCtrl -->|Auth| Identity

    Browser --> Views
    Browser --> CSS
    Browser --> JS
    Browser --> Layout

    ScriptsFolder --> Browser
    ContentFolder --> Browser

    DebugConfig --> IIS
    ReleaseConfig --> IIS
    PublishProfiles --> IIS

    %% Click Events
    click Views "https://github.com/techoji/educationonline/tree/master/EducationOnline/Views"
    click CSS "https://github.com/techoji/educationonline/blob/master/EducationOnline/Content/css/*.css"
    click JS "https://github.com/techoji/educationonline/blob/master/EducationOnline/Content/js/*.js"
    click Layout "https://github.com/techoji/educationonline/blob/master/EducationOnline/Views/Shared/_Layout.cshtml"

    click Route "https://github.com/techoji/educationonline/blob/master/EducationOnline/App_Start/RouteConfig.cs"
    click Bundle "https://github.com/techoji/educationonline/blob/master/EducationOnline/App_Start/BundleConfig.cs"
    click Filter "https://github.com/techoji/educationonline/blob/master/EducationOnline/App_Start/FilterConfig.cs"
    click GlobalASAX "https://github.com/techoji/educationonline/blob/master/EducationOnline/Global.asax"
    click GlobalASAX "https://github.com/techoji/educationonline/blob/master/EducationOnline/Global.asax.cs"

    click AccountCtrl "https://github.com/techoji/educationonline/blob/master/EducationOnline/Controllers/AccountController.cs"
    click AdminCtrl "https://github.com/techoji/educationonline/blob/master/EducationOnline/Controllers/AdminController.cs"
    click LabCtrl "https://github.com/techoji/educationonline/blob/master/EducationOnline/Controllers/LabController.cs"
    click PagesCtrl "https://github.com/techoji/educationonline/blob/master/EducationOnline/Controllers/PagesController.cs"

    click DbManager "https://github.com/techoji/educationonline/blob/master/EducationOnline/Models/DbManager.cs"
    click CourseModels "https://github.com/techoji/educationonline/blob/master/EducationOnline/Models/CourseModels.cs"
    click CompressImage "https://github.com/techoji/educationonline/blob/master/EducationOnline/Models/LabModels/CompressImage.cs"
    click LabPixelModel "https://github.com/techoji/educationonline/blob/master/EducationOnline/Models/LabModels/LabPixelModel.cs"
    click TestModels "https://github.com/techoji/educationonline/blob/master/EducationOnline/Models/TestModels.cs"
    click TopicFiles "https://github.com/techoji/educationonline/blob/master/EducationOnline/Models/TopicFiles.cs"
    click UserModels "https://github.com/techoji/educationonline/blob/master/EducationOnline/Models/UserModels.cs"
    click TeacherUpdates "https://github.com/techoji/educationonline/tree/master/EducationOnline/Models/TeacherUpdates"

    click AccountVM "https://github.com/techoji/educationonline/blob/master/EducationOnline/Models/ViewModels/AccountViewModels.cs"
    click CourseVM "https://github.com/techoji/educationonline/blob/master/EducationOnline/Models/ViewModels/CourseViewModels.cs"
    click TestVM "https://github.com/techoji/educationonline/blob/master/EducationOnline/Models/ViewModels/TestViewModels.cs"
    click UserVM "https://github.com/techoji/educationonline/blob/master/EducationOnline/Models/ViewModels/UserViewModels.cs"

    click ModelEDMX "https://github.com/techoji/educationonline/blob/master/EducationOnline/Models/ModelDB.edmx"
    click ModelCtx "https://github.com/techoji/educationonline/blob/master/EducationOnline/Models/ModelDB.Context.cs"
    click ModelDesigner "https://github.com/techoji/educationonline/blob/master/EducationOnline/Models/ModelDB.Designer.cs"
    click ShemaEDMX "https://github.com/techoji/educationonline/blob/master/EducationOnline/Models/shema.edmx"
    click ShemaCtx "https://github.com/techoji/educationonline/blob/master/EducationOnline/Models/shema.Context.cs"
    click ShemaDesigner "https://github.com/techoji/educationonline/blob/master/EducationOnline/Models/shema.Designer.cs"

    click DistanceDB "https://github.com/techoji/educationonline/blob/master/EducationOnline/App_Data/DistanceLearning.mdf"
    click DbManagerDB "https://github.com/techoji/educationonline/blob/master/EducationOnline/App_Data/DistanceLearning.Models.DbManager.mdf"

    click Excel "https://github.com/techoji/educationonline/blob/master/EducationOnline/bin/EPPlus.xml"
    click ScriptsFolder "https://github.com/techoji/educationonline/tree/master/EducationOnline/Scripts"
    click ContentFolder "https://github.com/techoji/educationonline/tree/master/EducationOnline/Content"
    click DebugConfig "https://github.com/techoji/educationonline/blob/master/EducationOnline/Web.Debug.config"
    click ReleaseConfig "https://github.com/techoji/educationonline/blob/master/EducationOnline/Web.Release.config"
    click PublishProfiles "https://github.com/techoji/educationonline/blob/master/EducationOnline/Properties/PublishProfiles/FolderProfile.pubxml"

    %% Styles
    classDef client fill:#E0F7FA,stroke:#006064,color:#004D40;
    classDef server fill:#E8F5E9,stroke:#1B5E20,color:#2E7D32;
    classDef business fill:#FFF8E1,stroke:#F9A825,color:#EF6C00;
    classDef data fill:#FFF3E0,stroke:#E65100,color:#BF360C;
    classDef external fill:#ECEFF1,stroke:#607D8B,color:#455A64;
```
