|
| 1 | +#!/usr/bin/env bash |
| 2 | +set -euo pipefail |
| 3 | + |
| 4 | +source "$(dirname "$0")/../infra.env" |
| 5 | + |
| 6 | +echo "π Generating README with deployment information..." |
| 7 | + |
| 8 | +DEPLOYMENT_OUTPUT=$(az deployment group show \ |
| 9 | + --resource-group "$RESOURCE_GROUP" \ |
| 10 | + --name "main" \ |
| 11 | + --query 'properties.outputs' \ |
| 12 | + --output json) |
| 13 | + |
| 14 | +FRONTEND_URL=$(echo "$DEPLOYMENT_OUTPUT" | jq -r '.frontendUrl.value') |
| 15 | +BACKEND_URL=$(echo "$DEPLOYMENT_OUTPUT" | jq -r '.backendUrl.value') |
| 16 | + |
| 17 | +cat > README.md <<EOF |
| 18 | +# Angular Chatbot |
| 19 | +
|
| 20 | +An Angular chatbot application with Azure OpenAI integration. |
| 21 | +
|
| 22 | +## π Live Demo |
| 23 | +
|
| 24 | +**Frontend:** [$FRONTEND_URL]($FRONTEND_URL) |
| 25 | +
|
| 26 | +**Backend API:** [$BACKEND_URL]($BACKEND_URL) |
| 27 | +
|
| 28 | +## π οΈ Technology Stack |
| 29 | +
|
| 30 | +- **Frontend:** Angular 19 with Server-Side Rendering (SSR) |
| 31 | +- **Backend:** Node.js Express server |
| 32 | +- **AI:** Azure OpenAI (GPT-4o) |
| 33 | +- **Infrastructure:** Azure App Service & Static Web Apps |
| 34 | +- **IaC:** Bicep |
| 35 | +
|
| 36 | +## π¦ Local Development |
| 37 | +
|
| 38 | +### Prerequisites |
| 39 | +
|
| 40 | +- Node.js 22+ |
| 41 | +- Azure CLI |
| 42 | +- Just command runner |
| 43 | +
|
| 44 | +### Setup |
| 45 | +
|
| 46 | +1. Clone the repository |
| 47 | +2. Deploy infrastructure: |
| 48 | + \`\`\`bash |
| 49 | + just deploy-all |
| 50 | + \`\`\` |
| 51 | +
|
| 52 | +3. Start local development: |
| 53 | + \`\`\`bash |
| 54 | + # Backend |
| 55 | + just backend-start |
| 56 | +
|
| 57 | + # Frontend (in another terminal) |
| 58 | + just frontend-start |
| 59 | + \`\`\` |
| 60 | +
|
| 61 | +## π’ Deployment |
| 62 | +
|
| 63 | +### Local Deployment |
| 64 | +
|
| 65 | +\`\`\`bash |
| 66 | +# Deploy all |
| 67 | +just deploy-all |
| 68 | +
|
| 69 | +# Or deploy individually |
| 70 | +just deploy-infra |
| 71 | +just deploy-backend |
| 72 | +just deploy-frontend |
| 73 | +\`\`\` |
| 74 | +
|
| 75 | +### GitHub Actions |
| 76 | +
|
| 77 | +Automatic deployment on push to \`main\` branch: |
| 78 | +- Backend deploys on changes to \`backend/**\` |
| 79 | +- Frontend deploys on changes to \`frontend/**\` |
| 80 | +
|
| 81 | +See [.github/SETUP.md](.github/SETUP.md) for configuration. |
| 82 | +
|
| 83 | +## π§ͺ Testing |
| 84 | +
|
| 85 | +\`\`\`bash |
| 86 | +# Test local services |
| 87 | +just test-backend |
| 88 | +just test-openai |
| 89 | +
|
| 90 | +# Test deployed services |
| 91 | +just test-backend-deployed |
| 92 | +just test-frontend-deployed |
| 93 | +\`\`\` |
| 94 | +
|
| 95 | +## π Available Commands |
| 96 | +
|
| 97 | +Run \`just\` to see all available commands. |
| 98 | +
|
| 99 | +## ποΈ Project Structure |
| 100 | +
|
| 101 | +\`\`\` |
| 102 | +βββ backend/ # Express API server |
| 103 | +βββ frontend/ # Angular application |
| 104 | +βββ infra/ # Bicep infrastructure templates |
| 105 | +β βββ scripts/ # Deployment scripts |
| 106 | +βββ .github/ |
| 107 | + βββ workflows/ # GitHub Actions |
| 108 | +\`\`\` |
| 109 | +
|
| 110 | +## π License |
| 111 | +
|
| 112 | +MIT |
| 113 | +EOF |
| 114 | + |
| 115 | +echo "β
README.md created with deployment URLs" |
0 commit comments