source: update Base rule Agent

This commit is contained in:
2026-03-09 18:01:01 +07:00
parent 3003a0ff0b
commit fd9f558fa1
22 changed files with 501 additions and 1426 deletions

View File

@@ -1,54 +1,54 @@
# Tài liệu Kiến trúc C4 - Mức 2: Container Diagram (Landing Page)
# C4 Architecture Document - Level 2: Container Diagram (Landing Page)
Mô tả các thành phần triển khai của hệ thống Landing Page.
Describes the deployable components of the Landing Page system.
## 1. Danh sách Container
## 1. Container List
### 1.1. Sales Landing App (Frontend)
- **Công nghệ**: React, Vite, TailwindCSS.
- **Vai trò**: Cung cấp giao diện tương tác (Responsive).
- **Chức năng**: Form nhập liệu, Camera capture (cho OCR), PDF Viewer, điều hướng sản phẩm.
- **Technology**: React, Vite, TailwindCSS.
- **Role**: Provides the interactive interface (Responsive).
- **Features**: Data input forms, Camera capture (for OCR), PDF Viewer, product navigation.
### 1.2. Backend For Frontend (BFF)
- **Công nghệ**: Node.js / Express (hoặc Serverless Functions).
- **Vai trò**: Trung gian bảo mật và điều phối API.
- **Chức năng**:
- Ẩn các Token/Secret khi gọi OCR PDF API.
- Quản lý session người dùng.
- Chuẩn hóa dữ liệu trước khi gửi đi.
- **Technology**: Node.js / Express (or Serverless Functions).
- **Role**: Secures intermediary and API coordinator.
- **Features**:
- Hides Tokens/Secrets when making calls to the OCR and PDF APIs.
- Manages user sessions.
- Sanitizes and normalizes data before dispatching.
### 1.3. Local Storage / Caching DB
- **Công nghệ**: PostgreSQL (hoặc Redis/LocalStorage tùy yêu cầu lưu lâu dài). *Dựa trên yêu cầu lưu lại khách hàng lần sau, sẽ dùng PostgreSQL.*
- **Vai trò**: Lưu nháp thông tin khách hàng và lịch sử minh họa tạm thời.
- **Technology**: PostgreSQL (or Redis/LocalStorage depending on long-term storage needs). *Based on the requirement to save customer data for future visits, PostgreSQL will be used.*
- **Role**: Stores draft customer information and temporary illustration history.
## 2. Sơ đồ Container
## 2. Container Diagram
```mermaid
C4Container
title Container Diagram - Landing Page Sales Party
Person(sales_agent, "Nhân viên kinh doanh", "Sử dụng thiết bị cá nhân.")
Person(sales_agent, "Sales Agent", "Using personal device.")
System_Boundary(landing_zone, "Landing Page System") {
Container(web_app, "Sales Landing App", "React/Vite", "Giao diện người dùng Mobile-first.")
Container(bff_api, "BFF Service", "Node.js", "Xử lý logic trung gian và bảo mật.")
ContainerDb(local_db, "Client Cache DB", "PostgreSQL", "Lưu thông tin khách hàng nháp.")
Container(web_app, "Sales Landing App", "React/Vite", "Mobile-first user interface.")
Container(bff_api, "BFF Service", "Node.js", "Intermediary logic and security handler.")
ContainerDb(local_db, "Client Cache DB", "PostgreSQL", "Stores draft customer information.")
}
System_Ext(auth_api, "Auth API", "Xác thực")
System_Ext(ocr_service, "OCR Service", "Xử lý ảnh")
System_Ext(pdf_engine, "PDF Engine", "Tạo PDF")
System_Ext(core_system, "Core System", "Lưu hợp đồng")
System_Ext(auth_api, "Auth API", "Authentication")
System_Ext(ocr_service, "OCR Service", "Image processing")
System_Ext(pdf_engine, "PDF Engine", "PDF Generation")
System_Ext(core_system, "Core System", "Stores contracts")
Rel(sales_agent, web_app, "Tương tác", "HTTPS")
Rel(sales_agent, web_app, "Interacts", "HTTPS")
Rel(web_app, bff_api, "API Call", "JSON/HTTPS")
Rel(bff_api, local_db, "Đọc/Ghi dữ liệu KH", "SQL")
Rel(bff_api, auth_api, "Proxy xác thực", "REST")
Rel(bff_api, ocr_service, "Gọi OCR", "REST")
Rel(bff_api, pdf_engine, "Gọi tạo PDF", "REST")
Rel(bff_api, core_system, "Submit hồ sơ", "REST")
Rel(bff_api, local_db, "Read/Write Customer Data", "SQL")
Rel(bff_api, auth_api, "Auth Proxy", "REST")
Rel(bff_api, ocr_service, "Calls OCR", "REST")
Rel(bff_api, pdf_engine, "Calls PDF Gen", "REST")
Rel(bff_api, core_system, "Submits application", "REST")
```
---
*Biên soạn bởi: Agent mbl-landing-page-architecture*
*Authored by: Agent mbl-landing-page-architecture*