Developer Portal Service — Deployment Topology
Version: 1.0 Status: Draft Owner: Product + Developer Relations (DevRel) Last Updated: 2026-04-20
1. Intent
Describe runtime, replicas, scaling triggers, regions, dependencies, and CDN posture for the Developer Portal. The portal mixes static (docs) and dynamic (Verify, key UI) workloads — both must be independently scalable.
2. Runtime Stack
- Docs: Next.js 15 SSG/ISR on Node 22. TBD
- Portal API: NestJS 11 on Node 22. TBD
- Sandbox proxy: Fastify on Node 22. TBD
- Verify worker: Node 22 background process. TBD
3. Replica Plan
| Component | Min | Max | Trigger |
|---|---|---|---|
| Docs (Next.js) | 3 | 6 | CPU > 70% / 5m |
| Portal API | 3 | 12 | RPS > 200/inst |
| Sandbox proxy | 4 | 16 | RPS > 500/inst |
| Verify worker | 2 | 8 | NATS lag > 100 |
4. Regions
- Primary: KBL-DC1 (Kabul). DR: KBL-DC2 + MZR-DC1 (Mazar). TBD
5. Dependencies (runtime)
auth-service(gRPC, mTLS) — hard dependency for key/Verify scopes. TBDsms-orchestrator(HTTPS) — Verify SMS dispatch. TBDchannel-router-service(gRPC) — Verify channel fallback. TBDanalytics-service(gRPC) — consumption dashboards. TBDbilling-service(gRPC) — Verify spend metering. TBD
6. CDN
- Cloudflare or in-country CDN equivalent fronting docs. TBD
7. Deployment Pipeline
- TBD (GitHub Actions → ArgoCD → blue/green portal API; canary 10% Verify worker)
8. Resource Sizing
- TBD
9. Secrets
- Vault (per-env) for API keys to upstream services and HMAC pepper. TBD