Update project documentation and scripts for improved setup and bilingual support
- Enhanced `README.md` with a quick start guide and detailed project structure. - Updated `SETUP_GUIDE.md` by removing it as it was redundant. - Improved `local-development.md` and `development.md` with clearer instructions for database migrations. - Added bilingual comments in various scripts for better understanding and usability. - Updated `.gitignore` to include specific build scripts while ignoring others. - Enhanced `scripts` for database management, including backup and seeding functionalities with bilingual support.
This commit is contained in:
@@ -4,19 +4,23 @@ set -e
|
||||
|
||||
echo "🧹 Cleaning up temporary files..."
|
||||
|
||||
# Remove node_modules (optional, comment out if you want to keep them)
|
||||
# EN: Remove node_modules (optional, comment out if you want to keep them)
|
||||
# VI: Xóa node_modules (tùy chọn, comment lại nếu muốn giữ)
|
||||
# find . -name "node_modules" -type d -prune -exec rm -rf {} \;
|
||||
|
||||
# Remove build artifacts
|
||||
# EN: Remove build artifacts
|
||||
# VI: Xóa các file build
|
||||
find . -name "dist" -type d -prune -exec rm -rf {} \;
|
||||
find . -name ".next" -type d -prune -exec rm -rf {} \;
|
||||
find . -name "build" -type d -prune -exec rm -rf {} \;
|
||||
find . -name "*.tsbuildinfo" -type f -delete
|
||||
|
||||
# Remove logs
|
||||
# EN: Remove logs
|
||||
# VI: Xóa file logs
|
||||
find . -name "*.log" -type f -delete
|
||||
|
||||
# Remove cache
|
||||
# EN: Remove cache
|
||||
# VI: Xóa cache
|
||||
find . -name ".turbo" -type d -prune -exec rm -rf {} \;
|
||||
find . -name ".cache" -type d -prune -exec rm -rf {} \;
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ set -e
|
||||
|
||||
SERVICE_NAME=$1
|
||||
|
||||
# EN: Validate arguments
|
||||
# VI: Xác thực tham số
|
||||
if [ -z "$SERVICE_NAME" ]; then
|
||||
echo "Usage: $0 <service-name>"
|
||||
echo "Example: $0 payment-service"
|
||||
@@ -12,6 +14,8 @@ fi
|
||||
|
||||
SERVICE_DIR="services/$SERVICE_NAME"
|
||||
|
||||
# EN: Check if service directory already exists
|
||||
# VI: Kiểm tra xem thư mục service đã tồn tại chưa
|
||||
if [ -d "$SERVICE_DIR" ]; then
|
||||
echo "❌ Service $SERVICE_NAME already exists"
|
||||
exit 1
|
||||
@@ -19,19 +23,23 @@ fi
|
||||
|
||||
echo "📦 Creating new service: $SERVICE_NAME..."
|
||||
|
||||
# Copy template
|
||||
# EN: Copy template
|
||||
# VI: Copy template
|
||||
cp -r services/_template "$SERVICE_DIR"
|
||||
|
||||
# Update package.json
|
||||
# EN: Update package.json
|
||||
# VI: Cập nhật package.json
|
||||
cd "$SERVICE_DIR"
|
||||
sed -i.bak "s/@goodgo\/service-template/@goodgo\/$SERVICE_NAME/g" package.json
|
||||
rm package.json.bak
|
||||
|
||||
# Update .env.example
|
||||
# EN: Update .env.example
|
||||
# VI: Cập nhật .env.example
|
||||
sed -i.bak "s/SERVICE_NAME=service-name/SERVICE_NAME=$SERVICE_NAME/g" .env.example 2>/dev/null || true
|
||||
rm .env.example.bak 2>/dev/null || true
|
||||
|
||||
# Update Dockerfile port if needed
|
||||
# EN: Update Dockerfile port if needed
|
||||
# VI: Cập nhật port Dockerfile nếu cần
|
||||
# (Keep default 5000, user can change later)
|
||||
|
||||
cd ../..
|
||||
|
||||
Reference in New Issue
Block a user