2.0 KiB
2.0 KiB
Bắt Đầu
Yêu Cầu
- Node.js >= 20.0.0
- PNPM >= 8.0.0
- Docker & Docker Compose
- Git
- Tài khoản Neon (https://neon.tech) - cho database
Thiết Lập Ban Đầu
-
Clone repository
git clone <repository-url> cd Base -
Thiết Lập Neon Database
# Chạy script setup ./scripts/db/setup-neon.sh # Hoặc thủ công: # 1. Tạo Neon project tại https://neon.tech # 2. Tạo branches: main (dev), staging, production # 3. Lấy connection strings # 4. Cập nhật deployments/local/.env.localXem Hướng Dẫn Thiết Lập Neon để biết chi tiết.
-
Khởi tạo project
./scripts/setup/init-project.sh -
Khởi động infrastructure (Redis, Traefik - không cần PostgreSQL)
cd deployments/local docker-compose up -d cd ../.. -
Chạy database migrations
./scripts/db/migrate.sh auth-service dev -
Seed database
./scripts/db/seed.sh auth-service -
Khởi động tất cả services
./scripts/dev/start-all.sh
Điểm Truy Cập
- API Gateway: http://localhost/api/v1
- Auth Service: http://localhost:5001
- Web Admin: http://admin.localhost hoặc http://localhost:3000
- Web Client: http://localhost hoặc http://localhost:3001
- Traefik Dashboard: http://localhost:8080
Database
Project này sử dụng Neon PostgreSQL cho tất cả môi trường:
- Development: Neon main branch
- Staging: Neon staging branch
- Production: Neon production branch
Không cần PostgreSQL local! Xem Thiết Lập Neon để biết chi tiết.
Các Bước Tiếp Theo
- Đọc Hướng Dẫn Development
- Xem Tài Liệu API
- Xem lại Tổng Quan Kiến Trúc