- 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.
89 lines
1.7 KiB
Markdown
89 lines
1.7 KiB
Markdown
# Hướng Dẫn Development
|
|
|
|
## Cấu Trúc Dự Án
|
|
|
|
```
|
|
├── apps/ # Frontend applications
|
|
├── services/ # Backend microservices
|
|
├── packages/ # Shared libraries
|
|
├── infra/ # Infrastructure configs
|
|
├── deployments/ # Deployment configs
|
|
├── scripts/ # Automation scripts
|
|
└── docs/ # Documentation
|
|
```
|
|
|
|
## Quy Trình Development
|
|
|
|
### 1. Tạo Feature Branch
|
|
|
|
```bash
|
|
git checkout -b feature/my-feature
|
|
```
|
|
|
|
### 2. Thực Hiện Thay Đổi
|
|
|
|
- Viết code tuân theo TypeScript strict mode
|
|
- Thêm tests cho chức năng mới
|
|
- Cập nhật tài liệu nếu cần
|
|
|
|
### 3. Chạy Tests Locally
|
|
|
|
```bash
|
|
# Tất cả tests
|
|
pnpm test
|
|
|
|
# Service cụ thể
|
|
pnpm --filter @goodgo/iam-service test
|
|
```
|
|
|
|
### 4. Lint và Format
|
|
|
|
```bash
|
|
pnpm lint
|
|
pnpm format
|
|
```
|
|
|
|
### 5. Tạo Pull Request
|
|
|
|
- Push branch của bạn
|
|
- Tạo PR target `develop`
|
|
- CI/CD sẽ chạy tự động
|
|
|
|
## Thêm Service Mới
|
|
|
|
1. Sử dụng template:
|
|
```bash
|
|
./scripts/utils/create-service.sh my-new-service
|
|
```
|
|
|
|
2. Cập nhật cấu hình service
|
|
3. Implement business logic
|
|
4. Thêm tests
|
|
5. Cập nhật tài liệu
|
|
|
|
## Thêm Package Mới
|
|
|
|
1. Tạo package trong `packages/new-package`
|
|
2. Thêm vào workspace trong `pnpm-workspace.yaml`
|
|
3. Export từ `index.ts`
|
|
4. Thêm tests
|
|
5. Ghi lại cách sử dụng
|
|
|
|
## Database Migrations
|
|
|
|
## Database Migrations
|
|
|
|
```bash
|
|
# Tạo migration (dev)
|
|
./scripts/db/migrate.sh iam-service dev
|
|
|
|
# Áp dụng migrations (production)
|
|
./scripts/db/migrate.sh iam-service deploy
|
|
```
|
|
|
|
## Debugging
|
|
|
|
- Sử dụng logger từ `@goodgo/logger`
|
|
- Kiểm tra Traefik logs: `docker logs traefik-local`
|
|
- Kiểm tra service logs: `./scripts/dev/logs.sh iam-service`
|