Refactor auth-service to iam-service and update related configurations

- Renamed auth-service to iam-service across various files for consistency.
- Updated deployment workflows, database migration scripts, and documentation to reflect the service name change.
- Enhanced bilingual documentation for clarity on the new service structure and usage.
- Removed outdated references to auth-service in scripts and configuration files to streamline the project structure.
This commit is contained in:
Ho Ngoc Hai
2025-12-30 21:03:00 +07:00
parent b104fafa85
commit 019c79b898
23 changed files with 57 additions and 58 deletions

View File

@@ -9,7 +9,7 @@ BACKUP_DIR="${2:-./backups}"
# VI: Xác thực tham số
if [ -z "$SERVICE" ]; then
echo "Usage: $0 <service-name> [backup-dir]"
echo "Example: $0 auth-service"
echo "Example: $0 iam-service"
exit 1
fi

View File

@@ -10,8 +10,8 @@ SERVICE=$1
# VI: Xác thực tham số tên service
if [ -z "$SERVICE" ]; then
echo "Usage: $0 <service-name> [dev|deploy] / Cách dùng: $0 <tên-service> [dev|deploy]"
echo "Example: $0 auth-service dev / Ví dụ: $0 auth-service dev"
echo "Example: $0 auth-service deploy / Ví dụ: $0 auth-service deploy"
echo "Example: $0 iam-service dev / Ví dụ: $0 iam-service dev"
echo "Example: $0 iam-service deploy / Ví dụ: $0 iam-service deploy"
exit 1
fi

View File

@@ -8,7 +8,7 @@ SERVICE=$1
# VI: Xác thực tham số
if [ -z "$SERVICE" ]; then
echo "Usage: $0 <service-name>"
echo "Example: $0 auth-service"
echo "Example: $0 iam-service"
exit 1
fi

View File

@@ -63,10 +63,10 @@ echo " See: deployments/staging/kubernetes/secrets.yaml.example"
echo " See: deployments/production/kubernetes/secrets.yaml.example"
echo ""
echo "3. Run initial migration:"
echo " ./scripts/db/migrate.sh auth-service dev"
echo " ./scripts/db/migrate.sh iam-service dev"
echo ""
echo "4. Seed database (optional):"
echo " ./scripts/db/seed.sh auth-service"
echo " ./scripts/db/seed.sh iam-service"
echo ""
echo -e "${GREEN}✅ Setup instructions complete!${NC}"
echo ""

View File

@@ -26,6 +26,6 @@ fi
# EN: Apply Kubernetes configurations and wait for rollout
# VI: Áp dụng cấu hình Kubernetes và đợi quá trình rollout hoàn tất
kubectl apply -f deployments/production/kubernetes/
kubectl rollout status deployment/auth-service -n production
kubectl rollout status deployment/iam-service -n production
echo "✅ Deployment completed!"

View File

@@ -14,6 +14,6 @@ fi
# EN: Apply Kubernetes configurations and wait for rollout
# VI: Áp dụng cấu hình Kubernetes và đợi quá trình rollout hoàn tất
kubectl apply -f deployments/staging/kubernetes/
kubectl rollout status deployment/auth-service -n staging
kubectl rollout status deployment/iam-service -n staging
echo "✅ Deployment completed!"

View File

@@ -6,7 +6,7 @@ SERVICE=$1
# VI: Kiểm tra cách sử dụng
if [ -z "$SERVICE" ]; then
echo "Usage: $0 <service-name> / Cách dùng: $0 <tên-service>"
echo "Example: $0 auth-service"
echo "Example: $0 iam-service"
echo ""
echo "Or use 'docker' to view Docker logs: / Hoặc dùng 'docker' để xem log Docker:"
echo " $0 docker <container-name>"

View File

@@ -92,12 +92,12 @@ echo " - Set DATABASE_URL from Neon Console"
echo " - Each service needs its own database"
echo ""
echo "3. Create databases in Neon:"
echo " - goodgo_auth_dev (for auth-service)"
echo " - goodgo_iam_dev (for iam-service)"
echo " - goodgo_user_dev (for user-service)"
echo " - etc."
echo ""
echo "4. Run migrations:"
echo " ./scripts/db/migrate.sh auth-service dev"
echo " ./scripts/db/migrate.sh iam-service dev"
echo ""
echo "5. Start development:"
echo " ./scripts/dev/start-all.sh"

View File

@@ -8,7 +8,7 @@ SERVICE=$1
# VI: Xác thực tham số
if [ -z "$SERVICE" ]; then
echo "Usage: $0 <service-name>"
echo "Example: $0 auth-service"
echo "Example: $0 iam-service"
exit 1
fi

View File

@@ -23,16 +23,15 @@ pnpm install
# EN: Generate Prisma clients
# VI: Tạo Prisma generic clients
echo "🔧 Generating Prisma clients..."
cd services/auth-service
cd services/iam-service
pnpm prisma:generate || echo "⚠️ Prisma generation skipped (database not available)"
cd ../..
# EN: Setup environment files
# VI: Thiết lập các file biến môi trường
echo "📝 Setting up environment files..."
if [ ! -f "services/auth-service/.env" ]; then
cp services/auth-service/env.example services/auth-service/.env
echo "✅ Created services/auth-service/.env"
if [ ! -f "services/iam-service/.env" ]; then
cp services/iam-service/env.local.example services/iam-service/.env.local 2>/dev/null || echo "⚠️ IAM service .env file not found"
fi
if [ ! -f "deployments/local/.env.local" ]; then
@@ -55,8 +54,8 @@ echo "Next steps:"
echo "1. Setup Neon database: ./scripts/db/setup-neon.sh"
echo "2. Update .env files with your Neon DATABASE_URL"
echo "3. Start all services: ./scripts/dev/start-all.sh"
echo "4. Run migrations: ./scripts/db/migrate.sh auth-service dev"
echo "5. Seed database: ./scripts/db/seed.sh auth-service"
echo "4. Run migrations: ./scripts/db/migrate.sh iam-service dev"
echo "5. Seed database: ./scripts/db/seed.sh iam-service"
echo "6. Start services: pnpm dev"
echo ""
echo "📚 See infra/databases/neon/README.md for Neon setup details"