- Renamed auth-service to iam-service across various files for consistency. - Updated Dockerfiles, deployment configurations, and documentation to reflect the service name change. - Enhanced testing commands in documentation to point to the new iam-service. - Removed outdated auth-service files and configurations to streamline the project structure. - Improved bilingual documentation for clarity on the new service structure and usage.
82 lines
2.0 KiB
Markdown
82 lines
2.0 KiB
Markdown
# 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
|
|
|
|
1. **Clone repository**
|
|
```bash
|
|
git clone <repository-url>
|
|
cd Base
|
|
```
|
|
|
|
2. **Thiết Lập Neon Database**
|
|
```bash
|
|
# 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.local
|
|
```
|
|
|
|
Xem [Hướng Dẫn Thiết Lập Neon](../../infra/databases/neon/README.md) để biết chi tiết.
|
|
|
|
3. **Khởi tạo project**
|
|
```bash
|
|
./scripts/setup/init-project.sh
|
|
```
|
|
|
|
4. **Khởi động infrastructure** (Redis, Traefik - không cần PostgreSQL)
|
|
```bash
|
|
cd deployments/local
|
|
docker-compose up -d
|
|
cd ../..
|
|
```
|
|
|
|
5. **Chạy database migrations**
|
|
```bash
|
|
./scripts/db/migrate.sh iam-service dev
|
|
```
|
|
|
|
6. **Seed database**
|
|
```bash
|
|
./scripts/db/seed.sh iam-service
|
|
```
|
|
|
|
7. **Khởi động tất cả services**
|
|
```bash
|
|
./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](../../infra/databases/neon/README.md) để biết chi tiết.
|
|
|
|
## Các Bước Tiếp Theo
|
|
|
|
- Đọc [Hướng Dẫn Development](development.md)
|
|
- Xem [Tài Liệu API](../api/openapi/)
|
|
- Xem lại [Tổng Quan Kiến Trúc](../architecture/system-design.md)
|