# VerifyIndia API - Project Setup Script (PowerShell)
# This script creates the complete folder structure for the project

Write-Host "🚀 Creating VerifyIndia API project structure..." -ForegroundColor Cyan

# Create directories
New-Item -ItemType Directory -Force -Path "src/routes" | Out-Null
New-Item -ItemType Directory -Force -Path "src/middleware" | Out-Null
New-Item -ItemType Directory -Force -Path "src/services" | Out-Null
New-Item -ItemType Directory -Force -Path "src/database" | Out-Null
New-Item -ItemType Directory -Force -Path "src/cache" | Out-Null
New-Item -ItemType Directory -Force -Path "data" | Out-Null

# Create source files
New-Item -ItemType File -Force -Path "src/index.js" | Out-Null

# Create route files
New-Item -ItemType File -Force -Path "src/routes/auth.js" | Out-Null
New-Item -ItemType File -Force -Path "src/routes/ifsc.js" | Out-Null
New-Item -ItemType File -Force -Path "src/routes/pincode.js" | Out-Null
New-Item -ItemType File -Force -Path "src/routes/gst.js" | Out-Null
New-Item -ItemType File -Force -Path "src/routes/pan.js" | Out-Null
New-Item -ItemType File -Force -Path "src/routes/bank.js" | Out-Null
New-Item -ItemType File -Force -Path "src/routes/user.js" | Out-Null

# Create middleware files
New-Item -ItemType File -Force -Path "src/middleware/auth.js" | Out-Null
New-Item -ItemType File -Force -Path "src/middleware/rateLimit.js" | Out-Null
New-Item -ItemType File -Force -Path "src/middleware/errorHandler.js" | Out-Null

# Create service files
New-Item -ItemType File -Force -Path "src/services/gstService.js" | Out-Null
New-Item -ItemType File -Force -Path "src/services/panService.js" | Out-Null
New-Item -ItemType File -Force -Path "src/services/bankService.js" | Out-Null
New-Item -ItemType File -Force -Path "src/services/analytics.js" | Out-Null

# Create database files
New-Item -ItemType File -Force -Path "src/database/connection.js" | Out-Null
New-Item -ItemType File -Force -Path "src/database/setup.js" | Out-Null

# Create cache files
New-Item -ItemType File -Force -Path "src/cache/redis.js" | Out-Null

# Create data files
New-Item -ItemType File -Force -Path "data/ifsc.json" | Out-Null
New-Item -ItemType File -Force -Path "data/pincodes.json" | Out-Null

# Create root config files
New-Item -ItemType File -Force -Path "package.json" | Out-Null
New-Item -ItemType File -Force -Path ".env.example" | Out-Null
New-Item -ItemType File -Force -Path "README.md" | Out-Null

Write-Host "✅ Project structure created successfully!" -ForegroundColor Green
Write-Host ""
Write-Host "📁 Directory structure:" -ForegroundColor Yellow
Get-ChildItem -Recurse -File | Where-Object { $_.Extension -in ".js", ".json", ".md" -or $_.Name -like ".env*" } | ForEach-Object { Write-Host $_.FullName.Replace((Get-Location).Path + "\", "") }
Write-Host ""
Write-Host "📦 Next steps:" -ForegroundColor Yellow
Write-Host "   1. Edit package.json with your dependencies"
Write-Host "   2. Copy .env.example to .env and configure variables"
Write-Host "   3. Run 'npm install' to install dependencies"
Write-Host "   4. Run 'npm start' to start the development server"
