How redhat-developer/rhdh works
Project Type and Purpose
• This is a full-stack, enterprise-grade Internal Developer Portal (Red Hat Developer Hub) built on Backstage.
• It consists of:
• A React-based Frontend (packages/app)
• A Node.js/Express-based Backend (packages/backend)
• Dozens of Backstage plugins (plugins/*) plus a dynamic-plugin wrapper layer (dynamic-plugins/*)
• CI/CD and infra code (manifests/, .github/workflows/, .ibm/pipelines)
• E2E test suite (e2e-tests/)
File-Structure Highlights
• packages/app: the core Backstage UI, bootstrap logic, plugin wiring (Scalprum dynamic-root loader), UI components, API client definitions.
• packages/backend: the Backstage backend service exposing plugin routes, auth, healthchecks, transitive-group-ownership resolution, dynamic-plugin loader.
• plugins/*: standalone plugins each with frontend and/or backend modules (e.g. dynamic-plugins-info, licensed-users-info, scalprum-backend).
• dynamic-plugins: the mechanism for packaging and loading community or custom plugins at runtime via wrapper packages.
• manifests/, docker/, scripts/: Kubernetes manifests, Dockerfiles, Helm hooks, and setup scripts for Keycloak, RH SSO, etc.
• .github/workflows & .ibm/pipelines: CI/CD pipelines for building images, running e2e tests, deploying to AKS/GKE/OpenShift.
• e2e-tests: Playwright suite for verifying UI flows and integrations (Auth, Plugins, RBAC, TLS, Redis cache).
Key Insights from README
• The system integrates many external systems via Backstage plugins: Keycloak (OIDC), GitHub (discovery/org data), Kubernetes, OCM, ArgoCD, Tekton, SonarQube, Jira, Dynatrace, Datadog, etc.
• Authentication is delegated to Keycloak (or other OIDC providers) via the Auth plugin.
• A Postgres database backs some plugins (e.g. licensed-users-info) and health checks. Redis is used as a cache for session or plugin-data.
• The app supports dynamic loading of plugins without rebuilding the core image.
Main Components & Interactions
A. Frontend (React/Backstage App)
• Hosts the Backstage core UI.
• Dynamically loads plugins from dynamic-plugins root (via Scalprum).
• Communicates to Backend over REST/HTTP through AuthApi, LearningPathApi, DynamicPluginsInfoApi, and plugin-specific APIs.
B. Backend (Node.js/Express)
• Serves plugin routes (router.ts in each backend plugin).
• Handles authentication introspection, RBAC enforcement, metrics (Prometheus), corporate-proxy.
• Loads dynamic-plugin bundles, exposes routes under /api/<plugin>.
C. Data Stores & Cache
• Postgres DB: licensed-users-info plugin, plugin metadata (via manifests/deployment).
• Redis Cache: global cache for sessions or resource data (verify-redis-cache in E2E tests).
D. External Services
• Identity: Keycloak (OIDC/OAuth2) or Google/Azure/GitHub providers.
• SCM & CI: GitHub (discovery, org data, actions, issues, pull requests), GitLab, Azure DevOps, Jenkins, Tekton.
• Kubernetes Cluster: OCM, ArgoCD, topology plugin, K8s plugin.
• Monitoring/Security: SonarQube, Dynatrace, Datadog, Security Insights plugin.
• Artifact Repositories: Quay, Nexus, JFrog Artifactory.
• Notifications: PagerDuty, Signals plugin.
E. CI/CD & Infra
• GitHub Actions + IBM pipelines build Docker images, run tests, push to quay.io.
• Kubernetes manifests (manifests/) and Helm overlays handle deployment to dev/prod.
• Scripts (scripts/) for setting up Keycloak, RH SSO, database secrets, operator deployments.
Architectural Patterns & Principles
• Plugin-based microfrontend architecture (Backstage + Scalprum).
• Modular backend services (each plugin provides its own router).
• Dynamic plugin loading to decouple release cycles.
• Clear separation of concerns: UI layer, API layer, persistence, external integrations.
• Infrastructure as code: declarative K8s manifests, Helm, CI pipelines.
Don’t Overthink—Capture Everything
• Enumerate as many components as possible (core, plugins, databases, caches, external systems, CI/CD).