# johnvo402/prn221-movie architecture

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

- Interactive diagram: https://gitdiagram.com/johnvo402/prn221-movie
- Repository: https://github.com/johnvo402/prn221-movie

## Overview

##### Main Architecture Components

The system appears to be a multi-project solution with distinct layers:

a) Frontend Components:
- AdminApp (WPF Application)
- Web (ASP.NET Core Web App with Razor Pages)

b) Core Components:
- Services Layer
- Repositories Layer
- Shared Layer (Models/DTOs)

##### Key Architectural Elements

**[User Interface Layer]**
- Web Application (Razor Pages)
- Public Pages
- User Features
- SignalR Hubs (Real-time)

- Admin Application (WPF)
- MVVM Architecture
- Management Features

**[Business Logic Layer]**
- Services
- Core Services (Film, User, Actor)
- Authentication
- Payment (VNPay)
- Cloud Services

**[Data Access Layer]**
- Repositories
- Generic Repository
- Specific Repositories

**[Shared Infrastructure]**
- Domain Models
- DTOs
- Database Context

##### Important Connections to Highlight

- Data flow between layers (→)
- Dependencies (⟶)
- Real-time communications (⇢)

##### Special Features to Emphasize

Create dedicated sections for:
- Real-time Communication (SignalR Hubs)
- Authentication Flow
- Payment Integration
- File Storage (Cloud Service)

##### Technical Details

Annotations for:
- .NET 8.0 Framework
- Entity Framework Core
- SignalR
- MVVM Pattern (Admin App)
- Repository Pattern
- Database Migrations

##### External Integrations

Third-party services:
- VNPay Payment Gateway
- Cloud Storage Service
- Email Service

##### Data Flow Patterns

Flow for key operations:
- User Authentication
- Movie Streaming
- Payment Processing
- Admin Management
- Real-time Comments

##### Notes Section

Important implementation details:
- Database migration process
- Security considerations
- Scalability points
- Real-time features

Remember to use standard UML notation where appropriate but prioritize clarity and understanding over strict UML compliance.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef service fill:#2ecc71,stroke:#27ae60,color:white
    classDef data fill:#f1c40f,stroke:#f39c12,color:black
    classDef shared fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef external fill:#e74c3c,stroke:#c0392b,color:white

    %% User Interface Layer
    subgraph UI["User Interface Layer"]
        WPF["Admin Application (WPF)"]
        WPF_MVVM["MVVM Components"]
        WPF_MGMT["Management Features"]
        WEB["Web Application"]
        WEB_PUBLIC["Public Pages"]
        WEB_USER["User Features"]
        RT_HUBS["SignalR Hubs"]
    end

    %% Business Logic Layer
    subgraph BLL["Business Logic Layer"]
        CORE_SVC["Core Services"]
        AUTH_SVC["Authentication Service"]
        PAY_SVC["Payment Service"]
        CLOUD_SVC["Cloud Service"]
    end

    %% Data Access Layer
    subgraph DAL["Data Access Layer"]
        GEN_REPO["Generic Repository"]
        SPEC_REPO["Specific Repositories"]
        DB_CTX["Database Context"]
    end

    %% Shared Infrastructure
    subgraph SHARED["Shared Infrastructure"]
        MODELS["Domain Models"]
        DTOS["DTOs"]
    end

    %% External Services
    VNPAY["VNPay Gateway"]:::external
    CLOUD["Cloud Storage"]:::external
    EMAIL["Email Service"]:::external

    %% Relationships
    WPF --> WPF_MVVM
    WPF --> WPF_MGMT
    WEB --> WEB_PUBLIC
    WEB --> WEB_USER
    WEB --> RT_HUBS

    WPF --> CORE_SVC
    WEB --> CORE_SVC
    RT_HUBS --> CORE_SVC

    CORE_SVC --> AUTH_SVC
    CORE_SVC --> PAY_SVC
    CORE_SVC --> CLOUD_SVC

    AUTH_SVC --> GEN_REPO
    PAY_SVC --> VNPAY
    CLOUD_SVC --> CLOUD

    GEN_REPO --> SPEC_REPO
    SPEC_REPO --> DB_CTX
    DB_CTX --> MODELS
    CORE_SVC --> DTOS

    %% Styling
    class WPF,WEB,WPF_MVVM,WPF_MGMT,WEB_PUBLIC,WEB_USER,RT_HUBS ui
    class CORE_SVC,AUTH_SVC,PAY_SVC,CLOUD_SVC service
    class GEN_REPO,SPEC_REPO,DB_CTX data
    class MODELS,DTOS shared
    class VNPAY,CLOUD,EMAIL external

    %% Click Events
    click WPF "https://github.com/johnvo402/prn221-movie/tree/dev/Prn221.Project.Movie.AdminApp/"
    click WPF_MVVM "https://github.com/johnvo402/prn221-movie/tree/dev/Prn221.Project.Movie.AdminApp/ViewModel/"
    click WEB "https://github.com/johnvo402/prn221-movie/tree/dev/Prn221.Project.Movie.Web/"
    click WEB_PUBLIC "https://github.com/johnvo402/prn221-movie/tree/dev/Prn221.Project.Movie.Web/Pages/"
    click RT_HUBS "https://github.com/johnvo402/prn221-movie/blob/dev/Prn221.Project.Movie.Web/Hubs/CommentHubs.cs"
    click AUTH_SVC "https://github.com/johnvo402/prn221-movie/tree/dev/Prn221.Project.Movie.Services/Services/AuthService/"
    click PAY_SVC "https://github.com/johnvo402/prn221-movie/tree/dev/Prn221.Project.Movie.Services/Services/AddFundService/VnPayService/"
    click CLOUD_SVC "https://github.com/johnvo402/prn221-movie/blob/dev/Prn221.Project.Movie.Services/Helper/CloudService.cs"
    click CORE_SVC "https://github.com/johnvo402/prn221-movie/tree/dev/Prn221.Project.Movie.Services/Services/"
    click GEN_REPO "https://github.com/johnvo402/prn221-movie/tree/dev/Prn221.Project.Movie.Repositories/Generic/"
    click SPEC_REPO "https://github.com/johnvo402/prn221-movie/tree/dev/Prn221.Project.Movie.Repositories/FilmRepository/"
    click DB_CTX "https://github.com/johnvo402/prn221-movie/blob/dev/Prn221.Project.Movie.Shared/Models/MovieDbContext.cs"
    click MODELS "https://github.com/johnvo402/prn221-movie/tree/dev/Prn221.Project.Movie.Shared/Models/"
    click DTOS "https://github.com/johnvo402/prn221-movie/tree/dev/Prn221.Project.Movie.Shared/Dtos/"
```
