How openplanhq/openplan works
openplan is a self-hosted Terraform/OpenTofu platform: users register Git-backed templates, compose and configure stack instances, then request plans, applies, or destroys and review durable run status and logs. The browser calls the API; the API owns product operations and coordinates durable work through Temporal, while executor workers run Terraform and return artifacts. The graph preserves documented access control, SSO, credentials, upgrades, and run history. Some subsystem links are documented capabilities rather than inspected call sites; these are dashed where wiring was not shown.
Main entry points: client.ts API client · router.tsx Product screens · service.go Product service · template_run.go Run activities
Components 23
Web experience
- Web application
web/src/main.tsx - Product screens
web/src/app/router.tsx - API client
web/src/api/client.ts - Sign-in and session UI
web/src/auth/SessionProvider.tsx - Template management
web/src/features/templates/RegisterTemplatePanel.tsx - Stack management
web/src/features/stacks/AddStackTemplateScreen.tsx - Run history and logs
web/src/features/runs/RunDetailScreen.tsx
Identity and access
- OIDC sessions
internal/authentication/flow.go - Stack authorization
internal/authorization/authorization.go - OIDC provider
API and orchestration
- HTTP API
internal/api/server.go - Product service
internal/app/service.go - Work queue
internal/queue/controller.go - Temporal workflows
internal/workflows/template_run.go - Template sync workflow
internal/workflows/template_sync.go - Temporal service
Run execution
- Temporal executor
cmd/executor/main.go - Run activities
internal/activities/template_run.go - Terraform/OpenTofu
internal/runner/terraform.go - Git repository
Persistence and artifacts
- PostgreSQL repositories
internal/postgres/repositories.go - Run artifacts
internal/artifacts/store.go
Other components
- Platform user
Connections 27
- Platform user → Web application: uses
README.md - Web application → Product screens: renders
web/src/main.tsx - Product screens → Sign-in and session UI: routes to
web/src/app/router.tsx - Product screens → Template management: routes to
web/src/app/router.tsx - Product screens → Stack management: routes to
web/src/app/router.tsx - Product screens → Run history and logs: routes to
web/src/app/router.tsx - Template management → API client: requests
- Stack management → API client: requests
- Run history and logs → API client: requests
- API client → HTTP API: calls
- HTTP API → OIDC sessions: authenticates
internal/api/server.go - Sign-in and session UI → API client: signs in through
- OIDC sessions → OIDC provider: verifies identity
README.md - HTTP API → Product service: dispatches requests
internal/api/server.go - Product service → Stack authorization: checks access
README.md - Product service → PostgreSQL repositories: reads and writes
- Product service → Work queue: enqueues work
internal/app/service.go - Work queue → Temporal service: dispatches workflows
- Temporal service → Temporal workflows: runs
- Temporal service → Template sync workflow: runs
- Temporal workflows → Temporal executor: schedules execution
README.md - Temporal executor → Run activities: registers
cmd/executor/main.go - Run activities → Terraform/OpenTofu: runs phases
README.md - Run activities → Git repository: fetches source
README.md - Run activities → Run artifacts: stores logs and plans
- Run history and logs → API client: polls run data
- Run artifacts → HTTP API: provides run logs