How same7ammar/kube-composer works
1. High-level shape
- This is a single-page React + TypeScript application built with Vite and styled with Tailwind CSS.
- Its core purpose is to let a user model Kubernetes resources in the browser and generate downloadable YAML, without any backend service in the normal request path.
2. Primary user-facing boundary
- src/App.tsx is the orchestration layer that wires the main editors, previews, summaries, and tabs together.
- The app is organized as a set of resource-specific editors rather than a generic form engine, which keeps Kubernetes concepts explicit in the UI and the output.
3. Resource configuration subsystem
- src/components/*Manager.tsx and *Form.tsx components are the main input surface for Kubernetes objects such as:
- Deployments, DaemonSets, Jobs/CronJobs
- Namespaces, ConfigMaps, Secrets
- ServiceAccounts, Roles, RoleBindings, ClusterRoles
- List components like DeploymentsList.tsx, SecretsList.tsx, and RolesList.tsx act as browsing/editing companions for the current project state.
4. Kubernetes domain modeling
- src/types/index.ts defines the shared TypeScript shapes used by the editors and generators.
- src/data/kubernetesRBAC.ts contains domain data for RBAC-related objects, supporting the role/permission wizard and resource generation flows.
- This means the app’s “source of truth” is typed client-side state, not server-side persistence.
5. Generation pipeline
- src/utils/yamlGenerator.ts is the central transformation layer that turns the in-memory Kubernetes configuration into YAML output.
- The generated YAML is then consumed by preview/export components such as YamlPreview.tsx.
- The architecture is therefore: form state → typed config model → YAML generator → preview/export.
6. Visualization and feedback loop
- VisualPreview.tsx and ResourceSummary.tsx provide immediate feedback on the current configuration, likely showing relationships between resources and validation-like summaries.
- KubernetesIcons.tsx supports a more diagrammatic presentation of resource types.
- The app is designed to help users understand resource topology, not just produce text.
7. Cross-cutting UI services
- src/context/ThemeContext.tsx, src/provider/ThemeProvider.tsx, and hooks like useTheme.ts / useDarkMode.ts manage presentation state independent of Kubernetes configuration.
- useUsageCounter.ts and src/utils/localStorage.ts indicate browser-local persistence for usage tracking or preferences.
- These are client-side concerns and do not affect YAML semantics.
8. Content, SEO, and sharing layer
- SEOHead.tsx, SocialShare.tsx, Footer.tsx, UsageCounter.tsx, and YouTubePopup.tsx are supporting components for discoverability, onboarding, and engagement.
- They sit outside the core generator path and do not participate in configuration generation, but they are part of the deployed frontend experience.
9. Job-related subsystem
- src/components/jobs/JobList.tsx and CronJobList.tsx, together with src/utils/jobsApi.ts, suggest a dedicated area for job-oriented resource handling.
- This appears to be a specialized sub-flow within the same browser app, not a separate service boundary.
10. Runtime and deployment model
- The app is statically built and served from dist using GitHub Pages and also packaged in Docker for local or containerized hosting.
- Files like public/CNAME, public/.nojekyll, and the GitHub Actions workflow under .github/workflows/docker-build.yml show that deployment is a build-and-publish pipeline, not an application server.
- The Dockerfile and README’s Docker commands confirm a simple static-runtime distribution.
11. Static asset and hosting boundary
- public/ contains the site manifest, robots/sitemap files, and domain configuration, which means the repo also owns its public-facing hosting metadata.
- index.html, main.tsx, and index.css form the app entry chain that bootstraps the SPA in the browser.
12. What an architecture diagram should emphasize
- Draw the app as a browser-only Kubernetes configuration studio with:
- input editors for resource types,
- shared typed state,
- a central YAML generation utility,
- preview/summary/visualization outputs,
- and optional local persistence/theme/usage services.
- Outside the browser, the only material infrastructure is the static hosting/build pipeline via Vite, Docker, and GitHub Pages.
Main entry points: App.tsx App Shell · index.ts Typed Model · RoleWizardManager.tsx RBAC Wizard · yamlGenerator.ts YAML Generator
Components 22
Browser App
Client-side Kubernetes configuration studio and its in-browser data flow.
- SPA Entry · Browser entry that mounts the application.
src/main.tsx - App Shell · Top-level composition and state wiring for the studio.
src/App.tsx - Deployment Form · Editor for Deployment configuration.
src/components/DeploymentForm.tsx - Workload Editors · DaemonSet and Job editing surfaces.
src/components/DaemonSetForm.tsx - Resource Managers · Editors for core Kubernetes objects like namespaces, configmaps, secrets, and RBAC.
src/components/NamespaceManager.tsx - Resource Lists · Companion lists for browsing and editing current project resources.
src/components/DeploymentsList.tsx - RBAC Wizard · Role and permission flow built on domain RBAC data.
src/components/RoleWizardManager.tsx - Typed Model · Client-side source of truth for Kubernetes configuration.
src/types/index.ts - RBAC Data · Static RBAC knowledge used by the wizard and generators.
src/data/kubernetesRBAC.ts - YAML Generator · Converts typed configuration state into YAML output.
src/utils/yamlGenerator.ts - YAML Preview · Rendered YAML inspection and export surface.
src/components/YamlPreview.tsx - Visual Preview · Diagrammatic view of configured Kubernetes resources.
src/components/VisualPreview.tsx - Resource Summary · Condensed configuration and relationship summary.
src/components/ResourceSummary.tsx
Platform
Build, static hosting, and packaging layers around the SPA.
- Static Shell · Vite-served HTML host for the SPA.
index.html - Public Assets · Manifest, robots, sitemap, and domain metadata.
public/site.webmanifest - Build Stack · Vite, Tailwind, and package-based frontend build pipeline.
vite.config.ts - Deploy Pipeline · Docker and GitHub Actions build-and-publish path.
.github/workflows/docker-build.yml
Support UI
Non-core UI services and engagement components.
- Theme Layer · Theme and dark-mode presentation state.
src/context/ThemeContext.tsx - Local State · Usage counters and persisted UI preferences.
src/utils/localStorage.ts - Usage Counter · Browser-side usage tracking component.
src/components/UsageCounter.tsx - SEO & Share · Head metadata and social sharing controls.
src/components/SEOHead.tsx - Media Popups · Onboarding and promo overlays.
src/components/YouTubePopup.tsx
Connections 28
- SPA Entry → App Shell: mounts · Bootstraps the application shell.
- Static Shell → SPA Entry: loads · HTML entry loads the SPA bundle.
- App Shell → Deployment Form: wires · Composes the deployment editor into the shell.
- App Shell → Workload Editors: wires · Includes workload-specific editing flows.
- App Shell → Resource Managers: wires · Connects core Kubernetes resource editors.
- App Shell → Resource Lists: wires · Provides list and navigation panes.
- App Shell → RBAC Wizard: wires · Includes the RBAC setup wizard.
- App Shell → YAML Preview: shows · Exposes generated YAML to the user.
- App Shell → Visual Preview: shows · Displays the resource topology view.
- App Shell → Resource Summary: shows · Presents a compact state summary.
- Deployment Form → Typed Model: updates · Edits the shared configuration model.
- Workload Editors → Typed Model: updates · Edits the shared configuration model.
- Resource Managers → Typed Model: updates · Mutates the client-side Kubernetes state.
- Resource Lists → Typed Model: reads · Browses the current typed project state.
- RBAC Wizard → RBAC Data: uses · Uses RBAC domain rules and options.
- RBAC Wizard → Typed Model: writes · Stores wizard output in the shared model.
- Typed Model → YAML Generator: feeds · Primary input to YAML generation.
- RBAC Data → YAML Generator: informs · Supplies RBAC-specific generation knowledge.
- YAML Generator → YAML Preview: renders · Generated YAML is shown in preview/export.
- Typed Model → Visual Preview: drives · Resource model powers diagrammatic preview.
- Typed Model → Resource Summary: drives · Current model powers the summary panel.
- Theme Layer → App Shell: themes · Provides presentation state across the app.
- Local State → Usage Counter: stores · Persists usage and preference data locally.
- SEO & Share → Static Shell: annotates · Adds metadata and sharing hooks to the site shell.
- Media Popups → App Shell: supports · Auxiliary engagement and onboarding surfaces.
- Build Stack → Static Shell: builds · Frontend tooling produces the browser bundle.
- Deploy Pipeline → Build Stack: packages · CI and Docker run the production build.
- Public Assets → Deploy Pipeline: served by · Public static assets ship with the deployed site.