# paulomtts/pyjinhx architecture

> Architecture diagram of the GitHub repository paulomtts/pyjinhx, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/paulomtts/pyjinhx
- Repository: https://github.com/paulomtts/pyjinhx
- Video tour (about a minute): https://gitdiagram.com/paulomtts/pyjinhx/video

## Overview

PyJinHx is a Python UI-component and server-rendering framework: developers define typed components and PJX templates, configure component discovery, then render nested components to HTML with collected assets. FastAPI integration can adapt requests and responses. Reactive components add memoized data loading, caching, invalidation, and fan-out updates. The graph follows documented workflow and source-index/import evidence; some built-in widgets and integrations are represented at directory level because their implementations were not sampled.

Main entry points: [`pyjinhx/rendering/pipeline.py`](https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/rendering/pipeline.py) (Render pipeline), [`pyjinhx/components/base.py`](https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/components/base.py) (Typed components), [`pyjinhx/reactive/component.py`](https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/reactive/component.py) (Reactive components), [`pyjinhx/integrations/fastapi.py`](https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/integrations/fastapi.py) (FastAPI adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Component authoring"]
  node_settings["Configuration<br/>[config.py]"]
  node_component_model["Typed components<br/>[base.py]"]
  node_discovery["Component discovery<br/>[discovery.py]"]
  node_scanner["PJX scanner<br/>[scanner.py]"]
  node_template_blocks["Template blocks<br/>[template_blocks.py]"]
  node_props["Props headers<br/>[props_header.py]"]
end

subgraph group_rendering["Render pipeline"]
  node_renderer["Render pipeline<br/>[pipeline.py]"]
  node_segments["HTML segments<br/>[segments.py]"]
  node_session["Render session<br/>[session.py]"]
  node_assets["Asset collection<br/>[assets.py]"]
  node_render_cache["Render cache<br/>[render_cache.py]"]
end

subgraph group_reactive["Reactive rendering"]
  node_reactive_component["Reactive components<br/>[component.py]"]
  node_reactive_cache["Reactive cache<br/>[cache.py]"]
  node_cache_backend[("Cache backend<br/>[backend.py]")]
  node_fanout["Update fan-out<br/>[fanout.py]"]
end

subgraph group_web["Web integration"]
  node_fastapi["FastAPI adapter<br/>[fastapi.py]"]
  node_responses["PJX responses<br/>[responses.py]"]
  node_client["Browser client<br/>[pjx.js]"]
end

subgraph group_widgets["Built-in widgets"]
  node_builtins["UI component library"]
end

node_developer(("App developer"))

node_developer -->|"configures"| node_settings
node_settings -->|"builds registry"| node_discovery
node_developer -->|"defines components"| node_component_model
node_component_model -->|"renders through"| node_renderer
node_renderer -->|"resolves tags"| node_discovery
node_renderer -->|"parses markup"| node_segments
node_renderer -->|"uses session"| node_session
node_renderer -->|"emits assets"| node_assets
node_renderer -->|"uses cache"| node_render_cache
node_component_model -->|"scans templates"| node_scanner
node_props -->|"parses header syntax"| node_scanner
node_template_blocks -->|"uses scanner"| node_scanner
node_component_model -->|"injects client"| node_client
node_developer -->|"installs adapter"| node_fastapi
node_fastapi -->|"adapts responses"| node_responses
node_fastapi -->|"scopes requests"| node_session
node_reactive_component -->|"extends model"| node_component_model
node_reactive_component -->|"memoizes loads"| node_reactive_cache
node_reactive_cache -->|"uses backend"| node_cache_backend
node_reactive_component -.->|"supports updates"| node_fanout
node_developer -->|"uses widgets"| node_builtins

click node_settings "https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/config.py"
click node_component_model "https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/components/base.py"
click node_discovery "https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/components/discovery.py"
click node_scanner "https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/document/scanner.py"
click node_template_blocks "https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/document/template_blocks.py"
click node_props "https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/components/props_header.py"
click node_renderer "https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/rendering/pipeline.py"
click node_segments "https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/rendering/segments.py"
click node_session "https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/rendering/session.py"
click node_assets "https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/rendering/assets.py"
click node_render_cache "https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/rendering/render_cache.py"
click node_reactive_component "https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/reactive/component.py"
click node_reactive_cache "https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/reactive/cache.py"
click node_cache_backend "https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/reactive/backend.py"
click node_fanout "https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/reactive/fanout.py"
click node_fastapi "https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/integrations/fastapi.py"
click node_responses "https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/integrations/responses.py"
click node_client "https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/client/pjx.js"
click node_builtins "https://github.com/paulomtts/pyjinhx/tree/master/pyjinhx/builtins"

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_settings,node_component_model,node_discovery,node_scanner,node_template_blocks,node_props toneBlue
class node_renderer,node_segments,node_session,node_assets,node_render_cache toneAmber
class node_reactive_component,node_reactive_cache,node_cache_backend,node_fanout toneMint
class node_fastapi,node_responses,node_client toneRose
class node_builtins,node_developer toneIndigo
```

## Components

### Component authoring

- [Configuration](https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/config.py): `pyjinhx/config.py`
- [Typed components](https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/components/base.py): `pyjinhx/components/base.py`
- [Component discovery](https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/components/discovery.py): `pyjinhx/components/discovery.py`
- [PJX scanner](https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/document/scanner.py): `pyjinhx/document/scanner.py`
- [Template blocks](https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/document/template_blocks.py): `pyjinhx/document/template_blocks.py`
- [Props headers](https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/components/props_header.py): `pyjinhx/components/props_header.py`

### Render pipeline

- [Render pipeline](https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/rendering/pipeline.py): `pyjinhx/rendering/pipeline.py`
- [HTML segments](https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/rendering/segments.py): `pyjinhx/rendering/segments.py`
- [Render session](https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/rendering/session.py): `pyjinhx/rendering/session.py`
- [Asset collection](https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/rendering/assets.py): `pyjinhx/rendering/assets.py`
- [Render cache](https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/rendering/render_cache.py): `pyjinhx/rendering/render_cache.py`

### Reactive rendering

- [Reactive components](https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/reactive/component.py): `pyjinhx/reactive/component.py`
- [Reactive cache](https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/reactive/cache.py): `pyjinhx/reactive/cache.py`
- [Cache backend](https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/reactive/backend.py): `pyjinhx/reactive/backend.py`
- [Update fan-out](https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/reactive/fanout.py): `pyjinhx/reactive/fanout.py`

### Web integration

- [FastAPI adapter](https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/integrations/fastapi.py): `pyjinhx/integrations/fastapi.py`
- [PJX responses](https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/integrations/responses.py): `pyjinhx/integrations/responses.py`
- [Browser client](https://github.com/paulomtts/pyjinhx/blob/master/pyjinhx/client/pjx.js): `pyjinhx/client/pjx.js`

### Built-in widgets

- [UI component library](https://github.com/paulomtts/pyjinhx/tree/master/pyjinhx/builtins): `pyjinhx/builtins`

### Other components

- **App developer**

## Connections

- App developer → Configuration: configures (evidence: `pyjinhx/config.py`)
- Configuration → Component discovery: builds registry (evidence: `pyjinhx/config.py`)
- App developer → Typed components: defines components (evidence: `README.md`)
- Typed components → Render pipeline: renders through (evidence: `pyjinhx/components/base.py`)
- Render pipeline → Component discovery: resolves tags (evidence: `pyjinhx/rendering/pipeline.py`)
- Render pipeline → HTML segments: parses markup (evidence: `pyjinhx/rendering/pipeline.py`)
- Render pipeline → Render session: uses session (evidence: `pyjinhx/rendering/pipeline.py`)
- Render pipeline → Asset collection: emits assets (evidence: `pyjinhx/rendering/pipeline.py`)
- Render pipeline → Render cache: uses cache (evidence: `pyjinhx/rendering/pipeline.py`)
- Typed components → PJX scanner: scans templates (evidence: `pyjinhx/components/base.py`)
- Props headers → PJX scanner: parses header syntax (evidence: `pyjinhx/components/props_header.py`)
- Template blocks → PJX scanner: uses scanner (evidence: `pyjinhx/document/template_blocks.py`)
- Typed components → Browser client: injects client (evidence: `pyjinhx/components/base.py`)
- App developer → FastAPI adapter: installs adapter
- FastAPI adapter → PJX responses: adapts responses (evidence: `pyjinhx/integrations/fastapi.py`)
- FastAPI adapter → Render session: scopes requests (evidence: `pyjinhx/integrations/fastapi.py`)
- Reactive components → Typed components: extends model (evidence: `pyjinhx/reactive/component.py`)
- Reactive components → Reactive cache: memoizes loads (evidence: `pyjinhx/reactive/component.py`)
- Reactive cache → Cache backend: uses backend (evidence: `pyjinhx/reactive/cache.py`)
- Reactive components → Update fan-out: supports updates (evidence: `pyjinhx/reactive/fanout.py`)
- App developer → UI component library: uses widgets (evidence: `README.md`)
