# rohithkumar6/morphing-ui-magic architecture

> Architecture diagram of the GitHub repository rohithkumar6/morphing-ui-magic, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rohithkumar6/morphing-ui-magic
- Repository: https://github.com/rohithkumar6/morphing-ui-magic

## Overview

MorphUI is a browser-based demonstration of an evolving, self-optimizing landing page. Visitors interact with the page; the evolution hook tracks engagement, scores the current genome, and can mutate, reset, or reload it, while the page renders the genome and its fitness/history. The graph captures the sampled calls and imports; several visual components are indexed but not fully shown, so links involving them are limited to relationships visible in the page excerpt or source index. No external persistence or analytics service is evidenced.

Main entry points: [`src/pages/Index.tsx`](https://github.com/rohithkumar6/morphing-ui-magic/blob/main/src/pages/Index.tsx) (Evolution page), [`src/lib/genome.ts`](https://github.com/rohithkumar6/morphing-ui-magic/blob/main/src/lib/genome.ts) (Genome genetics), [`src/hooks/useEvolution.ts`](https://github.com/rohithkumar6/morphing-ui-magic/blob/main/src/hooks/useEvolution.ts) (Evolution state), [`src/components/EvolvedHero.tsx`](https://github.com/rohithkumar6/morphing-ui-magic/blob/main/src/components/EvolvedHero.tsx) (Evolved hero)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Page experience"]
  node_app["App routing<br/>[App.tsx]"]
  node_page["Evolution page<br/>[Index.tsx]"]
end

subgraph group_evolution["Evolution runtime"]
  node_hook["Evolution state<br/>[useEvolution.ts]"]
  node_genome["Genome genetics<br/>[genome.ts]"]
  node_fitness["Fitness scoring<br/>[fitness.ts]"]
end

subgraph group_visuals["Evolution displays"]
  node_hero["Evolved hero<br/>[EvolvedHero.tsx]"]
  node_dna["DNA helix<br/>[DNAHelix.tsx]"]
  node_fitnessview["Fitness display<br/>[FitnessDisplay.tsx]"]
  node_visualizer["Genome visualizer"]
  node_controls["Evolution controls"]
  node_history["Evolution history"]
  node_background["Organic background"]
end

subgraph group_shared["Shared UI"]
  node_button["Button primitive<br/>[button.tsx]"]
  node_utils["Class utilities<br/>[utils.ts]"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens app"| node_app
node_app -->|"routes to"| node_page
node_page -->|"uses state"| node_hook
node_page -.->|"renders"| node_hero
node_page -->|"renders"| node_dna
node_page -->|"renders"| node_fitnessview
node_page -->|"renders"| node_visualizer
node_page -->|"renders"| node_controls
node_page -->|"renders"| node_history
node_page -.->|"renders"| node_background
node_hook -->|"generates and mutates"| node_genome
node_hook -->|"scores engagement"| node_fitness
node_hero -->|"reads traits"| node_genome
node_dna -->|"reads genome"| node_genome
node_fitnessview -->|"uses scoring"| node_fitness
node_visualizer -->|"reads genome"| node_genome
node_history -->|"reads genomes"| node_genome
node_hero -->|"uses"| node_button
node_button -->|"merges classes"| node_utils

click node_app "https://github.com/rohithkumar6/morphing-ui-magic/blob/main/src/App.tsx"
click node_page "https://github.com/rohithkumar6/morphing-ui-magic/blob/main/src/pages/Index.tsx"
click node_hook "https://github.com/rohithkumar6/morphing-ui-magic/blob/main/src/hooks/useEvolution.ts"
click node_genome "https://github.com/rohithkumar6/morphing-ui-magic/blob/main/src/lib/genome.ts"
click node_fitness "https://github.com/rohithkumar6/morphing-ui-magic/blob/main/src/lib/fitness.ts"
click node_hero "https://github.com/rohithkumar6/morphing-ui-magic/blob/main/src/components/EvolvedHero.tsx"
click node_dna "https://github.com/rohithkumar6/morphing-ui-magic/blob/main/src/components/DNAHelix.tsx"
click node_fitnessview "https://github.com/rohithkumar6/morphing-ui-magic/blob/main/src/components/FitnessDisplay.tsx"
click node_visualizer "https://github.com/rohithkumar6/morphing-ui-magic/blob/main/src/components/GenomeVisualizer.tsx"
click node_controls "https://github.com/rohithkumar6/morphing-ui-magic/blob/main/src/components/EvolutionControls.tsx"
click node_history "https://github.com/rohithkumar6/morphing-ui-magic/blob/main/src/components/EvolutionHistory.tsx"
click node_background "https://github.com/rohithkumar6/morphing-ui-magic/blob/main/src/components/OrganicBackground.tsx"
click node_button "https://github.com/rohithkumar6/morphing-ui-magic/blob/main/src/components/ui/button.tsx"
click node_utils "https://github.com/rohithkumar6/morphing-ui-magic/blob/main/src/lib/utils.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_page toneBlue
class node_hook,node_genome,node_fitness toneAmber
class node_hero,node_dna,node_fitnessview,node_visualizer,node_controls,node_history,node_background toneMint
class node_button,node_utils toneRose
class node_visitor toneIndigo
```

## Components

### Page experience

- [App routing](https://github.com/rohithkumar6/morphing-ui-magic/blob/main/src/App.tsx): `src/App.tsx`
- [Evolution page](https://github.com/rohithkumar6/morphing-ui-magic/blob/main/src/pages/Index.tsx): `src/pages/Index.tsx`

### Evolution runtime

- [Evolution state](https://github.com/rohithkumar6/morphing-ui-magic/blob/main/src/hooks/useEvolution.ts): `src/hooks/useEvolution.ts`
- [Genome genetics](https://github.com/rohithkumar6/morphing-ui-magic/blob/main/src/lib/genome.ts): `src/lib/genome.ts`
- [Fitness scoring](https://github.com/rohithkumar6/morphing-ui-magic/blob/main/src/lib/fitness.ts): `src/lib/fitness.ts`

### Evolution displays

- [Evolved hero](https://github.com/rohithkumar6/morphing-ui-magic/blob/main/src/components/EvolvedHero.tsx): `src/components/EvolvedHero.tsx`
- [DNA helix](https://github.com/rohithkumar6/morphing-ui-magic/blob/main/src/components/DNAHelix.tsx): `src/components/DNAHelix.tsx`
- [Fitness display](https://github.com/rohithkumar6/morphing-ui-magic/blob/main/src/components/FitnessDisplay.tsx): `src/components/FitnessDisplay.tsx`
- [Genome visualizer](https://github.com/rohithkumar6/morphing-ui-magic/blob/main/src/components/GenomeVisualizer.tsx): `src/components/GenomeVisualizer.tsx`
- [Evolution controls](https://github.com/rohithkumar6/morphing-ui-magic/blob/main/src/components/EvolutionControls.tsx): `src/components/EvolutionControls.tsx`
- [Evolution history](https://github.com/rohithkumar6/morphing-ui-magic/blob/main/src/components/EvolutionHistory.tsx): `src/components/EvolutionHistory.tsx`
- [Organic background](https://github.com/rohithkumar6/morphing-ui-magic/blob/main/src/components/OrganicBackground.tsx): `src/components/OrganicBackground.tsx`

### Shared UI

- [Button primitive](https://github.com/rohithkumar6/morphing-ui-magic/blob/main/src/components/ui/button.tsx): `src/components/ui/button.tsx`
- [Class utilities](https://github.com/rohithkumar6/morphing-ui-magic/blob/main/src/lib/utils.ts): `src/lib/utils.ts`

### Other components

- **Visitor**

## Connections

- Visitor → App routing: opens app
- App routing → Evolution page: routes to (evidence: `src/App.tsx`)
- Evolution page → Evolution state: uses state (evidence: `src/pages/Index.tsx`)
- Evolution page → Evolved hero: renders (evidence: `src/pages/Index.tsx`)
- Evolution page → DNA helix: renders (evidence: `src/pages/Index.tsx`)
- Evolution page → Fitness display: renders (evidence: `src/pages/Index.tsx`)
- Evolution page → Genome visualizer: renders (evidence: `src/pages/Index.tsx`)
- Evolution page → Evolution controls: renders (evidence: `src/pages/Index.tsx`)
- Evolution page → Evolution history: renders (evidence: `src/pages/Index.tsx`)
- Evolution page → Organic background: renders (evidence: `src/pages/Index.tsx`)
- Evolution state → Genome genetics: generates and mutates (evidence: `src/hooks/useEvolution.ts`)
- Evolution state → Fitness scoring: scores engagement (evidence: `src/hooks/useEvolution.ts`)
- Evolved hero → Genome genetics: reads traits (evidence: `src/components/EvolvedHero.tsx`)
- DNA helix → Genome genetics: reads genome (evidence: `src/components/DNAHelix.tsx`)
- Fitness display → Fitness scoring: uses scoring (evidence: `src/components/FitnessDisplay.tsx`)
- Genome visualizer → Genome genetics: reads genome (evidence: `src/components/GenomeVisualizer.tsx`)
- Evolution history → Genome genetics: reads genomes (evidence: `src/components/EvolutionHistory.tsx`)
- Evolved hero → Button primitive: uses (evidence: `src/components/EvolvedHero.tsx`)
- Button primitive → Class utilities: merges classes (evidence: `src/components/ui/button.tsx`)
