Files
pos-system/scripts/dev/start-all.sh
Ho Ngoc Hai 526f376c5f Enhance configuration and authentication features across services
- Updated `next.config.js` in both web-admin and web-client to enable React strict mode, set output to standalone, and expose environment variables for API URL.
- Enhanced `auth-sdk` with detailed comments for JWT verification, decoding, and token management functions.
- Improved `http-client` with comprehensive documentation for HTTP client configuration and methods.
- Expanded `logger` functionality with detailed configuration options and logging formats.
- Enhanced `tracing` setup with detailed comments for distributed tracing configuration.
- Updated `types` definitions for authentication and user data transfer objects with comprehensive comments.
- Improved `auth-service` with detailed comments in controllers, services, and middlewares for better clarity and maintainability.
- Added health check endpoints in `health.controller.ts` for service monitoring.
- Enhanced error handling and logging throughout the application for better debugging and user feedback.
2025-12-27 01:37:59 +07:00

53 lines
2.2 KiB
Bash
Executable File

#!/bin/bash
# EN: Script to start all services in development environment
# VI: Script để khởi động tất cả services trong môi trường development
set -e
echo "🚀 Starting all services... / Khởi động tất cả services..."
# EN: Verify Docker daemon is running
# VI: Xác minh Docker daemon đang chạy
if ! docker info &> /dev/null; then
echo "❌ Docker is not running. Please start Docker first. / Docker không chạy. Vui lòng khởi động Docker trước."
exit 1
fi
# EN: Load environment variables from shared config
# VI: Load biến môi trường từ shared config
if [ -f "deployments/local/.env.local" ]; then
export $(grep -v '^#' deployments/local/.env.local | xargs)
fi
# EN: Check if DATABASE_URL is configured (required for services)
# VI: Kiểm tra DATABASE_URL có được cấu hình không (bắt buộc cho services)
if [ -z "$DATABASE_URL" ]; then
echo "⚠️ WARNING: DATABASE_URL not set! / CẢNH BÁO: DATABASE_URL chưa được thiết lập!"
echo " Please setup Neon database: ./scripts/db/setup-neon.sh"
echo " Or set DATABASE_URL in deployments/local/.env.local"
echo " / Vui lòng thiết lập Neon database: ./scripts/db/setup-neon.sh"
echo " Hoặc đặt DATABASE_URL trong deployments/local/.env.local"
echo ""
read -p "Continue anyway? (y/n): / Tiếp tục? (y/n): " continue
if [ "$continue" != "y" ]; then
exit 1
fi
fi
# EN: Start infrastructure services (Redis for caching, Traefik for routing)
# VI: Khởi động infrastructure services (Redis cho caching, Traefik cho routing)
echo "📦 Starting infrastructure (Redis, Traefik)... / Khởi động infrastructure (Redis, Traefik)..."
cd deployments/local
docker-compose up -d
cd ../..
# EN: Give Redis time to fully start before starting services
# VI: Cho Redis thời gian để khởi động đầy đủ trước khi khởi động services
echo "⏳ Waiting for Redis to be ready... / Đang chờ Redis sẵn sàng..."
sleep 3
# EN: Start all microservices using pnpm dev
# VI: Khởi động tất cả microservices sử dụng pnpm dev
echo "🚀 Starting services... / Khởi động services..."
pnpm dev