1. Architecture
Traffic Tool
  • Traffic Tool Docs
    • Tổng quan
      • Tổng Quan
      • Setup Guide
      • System Architecture
      • Code Structure
      • Logs and Monitoring
      • Environment & Configuration
      • Deployment
        • Local
        • Staging
        • Product
    • Bussiness | Logic
      • 1. Thống kê hàng ngày (Daily Statistics)
      • 2. Thống kê hệ thống (System Statistics)
      • 3. Tìm kiếm tự động (Automated Discovery)
      • 4. Trung tâm Báo cáo (Report Center)
      • 5. Quản lý tài khoản (Account Management)
      • 6. Quản lý Hệ thống (System Management)
      • 7. Quản lý tài khoản Google (Google Account Management)
    • Project
      • ADMIN
        • Tổng quan
        • Hướng dẫn sử dung
          • Đăng Nhập & Xác Thực Hai Bước
          • Thống Kê Hệ Thống
          • Thống Kê Hàng Ngày
          • Tìm Kiếm Tự Động
          • Trung Tâm Báo Cáo
          • Quản Lý Tài Khoản
          • Quản Lý Server
          • Quản Lý Proxy
          • Quản Lý Gói Proxy
          • Quản Lý Nhà Cung Cấp Proxy
          • Quản Lý Backup Proxy
          • Quản Lý Tài Khoản Google
          • User Guide
        • Architecture
          • System Architecture
          • Code Structure
          • Environment & Configuration
          • Logs and Monitoring
        • Deployment
          • Local
          • Staging
          • Production
      • API
        • Tổng quan
        • Architecture
          • Database Schema
          • System Architecture
          • Code Structure
          • Environment & Configuration
          • Logs and Monitoring
        • Deployment
          • Local
          • Staging
          • Production
        • API Interface
          • 🔑 Identity & Session
            • Đăng nhập hệ thống (Login)
            • Đăng ký tài khoản mới (Public)
            • Lấy danh sách người dùng (Phân trang)
            • Admin tạo người dùng mới
            • Lấy thông tin cá nhân hiện tại
            • Khởi tạo bảo mật 2FA
            • Xác thực mã OTP
            • Chi tiết người dùng theo ID
            • Cập nhật thông tin người dùng
            • Xóa tài khoản người dùng
            • Đổi mật khẩu
            • Kiểm tra Cấu hình Thông báo Telegram Toàn hệ thống
            • Bật/Tắt Thông báo Telegram Toàn cục
          • 📁 Campaign Management
            • Danh sách Chiến dịch Toàn cầu
            • Khởi tạo Chiến dịch Mới
            • Chi tiết Chiến dịch
            • Cập nhật Chiến dịch
            • Xóa Chiến dịch
            • Tắt/Mở Chiến dịch (Hàng loạt)
            • Dữ liệu Hình mẫu SEO (Negative SEO)
          • ⚙️ Project Mechanics
            • Danh sách Dự án (Projects List)
            • Khởi tạo Kịch bản Mô phỏng
            • Lấy chi tiết cấu hình Dự án
            • Cập nhật Kịch bản chạy
            • Xóa Dự án
            • Chỉnh sửa Hàng loạt (Bulk)
            • Bật/Tắt Dự án
          • 👤 Profile Management
            • Danh sách Vân tay số (Profiles Data)
            • Tạo Hồ sơ Đơn lẻ (Tạo Vân tay mới)
            • Nhập kho Tài khoản Email (Bulk Import)
            • Chi tiết Session/Cookies
            • Chỉnh sửa Hồ sơ/Ghi chú
            • Xóa Vân tay số và Dữ liệu Local
            • Mở khóa Captcha/Trạng thái Blocked
            • Tra cứu Kho Profile Khả dụng
            • Báo cáo Sức khỏe Kho Tài Khoản
          • 🦾 Worker Interface
            • Đăng ký Khởi tạo Node (Handshake)
            • Nhịp Tim Khảo Sát Tình Trạng (Heartbeat)
            • Nhận Cấu hình Bypass & Hệ thống
            • Kéo (PULL) Nhiệm vụ Traffic SEO
            • Báo cáo Sự cố Node (Crash Report)
          • 📊 Report: Execution
            • Kéo Công việc Báo cáo (Worker Pull)
            • Quản lý Giám sát Nhiệm vụ (Task Dashboard)
            • Bắn Lại Báo Cáo Thất Bại (Manual Retry)
          • 📊 Report: Discovery
            • Danh sách Tên miền Chờ Xử Lý (Discovery Pool)
            • Nhập Mục Tiêu Thủ Công (Manual Insert)
            • Kích hoạt Heuristic Scanner (Cào tự động)
            • Chi tiết Bằng Chứng (Evidence Data)
            • Dán nhãn Vi Phạm / Cập nhật Screenshot
            • Loại Bỏ Mục Tiêu
            • Duyệt Yêu Cầu (Approve to Execution)
          • 📊 Report: Platforms Configuration
            • Truy vấn Danh sách Nền tảng Đối tác (Vendor)
            • Tạo Nền tảng Vendor Báo cáo Mới
            • Bật/Tắt Trang báo cáo theo Loại
            • Cập nhật Metadata Trang
            • Xóa Trang Báo Cáo
            • Lấy Cài đặt LLM cho Vendor cụ thể
            • Cập nhật Cài đặt Tạo mẫu LLM
            • Lấy Cấu hình Schema Biểu mẫu cho Vendor
            • Cập nhật Yêu cầu Trường Biểu mẫu
          • 📊 Report: Email Automation
            • Danh sách SMTP/Mailer Server
            • Thêm kết nối SMTP Mới
            • Nhật ký Nhiệm vụ Gửi Mail (Email Log)
            • Phân tích Tỉ lệ Chuyển đổi (Email Delivery Analytics)
          • 🌐 Global Proxies
            • Danh sách Kho Proxy Phân trang (Proxy Pool)
            • Thêm mới Tuyến IP (Bulk Import)
            • Cập nhật Thông tin máy chủ Proxy
            • Xóa Proxy (Thu hồi tài nguyên)
            • Kích hoạt Xoay vòng (Rotate IP) Cưỡng bức
          • 📈 System Intelligence
            • Báo cáo Luồng Bảo mật Hợp nhất (Colossal Report)
            • Bản Đồ Lưu Lượng GeoIP (Heatmap)
          • 🪝 Webhook Integrations
            • Callback Hoàn tất Gói Lưu lượng SEO (Traffic Node)
            • Callback Thông báo Hoàn tất Bắn Report AI
      • Tool
        • Tổng quan
        • Architecture
          • System Architecture
          • Code Structure
          • Environment & Configuration
          • Logs And Monitoring
          • Database Schema
        • Deployment
          • Local
          • Staging
          • Production
        • API interface
          • Tasks
            • Lấy tasks có phân trang và lọc
            • Xóa tất cả tasks
            • Get all tasks
            • Cập nhật một task
            • Xóa một task theo ID
            • Get all tasks
          • Group task
            • Tạo nhiều task groups
            • Lấy tất cả task groups
            • Xóa tất cả task groups
            • Xóa một task group theo ID
            • Endpoint /api/task-traffics/
            • Test parse proxy string
            • Endpoint /api/task-traffics/
          • Test
            • Mock proxy endpoint cho development
            • Mock profile endpoint cho development
            • Endpoint /api/test
            • Endpoint /api/test/account-stats
            • Endpoint /api/test/session-recommendation
            • Endpoint /api/test/check-browser
            • Endpoint /api/test/clear-browser-sessions
          • Proxies
            • Lấy tất cả proxy records
            • Tạo proxy record mới
            • Xóa tất cả proxies
            • Get all proxies
            • Xóa một proxy theo ID
            • Reset proxy process counter
            • Get all proxies
            • Get all proxies
          • Report Platforms
            • Submit report to multiple platforms
            • Submit report to specific platform
            • Get available platforms
            • Get platform statistics
            • Health check
          • Reports
            • Create a new report
            • Create a new report
            • Get report by ID
            • Get report by ID
            • Get report statistics
            • Get report groups
            • Get report groups
            • Get report group
            • Add report to group
            • Bulk add reports to group
            • Get report group statistics
            • Get analytics data
            • Get platform success rates
            • Get reports by platform
            • Get reports by group
            • Create test reports in bulk
            • Tạo PC report CSV
            • Lấy PC report JSON
            • Lấy report tasks
            • Giám sát report tasks
            • Report tasks đang hoạt động
            • Chi tiết report task
            • Thống kê reports
            • Dữ liệu biểu đồ reports
            • Lấy danh sách report sites
            • Tạo report site
            • Thống kê sites
            • Toggle site enabled/disabled
            • Toggle tất cả sites
            • Toggle sites theo type
            • Cập nhật hàng loạt AI prompts
            • Cập nhật site
            • Xóa site
            • Lấy cấu hình đầy đủ của site
            • Lấy AI prompt của site
            • Cập nhật AI prompt của site
            • Lấy GPT config của site
            • Cập nhật GPT config
            • Lấy response config của site
            • Cập nhật response config
            • Lấy security vendors đang bật
            • Phân tích keywords
            • Top keywords
            • Thống kê analytics
            • PC report dashboard
            • Lấy report domains
            • Thêm report domain
            • Chi tiết report domain
            • Thống kê hàng ngày
            • Cập nhật hàng loạt reports
          • Test Report
            • Test Microsoft report submission
            • Test AdGuard report submission
            • Test Google Ads report submission
            • Test Spamhaus report submission
            • Test ESET report submission
            • Test multi-platform report submission
            • Get available platforms
          • ESET Test
            • Simple test
            • Minimal POST test
            • Generate ESET report content
            • Get sample test data
            • Test form filling
            • Test full form submission
          • Spamhaus Test
            • Simple test
            • Minimal POST test
            • Generate Spamhaus report content
            • Get sample test data
            • Test Spamhaus form filling
            • Test full Spamhaus form submission
          • Report Scheduler
            • Get report scheduler statistics
            • Process ad detection result
            • Submit a scheduled report
            • Start report scheduler
            • Stop report scheduler
            • Get scheduler status
            • Process scheduled reports
            • Test browser session (non-headless)
            • Test report submission (non-headless)
          • Comprehensive Analytics
            • Get comprehensive dashboard analytics
            • Get overview statistics
            • Get brand-wise statistics
            • Get daily statistics
            • Get platform success rates
            • Get account performance
            • Get summary report
          • Search
            • Tạo nhiều search tasks
            • Lấy tổng số search tasks
          • Report Tasks
            • Tạo report tasks cho một domain
            • Tạo report tasks trực tiếp (hỗ trợ profileCountry và domainType rõ ràng)
            • Tạo report tasks cho nhiều domains cùng lúc
            • Tạo email-based report tasks
            • Lấy report task PENDING tiếp theo
            • Cập nhật status của report task
            • Lấy danh sách platforms có sẵn
            • Thống kê report tasks
            • Kích hoạt thực thi thủ công
          • Monitor
            • Thông tin tài nguyên hệ thống
          • System
            • Hello World
            • Health check
            • Đọc file log từ xa
            • Monitor worker status
          • Auth
            • Đăng nhập
            • Đăng ký tài khoản
          • User Management
            • Danh sách users có phân trang
            • Tạo user mới (Admin only)
            • Lấy tất cả users (không phân trang)
            • Lấy thông tin profile của user hiện tại
            • Tạo QR code TOTP cho 2FA
            • Xác thực TOTP để bật 2FA
            • Lấy user theo ID
            • Cập nhật thông tin user
            • Xóa user
            • Đổi mật khẩu user
          • Campaign Management
            • Danh sách campaigns có phân trang
            • Tạo campaign mới
            • Lấy tất cả campaigns
            • Thống kê tổng hợp campaigns
            • Xuất campaigns ra Excel
            • Lấy dữ liệu Negative SEO
            • Xuất dữ liệu Negative SEO ra Excel
            • Xuất Negative SEO theo IDs
            • Lấy dữ liệu Home Traffic
            • Xuất Home Traffic ra Excel
            • Xuất Home Traffic theo IDs
            • Lấy báo cáo campaigns (Public)
            • Lấy tất cả báo cáo campaigns (Public)
            • Lấy chi tiết campaign
            • Cập nhật campaign
            • Xóa campaign
            • Lấy campaigns đã fired theo type
          • Server Management
            • Danh sách servers có phân trang
            • Tạo server mới
            • Lấy tất cả servers
            • Lấy servers từ MongoDB
            • Báo cáo hiệu suất server
            • Thống kê health check
            • Thống kê task monitor
            • Lịch sử lỗi server
            • Thống kê lỗi server
            • Thay đổi trạng thái server
            • Xóa nhiều servers
            • Lấy server theo ID
            • Cập nhật server
            • Xóa server
            • Báo cáo servers (Public)
          • Project Management
            • Lấy tất cả projects
            • Tạo project mới
            • Lấy projects theo campaign
            • Cập nhật dữ liệu traffic
            • Cập nhật nhiều projects
            • Xóa nhiều projects
            • Lấy project theo ID
            • Cập nhật project
            • Cập nhật state của project
            • Cập nhật status của project
            • Tính lại chi tiết project
          • Task Management
            • Worker yêu cầu tasks
            • Reset task creation
          • Proxy Management
            • Danh sách proxies
            • Tạo proxy mới
            • Xóa tất cả proxies
            • Xuất proxies ra Excel
            • Tải template Excel mẫu
            • Tạo nhiều proxies
            • Import proxies từ Excel
            • Import từ tất cả providers
            • Xóa nhiều proxies
            • Lấy proxy theo ID
            • Cập nhật proxy
            • Xóa proxy
            • Toggle trạng thái proxy
          • Backup Proxy
            • Lấy danh sách backup proxies
            • Tạo backup proxy
            • Xóa nhiều backup proxies
            • Import từ Proxifly
            • Chạy health check
            • Lấy backup proxy theo ID
            • Cập nhật backup proxy
            • Xóa backup proxy
            • Test backup proxy
          • Proxy Providers
            • Lấy danh sách proxy providers
            • Tạo proxy provider
            • Xóa nhiều providers
            • Lấy provider theo ID
            • Cập nhật provider
            • Xóa provider
          • Proxy Packages
            • Lấy danh sách proxy packages
            • Tạo proxy package
            • Xóa nhiều packages
            • Lấy package theo ID
            • Cập nhật package
            • Xóa package
          • Profiles
            • Lấy profiles khả dụng (Public)
            • Lấy profile ngẫu nhiên (Public)
            • Danh sách profiles có phân trang
            • Phân tích profiles
            • Health check profiles
            • Tạo profile session
            • Lấy profile session
            • Cập nhật profile session
            • Xóa profile session
            • Đánh dấu profile đã dùng
            • Cập nhật nhiều profiles
            • Tạo nhiều profiles
            • Dọn dẹp sessions hết hạn
            • Dọn dẹp toàn diện
            • Tạo profile mới
            • Lấy profile theo ID
            • Cập nhật profile
            • Xóa profile
            • Thống kê profile
            • Sessions của profile (phân trang)
            • Report tasks của profile
            • Domains đã report bởi profile
            • Tasks theo domain của profile
            • Reset cooldown của profile
            • Test kết nối profile
            • Reset số lần đăng nhập thất bại
            • Ghi nhận đăng nhập thất bại
          • Keywords
            • Danh sách keywords
            • Tạo keyword mới
            • Xuất keywords ra Excel
            • Xác nhận fire keyword
            • Reset tất cả keywords
            • Lấy keyword theo ID
            • Cập nhật keyword
            • Xóa keyword
            • Reset keyword
            • Cập nhật status keyword
            • Kết quả SERP của keyword
          • Dashboard
            • Dữ liệu tổng hợp dashboard
            • Thống kê hệ thống
            • Thống kê traffic theo ID
            • Dữ liệu bảng biểu đồ traffic
            • Xuất báo cáo ra Excel
            • Lấy dữ liệu báo cáo
            • Cập nhật hàng loạt dashboard
            • Tính lại chi tiết projects (Admin only)
          • System Settings
            • Toggle Telegram notifications
            • Trạng thái Telegram notification
          • Activity Logs
            • Lấy activity logs
          • Locations
            • Lấy tất cả locations
            • Tạo location mới
            • Lấy location theo ID
            • Cập nhật location
            • Xóa location
          • Evidence
            • Kiểm tra evidence tồn tại
            • Kiểm tra evidence hàng loạt
            • Lấy evidence mới nhất
          • Files
            • Upload file
            • Download file
          • Server Hourly Reports
            • Lấy server hourly reports
          • Task Logs
            • Lấy task logs
          • Webhooks - Proxy
            • Lấy proxy cho task (Worker webhook)
            • Lấy proxies có thể rotate (Worker webhook)
            • Báo cáo kết quả proxy rotation (Worker webhook)
            • Lấy backup proxy (Worker webhook)
          • Webhooks - Profile
            • Lấy profiles (admin view, webhook)
            • Lấy profile ngẫu nhiên (Worker webhook)
            • Profiles khả dụng (webhook)
            • Lấy profile session (webhook)
            • Tạo profile session (webhook)
            • Đánh dấu profile đã dùng (webhook)
            • Lấy profile tags (webhook)
            • Lấy tất cả profile sessions (webhook)
          • Webhooks - Task
            • Cập nhật kết quả thực thi task (Worker webhook)
          • Webhooks - Search
            • Báo cáo domains đã click (webhook)
            • Lấy clicked domains (webhook)
            • Báo cáo domains (webhook)
            • Third party callback (webhook)
          • Webhooks - Logs
            • Lấy file logs (webhook)
            • Xóa nội dung log (webhook)
            • Kiểm tra IP address (webhook)
          • Webhooks - Keyword
            • Gửi kết quả SERP keyword (webhook)
          • Webhooks - Report
            • Cập nhật trạng thái report task (webhook)
          • Webhooks - CocCoc Token
            • Lấy CocCoc tokens (webhook)
            • Lock CocCoc token (webhook)
            • Unlock CocCoc token (webhook)
    • Schemas
      • LoginRequest
      • UpdateTask
      • WorkerStatus
      • StandardResponse
      • UserResponseDto
      • CreateTaskGroupRequest
      • HealthResponse
      • UserModel
      • CreateProxy
      • ErrorResponse
      • Pagination
      • CreateUserRequest
      • ReportTaskCreation
      • ErrorResponseFull
      • BulkDeleteRequest
      • UpdateUserRequest
      • CreateEmail
      • MessageResponse
      • UserResponse
      • PagingInfo
      • CreateMultipleSearchRequest
      • TrafficType
      • CampaignResponse
      • ProfileModel
      • CreateMultipleReportRequest
      • ServerResponse
      • CreateProfileRequest
      • UpdateReportStatusRequest
      • Task
      • BulkImportProfileReq
      • TestProxyRequest
      • TaskGroup
      • ProxyResponse
      • UpdateProfileRequest
      • CreateTask
      • UpdateTaskBody
      • KeywordResponse
      • CampaignModel
      • CreateSearch
      • TaskPaginatedResponse
      • LocationResponse
      • CreateCampaignRequest
      • ProxyTestResult
      • UpdateCampaignRequest
      • CreateReportTaskBody
      • BulkUpdateCampaignStatusReq
      • CreateEmailReportTaskBody
      • NegativeSeoData
      • BatchReportTaskItem
      • CreateProjectRequest
      • CreateReportTaskResponse
      • UpdateProjectRequest
      • BatchReportTaskResponse
      • ProjectModel
      • BulkUpdateProjectRequest
      • ReportTask
      • WorkerHandshakeRequest
      • UpdateReportTaskStatusBody
      • WorkerHandshakeResponse
      • UpdateReportTaskStatusResponse
      • WorkerHeartbeatPayload
      • PlatformsListResponse
      • WorkerGlobalSettings
      • ReportTaskStatsResponse
      • TaskPullRequest
      • ExecuteReportTaskResponse
      • WorkerFatalLog
      • CreateSearchTask
      • TaskModel
      • Proxy
      • TaskUpdateDto
      • CreateProxyBody
      • ReportTaskModel
      • CreateProxyResponse
      • ReportTaskResult
      • ResetProcessResponse
      • PCReportResponse
      • MonitorResponse
      • ReportSiteItem
      • CreateReportSiteRequest
      • TestProxyResponse
      • GPTConfig
      • TestProfileResponse
      • ResponseConfig
      • ReportDomainsResponse
      • ReportDomainItem
      • AddReportDomainRequest
      • UpdateReportDomainRequest
      • BulkUpdateDashboardRequest
      • ProxyModel
      • CreateProxyRequest
      • UpdateProxyRequest
      • SMTPServerConfig
      • EmailTaskLog
      • GeoLocation
      • CampaignConfigs
      • ProjectAttribute
      • TaskTrafficType
      • ReportTaskItem
      • SummaryStats
      • DailyStats
      • BrandStats
      • ProfileStats
      • FieldConfig
  1. Architecture

Code Structure

Cấu Trúc Mã Nguồn — Admin Dashboard Traffic Tools V2#


1. Cây thư mục#

admin/
├── src/
│   ├── assets/                   ← Tài nguyên tĩnh qua build pipeline
│   │   ├── icons/                ← Icon SVG tùy chỉnh
│   │   ├── images/               ← Hình ảnh trong UI
│   │   └── styles/
│   │       ├── index.scss        ← Import toàn bộ CSS global
│   │       └── tailwind.scss     ← Khai báo Tailwind directives
│   ├── components/               ← Components dùng chung toàn ứng dụng
│   │   ├── BulkActions.vue       ← Thanh hành động hàng loạt
│   │   ├── block/                ← Block components (card, panel)
│   │   ├── common/               ← Components phổ biến (DatePicker, SearchInput)
│   │   ├── header/               ← HeaderBar và các thành phần header
│   │   ├── helper/               ← Components hỗ trợ (tooltip, popover)
│   │   ├── icon/                 ← Wrapper components cho icon
│   │   ├── pagination/           ← Component phân trang tùy chỉnh
│   │   └── progress/             ← Component thanh tiến trình
│   ├── composables/              ← Vue composables (logic tái sử dụng)
│   │   ├── auth.ts               ← Composable xác thực
│   │   ├── format.ts             ← Định dạng số, ngày, trạng thái
│   │   ├── i18n.ts               ← Tiện ích đa ngôn ngữ
│   │   ├── render.ts             ← Render động cột bảng Naive UI
│   │   ├── router.ts             ← Tiện ích router (replaceParamsInPath)
│   │   ├── toggle.ts             ← Quản lý trạng thái boolean
│   │   ├── useBulkSelection.ts   ← Chọn nhiều bản ghi trong bảng
│   │   └── utils.ts              ← Tiện ích tổng hợp (useHelper, useEnv, ...)
│   ├── configs/                  ← Cấu hình hệ thống
│   │   ├── axios.ts              ← Axios instance + interceptors
│   │   ├── colors.ts             ← Bảng màu hệ thống
│   │   ├── theme/                ← Cấu hình theme Naive UI
│   │   ├── theme.ts              ← Theme override cho Naive UI
│   │   └── webhook-axios.ts      ← Axios instance riêng cho webhook
│   ├── data/                     ← Dữ liệu tĩnh và hằng số
│   │   ├── constants/
│   │   │   └── router.ts         ← Định nghĩa toàn bộ RouteName
│   │   ├── menu/                 ← Cấu hình menu sidebar theo nhóm
│   │   ├── sidebarMenu.ts        ← Cấu hình tổng hợp sidebar menu
│   │   └── vietnamLocations.ts   ← Danh sách tỉnh thành Việt Nam
│   ├── layouts/                  ← Khung bố cục trang
│   │   ├── LayoutDefault.vue     ← Layout chính sau đăng nhập
│   │   └── components/
│   │       ├── SidebarMenu.vue   ← Menu điều hướng dọc
│   │       └── HeaderBar.vue     ← Thanh tiêu đề với breadcrumb
│   ├── plugins/
│   │   └── i18n.ts               ← Cấu hình vue-i18n, locale options
│   ├── router/
│   │   ├── index.ts              ← Router instance + beforeEach/afterEach guard
│   │   └── modules/              ← Route definitions theo chức năng
│   │       ├── authFactor.ts     ← Route /auth-factor
│   │       ├── autoSearch.ts     ← Route /auto-search và children
│   │       ├── campaign.ts       ← Route /campaigns
│   │       ├── dashboard1.ts     ← Route /dashboard1 và children
│   │       ├── errors.ts         ← Route 404, 403
│   │       ├── remaining.ts      ← Route /login, /signup (không có layout)
│   │       ├── reportDaily.ts    ← Route /report-daily
│   │       ├── reportDashboard.ts ← Route /report-dashboard
│   │       ├── server-management.ts ← Route /system-management và children
│   │       ├── task.ts           ← Route /tasks
│   │       └── user-management.ts ← Route /user-management và children
│   ├── services/                 ← Lớp gọi API
│   │   ├── api/
│   │   │   ├── auth.ts
│   │   │   ├── autoSearch.ts
│   │   │   ├── backup-proxies.ts
│   │   │   ├── campain.ts
│   │   │   ├── dashBoard.ts
│   │   │   ├── location.ts
│   │   │   ├── negativeSeo.ts
│   │   │   ├── package.ts
│   │   │   ├── profiles.ts
│   │   │   ├── provider.ts
│   │   │   ├── proxies.ts
│   │   │   ├── reports.ts        ← Class ReportApiService
│   │   │   ├── reports/          ← Sub-services cho module báo cáo
│   │   │   ├── serverPerformance.ts
│   │   │   ├── servers.ts
│   │   │   ├── task.ts
│   │   │   ├── trafficNatural.ts
│   │   │   └── users.ts
│   │   └── mockData.ts           ← Dữ liệu mock cho development
│   ├── stores/
│   │   ├── authStore.ts
│   │   ├── appStore.ts
│   │   ├── reportStore.ts
│   │   └── report/               ← Store con cho module báo cáo
│   ├── types/
│   │   ├── index.ts              ← Re-export toàn bộ namespace
│   │   ├── breadcrumb.d.ts
│   │   ├── http.d.ts             ← APIResponseSuccess, Pagination
│   │   ├── pagination.d.ts
│   │   └── modules/              ← Kiểu từng module nghiệp vụ
│   ├── utils/
│   │   ├── countries.ts          ← Danh sách quốc gia
│   │   └── date.ts               ← Hàm format ngày tháng
│   ├── views/                    ← Màn hình nghiệp vụ
│   │   ├── auth/                 ← Đăng nhập, đăng ký
│   │   ├── auth-factor/          ← Xác thực 2FA
│   │   ├── auto-search/          ← Tìm kiếm tự động
│   │   ├── campain/              ← Quản lý chiến dịch
│   │   ├── dashboard1/           ← Thống kê hệ thống
│   │   ├── errors/               ← Trang lỗi 404, 403
│   │   ├── profile-management/   ← Quản lý Browser Profile
│   │   ├── report-daily/         ← Báo cáo hàng ngày
│   │   ├── report-dashboard/     ← Dashboard báo cáo
│   │   ├── server-management/    ← Quản lý hạ tầng
│   │   ├── task/                 ← Danh sách tác vụ
│   │   └── user-management/      ← Quản lý người dùng
│   ├── App.vue                   ← Root component
│   └── main.ts                   ← Entry point, khởi tạo app
├── locales/
│   ├── vi-VN.json
│   ├── en-US.json
│   └── _schema.json
├── public/
│   ├── runtime.config.js         ← window.configs injection point
│   ├── favicon.ico
│   └── fonts/                    ← Font icon tùy chỉnh
├── deploy/
│   ├── development/Dockerfile
│   └── production/Dockerfile
├── docs/
├── .env.development
├── .env.staging
├── .env.release
├── .env.production
├── package.json
├── vite.config.ts
└── tsconfig.json

2. Hệ thống kiểu dữ liệu#

2.1. Namespace Auth#

2.2. Namespace AutoSearchKeyword#

Item — Một nhóm từ khóa tìm kiếm:
SearchDataItem — Một kết quả tìm kiếm cụ thể:
Enum AutoSearchEngine:
Enum SearchEngineType:

2.3. Namespace Server#

2.4. Namespace ServerPerformance#

2.5. Namespace Proxy#

2.6. Namespace Task#

2.7. Namespace Provider#

2.8. Interface Profile#

2.9. Interface Activity#


3. Chi tiết module views#

3.1. Xác thực (views/auth/)#

views/auth/
├── LoginView.vue
├── SignUpView.vue
└── composables/
    └── useLoginAuth.ts
useLoginAuth.ts chứa:
handleLogin(email, password): Gọi authStore.login(), sau đó authStore.getMe(). Kiểm tra profile.two_factor để chuyển sang màn hình OTP hay QR.
verifyCode(otp): Gọi POST /api/user/verify-totp. Khi thành công, lưu token vào localStorage, đặt move_to_dashboard = 'true' và điều hướng vào Dashboard.
generateQR(): Gọi GET /api/user/generate-totp để lấy mã QR cho lần thiết lập 2FA đầu tiên.

3.2. Tìm kiếm tự động (views/auto-search/)#

views/auto-search/
├── IndexView.vue
├── components/
│   ├── GoogleAds.vue
│   ├── CocCocAds.vue
│   ├── ServerPerformance.vue
│   └── server-performance/
│       └── composables/
│           └── useServerPerformanceCharts.ts
├── composables/
│   ├── useDataTableServerDetail.ts
│   └── server-performance/
│       └── useServerPerformanceColumns.ts
└── stores/
GoogleAds.vue và CocCocAds.vue cung cấp:
Danh sách nhóm từ khóa với phân trang và tìm kiếm.
Tạo mới hàng loạt (nhiều từ khóa cùng lúc).
Cập nhật cấu hình: engine, thiết bị, số kết quả, vị trí địa lý.
Xem kết quả tìm kiếm chi tiết và lịch sử.
Cập nhật action_status và confirm_status cho từng kết quả.
Reset từ khóa về trạng thái ban đầu.
Xuất dữ liệu ra Excel.
ServerPerformance.vue cung cấp:
Bảng tổng hợp hiệu suất tất cả Worker.
Biểu đồ phân tích theo khung giờ (0-23h) cho từng máy chủ.
Các chỉ số: process, success, fail, captcha, error, unknown, notfound, waiting.
Bộ lọc theo ngày để xem hiệu suất lịch sử.

3.3. Quản lý hệ thống (views/server-management/)#

views/server-management/
├── IndexView.vue
├── servers/IndexView.vue
├── proxies/IndexView.vue
├── backup-proxies/IndexView.vue
├── packages/IndexView.vue
└── providers/IndexView.vue
proxies/IndexView.vue có các tính năng đặc biệt:
Import proxy từ file Excel mẫu.
Import hàng loạt qua apiProxies.uploadProxy(formData) với Content-Type multipart/form-data.
Import tự động từ nguồn bên ngoài qua apiProxies.uploadProxyv2() với timeout 5 phút.
Kích hoạt/vô hiệu hóa từng proxy hoặc hàng loạt.
backup-proxies/IndexView.vue có thêm:
Kiểm tra sức khỏe từng proxy qua apiBackupProxies.testProxy(id).
Import từ Proxifly qua apiBackupProxies.importFromProxifly().
Kiểm tra sức khỏe toàn bộ pool qua apiBackupProxies.healthCheck().
providers/IndexView.vue có thêm:
Sắp xếp thứ tự ưu tiên nhà cung cấp bằng drag-and-drop, lưu qua apiProviders.updateSort(data).
Xem lịch sử sử dụng dữ liệu qua apiProviders.getDataUsage(params).

3.4. Quản lý người dùng (views/user-management/)#

views/user-management/
├── IndexView.vue
├── users/UserView.vue
└── activities/ActivityView.vue
ActivityView.vue hiển thị nhật ký với: tên người dùng, hành động, tên model và ID bản ghi bị tác động, giá trị trước/sau khi thay đổi (JSON diff), IP, User-Agent và thời gian.

4. Quy tắc đặt tên và tổ chức code#

4.1. Quy tắc tên file#

LoạiQuy tắcVí dụ
Vue ComponentPascalCaseGoogleAds.vue, UserView.vue
TypeScript ComposablecamelCase với tiền tố useuseLoginAuth.ts, useBulkSelection.ts
TypeScript UtilitycamelCaseutils.ts, format.ts
Pinia StorecamelCase với hậu tố StoreauthStore.ts, appStore.ts
Service APIcamelCaseautoSearch.ts, proxies.ts
Route Modulekebab-caseserver-management.ts, user-management.ts

4.2. Quy tắc import#

4.3. Quy tắc component script#

Mọi file .vue phải dùng <script setup lang="ts">:
<script setup lang="ts">
const props = defineProps<{
  data: Server.Item[]
  loading: boolean
}>()

const emit = defineEmits<{
  (e: 'refresh'): void
  (e: 'delete', id: number): void
}>()
</script>

4.4. Auto-import globals#

unplugin-auto-import tự động import vào mọi file:
Vue core APIs: ref, computed, watch, watchEffect, onMounted, nextTick, v.v.
Vue Router: useRouter, useRoute.
Pinia: defineStore, storeToRefs.
VueUse: useUrlSearchParams, useDebounceFn, useEventBus, useClipboard.
Naive UI: useDialog, useMessage, useNotification, useLoadingBar.
Zod: z.
Tất cả composables trong src/composables/**.
Tất cả stores trong src/stores/**.
Tất cả service APIs trong src/services/api/**.
unplugin-vue-components tự động resolve và import tất cả Naive UI components trong template.

4.5. Quy tắc xử lý lỗi#

Mọi lời gọi API phải được bọc trong try-catch và dùng showMessageError:

4.6. Quy tắc xác nhận trước khi xóa#

Mọi thao tác xóa phải hiển thị dialog xác nhận:
Modified at 2026-03-27 04:32:26
Previous
System Architecture
Next
Environment & Configuration
Built with