# luongxuannhat/vietnamhistory_feweb architecture

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

- Interactive diagram: https://gitdiagram.com/luongxuannhat/vietnamhistory_feweb
- Repository: https://github.com/luongxuannhat/vietnamhistory_feweb

## Overview

##### Main Components
- User Interface (UI): Represented by the Angular frontend. The UI is subdivided into multiple feature modules (e.g., account, home, course, forum, document, exam, discover, news, etc.) as seen in the extensive “src/app” folder.
- Feature Modules & Components: Each subdirectory under “src/app” (like account, forum, document, etc.) represents logically separated functionalities. Include components for login, registration, profile updates, content creation, forum discussions, and historical content displays.
- Services and Utilities: The “src/app/service” directory contains many core services (authentication, session management, data sharing, guards, animations, and CKEditor integration). These should be depicted as supporting infrastructure connecting the UI to business logic.
- External Backend: Although not included in this repository, note that the frontend communicates with a backend API (as indicated by the service configuration in auth.service.ts pointing to https://localhost:7138). Represent this as an external component.
- Third-Party Libraries/Frameworks: Include Angular CLI (with angular.json and webpack.config.ts), Bootstrap, Angular Material, and CKEditor. Mark these as common libraries enhancing the UI and development processes.

##### Relationships and Data Flow
- How third-party tools like CKEditor and Material modules integrate directly with the UI components (e.g., in forms, rich text editing) with connecting lines.

##### Architectural Patterns and Design Principles
- Component-based Architecture: The project clearly follows Angular’s modular component and service pattern (each “.component.ts” file belongs to a self-contained UI module).
- Dependency Injection: Although not explicitly diagrammed, you may annotate that Angular’s DI mechanism contributes to managing the service dependencies.

##### Detailed Component Mapping Suggestions
- User Account Management (login, registration, updateaccount, forgetpass, etc.)
- Content Delivery Modules (course, document, exam, news)
- Social Interaction Modules (forum, discover, chat)
- Additional Features (mycategory and related components like mypost, mydocument, etc.)
- Core Services (auth, session, data sharing, guards)

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Vietnam History Learning App – Frontend"
        subgraph "Presentation Layer (UI Modules)"
            AccountModule["Account Module"]:::ui
            CourseModule["Course Module"]:::ui
            DocumentModule["Document Module"]:::ui
            ExamModule["Exam Module"]:::ui
            NewsModule["News Module"]:::ui
            ForumModule["Forum Module"]:::ui
            DiscoverModule["Discover Module"]:::ui
            MyCategoryModule["MyCategory Module"]:::ui
        end
        subgraph "Core Services"
            AuthService["Auth Service"]:::service
            SessionManagement["Session Management"]:::service
            DataSharing["Data Sharing"]:::service
            Guards["Guards"]:::service
            Animations["Animations"]:::service
            CKEditorIntegration["CKEditor Integration"]:::service
        end
    end

    subgraph "Third Party Libraries"
        AngularCLI["Angular CLI & Build Tools"]:::thirdParty
        AngularMaterial["Angular Material"]:::thirdParty
        CKEditorLibrary["CKEditor Library"]:::thirdParty
    end

    subgraph "Deployment & Documentation"
        Documentation["Documentation"]:::config
        CICDPipeline["CI/CD Pipeline"]:::config
        DeploymentConfig["Deployment Configuration"]:::config
    end

    BackendAPI["Backend API"]:::external

    %% UI Modules to Core Services
    AccountModule -->|"triggers"| AuthService
    CourseModule -->|"calls"| DataSharing
    DocumentModule -->|"calls"| DataSharing
    ExamModule -->|"calls"| DataSharing
    NewsModule -->|"calls"| DataSharing
    ForumModule -->|"triggers"| AuthService
    DiscoverModule -->|"calls"| DataSharing
    MyCategoryModule -->|"calls"| DataSharing

    %% Core Services to External Backend API
    AuthService -->|"HTTP"| BackendAPI
    SessionManagement -->|"verifies"| BackendAPI
    Guards -->|"secures"| BackendAPI

    %% Integration between Core Services and Third Party Libraries
    CKEditorIntegration ---|"integrates"| CKEditorLibrary

    %% UI Modules using Third Party Libraries 
    AccountModule ---|"uses"| AngularMaterial
    CourseModule ---|"uses"| AngularMaterial
    DocumentModule ---|"uses"| AngularMaterial
    ExamModule ---|"uses"| AngularMaterial
    NewsModule ---|"uses"| AngularMaterial
    ForumModule ---|"uses"| AngularMaterial

    %% Angular CLI supports the Frontend build
    AccountModule ---|"compiledWith"| AngularCLI

    %% Deployment & Documentation relationships
    CICDPipeline -->|"deploys"| DeploymentConfig
    Documentation -->|"guides"| DeploymentConfig

    classDef ui fill:#AED6F1,stroke:#2E86C1,stroke-width:2px;
    classDef service fill:#F9E79F,stroke:#F1C40F,stroke-width:2px;
    classDef external fill:#FADBD8,stroke:#E74C3C,stroke-width:2px;
    classDef thirdParty fill:#D5F5E3,stroke:#28B463,stroke-width:2px;
    classDef config fill:#E8DAEF,stroke:#9B59B6,stroke-width:2px;

    %% Click Events
    click AccountModule "https://github.com/luongxuannhat/vietnamhistory_feweb/tree/master/src/app/account"
    click CourseModule "https://github.com/luongxuannhat/vietnamhistory_feweb/tree/master/src/app/course"
    click DocumentModule "https://github.com/luongxuannhat/vietnamhistory_feweb/tree/master/src/app/document"
    click ExamModule "https://github.com/luongxuannhat/vietnamhistory_feweb/tree/master/src/app/exam"
    click NewsModule "https://github.com/luongxuannhat/vietnamhistory_feweb/tree/master/src/app/news"
    click ForumModule "https://github.com/luongxuannhat/vietnamhistory_feweb/tree/master/src/app/forum"
    click DiscoverModule "https://github.com/luongxuannhat/vietnamhistory_feweb/tree/master/src/app/discover"
    click MyCategoryModule "https://github.com/luongxuannhat/vietnamhistory_feweb/tree/master/src/app/mycategory"

    click AuthService "https://github.com/luongxuannhat/vietnamhistory_feweb/blob/master/src/app/service/auth.service.ts"
    click SessionManagement "https://github.com/luongxuannhat/vietnamhistory_feweb/tree/master/src/app/service/session"
    click DataSharing "https://github.com/luongxuannhat/vietnamhistory_feweb/tree/master/src/app/service/datashare"
    click Guards "https://github.com/luongxuannhat/vietnamhistory_feweb/tree/master/src/app/service/guard"
    click Animations "https://github.com/luongxuannhat/vietnamhistory_feweb/tree/master/src/app/service/animations"
    click CKEditorIntegration "https://github.com/luongxuannhat/vietnamhistory_feweb/tree/master/src/app/service/CKEditor"

    click AngularCLI "https://github.com/luongxuannhat/vietnamhistory_feweb/blob/master/angular.json"
    click AngularMaterial "https://github.com/luongxuannhat/vietnamhistory_feweb/blob/master/src/material.module.ts"
    click CKEditorLibrary "https://github.com/luongxuannhat/vietnamhistory_feweb/tree/master/src/app/service/CKEditor"

    click Documentation "https://github.com/luongxuannhat/vietnamhistory_feweb/tree/master/docs"
    click CICDPipeline "https://github.com/luongxuannhat/vietnamhistory_feweb/tree/master/.github/workflows"
    click DeploymentConfig "https://github.com/luongxuannhat/vietnamhistory_feweb/blob/master/package.json"
```
