# wibu009/just-blog architecture

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

- Interactive diagram: https://gitdiagram.com/wibu009/just-blog
- Repository: https://github.com/wibu009/just-blog

## Overview

##### Project Type and Purpose
- This is a full-stack ASP.NET Core MVC blogging platform (“JustBlog”) with two UIs (public site and admin area).
- It uses a layered, modular solution: a Web presentation layer, a Service/business layer, a Repository/data-access layer, a Core/domain layer, shared utilities, and ViewModels for DTOs.

##### File Structure
- Top-level solution file: JustBlog.sln
- Projects:
- JustBlog.Common: shared helpers & utilities
- JustBlog.Core: domain entities, EF Core DbContext, migrations & initializer
- JustBlog.Repositories: repository interfaces & implementations, Unit of Work pattern
- JustBlog.Services: business logic and AutoMapper configuration
- JustBlog.ViewModels: DTOs for all entities (Category, Post, Comment, Tag, User, Role)
- JustBlog.Web: ASP.NET Core MVC app with Controllers, Views (Razor), static assets (wwwroot), Areas/Admin
- Notice architectural patterns: layered architecture, MVC, Repository, Unit of Work, Dependency Injection.
- Configuration/build files: .csproj per project, appsettings.json, NLog.config, launchSettings.json.

##### README
- Minimal content, but confirms project name “JustBlog”. Assume typical blog features: CRUD for posts, categories, comments, tags, user/role management.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Presentation Layer
    subgraph "Presentation Layer" 
        direction TB
        Web["JustBlog.Web (MVC)"]:::presentation
        Controllers["Controllers"]:::presentation
        Views["Views (Razor)"]:::presentation
        AdminControllers["Areas/Admin Controllers"]:::presentation
        AdminViews["Areas/Admin Views"]:::presentation
        StaticAssets["Static Assets (wwwroot)"]:::external
        Configs["Configuration & Startup"]:::presentation
        Web --> Controllers
        Web --> Views
        Web --> AdminControllers
        Web --> AdminViews
        Web --> StaticAssets
        Web --> Configs
    end

    %% Service Layer
    subgraph "Service Layer"
        direction TB
        Services["JustBlog.Services"]:::service
        CategoryService["CategoryService & ICategoryService"]:::service
        CommentService["CommentService & ICommentService"]:::service
        PostService["PostService & IPostService"]:::service
        TagService["TagService & ITagService"]:::service
        UserService["UserService & IUserService"]:::service
        RoleService["RoleService & IRoleService"]:::service
        MappingConfig["MappingConfig (AutoMapper)"]:::service
        Services --> CategoryService
        Services --> CommentService
        Services --> PostService
        Services --> TagService
        Services --> UserService
        Services --> RoleService
        Services --> MappingConfig
    end

    %% Data Access Layer
    subgraph "Data Access Layer"
        direction TB
        Repos["JustBlog.Repositories"]:::dataaccess
        GenericRepo["GenericRepository & IGenericRepository"]:::dataaccess
        UnitOfWork["UnitOfWork & IUnitOfWork"]:::dataaccess
        CategoryRepo["CategoryRepository & ICategoryRepository"]:::dataaccess
        CommentRepo["CommentRepository & ICommentRepository"]:::dataaccess
        PostRepo["PostRepository & IPostRepository"]:::dataaccess
        TagRepo["TagRepository & ITagRepository"]:::dataaccess
        UserRepo["UserRepository & IUserRepository"]:::dataaccess
        RoleRepo["RoleRepository & IRoleRepository"]:::dataaccess
        Repos --> GenericRepo
        Repos --> UnitOfWork
        Repos --> CategoryRepo
        Repos --> CommentRepo
        Repos --> PostRepo
        Repos --> TagRepo
        Repos --> UserRepo
        Repos --> RoleRepo
    end

    %% Domain/Core Layer
    subgraph "Domain/Core Layer"
        direction TB
        Core["JustBlog.Core"]:::domain
        Entities["Entities"]:::domain
        DbContext["JustBlogContext (DbContext)"]:::domain
        Initializer["JustBlogInitializer"]:::domain
        ConfigsCore["EntityType Configs"]:::domain
        Migrations["Migrations"]:::domain
        Core --> Entities
        Core --> DbContext
        Core --> Initializer
        Core --> ConfigsCore
        Core --> Migrations
    end

    %% Shared Utilities
    Common["JustBlog.Common"]:::utility

    %% DTOs / ViewModels
    VM["JustBlog.ViewModels"]:::dto

    %% Database
    Database["SQL Database"]:::database

    %% External Components
    subgraph "External Components"
        direction TB
        CKEditor["CKEditor"]:::external
        Bootstrap["Bootstrap"]:::external
        jQuery["jQuery"]:::external
        NLog["NLog"]:::external
    end

    %% Relationships
    Controllers -->|"calls"| Services
    AdminControllers -->|"calls"| Services
    Services -->|"uses"| Repos
    Repos -->|"uses"| DbContext
    DbContext -->|"reads/writes"| Database
    Repos -->|"manages Entities"| Entities
    Services <-->|"maps Entities↔ViewModels"| VM
    Controllers -->|"renders"| VM
    StaticAssets -->|"served to"| Web
    Configs -- Configuration --> Web
    Configs -- Configuration --> Core
    Initializer -->|"seeds"| Database
    CKEditor -->|"used in"| Views
    Bootstrap -->|"used in"| Views
    jQuery -->|"used in"| Views
    NLog -->|"logging in"| Web

    %% Click Events - Presentation
    click Web "https://github.com/wibu009/just-blog/tree/master/JustBlog.Web/"
    click Controllers "https://github.com/wibu009/just-blog/tree/master/JustBlog.Web/Controllers/"
    click Views "https://github.com/wibu009/just-blog/tree/master/JustBlog.Web/Views/"
    click AdminControllers "https://github.com/wibu009/just-blog/tree/master/JustBlog.Web/Areas/Admin/Controllers/"
    click AdminViews "https://github.com/wibu009/just-blog/tree/master/JustBlog.Web/Areas/Admin/Views/"
    click StaticAssets "https://github.com/wibu009/just-blog/tree/master/JustBlog.Web/wwwroot/"
    click Configs "https://github.com/wibu009/just-blog/blob/master/JustBlog.Web/appsettings.json"
    click Configs "https://github.com/wibu009/just-blog/blob/master/JustBlog.Web/appsettings.Development.json"
    click Configs "https://github.com/wibu009/just-blog/blob/master/JustBlog.Web/NLog.config"
    click Configs "https://github.com/wibu009/just-blog/blob/master/JustBlog.Web/Program.cs"
    click Configs "https://github.com/wibu009/just-blog/blob/master/JustBlog.Web/Properties/launchSettings.json"

    %% Click Events - Service Layer
    click Services "https://github.com/wibu009/just-blog/tree/master/JustBlog.Services/"
    click CategoryService "https://github.com/wibu009/just-blog/blob/master/JustBlog.Services/Category/CategoryService.cs"
    click MappingConfig "https://github.com/wibu009/just-blog/blob/master/JustBlog.Services/Mapper/MappingConfig.cs"

    %% Click Events - Data Access Layer
    click Repos "https://github.com/wibu009/just-blog/tree/master/JustBlog.Repositories/"
    click GenericRepo "https://github.com/wibu009/just-blog/blob/master/JustBlog.Repositories/Infrastructure/GenericRepository.cs"
    click UnitOfWork "https://github.com/wibu009/just-blog/blob/master/JustBlog.Repositories/Infrastructure/UnitOfWork.cs"
    click CategoryRepo "https://github.com/wibu009/just-blog/blob/master/JustBlog.Repositories/Category/CategoryRepository.cs"

    %% Click Events - Domain/Core Layer
    click Core "https://github.com/wibu009/just-blog/tree/master/JustBlog.Core/"
    click Entities "https://github.com/wibu009/just-blog/tree/master/JustBlog.Core/Entities/"
    click DbContext "https://github.com/wibu009/just-blog/blob/master/JustBlog.Core/Database/JustBlogContext.cs"
    click Migrations "https://github.com/wibu009/just-blog/tree/master/JustBlog.Core/Migrations/"

    %% Click Events - Shared Utilities
    click Common "https://github.com/wibu009/just-blog/tree/master/JustBlog.Common/"

    %% Click Events - ViewModels
    click VM "https://github.com/wibu009/just-blog/tree/master/JustBlog.ViewModels/"

    %% Styles
    classDef presentation fill:#D0E8FF,stroke:#004080,stroke-width:1px
    classDef service fill:#DFF2BF,stroke:#4F8A10,stroke-width:1px
    classDef dataaccess fill:#FFE7BA,stroke:#FF8C00,stroke-width:1px
    classDef domain fill:#F0F0F0,stroke:#666666,stroke-width:1px
    classDef database fill:#CCCCCC,stroke:#333333,stroke-width:1px
    classDef external fill:#FDDDE6,stroke:#C00039,stroke-width:1px
    classDef utility fill:#FFF2CC,stroke:#7F6000,stroke-width:1px
    classDef dto fill:#E3E3F3,stroke:#333399,stroke-width:1px
```
