A minimal vercel-inspired static hosting orchestrator for deploying static sites. Uses Docker for builds, MinIO for S3-compatible storage, and Nginx for reverse proxy routing — all wrapped in a fast, modern backend with a beautiful, intuitive UI for managing deployments and projects.
- 🚀 Automated Deployments: Deploy static sites from GitHub repositories
- 🔄 Webhook Integration: Auto-deploy on Git push events
- 🐳 Docker Builds: Isolated build environment for each deployment
- 📦 S3 Storage: MinIO for reliable artifact storage
- 🔁 Retry Logic: Automatic retry with exponential backoff (3 attempts)
- ⏮️ Rollback: Easy rollback to previous successful deployments
- 📊 Deployment History: Track all deployments with logs
- 🔧 Auto Nginx Config: Automatic reverse proxy configuration
- Node.js 18+
- Docker Desktop (running)
- Git
git clone <your-repo>
cd infra-orchestrator
npm installcp .env.example .envEdit .env if needed (defaults work for local development).
# Start Docker containers (MinIO, Nginx, MongoDB)
npm run docker:up / docker-compose up -d
# Start the orchestrator
npm run devThe services will be available at:
- Orchestrator API: http://localhost:3000
- MinIO Console: http://localhost:9001 (minioadmin/minioadmin)
- Nginx Proxy: http://localhost:8080
- MongoDB: localhost:27017
# Create a project
POST /api/projects
{
"name": "my-app",
"githubUrl": "https://github.com/user/repo",
"branch": "main",
"buildCommand": "npm run build",
"outputDir": "dist"
}
# Get all projects
GET /api/projects
# Get single project
GET /api/projects/:id
# Update project
PATCH /api/projects/:id
# Delete project
DELETE /api/projects/:id
# Trigger manual deployment
POST /api/projects/:id/deploy
# Get project deployments
GET /api/projects/:id/deployments# Get all deployments
GET /api/deployments
# Get single deployment
GET /api/deployments/:id
# Get deployment logs
GET /api/deployments/:id/logs
# Rollback to deployment
POST /api/deployments/:id/rollback
# Cancel queued deployment
POST /api/deployments/:id/cancel
# Delete deployment
DELETE /api/deployments/:id# GitHub webhook endpoint (configure in GitHub)
POST /api/webhook/github
# Test webhook
POST /api/webhook/test
{
"projectId": "project-id-here"
}
# Get webhook config instructions
GET /api/webhook/config/:projectId# Health check
GET /api/system/health
# Get statistics
GET /api/system/stats
# Get queue status
GET /api/system/queuecurl -X POST http://localhost:3000/api/projects \
-H "Content-Type: application/json" \
-d '{
"name": "my-portfolio",
"githubUrl": "https://github.com/yourusername/portfolio",
"branch": "main",
"buildCommand": "npm ci && npm run build",
"outputDir": "dist"
}'curl -X POST http://localhost:3000/api/projects/{PROJECT_ID}/deployOnce deployment succeeds, your site will be available at:
http://localhost:8080/{project-name}/
- Get webhook configuration:
curl http://localhost:3000/api/webhook/config/{PROJECT_ID}- In your GitHub repo:
- Go to Settings > Webhooks > Add webhook
- Set Payload URL to:
http://your-server:3000/api/webhook/github - Content type:
application/json - Events: Just the push event
- Save
Now deployments will trigger automatically on git push!
src/
├── api/
│ ├── routes/ # API route definitions
│ └── index.ts # Route initialization
├── config/
│ ├── logger.ts # Winston logger
│ ├── mongoose.ts # MongoDB connection
│ ├── morgan.ts # HTTP request logging
│ └── orchestratorConfig.ts # Environment config
├── controllers/ # Request handlers
│ ├── project.controller.ts
│ ├── deployment.controller.ts
│ ├── webhook.controller.ts
│ └── system.controller.ts
├── models/ # MongoDB schemas
│ ├── project.model.ts
│ └── deployment.model.ts
├── services/ # Business logic
│ ├── docker.service.ts # Docker build operations
│ ├── storage.service.ts # MinIO/S3 operations
│ ├── nginx.service.ts # Nginx config generation
│ └── buildQueue.service.ts # Build queue with retry
├── lib/ # Utilities
│ ├── error.ts # Error handling
│ └── validate.ts # Request validation
├── utils/
│ └── ApiError.ts # Custom error class
└── index.ts # Application entry point
- Project Creation: Define your project with GitHub URL and build commands
- Webhook/Manual Trigger: Deployment is triggered via webhook or manually
- Queue: Deployment is added to the build queue
- Clone: Repository is cloned to workspace
- Build: Docker container builds the project
- Upload: Built files are uploaded to MinIO
- Configure: Nginx config is regenerated and reloaded
- Serve: Site is accessible via Nginx at
/project-name/
# Server
NODE_ENV=development
PORT=3000
# Database
DB_CONNECTION=mongodb://localhost:27017/infra-orchestrator
# MinIO
MINIO_ENDPOINT=localhost
MINIO_PORT=9000
MINIO_ACCESS_KEY=minioadmin
MINIO_SECRET_KEY=minioadmin
MINIO_BUCKET=deployments
# Nginx
NGINX_HOST=localhost
NGINX_PORT=8080
NGINX_CONFIG_PATH=./nginx/conf.d
# Build
MAX_RETRY_ATTEMPTS=3
BUILD_TIMEOUT_MINUTES=15
WORKSPACE_DIR=./workspace
# Webhook (optional)
WEBHOOK_SECRET=your-secret-hereGitHub Push
↓
Webhook Received
↓
Create Deployment Record
↓
Add to Build Queue
↓
Clone Repository
↓
Build in Docker
↓ (retry up to 3x on failure)
Upload to MinIO
↓
Update Nginx Config
↓
Deployment Live! 🎉
If a deployment fails or you need to revert:
# List deployments
GET /api/projects/{PROJECT_ID}/deployments
# Rollback to specific deployment
POST /api/deployments/{DEPLOYMENT_ID}/rollback# Deployment logs
GET /api/deployments/{DEPLOYMENT_ID}/logs
# System stats
GET /api/system/stats
# Queue status
GET /api/system/queue# View all container logs
npm run docker:logs
# View specific container
docker logs infra-minio
docker logs infra-nginx# Verify Docker is running
docker --version
docker ps# Check MinIO is running
docker ps | grep minio
# Access MinIO console
open http://localhost:9001- Check deployment logs:
GET /api/deployments/{id}/logs - Verify build command works locally
- Check Docker has enough resources
- Ensure output directory is correct
# Check nginx config
cat nginx/conf.d/deployments.conf
# Reload nginx manually
docker exec infra-nginx nginx -s reload# Start in dev mode with hot reload
npm run dev
# Build TypeScript
npm run build
# Start production build
npm startFor production use:
- Set
NODE_ENV=productionin.env - Configure proper MongoDB connection string
- Set
WEBHOOK_SECRETfor GitHub webhooks - Use proper domain names in nginx config
- Configure SSL/TLS certificates
- Set up proper monitoring and logging
- Consider using managed MinIO or S3
- Run behind a proper reverse proxy (Caddy/Traefik)
This project works on Windows using:
- Docker Desktop for Windows
- Git Bash or PowerShell
- Node.js for Windows
Make sure Docker Desktop is running before starting the orchestrator.
MIT
Contributions welcome! This is a portfolio/learning project, so feel free to:
- Add features
- Fix bugs
- Improve documentation
- Share feedback
- Multiple build runtimes (Python, Go, etc.)
- Custom domains
- SSL certificate management
- Build caching
- Environment variable management UI
- Deployment preview URLs
- Team/user management
- API authentication
- Metrics and analytics
- Slack/Discord notifications
