How phasehq/console works
Main Components
a. Frontend (Next.js + Apollo)
b. API Gateway / Reverse Proxy (Nginx)
c. Backend (Django REST + Graphene GraphQL)
d. Relational Database (PostgreSQL)
e. Cache / Queue (Redis for RQ workers)
f. Background Workers (RQ)
g. Logging Service (DynamoDB via backend/logs)
h. External Integrations (GitHub, GitLab, AWS Secrets Manager, Cloudflare, Vercel, Nomad, Railway, Vault, Kubernetes)
i. CLI (Phase CLI communicating over REST/GraphQL)
j. Self-hosting Orchestration (Docker Compose, Kubernetes)
• Gray clouds for “External Services & Integrations”
External Integrations (Gray Clouds, placed around the periphery)
• OAuth Providers: GitHub, GitLab, Google (via backend/api/authentication/adapters)
• Sync Targets: AWS, Cloudflare, Vault, Vercel, Nomad, Railway (via backend/api/utils/syncing/*)
• Kubernetes (Phase Secrets Operator)
• Email (SMTP) for invites & notifications (backend/api/emails.py)
• Docker Compose services: nginx, frontend, backend, db, redis, worker
• Kubernetes (optional self-hosted)
That all internal components are packaged as Docker containers managed by Compose / Kubernetes.
Architectural Patterns & Design Principles
• API-First & GraphQL (schema in frontend/apollo/schema.graphql & backend/backend/schema.py)
• Modular Authentication Adapters for SSO / OAuth
• Background Processing via RQ to off-load long-running sync tasks
• Layered separation: Presentation (Next.js) → API (GraphQL/REST) → Business Logic (Django Services) → Data Layer (ORM, DB, Cache)
• Open-Core model: feature-flagged ee/ modules loaded conditionally
Final Checklist
[ ] Frontend → Nginx → Backend
[ ] Backend → PostgreSQL & Redis
[ ] RQ Workers → External Integrations & DynamoDB Logs
[ ] CLI communication path to Nginx/Backend
[ ] Deployment context (Docker Compose / Kubernetes)
[ ] External OAuth & sync target clouds