How pegasystems/constellation-ui-gallery works
Project type and purpose
• This is a front-end component library and documentation site built with React, TypeScript, and Storybook. It provides ready-to-use “Constellation DX” UI components for the Pega Platform, along with tooling to build, test, bundle, and publish them.
File structure
• Top-level directories and files:
• .devcontainer/ – VS Code Dev Container configuration
• .github/workflows/ – CI/CD pipelines (GitHub Actions)
• src/ – React components, MDX docs, Storybook stories
• storybook/ – Storybook configuration and theming
• package.json, babel.config.js, tsconfig*.json – build, lint, test configuration
• tasks.config.json – Constellation DX CLI publishing config
• Build and test scripts are in package.json (start, build, lint, test, publish).
README for additional insights
• The README outlines local development (npm install, npm run start for Storybook), linting, unit tests (Jest), end-to-end tests (Playwright), production build, and publishing to a Pega server via Constellation DX CLI.
Main components and their interactions
a. Source Code Repository (GitHub)
b. Developer Environment
• VS Code with Dev Container
• Node.js, npm
• React/TypeScript code in src/
c. Storybook
• Serves interactive component gallery (npm run start)
• Static build (npm run build-storybook)
d. Testing
• Unit tests via Jest
• E2E tests & accessibility checks via Playwright against Storybook
e. Build & Packaging
• Babel + TypeScript → transpile components
• npm run buildAllComponents → bundles ready for consumption
f. Publishing
• Constellation DX CLI: npm run authenticate → auth to Pega Platform
• npm run publishAll → upload RAP file containing components to Pega server
g. CI/CD (GitHub Actions)
• Validate PRs, run lint/test, build Storybook, deploy docs to GitHub Pages, run security scans
Architectural patterns and design principles
• Separation of concerns:
• Presentation components under src/components/*
• Documentation in MDX alongside each component
• Configuration and demos isolated in per-component folders
• Pipeline-as-code: workflows defined in .github/workflows
• Containerized development: .devcontainer for reproducible IDE setup
Detail without over-fragmentation
• Component is clearly named (e.g., “Constellation DX CLI”, “Storybook Server”, “GitHub Pages”).