One-Stop Infrastructure Repository: Local development, cloud deployment (Azure), and automation scripts for the xshopai e-commerce platform.
This repository contains everything needed to deploy and run the xshopai platform in any environment:
- 🏠 Local Development - Docker Compose for local testing
- ☁️ Azure Deployment - Infrastructure as Code (Bicep) + automation scripts
- 🤖 CI/CD - GitHub Actions workflows for automated deployments
- 📜 Scripts - Bootstrap, setup, and utility scripts
# Start all services locally with Docker Compose
cd local/docker-compose
./start-infra.sh
# Or use Docker scripts
cd local/docker
./deploy.sh# One-command bootstrap and deployment
cd azure/app-service
./scripts/deploy.shThis will:
- ✅ Create Azure Service Principal
- ✅ Create Container Registry
- ✅ Configure GitHub secrets
- ✅ Setup GitHub environments
- ✅ Trigger infrastructure deployment
- ✅ Deploy all 16 services
Time: ~1 hour (10 min hands-on, 50 min automated)
infrastructure/
├── .github/workflows/
│ └── deploy-app-service-infra.yml # Infrastructure CI/CD
│
├── azure/
│ ├── app-service/ # App Service deployment (self-contained)
│ │ ├── bicep/ # Bicep IaC templates
│ │ │ ├── main.bicep
│ │ │ ├── parameters.*.json
│ │ │ └── modules/
│ │ ├── scripts/ # All scripts needed for deployment
│ │ │ ├── deploy.sh # 🎯 Main entry point
│ │ │ ├── azure-setup.sh # Azure prerequisites
│ │ │ ├── github-setup.sh # GitHub configuration
│ │ │ ├── health-check.sh # Verification
│ │ │ └── common.sh # Shared functions
│ │ └── docs/ # Deployment guides
│ │
│ └── aca/ # Container Apps (self-contained alternative)
│ ├── bicep/
│ ├── scripts/
│ └── docs/
│
├── local/
│ ├── docker/ # Docker-based local dev
│ │ ├── deploy.sh
│ │ ├── stop.sh
│ │ └── modules/
│ └── docker-compose/ # Docker Compose setup
│ ├── docker-compose.*.yml
│ ├── start-infra.sh
│ └── stop-infra.sh
│
└── shared/ # Shared configs (service definitions)
└── services/
└── services.yaml # Service metadata
What you get:
- 16 App Services (14 microservices + 2 UIs)
- RabbitMQ Container Instance
- 4 Database systems (Cosmos DB, PostgreSQL, MySQL, SQL Server)
- Redis Cache
- Key Vault (with auto-generated secrets)
- Application Insights monitoring
Quick start:
cd azure/app-service
./scripts/deploy.shDocumentation: azure/app-service/docs/README.md
What you get:
- Serverless container hosting
- Dapr integration
- Auto-scaling
- Service Bus messaging
Quick start:
cd azure/aca/scripts
./deploy.shDocumentation: azure/aca/docs/README.md
What you get:
- All 16 services running locally
- Local databases (MongoDB, PostgreSQL, MySQL, SQL Server)
- RabbitMQ
- Redis
- Full platform for testing
Quick start:
cd local/docker-compose
./start-infra.shDocumentation: local/docker-compose/README.md
Secrets are auto-generated by the infrastructure workflow:
- JWT RS256 key pair
- Admin password
- Database passwords
View secrets in Azure Key Vault after deployment.
Secrets are in .env files (not committed to git).
| Script | Purpose | Location |
|---|---|---|
deploy.sh |
⭐ Master bootstrap orchestrator | azure/app-service/scripts/ |
azure-setup.sh |
Create Service Principal + ACR | azure/app-service/scripts/ |
github-setup.sh |
Create GitHub environments | azure/app-service/scripts/ |
health-check.sh |
Test all service health endpoints | azure/app-service/scripts/ |
common.sh |
Shared utility functions | azure/app-service/scripts/ |
| Script | Purpose | Location |
|---|---|---|
start-infra.sh |
Start local infrastructure | local/docker-compose/ |
stop-infra.sh |
Stop local infrastructure | local/docker-compose/ |
Note: Each deployment type is self-contained with all scripts in its own folder.
File: .github/workflows/deploy-app-service-infra.yml
Triggers:
- 🔄 Automatic - Push to
main(deploys to dev) - 👆 Manual - Workflow dispatch (choose dev/prod)
Protection:
- Development: No approval
- Production: 2 reviewers required
| Environment | Monthly Cost (USD) |
|---|---|
| Local | $0 (your machine) |
| Azure Dev | ~$119/month |
| Azure Prod | ~$657/month |
See detailed cost breakdowns in deployment guides.
- Quick Start: This README
- App Service Deployment: azure/app-service/docs/README.md
- Architecture Deep Dive: azure/app-service/docs/ARCHITECTURE.md
- Container Apps: azure/aca/docs/README.md
- Local Development: local/docker-compose/README.md
If you were using the old deployment repo...
The deployment repo has been consolidated into infrastructure:
| Old Location | New Location |
|---|---|
deployment/azure/app-service/scripts/ |
infrastructure/azure/app-service/scripts/ |
deployment/azure/app-service/docs/ |
infrastructure/azure/app-service/docs/ |
deployment/local/docker-compose/ |
infrastructure/local/docker-compose/ |
Update your workflows:
# Old
uses: xshopai/deployment/.github/workflows/...
# New
uses: xshopai/infrastructure/.github/workflows/...Problem: Application services fail to start or show "Application Error"
Common Cause: Critical infrastructure services (PostgreSQL, RabbitMQ) may be stopped
Solution:
# Check and start all infrastructure services
cd scripts
chmod +x ensure-services-running.sh
./ensure-services-running.sh rg-xshopai-development developmentOr manually check:
# Check PostgreSQL state
az postgres flexible-server show \
--name psql-xshopai-development \
--resource-group rg-xshopai-development \
--query "state" -o tsv
# Start if stopped
az postgres flexible-server start \
--name psql-xshopai-development \
--resource-group rg-xshopai-development
# Check RabbitMQ state
az container show \
--name aci-rabbitmq-development \
--resource-group rg-xshopai-development \
--query "instanceView.state" -o tsvPrevention:
- Azure Postgres Flexible Server doesn't auto-start - avoid manually stopping it
- Use Azure Monitor alerts to notify when services go down
- Run
ensure-services-running.shbefore deployments
If App Service shows "unhealthy" in Azure Portal:
- Check infrastructure services are running (see above)
- Verify environment variables are set correctly
- Check application logs:
az webapp log tail --name <app-name> --resource-group <rg-name>
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: See
docs/folders in each deployment option
MIT License - See LICENSE file for details.
Happy Deploying! 🚀