Deploy dự án Claude Code của bạn lên Hostinger — cách an toàn
Đưa dự án Claude Code của bạn lên mạng — push an toàn lên GitHub, khởi chạy trên Hostinger và biến bản dựng cục bộ thành một website thật mà mọi người có thể truy cập.
Lộ trình & tài nguyên
Kết nối VS Code với GitHub
Đăng nhập bằng GitHub
VS Code Sign In Continue with GitHub
Tạo một kho GitHub trống
Tạo kho lưu trữ
GitHub New Repository
Chọn một tên repository rõ ràng Chọn Private Để trống README, License và .gitignore Tạo repository Sao chép URL HTTPS
Kiểm thử trên máy trước, rồi đẩy lên GitHub
Chạy một bài kiểm thử nhanh trên máy
Tải Node.js
Chỉ cài Node.js nếu chưa có npm.
https://nodejs.org/en
npm install
npm run dev
Mở URL cục bộ và xác nhận dự án chạy đúng.
Dùng prompt xuất bản an toàn
Tải Git
Chỉ cài Git nếu chưa có sẵn.
https://git-scm.com/
Prompt đẩy lên GitHub an toàn
Thêm URL kho GitHub của bạn bên dưới, rồi dùng prompt đã tùy chỉnh trong Claude Code.
I already created an empty GitHub repository. GitHub repository URL: {{GITHUB_REPOSITORY_URL}} Please prepare and push this local project to that GitHub repository. Rules: - Do not change the app code, UI, design, routes, database logic, backend logic, Supabase logic, or functionality. - Only handle Git and GitHub publishing. - Check Git status, branch, remotes, .gitignore, and tracked files first. - Make sure .env and .env.local are not committed. - Make sure generated files like node_modules, dist, dist-ssr, *.tsbuildinfo, .DS_Store, and log files are ignored. - If unnecessary files are already tracked, remove them from Git tracking only. Do not delete real project files. - Use main for a new repository, unless an existing branch should be preserved. - Connect this project to the GitHub repository URL. - Create a clean commit if needed. - Push the project to GitHub. If the push fails, diagnose and fix only the Git/GitHub setup. Do not change app functionality. Before any destructive action, explain what you found and what you plan to do.
URL kho GitHub
https://github.com/username/repository-name.git
Deploy trên Hostinger
Mở Hostinger
Mở Hostinger
Bắt đầu thiết lập hosting cho bước này.
RECOMMENDED
https://www.hostg.xyz/SHJTL
Tạo một ứng dụng web Node.js
Hostinger Websites Add Website Node.js Web App
Import kho GitHub của bạn
Thêm biến môi trường nếu cần
Hỏi Claude Code xem dự án của bạn cần những biến môi trường nào, rồi chỉ thêm đúng những giá trị đó trong Hostinger.
Các biến Supabase dùng trong hướng dẫn này
VITE_SUPABASE_URL VITE_SUPABASE_ANON_KEY
VITE_SUPABASE_URL
URL dự án
VITE_SUPABASE_ANON_KEY
Khóa anon (công khai)
Lấy các giá trị này từ Supabase
Mở cài đặt API
https://supabase.com/dashboard/project/_/settings/api
Mở website đang chạy thật của bạn
Kiểm tra các trang chính và xác nhận các tính năng của dự án hoạt động đúng khi trực tuyến.
Cập nhật & hoàn tác sai sót
Xuất bản các cập nhật về sau
Thực hiện thay đổi bằng Claude Code Kiểm tra thay đổi ở máy cục bộ Xem lại các tệp trong Source Control Commit kèm một thông điệp ngắn Đồng bộ thay đổi lên GitHub
Hostinger sẽ tự động triển khai lại phiên bản mới nhất.
Hủy bỏ các thay đổi cục bộ không mong muốn
VS Code Source Control Modified File Discard Changes
VS Code Source Control More Actions Changes Discard All Changes
Chỉ dùng các tùy chọn này trước khi commit hoặc đồng bộ thay đổi.