This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
@stolostron/console is the user interface for Red Hat Advanced Cluster Management (ACM) for Kubernetes and Red Hat MultiCluster Engine (MCE). It's a sophisticated multi-cluster management console that can run both as a standalone application (for development purposes) and as OpenShift Console dynamic plugins.
npm ci- Install dependencies for both frontend and backendnpm start- Start both frontend and backend in development modenpm run plugins- Run as OpenShift Console plugins with OCP console (requires cluster setup)npm test- Run comprehensive test suite for both frontend and backendnpm run check- Run linting, formatting, and type checking across the entire projectnpm run build- Production build for both frontend and backend
npm run setup- Configure environment for cluster connection (creates backend/.env)npm run clean- Clean build artifacts from both frontend and backend
npm run lint- Lint both frontend and backend codenpm run lint:fix- Auto-fix linting issuesnpm run i18n- Validate internationalization filesnpm run i18n:fix- Fix i18n issues
npm run test:frontend- Run frontend tests onlynpm run test:backend- Run backend tests only- Individual test files:
npm test -- <test-file-pattern>
console/
├── frontend/ # React application with TypeScript
├── backend/ # Node.js ESM backend service
├── docs/ # Architecture documentation
└── scripts/ # Build and development scripts
- Framework: React 18+ with TypeScript in strict mode
- State Management: Recoil for global state, Redux Toolkit for complex scenarios
- UI Framework: PatternFly 6+ (Red Hat's design system)
- Routing: React Router with v5 compatibility layer
- Build: Webpack 5 with module federation for dynamic plugins
- Testing: Jest with React Testing Library
- Runtime: Node.js 20+ with ESM modules
- Server: Custom HTTP/2 proxy server using find-my-way router
- Authentication: OAuth flow with cookie-based token management
- Logging: Pino structured logging with development formatting
- Metrics: Prometheus client integration
The console supports three deployment modes:
- Standalone: Independent web application
- ACM Dynamic Plugin: Integrated into OpenShift Console for ACM features
- MCE Dynamic Plugin: Integrated into OpenShift Console for MCE features
- Frontend: React, TypeScript, PatternFly, Recoil, Monaco Editor, React Query
- Backend: Node.js ESM, HTTP/2 proxy, Pino logging, Prometheus metrics
- Development: Webpack 5, Jest, ESLint, Prettier, Husky pre-commit hooks
- Node.js 20 and npm 9 are required
- OpenShift 4.x cluster with ACM or MCE installed for full functionality
- openssl for certificate generation
All ports are customizable via environment variables defined in port-defaults.sh:
FRONTEND_PORT(default 3000) - Standalone consoleBACKEND_PORT(default 4000) - Backend APIsCONSOLE_PORT(default 9000) - OpenShift consoleACM_PORT(default 3001) - ACM pluginMCE_PORT(default 3002) - MCE plugin
- Frontend uses
acm-access-token-cookiefor user tokens - On 401 responses, OAuth flow starts via
/loginendpoint - Backend proxies to cluster OAuth and sets cookie on success
- Use
npm run pluginsto develop with OpenShift Console integration - Plugin code is in
frontend/plugins/directory - ACM and MCE plugins are built separately and served on different ports
The @stolostron/multicluster-sdk package provides:
- Fleet-wide resource management across multiple clusters
- Multicluster-aware React hooks and components
- Search capabilities across managed clusters
- Strict mode enabled across the project
- No implicit any allowed
- Comprehensive type checking required before commits
- Jest with React Testing Library for frontend
- Node.js native test runner for backend
- Coverage requirements enforced
- ESLint with TypeScript rules
- Prettier for code formatting
- Husky pre-commit hook enforces Signed-off-by line on commits
Features can be enabled/disabled via the console-config ConfigMap in the installation namespace. Feature flags are defined in frontend/src/utils/flags/consts.ts.
If experiencing proxy errors, remove backend/certs folder and run npm run ci:backend to regenerate certificates.
Ensure Node.js 20 and npm 9 are being used. Version mismatches cause ESM module resolution failures.
Run npm run setup to generate the required backend/.env file with cluster connection details.
The project uses automatic fast-forwarding between release branches:
- Pull requests should target the first branch in each release line
main → release-2.16 → backplane-2.11(current active release branch will begin withmain)- Multiple release lines are maintained for different product versions