Skip to content

About

Pho CDK Gemini — Web portal, API, and background worker for CDK key tasks, account batch processing, and queue progress tracking, built with React, Node.js, Docker, and Nginx.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Pho CDK

Ứng dụng web quản lý CDK, gửi danh sách tài khoản và theo dõi tiến trình xử lý theo thời gian thực, xây dựng với React + Vite + Tailwind CSS (Neubrutalism) và Node.js + Express.

Tính năng chính

  • Xác thực & quản lý CDK: Kiểm tra thông tin thẻ, hiển thị lượt còn lại, nạp lượt từ thẻ khác và hỗ trợ mở Dashboard đối với cả thẻ đã hết lượt để theo dõi tiến trình task.
  • Tạo Task mới: Chọn gói dịch vụ, loại dịch vụ, nhập nhanh nhiều tài khoản (hỗ trợ dấu phân tách |, tab, /, ----, tự lọc trùng) hoặc chỉnh sửa trực tiếp trên bảng.
  • Theo dõi tiến trình realtime: Cập nhật trạng thái qua SSE (/api/stream) kèm timeline 1 dòng gọn gàng và nút mở rộng chi tiết từng bước, tìm kiếm, phân trang, huỷ task đang chờ và xuất link kết quả (.txt).
  • Biểu đồ hệ thống & tiện ích: Heatmap hoạt động trong 2 giờ qua (mỗi ô 5 phút), hướng dẫn sử dụng, thông báo dịch vụ và chuyển đổi song ngữ Tiếng Việt / Tiếng Anh.
  • 2 chế độ Backend:
    • Proxy Mode (mặc định): Chuyển tiếp toàn bộ /api/* tới UPSTREAM_URL (mặc định https://renewgpt.online).
    • Local Mode: Khi UPSTREAM_URL để trống, sử dụng JSON store cục bộ (server/data/db.json) kèm worker mô phỏng xử lý task.

Cấu trúc thư mục

.
├── client/                 # Frontend React + Vite + TypeScript + Tailwind CSS
├── server/                 # Backend Node.js + Express (Proxy & Local API)
├── Dockerfile              # Multi-stage Docker build (client dist + Node.js server)
├── docker-compose.yml      # Chạy container độc lập (publish port)
├── docker-compose.vps.yml  # Chạy sau Shared Nginx Proxy trên VPS (network shared-proxy)
├── nginx/gem-phodev.conf   # Cấu hình Nginx mẫu cho domain gem.phodev.xyz
├── .env.example            # Mẫu biến môi trường triển khai
└── package.json            # Scripts chạy đồng thời client & server

Chạy môi trường phát triển (Local)

Yêu cầu Node.js >= 20 (khuyến nghị Node 22).

# Cài đặt dependencies
npm install
npm install --prefix server
npm install --prefix client

# Chạy đồng thời API Proxy (port 3001) và Vite dev server (port 5173)
npm run dev

Mở trình duyệt tại http://localhost:5173/.

Kiểm thử & Build

# Chạy unit/integration test cho cả server và client
npm test

# Kiểm tra TypeScript và build frontend production
npm run build

Triển khai lên VPS bằng Docker

1. Chạy sau Shared Nginx Reverse Proxy (/opt/shared-proxy)

# Chạy container pho-cdk nối vào external network shared-proxy (không mở port public)
docker compose -f docker-compose.vps.yml up -d --build

# Copy cấu hình Nginx sang shared-proxy, kiểm tra syntax và reload Nginx
cp nginx/gem-phodev.conf /opt/shared-proxy/nginx/conf.d/gem-phodev.conf
docker exec <ten-container-nginx> nginx -t && docker exec <ten-container-nginx> nginx -s reload

2. Chạy độc lập (mở port trực tiếp)

cp .env.example .env
# Chỉnh sửa HOST_PORT (VD: 80 hoặc 3001) và UPSTREAM_URL nếu cần

docker compose up -d --build

Kiểm tra trạng thái và log container:

docker compose ps
docker compose logs -f pho-cdk

Endpoint kiểm tra sức khoẻ container: GET /healthz.

About

Pho CDK Gemini — Web portal, API, and background worker for CDK key tasks, account batch processing, and queue progress tracking, built with React, Node.js, Docker, and Nginx.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages