# coelho-labs/portal-shell architecture

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

- Interactive diagram: https://gitdiagram.com/coelho-labs/portal-shell
- Repository: https://github.com/coelho-labs/portal-shell

## Overview

Portal Shell is a React micro-frontend host. The user-facing flow is browser entry into the shell, route selection, then lazy loading of Planning Poker; the shell also places remote content-delivery widgets in its layout. Theme selection is a separate shared-UI capability. The home page shown is starter content rather than a developed product feature. Edges follow the sampled imports and calls plus README documentation; remote services are external to this repository.

Main entry points: [`src/App.tsx`](https://github.com/coelho-labs/portal-shell/blob/main/src/App.tsx) (Shell router and layout), [`src/components/theme-toggle.tsx`](https://github.com/coelho-labs/portal-shell/blob/main/src/components/theme-toggle.tsx) (Theme selector), [`module-federation.config.ts`](https://github.com/coelho-labs/portal-shell/blob/main/module-federation.config.ts) (Remote configuration), [`src/main.tsx`](https://github.com/coelho-labs/portal-shell/blob/main/src/main.tsx) (React entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["Shell experience"]
  node_entry["React entry<br/>[main.tsx]"]
  node_app["Shell router and layout<br/>[App.tsx]"]
  node_home["Home page<br/>[Home.page.tsx]"]
end

subgraph group_remotes["Remote modules"]
  node_planning["Planning Poker MFE"]
  node_content["Content delivery MFE"]
end

subgraph group_theme["Theme and UI"]
  node_theme_toggle["Theme selector<br/>[theme-toggle.tsx]"]
  node_theme_hook["Theme state<br/>[use-theme.ts]"]
  node_button["Button component<br/>[button.tsx]"]
  node_dropdown["Dropdown menu<br/>[dropdown-menu.tsx]"]
  node_styles["Class utilities<br/>[utils.ts]"]
end

subgraph group_federation["Federation runtime"]
  node_federation_config["Remote configuration"]
end

node_user(("Portal user"))

node_user -->|"opens portal"| node_entry
node_entry -->|"renders"| node_app
node_app -->|"routes to"| node_home
node_app -->|"lazy-loads route"| node_planning
node_app -->|"lazy-loads widgets"| node_content
node_app -->|"renders"| node_theme_toggle
node_theme_toggle -->|"reads and sets"| node_theme_hook
node_theme_toggle -->|"uses"| node_button
node_theme_toggle -->|"uses"| node_dropdown
node_button -->|"merges classes"| node_styles
node_dropdown -->|"merges classes"| node_styles
node_theme_hook -->|"persists preference"| node_user
node_federation_config -->|"configures remote"| node_planning
node_federation_config -->|"configures remote"| node_content

click node_entry "https://github.com/coelho-labs/portal-shell/blob/main/src/main.tsx"
click node_app "https://github.com/coelho-labs/portal-shell/blob/main/src/App.tsx"
click node_home "https://github.com/coelho-labs/portal-shell/blob/main/src/pages/home/Home.page.tsx"
click node_federation_config "https://github.com/coelho-labs/portal-shell/blob/main/module-federation.config.ts"
click node_theme_toggle "https://github.com/coelho-labs/portal-shell/blob/main/src/components/theme-toggle.tsx"
click node_theme_hook "https://github.com/coelho-labs/portal-shell/blob/main/src/hooks/use-theme.ts"
click node_button "https://github.com/coelho-labs/portal-shell/blob/main/src/components/ui/button.tsx"
click node_dropdown "https://github.com/coelho-labs/portal-shell/blob/main/src/components/ui/dropdown-menu.tsx"
click node_styles "https://github.com/coelho-labs/portal-shell/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_entry,node_app,node_home,node_user toneBlue
class node_planning,node_content toneAmber
class node_theme_toggle,node_theme_hook,node_button,node_dropdown,node_styles toneMint
class node_federation_config toneRose
```

## Components

### Shell experience

- [React entry](https://github.com/coelho-labs/portal-shell/blob/main/src/main.tsx): `src/main.tsx`
- [Shell router and layout](https://github.com/coelho-labs/portal-shell/blob/main/src/App.tsx): `src/App.tsx`
- [Home page](https://github.com/coelho-labs/portal-shell/blob/main/src/pages/home/Home.page.tsx): `src/pages/home/Home.page.tsx`

### Remote modules

- **Planning Poker MFE**
- **Content delivery MFE**

### Theme and UI

- [Theme selector](https://github.com/coelho-labs/portal-shell/blob/main/src/components/theme-toggle.tsx): `src/components/theme-toggle.tsx`
- [Theme state](https://github.com/coelho-labs/portal-shell/blob/main/src/hooks/use-theme.ts): `src/hooks/use-theme.ts`
- [Button component](https://github.com/coelho-labs/portal-shell/blob/main/src/components/ui/button.tsx): `src/components/ui/button.tsx`
- [Dropdown menu](https://github.com/coelho-labs/portal-shell/blob/main/src/components/ui/dropdown-menu.tsx): `src/components/ui/dropdown-menu.tsx`
- [Class utilities](https://github.com/coelho-labs/portal-shell/blob/main/src/lib/utils.ts): `src/lib/utils.ts`

### Federation runtime

- [Remote configuration](https://github.com/coelho-labs/portal-shell/blob/main/module-federation.config.ts): `module-federation.config.ts`

### Other components

- **Portal user**

## Connections

- Portal user → React entry: opens portal (evidence: `README.md`)
- React entry → Shell router and layout: renders (evidence: `src/main.tsx`)
- Shell router and layout → Home page: routes to (evidence: `src/App.tsx`)
- Shell router and layout → Planning Poker MFE: lazy-loads route (evidence: `src/App.tsx`)
- Shell router and layout → Content delivery MFE: lazy-loads widgets (evidence: `src/App.tsx`)
- Shell router and layout → Theme selector: renders (evidence: `src/App.tsx`)
- Theme selector → Theme state: reads and sets (evidence: `src/components/theme-toggle.tsx`)
- Theme selector → Button component: uses (evidence: `src/components/theme-toggle.tsx`)
- Theme selector → Dropdown menu: uses (evidence: `src/components/theme-toggle.tsx`)
- Button component → Class utilities: merges classes (evidence: `src/components/ui/button.tsx`)
- Dropdown menu → Class utilities: merges classes (evidence: `src/components/ui/dropdown-menu.tsx`)
- Theme state → Portal user: persists preference (evidence: `src/hooks/use-theme.ts`)
- Remote configuration → Planning Poker MFE: configures remote (evidence: `module-federation.config.ts`)
- Remote configuration → Content delivery MFE: configures remote (evidence: `module-federation.config.ts`)
