Turn GitHub PRs into per-PR preview environments (Vercel/Netlify), manage encrypted env vars + rotation, track health/uptime, and get Slack alerts — with deploy analytics (success rate, P95 create time, error taxonomy).
- 🚀 Per-PR Previews: Automatic create/teardown via GitHub webhooks → Vercel/Netlify
- 🔐 Secrets & Rotation: AES-256-GCM encryption at rest, versioning, automated rotation policies
- 💚 Health Monitoring: OK/DEGRADED state machine, Slack alerts with cooldown, auto-registration
- 📊 Deploy Analytics: Success rate, P50/P95/P99 metrics, error taxonomy, weekly digest
- 👥 RBAC & Audit: Organization/Project roles; comprehensive audit logging
- 🔧 Provider Agnostic: Extensible architecture supporting Vercel, Netlify, and custom providers
flowchart LR
GH[GitHub Webhooks] --> API
UI[Next.js Web] --> API
API[NestJS API] --> Q[Redis/BullMQ]
Q --> Prov[Vercel/Netlify Provider]
API --> PG[(PostgreSQL)]
API --> Slack[Slack API]
HC[Health Probes] --> API
- Web App (Next.js): React dashboard with TypeScript
- API (NestJS): RESTful API with authentication, RBAC, and webhooks
- Queue (BullMQ + Redis): Background job processing for deployments
- Database (PostgreSQL): Primary data store with Prisma ORM
- Providers: Vercel, Netlify, and mock providers for testing
- Monitoring: Health checks, analytics, and Slack notifications
- Node.js 18+
- Docker & Docker Compose
- pnpm
# 1) Clone and install
git clone <your-repo>
cd DevInfra-OpsHub
pnpm install
# 2) Environment setup
cp deploy/env.example .env
# Edit .env with your GitHub OAuth credentials
# 3) Start services
docker compose -f deploy/docker-compose.prod.yml up -d
# 4) Database setup
pnpm --filter @opshub/api prisma migrate dev
pnpm --filter @opshub/api prisma db seed
# 5) Start applications
pnpm -w dev
# 6) Visit the app
open http://localhost:3000For testing without GitHub OAuth:
# Enable test login
echo "ALLOW_TEST_LOGIN=1" >> .env
# Login as demo user
curl -X POST http://localhost:4000/test/login-as \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]"}'- Click the "Deploy to Render" button above
- Connect your GitHub repository
- Configure environment variables (see
deploy/env.example) - Deploy with one click!
See docs/DEPLOY.md for detailed deployment instructions.
- Architecture - System design and component interactions
- Security - Threat model, encryption, and security practices
- Operations - Environment setup, monitoring, and runbooks
- API Reference - Complete API documentation with examples
- Demo Guide - Step-by-step demonstration scenarios
- Troubleshooting - Common issues and solutions
# 1) Seed demo data
pnpm demo:seed
# 2) Open a PR (simulates GitHub webhook)
pnpm demo:open --repo octocat/Hello-World --pr 42 --branch feature/demo
# 3) Check the dashboard - you'll see:
# - New preview deployment
# - Health check auto-created
# - Slack notification (if configured)
# 4) Close the PR
pnpm demo:close --repo octocat/Hello-World --pr 42
# 5) View analytics and health metricsEnable demo mode for guided demonstrations:
# Set demo mode in .env
echo "DEMO_MODE=1" >> .env
echo "USE_MOCK_PROVIDER=1" >> .env
echo "DISABLE_SLACK=1" >> .env
# Start the application
pnpm dev
# Visit /demo for guided steps
open http://localhost:3000/demo# Build and install CLI
pnpm --filter @opshub/cli build
pnpm link -w
# Login and run demo
opshub login --email [email protected]
opshub demo reset
opshub demo open-pr
opshub demo degrade
opshub demo recover
opshub demo close-prSee docs/screenshots/ for automated UI screenshots.
├── apps/
│ ├── web/ # Next.js frontend
│ └── api/ # NestJS backend
├── packages/
│ ├── types/ # Shared TypeScript types
│ └── cli/ # Command-line interface
├── docs/ # Documentation
├── scripts/ # Demo and utility scripts
└── deploy/ # Deployment configurations
# Development
pnpm dev # Start all services
pnpm build # Build all packages
pnpm test # Run all tests
pnpm test:e2e # Run Playwright E2E tests
pnpm test:k6 # Run k6 load tests
# Demo
pnpm demo:seed # Seed demo data
pnpm demo:open # Simulate PR opened
pnpm demo:close # Simulate PR closed
pnpm demo:screens # Generate screenshots
# CLI
pnpm --filter @opshub/cli build # Build CLI
pnpm link -w # Link CLI globally
opshub --help # Show CLI help
# Database
pnpm db:migrate # Run migrations
pnpm db:seed # Seed databaseSee deploy/env.example for complete configuration options.
DATABASE_URL- PostgreSQL connection stringREDIS_URL- Redis connection stringJWT_SECRET- JWT signing secretENCRYPTION_KEY_BASE64- 32-byte base64 encryption keyGITHUB_CLIENT_ID- GitHub OAuth client IDGITHUB_CLIENT_SECRET- GitHub OAuth client secret
ALLOW_TEST_LOGIN- Enable test login (development only)DISABLE_SLACK- Disable Slack notifications (testing)USE_MOCK_PROVIDER- Use mock provider (testing)
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
MIT License - see LICENSE for details.
Built with:
- Next.js - React framework
- NestJS - Node.js framework
- Prisma - Database ORM
- BullMQ - Queue processing
- Playwright - E2E testing
- k6 - Load testing
Ready to deploy? Check out the Demo Guide for a complete walkthrough! 🚀