Sure! Pl
This commit is contained in:
58
scripts/setup/init-project.sh
Executable file
58
scripts/setup/init-project.sh
Executable file
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
echo "🚀 Initializing GoodGo Microservices Project..."
|
||||
|
||||
# Check prerequisites
|
||||
if ! command -v pnpm &> /dev/null; then
|
||||
echo "❌ PNPM is not installed. Please install it first: npm install -g pnpm"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v docker &> /dev/null; then
|
||||
echo "⚠️ Docker is not installed. Some features may not work."
|
||||
fi
|
||||
|
||||
# Install dependencies
|
||||
echo "📦 Installing dependencies..."
|
||||
pnpm install
|
||||
|
||||
# Generate Prisma clients
|
||||
echo "🔧 Generating Prisma clients..."
|
||||
cd services/auth-service
|
||||
pnpm prisma:generate || echo "⚠️ Prisma generation skipped (database not available)"
|
||||
cd ../..
|
||||
|
||||
# Setup environment files
|
||||
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"
|
||||
fi
|
||||
|
||||
if [ ! -f "deployments/local/.env.local" ]; then
|
||||
cp deployments/local/env.local.example deployments/local/.env.local
|
||||
echo "✅ Created deployments/local/.env.local"
|
||||
echo "⚠️ IMPORTANT: Edit .env.local and add your Neon DATABASE_URL"
|
||||
fi
|
||||
|
||||
if [ ! -f "apps/web-admin/.env.local" ]; then
|
||||
cp apps/web-admin/.env.example apps/web-admin/.env.local 2>/dev/null || echo "⚠️ Web admin .env.example not found"
|
||||
fi
|
||||
|
||||
if [ ! -f "apps/web-client/.env.local" ]; then
|
||||
cp apps/web-client/.env.example apps/web-client/.env.local 2>/dev/null || echo "⚠️ Web client .env.example not found"
|
||||
fi
|
||||
|
||||
echo "✅ Project initialization complete!"
|
||||
echo ""
|
||||
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 infrastructure: cd deployments/local && docker-compose up -d"
|
||||
echo "4. Run migrations: ./scripts/db/migrate.sh auth-service dev"
|
||||
echo "5. Seed database: ./scripts/db/seed.sh auth-service"
|
||||
echo "6. Start services: pnpm dev"
|
||||
echo ""
|
||||
echo "📚 See infra/databases/neon/README.md for Neon setup details"
|
||||
Reference in New Issue
Block a user