How ansible/ansible-ui works
Project Type and Purpose
• This is a monorepo full-stack UI project that ships three React/TypeScript client applications—AWX UI, EDA UI, and HUB UI—backed by a shared “framework” component library.
• It does not contain the backend services themselves; rather, each UI calls out to its corresponding backend (AWX server, EDA server, Galaxy HUB server) as configured by environment variables.
File Structure Highlights
• Top-level:
• frontend/awx, frontend/eda, frontend/hub – the three separate client apps
• framework/ – the shared PatternFly-based component library
• cypress/ – end-to-end and component test suites
• nginx/ – production Nginx configuration files
• Dockerfile, .github/workflows/ – CI/CD definitions
• Each client subfolder is a conventional React app (src, assets, tsconfig, etc.) using shared “framework” via an internal package reference.
• Cypress sits at the root and in each app folder to drive E2E and component tests against locally running servers.
• Dockerfile and Nginx configs show that apps get containerized and served behind Nginx with API proxying.
Key README Insights
• Scripts like npm run awx, npm run hub, npm run eda launch each UI on a different port locally.
• Environment variables AWX_SERVER, EDA_SERVER, HUB_SERVER define API backends.
• CI runs TypeScript checks, ESLint, Prettier, and Cypress tests in GitHub Actions workflows.
Main Components
a. Developer / CI Environment
– Local Node/NPM build & dev servers for each app
– Cypress test runner (E2E + component tests)
– GitHub Actions (lint → tsc → build → test → Docker build → deploy)
b. Shared Library
– framework package (shared React components, hooks, utilities)
c. Client Applications
– AWX UI (React app served on http://localhost:4101)
– EDA UI (React app served on http://localhost:4103)
– HUB UI (React app served on http://localhost:4102)
d. Production Web Tier
– Docker container with Nginx serving static assets and reverse-proxying API calls
e. Backend Services (External)
– AWX server REST/WebSocket API
– EDA server REST API
– Galaxy HUB server API (galaxykit)
Interactions and Data Flow
• Browser → HTTP GET (static JS/CSS) → Nginx
• Browser JS → AJAX/Fetch or WebSocket → Nginx API proxy → Backend
• Cypress tests → HTTP to local dev server → run UI flows → validate responses
• CI pipeline → builds + tests + Docker image → deploy to staging/production
Architectural Patterns & Principles
• Monorepo with multiple client packages and a shared UI library
• Component library / design system (framework) for consistency
• Separation of concerns: UI layer (React + PatternFly) vs. API backends
• CI/CD pipeline with automated lint, build, test, containerization
• Environment‐driven configuration for backends and API prefixes
Essential Elements to Capture
• Monorepo structure → shared framework + three client apps
• Developer vs. CI vs. production environments
• Data flow: browser → static assets → API calls → backends
• Cypress/E2E test integration
• Docker + Nginx containerization and proxy configuration