Hạ tầng Kỹ thuật & Công nghệ (Infrastructure & DevOps)
Tài liệu này mô tả toàn bộ kiến trúc hạ tầng đám mây (Cloud Infrastructure), mạng phân phối CDN, dịch vụ Serverless và cơ chế tự động hóa CI/CD triển khai cho hệ sinh thái danghong.me.
1. Bản đồ Hạ tầng Tổng quan (Architecture Topology)
Hệ sinh thái danghong.me được triển khai theo mô hình Edge-First Serverless & Jamstack, tối ưu hóa tuyệt đối tốc độ tải trang, giảm thiểu chi phí vận hành và đảm bảo tính khả dụng 99.99%.
[ Người dùng Toàn cầu ]
│
▼
[ Cloudflare Global Edge Network ]
(DNSSEC, DDoS Shield, SSL/TLS, Caching)
│
┌─────────────────────────────┼─────────────────────────────┐
▼ ▼ ▼
[ danghong.me ] [ docs.danghong.me ] [ api.danghong.me ]
Main Website Docs Portal Edge API
───────────────── ────────────────── ─────────────────
Cloudflare Pages / Cloudflare Pages / Cloudflare Workers
Next.js 16 (SSG) VitePress (Static) Hono TS Framework
HTML/CSS/JS Assets Markdown SSG Engine Edge Compute, CORS2. Chi tiết các thành phần hạ tầng
2.1. Main Portal (danghong.me)
- Framework: Next.js 16 (React 19), TypeScript, Tailwind CSS v4, Framer Motion.
- Rendering Strategy: 100% SSG (Static Site Generation), không runtime Node.js server.
- Hosting: Cloudflare Pages / Vercel Edge.
- Lưu trữ dữ liệu: Local Markdown & JSON (Git-backed Headless CMS). Không phụ thuộc database SQL/NoSQL ngoại vi.
2.2. Documentation Portal (docs.danghong.me)
- Framework: VitePress (Vue 3, Vite-powered SSG).
- Tính năng:
- Full-text Search tự động (Local Minisearch).
- Dark / Light mode chuyển đổi mượt mà.
- Markdown mở rộng: Code highlighting, Callout banners, Tables, Mermaid diagram support.
- Hosting: Cloudflare Pages (Custom Domain
docs.danghong.me).
2.3. Edge API Service (api.danghong.me)
- Runtime: Cloudflare Workers (V8 isolates running in 300+ edge locations).
- Framework: Hono.js (Siêu nhẹ, hiệu năng cao, zero cold-start latency < 5ms).
- Tính năng:
- Health check
/health - Versioning
/api/v1 - Contact & Lead capture forwarding
- Product & Catalog proxy endpoint
- Rate limiting & Edge security CORS middleware
- Health check
3. Quản lý Tên miền & DNS (Cloudflare DNS)
Toàn bộ zone danghong.me được quản lý trực tiếp trên Cloudflare DNS:
| Hostname | Record Type | Target / Route | Proxy Status | Ghi chú |
|---|---|---|---|---|
danghong.me | CNAME / A | Cloudflare Pages | Proxied (Orange Cloud) | Apex & Web chính |
www.danghong.me | CNAME | danghong.me | Proxied | Redirect về root |
docs.danghong.me | CNAME | Cloudflare Pages (docs) | Proxied | Cổng tài liệu nội bộ & đối tác |
api.danghong.me | Custom Domain | Cloudflare Worker (api-danghong-me) | Proxied | Edge API Gateway |
4. Bảo mật & Hiệu năng (Security & Performance)
- SSL/TLS: Full (Strict) với chứng chỉ Edge tự động gia hạn bởi Cloudflare.
- Bảo vệ DDoS & WAF: Bật Cloudflare Web Application Firewall và Bot Fight Mode.
- CORS: Thiết lập chặt chẽ cho
api.danghong.mechỉ chấp nhận request hợp lệ từdanghong.mevàdocs.danghong.me. - Caching:
- Static Assets:
Cache-Control: public, max-age=31536000, immutable. - HTML Documents: Stale-while-revalidate đảm bảo người dùng luôn nhận bản mới nhất ngay khi cập nhật.
- Static Assets: