1. Tool Record
Domain Tool
  • Tổng quan
  • Business | Logic
    • Admin Business Logic
    • Worker & Automation Business
    • Integration & Reliability Business
    • API INTERFACE & TASK MANAGEMENT
    • SYSTEM BUSINESS OVERVIEW
  • Project
    • ADMIN
      • Tổng quan
      • Architecture
        • Database Schema
        • System Architecture
        • Code Structure
      • Deployment
        • Local
        • Staging
        • Product
      • Hướng dẫn sử dụng
        • Tổng quan
        • Đăng nhập
        • Kiểm tra tự động
        • Kiểm tra thủ công
        • Xếp hạng thủ công
        • Xác nhận kiểm tra
        • Xếp hạng tự động
        • Quản lý từ khóa xếp hạng
        • Kiểm tra whitelist
        • Quản lý từ khóa
        • Truy vết tên miền
        • Quản lý volume từ khóa
        • Kiểm tra domain sở hữu
        • Lịch sử check domain
        • Kiểm tra và view source
        • Kiểm tra thương hiệu tên miền
        • Quản lý người dùng
        • Server
    • API
      • Tổng quan
      • Architecture
        • Database Schema
        • System Architecture
        • Code Structure
      • Deployment
        • Staging
        • Product
        • Local
      • API Interface
        • Public API
          • Xác thực
            • login
            • refresh token
          • Thông tin đăng nhập
            • get current user
            • changePasswordUser
          • Quản lý người dùng
            • getUserList
            • createUser
            • getUserItem
            • updateUser
            • deleteUser
            • updateActive
            • Update FCM Token
          • Quản lý từ khóa
            • Get list of Keywords
            • createKeyword
            • getKeywordItem
            • updateKeyword
            • deleteKeyword
            • deleteKeyword
            • totalKeywordBranchGroup
          • Quản lý Proxy
            • Get all Proxies
            • createProxy
            • getProxyItem
            • updateProxy
            • deleteProxy
            • getActiveProxyList
          • Branch
            • getBranchList
            • createBranch
            • getBranchItem
            • updateBranch
            • deleteBranch
          • Check Brand Domain Histories
            • Get list of Check Brand Domain Histories
            • export Check Brand Domain Histories Data
            • checkBrandDomainHistoriesCopy
            • Import data from Excel
            • exportSampleImportFile
          • Check Confirm
            • List Check Confirms
            • Create Check Confirm
            • Bulk create Check Confirms
            • Show Check Confirm
            • Approve or update confirm detail
            • Delete Check Confirm
            • Approve Check Confirm
            • Approve or Reject Check Confirm
            • List approvers
          • Check Owned Domain
            • Check owned domain
          • Check View Source
            • List current user's check view source histories
            • Check view source for domains
            • Delete all histories of current user
          • Tên Miền Công Ty
            • Get a list of company domains
            • Create a new company domain
            • Get a specific company domain
            • Update a specific company domain with tags
            • Delete a specific company domain
            • Import Whitelist Domains from Excel
            • deleteBulkWhitelistDomain
            • Delete company domains by tag ID
          • Xuất dữ liệu excel
            • Export company domains
            • autoCheckDomainRdrExport
            • exportExcelHistoryCheck
            • exportExcelHistoryRecord
            • autoCheckHistoryDomainRecordExport
            • AutoCheckHistoryDomainCheckExport
            • export Keyword Data
            • autoCheckKeywordExport
            • exportKeywordVolumes
            • exportTrackingDomain
            • exportExcelManualRankingKeywordHistory
            • exportExcelManualSessionHistoryCheck
            • exportExcelRankingDomainHistory
            • exportCompareProxies
            • export Ranking Keyword Data
            • autoCheckRankingKeywordExport
            • exportSampleImportFile
            • exportExcelRankingKeywordHistory
            • exportExcelRankingHistory
            • exportExcelDomainRankingHistory
            • exportExcelWhiteListDomainBlock
            • WhitelistBlockExportSampleImportFile
            • exportSampleImportFile
            • ExportWhitelistByTag
          • Copy
            • Copy company domains
            • autoCheckDomainRdrCopy
            • autoCheckHistoryDomainRecordCopy
            • autoCheckHistoryDomainCheckCopy
            • autoCheckKeywordCopy
            • copyKeywordVolumes
            • copyTrackingDomain
            • copyManualRankingKeywordHistory
            • copySessionHistory
            • copySessionHistory
            • manualUploadFileCopy
            • copyRankingDomainHistory
            • autoCheckRankingKeywordCopy
            • copyRankingKeywordHistory
            • copyRankingHistory
            • copyWhiteListDomainBlock
            • copyWhitelistByTag
          • Nhà cung cấp proxy
            • getDataUsageHistory
            • getProxyProviderList
            • createProxyProvider
            • getProxyProviderItem
            • updateProxyProvider
            • deleteProxyProvider
            • updateSortProxyProvider
            • getProviderProxyCombine
            • createProxyProvider
            • detailProviderProxyCombine
            • updateProxyProvider
            • deleteProviderProxyCombine
          • Quản lý Domain
            • getDomainList
            • createDomain
            • getDomainItem
            • updateDomain
            • deleteDomain
          • Chạy thủ công
            • Run Manual Domain
            • Run Manual Check Domain
            • Run Retry Record Domain
            • Run Retry check Domain
            • Run Manual Domain By Type
            • Run Manual Keyword
          • Domain Check Redirect
            • createDomainCheckRDR
            • getDomainCheckRDRItem
            • updateDomainCheckRDR
            • deleteDomainCheckRDR
            • createHistoryDomainCheck
            • updateHistoryDomainCheck
            • deleteHistoryDomainCheck
            • getListWebByKeyword
            • getListAppByKeyword
            • getListAdsByKeyword
            • getDomainCheckRDRList
          • Quản lý summary
            • Get Domain Wiki Statistics
            • Get Domain Wiki Details
            • Export Domain Wiki Data
            • Copy Domain Wiki List
            • Get Domain Wiki Chart Data
            • Get Summaries
            • Get Auto Summaries
            • Get ranking Summaries
          • External API
            • Create external record domain task
          • Flow
            • stop current flow search domain
            • start current flow search domain
            • get metric flow
            • Get domain RDR processing metrics
            • Get keyword processing metrics
            • Get status auto
          • Group
            • getGroupList
            • createGroup
            • getGroupItem
            • updateGroup
            • deleteGroup
          • Lấy lịch sử check domain
            • getHistoryDomainCheckList
            • getHistoryDomainRecordList
            • getHistoryDomainCheckItem
            • getHistoryDomainRecordItem
            • getHistoryDomainChart
            • getHistoryDomainRecordListV2
          • Ranking Keyword
            • setTimeToRunAutoKeyword
            • postRankingDomainHistory
            • compareProxiesDomainHistory
            • compareProxiesDomainHistoryCopy
            • getChartRankingDomainHistory
            • restartRankingDomainHistory
            • Get list of Ranking Keywords
            • createRankingKeyword
            • getRankingKeywordItem
            • updateRankingKeyword
            • deleteRankingKeyword
            • deleteRankingKeyword
            • totalRankingKeywordBranchGroup
            • Get keyword ranking metric
            • retryRankingKeyword
            • Update Order
            • Import data from Excel
            • Update Order by filter
            • deleteAllRankingKeyword
            • getRankingKeywordHistory
            • setTimeToRunAutoRanking
            • getTimeRunAutoRanking
            • Get ranking group list
          • Quản lý Keyword volume
            • 8ceaf215c302596b08d25b1e12e7ab45
            • Get maximum search volume
          • Quản lý Activities
            • getLogs
            • getLogs
            • trackingDomain
          • Manual Ranking Keyword
            • Get manual ranking keyword histories
            • Get manual ranking keyword history metric
            • GetJsonFileRanking
            • Get ranking group list
          • Quản lý Manual
            • Get list of Manual session domain
            • create manual session domain
            • Get Manual session domain
            • Update list manual session history by manual_sessions_id
            • deleteSession
            • Get list session history
            • Update manual session history by id
            • deleteSessionHistory
            • Get process of Process Manual session domain
            • Get session histories
            • Get statistics session history records
            • Get detailed session history records
            • Get Manual upload files
            • Create Manual upload files
            • Delete Manual upload files
            • deleteBulkManualUploadFiles
          • Ranking Branch
            • getRankingBranchList
            • createRankingBranch
            • getRankingBranchItem
            • updateRankingBranch
            • deleteRankingBranch
          • Ranking Group
            • getRankingGroupList
            • createRankingGroup
            • detailRankingGroup
            • updateRankingGroup
            • deleteRankingGroup
          • Reported Domains
            • getReportedDomainList
            • createReportedDomain
            • getReportedDomainItem
            • updateReportedDomain
            • deleteReportedDomain
            • deleteReportedDomain
            • deleteBulkReportedDomain
          • SearchEngine
            • getSearchEngineList
            • createSearchEngine
            • getSearchEngineItem
            • updateSearchEngine
            • deleteSearchEngine
          • Quản lý cụm Server
            • getServerList
            • createServer
            • getServerItem
            • updateServer
            • deleteServer
          • Statistics
            • getStatistics
          • Tag
            • getTagList
            • createTag
            • getTagItem
            • updateTag
            • deleteTag
            • deleteBulkTag
          • Webhook
            • Execute updateAfterRecordDomain action
            • Execute updateAfterRecordDomain action
            • Execute updateAfterRecordDomain action
            • Handle check confirm capture webhook
            • Execute updateAfterRecordDomain action
            • Execute externalRecordDomainSuccess action
            • Execute updateAfterRecordDomain action
            • Execute updateAfterRecordDomain action
            • Execute updateAfterCheckRankingDomain action
            • Execute updateDomainSearchRanking action
            • Execute updateDomainSearchRankingManual action
          • Quản lý whitelist domain block từ hệ thống
            • getWhiteListDomainBlockApiList
            • createWhiteListDomainBlockApi
            • getWhiteListDomainBlockApiItem
            • updateWhiteListDomainBlockApi
            • deleteWhiteListDomainBlockApi
            • deleteBulkWhiteListDomainBlockApi
          • Quản lý whitelist domain
            • getWhitelistDomainList
            • createWhitelistDomain
            • getWhitelistDomainList
            • getWhitelistDomainItem
            • updateWhitelistDomain
            • deleteWhitelistDomain
            • deleteWhitelistDomain
            • Import Whitelist Domains from Excel
            • deleteBulkWhitelistDomain
    • Tool Check
      • Tổng quan
      • Architecture
        • Database Schema
        • System Architecture
        • Code Structure
      • Deployment
        • Local
        • Staging
        • Product
      • API Interface
        • Public API
          • Public API
    • Tool Record
      • Tổng quan
      • Architecture
        • Database Schema
        • System Architecture
        • Code Structure
      • Deployment
        • Local
        • Staging
        • Product
      • API Interface
        • Public API
          • Task System
            • Get All Tasks
            • Create Task (List)
            • Create Task (Single)
            • Update Task
            • Delete Tasks
            • Count Processing Tasks
            • Get System Logs
            • Send single Task to Webhook
            • Send multiple Tasks to Webhooks
          • System Info
            • Root Details
            • Health Check
  1. Tool Record

Tổng quan

Tổng Quan Vận Hành — Source tool-recordvideo#

Vai trò: Máy quay video — Ghi lại toàn bộ màn hình khi truy cập website
Công nghệ: Bun · Elysia · TypeScript · Selenium/Puppeteer · MongoDB · AWS S3

1. Source này làm gì?#

tool-recordvideo là máy quay chuyên dụng — nó mở trình duyệt, truy cập website, và ghi lại toàn bộ quy trình thành video. Mục đích là tạo ra bằng chứng trực quan không thể chối cãi về trạng thái của một website tại một thời điểm cụ thể.
Nhiệm vụ chính:
Nhận lệnh từ api (trung tâm điều phối) sau khi tool-check đã kiểm tra xong
Mở trình duyệt và truy cập website bằng thiết bị thật được mô phỏng (desktop hoặc mobile)
Quay video màn hình toàn bộ phiên truy cập
Chụp ảnh tại thời điểm quan trọng
Upload ảnh & video lên lưu trữ đám mây (AWS S3)
Báo kết quả về api khi hoàn thành

2. Vị trí trong hệ thống#

                       ┌──────────────────┐
                       │   API trung tâm  │
                       └─────┬───────────┘
                             │
              ┌──────────────┴──────────────┐
              │                             │
              ▼                             ▼
     ┌─────────────────┐         ┌─────────────────────┐
     │   tool-check    │         │  tool-recordvideo   │
     │   (kiểm tra     │         │   (quay video &     │
     │    website)     │         │    chụp ảnh)        │
     └────────┬────────┘         └──────────┬──────────┘
              │                             │
              │ Báo kết quả check           │ Báo kết quả video
              │ qua Webhook                 │ qua Webhook
              └──────────────┬──────────────┘
                             ▼
                   ┌──────────────────┐
                   │   API trung tâm  │
                   │  Lưu vào DB,     │
                   │  cập nhật trạng  │
                   │  thái domain     │
                   └──────────────────┘
Lưu ý: tool-check và tool-recordvideo hoạt động song song độc lập nhau. Cả hai cùng nhận lệnh từ api, không phụ thuộc vào nhau.

3. Vòng đời xử lý một task ghi video#

API trung tâm tạo "phiếu quay video" (task) trong MongoDB
        │
        ▼
Dispatcher phát hiện task mới đang chờ
        │
        ▼
Kiểm tra:  CPU < 70%?  Còn slot worker trống?
        │
        ▼ Đủ điều kiện
Giao task cho Worker rảnh nhất
        │
        ▼
Worker chuẩn bị:
  → Xác định thiết bị (desktop / mobile)
  → Khởi động phiên trình duyệt
  → Áp dụng cấu hình màn hình phù hợp
        │
        ▼
Truy cập website cần quay
  → Thực hiện các tương tác trên trang (cuộn, click...)
  → Ghi lại toàn bộ thành file video
  → Chụp ảnh tại các thời điểm quan trọng
        │
        ▼
Upload lên AWS S3 (lưu trữ đám mây):
  ├── Ảnh chụp (.png / .jpg)
  └── Video quay (.mp4 / .webm)
        │
        ▼ Tối đa thử lại 3 lần nếu upload thất bại
Gửi đường link ảnh & video về api qua Webhook
        │
        ▼
Task hoàn thành → Worker sẵn sàng nhận task tiếp theo

4. Cấu trúc bên trong#

┌─────────────────────────────────────────────────────────────────┐
│                    SOURCE: tool-recordvideo                      │
│                                                                  │
│  ┌───────────────────────────────────────────────────────────┐  │
│  │             BỘ ĐIỀU PHỐI (Dispatcher)                     │  │
│  │  - Liên tục poll MongoDB lấy task mới                     │  │
│  │  - Kiểm tra CPU / RAM trước khi giao việc                 │  │
│  │  - Phân phối theo thứ tự (ưu tiên task manual trước)      │  │
│  └──────────────────────┬────────────────────────────────────┘  │
│                         │ Phân công                             │
│          ┌──────────────┼──────────────┐                        │
│          │              │              │                         │
│          ▼              ▼              ▼                         │
│   ┌───────────┐  ┌───────────┐  ┌───────────┐                  │
│   │ Worker 1  │  │ Worker 2  │  │ Worker N  │                  │
│   │ Quay video│  │ Quay video│  │ Quay video│                  │
│   │ + Upload  │  │ + Upload  │  │ + Upload  │                  │
│   └─────┬─────┘  └─────┬─────┘  └─────┬─────┘                  │
│         └──────────────┴──────────────┘                         │
│                         │                                        │
│                         ▼                                        │
│              ┌─────────────────────┐                            │
│              │  BỘ GỬI KẾT QUẢ    │                            │
│              │  (Webhook Worker)   │                            │
│              │  Báo đường link     │                            │
│              │  ảnh/video về api  │                            │
│              └─────────────────────┘                            │
└─────────────────────────────────────────────────────────────────┘

5. Điểm khác biệt với tool-check#

Tiêu chítool-checktool-recordvideo
Mục đíchKiểm tra trạng thái, phân tích nội dungGhi bằng chứng video + ảnh
Đầu raTrạng thái (chặn/sống), loại domainFile ảnh + video lưu trên S3
Thời gian mỗi taskNhanh hơn (~1-2 phút)Lâu hơn (phải quay đủ video)
Phân tích thêmKiểm tra từ khóa, phân loại domainKhông phân tích — chỉ ghi lại
Lưu trữẢnh chụp trên S3Ảnh + Video đầy đủ trên S3

6. Hệ thống tự bảo vệ khi lỗi#

Lỗi trong quá trình quay:
        │
        ▼
Tự động thử lại (tối đa 3 lần)
Chờ 5 giây giữa mỗi lần thử
        │
        ▼ Nếu vẫn thất bại
Gửi cảnh báo Telegram ngay lập tức
Ghi log chi tiết
        │
        ▼
Task được đánh dấu lỗi
API trung tâm có thể retry sau
Lỗi upload S3:
Nếu upload ảnh hoặc video thất bại → task được đặt lại về trạng thái "cần thử lại"
File cục bộ được xóa sau khi upload thành công (để tiết kiệm dung lượng máy chủ)

7. Phân loại thiết bị kiểm tra#

Tool-recordvideo hỗ trợ quay trên nhiều loại thiết bị ảo:
Thiết bịÝ nghĩa
DesktopGiả lập màn hình máy tính lớn
MobileGiả lập điện thoại di động
Thiết bị nào được dùng là do api chỉ định trong phiếu công việc — nhân viên có thể cấu hình từ giao diện admin.

8. Kết quả cuối cùng nhân viên thấy#

Sau khi tool-recordvideo hoàn thành, nhân viên sẽ thấy trên giao diện admin:
Trang "Lịch sử kiểm tra" (History Domain Check)
  │
  ├── 🖼️  Ảnh chụp màn hình  [Click để xem / tải về]
  │        → Đường link tới AWS S3
  │
  └── 🎬  Video ghi màn hình  [Click để xem / tải về]
           → Đường link tới AWS S3

9. Tóm tắt nhanh#

tool-recordvideo giống như quay phim viên: được giao nhiệm vụ đến địa chỉ nào, mở trình duyệt lên, quay lại toàn bộ cảnh website đó, rồi gửi file về kho lưu trữ. Đây là bằng chứng thực tế nhất về tình trạng của một website tại một thời điểm bất kỳ.

Modified at 2026-03-31 05:47:31
Previous
Product
Next
Database Schema
Built with