{"id":48770286,"url":"https://github.com/xshopai/infrastructure","last_synced_at":"2026-04-13T09:46:00.275Z","repository":{"id":331960583,"uuid":"1131136133","full_name":"xshopai/infrastructure","owner":"xshopai","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-05T22:58:20.000Z","size":914,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-06T00:39:38.394Z","etag":null,"topics":["automation","azure","bicep","devops","infrastructure"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xshopai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-09T14:29:21.000Z","updated_at":"2026-03-05T22:58:23.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/xshopai/infrastructure","commit_stats":null,"previous_names":["xshopai/infrastructure"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xshopai/infrastructure","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xshopai%2Finfrastructure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xshopai%2Finfrastructure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xshopai%2Finfrastructure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xshopai%2Finfrastructure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xshopai","download_url":"https://codeload.github.com/xshopai/infrastructure/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xshopai%2Finfrastructure/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31746339,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T09:16:15.125Z","status":"ssl_error","status_checked_at":"2026-04-13T09:16:05.023Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","azure","bicep","devops","infrastructure"],"created_at":"2026-04-13T09:45:59.316Z","updated_at":"2026-04-13T09:46:00.265Z","avatar_url":"https://github.com/xshopai.png","language":"Shell","readme":"# xshopai Infrastructure\n\n\u003e **One-Stop Infrastructure Repository**: Local development, cloud deployment (Azure), and automation scripts for the xshopai e-commerce platform.\n\nThis repository contains everything needed to deploy and run the xshopai platform in any environment:\n\n- 🏠 **Local Development** - Docker Compose for local testing\n- ☁️ **Azure Deployment** - Infrastructure as Code (Bicep) + automation scripts\n- 🤖 **CI/CD** - GitHub Actions workflows for automated deployments\n- 📜 **Scripts** - Bootstrap, setup, and utility scripts\n\n---\n\n## 🚀 Quick Start\n\n### Local Development\n\n```bash\n# Start all services locally with Docker Compose\ncd local/docker-compose\n./start-infra.sh\n\n# Or use Docker scripts\ncd local/docker\n./deploy.sh\n```\n\n### Azure App Service Deployment\n\n```bash\n# One-command bootstrap and deployment\ncd azure/app-service\n./scripts/deploy.sh\n```\n\nThis will:\n\n1. ✅ Create Azure Service Principal\n2. ✅ Create Container Registry\n3. ✅ Configure GitHub secrets\n4. ✅ Setup GitHub environments\n5. ✅ Trigger infrastructure deployment\n6. ✅ Deploy all 16 services\n\n**Time:** ~1 hour (10 min hands-on, 50 min automated)\n\n---\n\n## 📁 Repository Structure\n\n```\ninfrastructure/\n├── .github/workflows/\n│   └── deploy-app-service-infra.yml    # Infrastructure CI/CD\n│\n├── azure/\n│   ├── app-service/                     # App Service deployment (self-contained)\n│   │   ├── bicep/                       # Bicep IaC templates\n│   │   │   ├── main.bicep\n│   │   │   ├── parameters.*.json\n│   │   │   └── modules/\n│   │   ├── scripts/                     # All scripts needed for deployment\n│   │   │   ├── deploy.sh               # 🎯 Main entry point\n│   │   │   ├── azure-setup.sh          # Azure prerequisites\n│   │   │   ├── github-setup.sh         # GitHub configuration\n│   │   │   ├── health-check.sh         # Verification\n│   │   │   └── common.sh               # Shared functions\n│   │   └── docs/                        # Deployment guides\n│   │\n│   └── aca/                             # Container Apps (self-contained alternative)\n│       ├── bicep/\n│       ├── scripts/\n│       └── docs/\n│\n├── local/\n│   ├── docker/                          # Docker-based local dev\n│   │   ├── deploy.sh\n│   │   ├── stop.sh\n│   │   └── modules/\n│   └── docker-compose/                  # Docker Compose setup\n│       ├── docker-compose.*.yml\n│       ├── start-infra.sh\n│       └── stop-infra.sh\n│\n└── shared/                              # Shared configs (service definitions)\n    └── services/\n        └── services.yaml                # Service metadata\n```\n\n---\n\n## 🎯 Deployment Options\n\n### Option 1: Azure App Service (Recommended for Production)\n\n**What you get:**\n\n- 16 App Services (14 microservices + 2 UIs)\n- RabbitMQ Container Instance\n- 4 Database systems (Cosmos DB, PostgreSQL, MySQL, SQL Server)\n- Redis Cache\n- Key Vault (with auto-generated secrets)\n- Application Insights monitoring\n\n**Quick start:**\n\n```bash\ncd azure/app-service\n./scripts/deploy.sh\n```\n\n**Documentation:** [azure/app-service/docs/README.md](azure/app-service/docs/README.md)\n\n---\n\n### Option 2: Azure Container Apps\n\n**What you get:**\n\n- Serverless container hosting\n- Dapr integration\n- Auto-scaling\n- Service Bus messaging\n\n**Quick start:**\n\n```bash\ncd azure/aca/scripts\n./deploy.sh\n```\n\n**Documentation:** [azure/aca/docs/README.md](azure/aca/docs/README.md)\n\n---\n\n### Option 3: Local Development (Docker)\n\n**What you get:**\n\n- All 16 services running locally\n- Local databases (MongoDB, PostgreSQL, MySQL, SQL Server)\n- RabbitMQ\n- Redis\n- Full platform for testing\n\n**Quick start:**\n\n```bash\ncd local/docker-compose\n./start-infra.sh\n```\n\n**Documentation:** [local/docker-compose/README.md](local/docker-compose/README.md)\n\n---\n\n## 🔐 Secrets Management\n\n### Azure Deployment\n\nSecrets are **auto-generated** by the infrastructure workflow:\n\n- JWT RS256 key pair\n- Admin password\n- Database passwords\n\nView secrets in Azure Key Vault after deployment.\n\n### Local Development\n\nSecrets are in `.env` files (not committed to git).\n\n---\n\n## 🛠️ Available Scripts\n\n### App Service Deployment\n\n| Script            | Purpose                           | Location                     |\n| ----------------- | --------------------------------- | ---------------------------- |\n| `deploy.sh`       | ⭐ Master bootstrap orchestrator  | `azure/app-service/scripts/` |\n| `azure-setup.sh`  | Create Service Principal + ACR    | `azure/app-service/scripts/` |\n| `github-setup.sh` | Create GitHub environments        | `azure/app-service/scripts/` |\n| `health-check.sh` | Test all service health endpoints | `azure/app-service/scripts/` |\n| `common.sh`       | Shared utility functions          | `azure/app-service/scripts/` |\n\n### Local Development\n\n| Script           | Purpose                    | Location                |\n| ---------------- | -------------------------- | ----------------------- |\n| `start-infra.sh` | Start local infrastructure | `local/docker-compose/` |\n| `stop-infra.sh`  | Stop local infrastructure  | `local/docker-compose/` |\n\n\u003e **Note**: Each deployment type is self-contained with all scripts in its own folder.\n\n---\n\n## 📊 CI/CD Workflows\n\n### Infrastructure Workflow\n\n**File:** `.github/workflows/deploy-app-service-infra.yml`\n\n**Triggers:**\n\n- 🔄 **Automatic** - Push to `main` (deploys to dev)\n- 👆 **Manual** - Workflow dispatch (choose dev/prod)\n\n**Protection:**\n\n- Development: No approval\n- Production: **2 reviewers required**\n\n---\n\n## 💰 Cost Estimates\n\n| Environment    | Monthly Cost (USD) |\n| -------------- | ------------------ |\n| **Local**      | $0 (your machine)  |\n| **Azure Dev**  | ~$119/month        |\n| **Azure Prod** | ~$657/month        |\n\nSee detailed cost breakdowns in deployment guides.\n\n---\n\n## 📚 Documentation\n\n- **Quick Start**: This README\n- **App Service Deployment**: [azure/app-service/docs/README.md](azure/app-service/docs/README.md)\n- **Architecture Deep Dive**: [azure/app-service/docs/ARCHITECTURE.md](azure/app-service/docs/ARCHITECTURE.md)\n- **Container Apps**: [azure/aca/docs/README.md](azure/aca/docs/README.md)\n- **Local Development**: [local/docker-compose/README.md](local/docker-compose/README.md)\n\n---\n\n## 🔄 Migrating from Old Structure\n\n\u003cdetails\u003e\n\u003csummary\u003eIf you were using the old \u003ccode\u003edeployment\u003c/code\u003e repo...\u003c/summary\u003e\n\nThe `deployment` repo has been **consolidated into `infrastructure`**:\n\n| Old Location                            | New Location                                |\n| --------------------------------------- | ------------------------------------------- |\n| `deployment/azure/app-service/scripts/` | `infrastructure/azure/app-service/scripts/` |\n| `deployment/azure/app-service/docs/`    | `infrastructure/azure/app-service/docs/`    |\n| `deployment/local/docker-compose/`      | `infrastructure/local/docker-compose/`      |\n\n**Update your workflows**:\n\n```yaml\n# Old\nuses: xshopai/deployment/.github/workflows/...\n\n# New\nuses: xshopai/infrastructure/.github/workflows/...\n```\n\n\u003c/details\u003e\n\n---\n\n## 🔧 Troubleshooting\n\n### Services Not Responding After Deployment\n\n**Problem**: Application services fail to start or show \"Application Error\"\n\n**Common Cause**: Critical infrastructure services (PostgreSQL, RabbitMQ) may be stopped\n\n**Solution**:\n\n```bash\n# Check and start all infrastructure services\ncd scripts\nchmod +x ensure-services-running.sh\n./ensure-services-running.sh rg-xshopai-development development\n```\n\nOr manually check:\n\n```bash\n# Check PostgreSQL state\naz postgres flexible-server show \\\n  --name psql-xshopai-development \\\n  --resource-group rg-xshopai-development \\\n  --query \"state\" -o tsv\n\n# Start if stopped\naz postgres flexible-server start \\\n  --name psql-xshopai-development \\\n  --resource-group rg-xshopai-development\n\n# Check RabbitMQ state\naz container show \\\n  --name aci-rabbitmq-development \\\n  --resource-group rg-xshopai-development \\\n  --query \"instanceView.state\" -o tsv\n```\n\n**Prevention**:\n\n- Azure Postgres Flexible Server doesn't auto-start - avoid manually stopping it\n- Use Azure Monitor alerts to notify when services go down\n- Run `ensure-services-running.sh` before deployments\n\n### Application Health Check Failing\n\nIf App Service shows \"unhealthy\" in Azure Portal:\n\n1. Check infrastructure services are running (see above)\n2. Verify environment variables are set correctly\n3. Check application logs: `az webapp log tail --name \u003capp-name\u003e --resource-group \u003crg-name\u003e`\n\n---\n\n## 🆘 Support\n\n- **Issues**: [GitHub Issues](https://github.com/xshopai/infrastructure/issues)\n- **Discussions**: [GitHub Discussions](https://github.com/xshopai/infrastructure/discussions)\n- **Documentation**: See `docs/` folders in each deployment option\n\n---\n\n## 📝 License\n\nMIT License - See [LICENSE](LICENSE) file for details.\n\n---\n\n**Happy Deploying! 🚀**\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxshopai%2Finfrastructure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxshopai%2Finfrastructure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxshopai%2Finfrastructure/lists"}