# taannv636/web2-nhom10 architecture

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

- Interactive diagram: https://gitdiagram.com/taannv636/web2-nhom10
- Repository: https://github.com/taannv636/web2-nhom10

## Overview

##### Main Components Identification

a) Frontend Layer:
- Public Interface (index.php, about.php, thucdon.php, etc.)
- Menu Categories (menu-con directory)
- Shopping Cart System (cart directory)
- User Authentication (login directory)

b) Admin Panel:
- Dashboard
- Category Management
- Product Management
- User Management
- Database Management

c) Core Services:
- Authentication Service
- Mail Service (PHPMailer integration)
- Database Service
- Utility Services

##### Database Layer
- MySQL Database (indicated by asm_php1.sql)
- Database Configuration
- Database Helper Functions

##### External Services
- PHPMailer Service
- Payment Processing System

##### Use a Three-Tier Architecture representation
**[Client Layer] → [Application Layer] → [Data Layer]**

##### Component Relationships

**Frontend ↔ Core Services ↔ Database**
**Admin Panel ↔ Core Services ↔ Database**
**Core Services ↔ External Services**

##### Specific Implementation Details

Key elements:
- Authentication flow
- Shopping cart process flow
- Order management flow
- Email notification system
- Product management workflow

##### Integration Points

Critical connections:
- Database connectivity
- Email service integration
- Payment processing
- Session management
- File upload handling

##### External service integrations

Tools Recommendation:
- Maintain consistent styling
- Use standard UML notations where applicable
- Version information

##### Integration points with external services

Remember to maintain a balance between detail and clarity, focusing on the architectural decisions that impact the system's operation and maintenance.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        FE[Frontend Interface]
        MC[Menu Categories]
        SC[Shopping Cart]
        UA[User Authentication]
    end

    subgraph Application
        direction TB
        subgraph AdminPanel
            AD[Dashboard]
            CM[Category Management]
            PM[Product Management]
            UM[User Management]
            DM[Database Management]
        end

        subgraph CoreServices
            AS[Authentication Service]
            MS[Mail Service]
            DS[Database Service]
            US[Utility Services]
        end
    end

    subgraph External
        PMS[PHPMailer Service]
        PPS[Payment Processing]
    end

    subgraph Data
        DB[(MySQL Database)]
    end

    %% Relationships
    FE --> SC
    FE --> MC
    FE --> UA
    SC --> PPS
    UA --> AS
    AS --> DS
    MS --> PMS
    DS --> DB
    AdminPanel --> DS
    CoreServices --> External

    %% Click Events
    click FE "https://github.com/taannv636/web2-nhom10/blob/main/PHP/index.php"
    click MC "https://github.com/taannv636/web2-nhom10/tree/main/PHP/menu-con"
    click SC "https://github.com/taannv636/web2-nhom10/tree/main/PHP/cart"
    click UA "https://github.com/taannv636/web2-nhom10/tree/main/PHP/login"
    click AD "https://github.com/taannv636/web2-nhom10/blob/main/PHP/admin/dashboard.php"
    click CM "https://github.com/taannv636/web2-nhom10/tree/main/PHP/admin/category"
    click PM "https://github.com/taannv636/web2-nhom10/tree/main/PHP/admin/product"
    click UM "https://github.com/taannv636/web2-nhom10/tree/main/PHP/admin/user"
    click DM "https://github.com/taannv636/web2-nhom10/tree/main/PHP/admin/database"
    click MS "https://github.com/taannv636/web2-nhom10/blob/main/PHP/PHPMailer-master/src/PHPMailer.php"
    click DS "https://github.com/taannv636/web2-nhom10/tree/main/PHP/database"
    click US "https://github.com/taannv636/web2-nhom10/blob/main/PHP/utils/utility.php"
    click PPS "https://github.com/taannv636/web2-nhom10/blob/main/PHP/api/checkout-form.php"

    %% Styling
    classDef frontend fill:#a8d1ff
    classDef admin fill:#90EE90
    classDef core fill:#FFE5B4
    classDef external fill:#FFB6C1
    classDef data fill:#E6E6FA

    class FE,MC,SC,UA frontend
    class AD,CM,PM,UM,DM admin
    class AS,MS,DS,US core
    class PMS,PPS external
    class DB data
```
