# intforout/sham-wah architecture

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

- Interactive diagram: https://gitdiagram.com/intforout/sham-wah
- Repository: https://github.com/intforout/sham-wah

## Overview

Sham-Wah is a client–server knowledge-graph explorer: users select concepts and filters, query digital assets, inspect results, and explore graph neighborhoods and metadata. The GUI also documents demonstration data, map, edit, chatbot, and Cypher-query surfaces. The sampled code confirms the asset-query path and graph-rendering utilities; links for unsampled API routes and auxiliary product surfaces are limited to documented responsibilities.

Main entry points: [`gui/app/components/canvas/GraphCanvas.vue`](https://github.com/intforout/sham-wah/blob/main/gui/app/components/canvas/GraphCanvas.vue) (Graph canvas), [`api/app/main.py`](https://github.com/intforout/sham-wah/blob/main/api/app/main.py) (API application), [`api/app/routers/assets.py`](https://github.com/intforout/sham-wah/blob/main/api/app/routers/assets.py) (Asset query route), [`gui/app/stores/query-result-store.ts`](https://github.com/intforout/sham-wah/blob/main/gui/app/stores/query-result-store.ts) (Query results)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gui["GUI"]
  node_predefined["Asset search"]
  node_filters["Query filters<br/>[QueryFilters.vue]"]
  node_filterstate["Filter state"]
  node_results["Query results"]
  node_graphstate["Graph state<br/>[graph-store.ts]"]
  node_graphcanvas["Graph canvas<br/>[GraphCanvas.vue]"]
  node_infopanel["Asset details<br/>[GraphInfoPanel.vue]"]
  node_map["Map view<br/>[MapCanvas.vue]"]
  node_chatbot["Chatbot panel<br/>[ChatbotPanel.vue]"]
  node_cypher["Cypher panel<br/>[CypherPanel.vue]"]
end

subgraph group_api["API"]
  node_main["API application<br/>[main.py]"]
  node_assetsapi["Asset query route<br/>[assets.py]"]
  node_graphapi["Graph routes<br/>[graph.py]"]
  node_dbapi["Database routes<br/>[db.py]"]
end

subgraph group_graph["Graph processing"]
  node_mockassets["Demo assets<br/>[mockData.ts]"]
  node_renderer["Graph renderer"]
  node_graphutils["Graph utilities<br/>[graphAdapter.ts]"]
  node_parser["Asset parser<br/>[parsers.py]"]
end

subgraph group_external["External systems"]
  node_neo4j[("Knowledge graph")]
  node_api_service["Sham-Wah API"]
end

node_user(("Explorer"))

node_user -->|"selects query"| node_predefined
node_predefined -->|"configures"| node_filters
node_filters -->|"updates filters"| node_filterstate
node_predefined -->|"runs search"| node_results
node_results -->|"posts asset query"| node_api_service
node_results -.->|"filters demo data"| node_mockassets
node_api_service -->|"routes request"| node_main
node_main -->|"dispatches"| node_assetsapi
node_assetsapi -->|"queries"| node_neo4j
node_assetsapi -->|"converts records"| node_parser
node_assetsapi -->|"returns assets"| node_results
node_user -->|"explores graph"| node_graphcanvas
node_graphcanvas -->|"renders graph"| node_renderer
node_renderer -->|"uses graph helpers"| node_graphutils
node_graphcanvas -->|"reads graph state"| node_graphstate
node_graphstate -->|"requests graph data"| node_graphapi
node_graphapi -->|"accesses graph"| node_neo4j
node_graphcanvas -->|"shows selected node"| node_infopanel
node_user -->|"opens map"| node_map
node_user -->|"uses assistant"| node_chatbot
node_user -->|"enters Cypher"| node_cypher
node_main -->|"dispatches"| node_graphapi
node_main -->|"dispatches"| node_dbapi
node_dbapi -->|"checks database"| node_neo4j

click node_predefined "https://github.com/intforout/sham-wah/blob/main/gui/app/components/sidebar/panels/PredefinedQueryPanel.vue"
click node_filters "https://github.com/intforout/sham-wah/blob/main/gui/app/components/sidebar/panels/predefinedQueryPanel/QueryFilters.vue"
click node_filterstate "https://github.com/intforout/sham-wah/blob/main/gui/app/stores/predefined-query-store.ts"
click node_results "https://github.com/intforout/sham-wah/blob/main/gui/app/stores/query-result-store.ts"
click node_mockassets "https://github.com/intforout/sham-wah/blob/main/gui/app/utils/graph/mockData.ts"
click node_graphstate "https://github.com/intforout/sham-wah/blob/main/gui/app/stores/graph-store.ts"
click node_graphcanvas "https://github.com/intforout/sham-wah/blob/main/gui/app/components/canvas/GraphCanvas.vue"
click node_renderer "https://github.com/intforout/sham-wah/blob/main/gui/app/composables/useGraphRenderer.ts"
click node_graphutils "https://github.com/intforout/sham-wah/blob/main/gui/app/utils/graph/graphAdapter.ts"
click node_infopanel "https://github.com/intforout/sham-wah/blob/main/gui/app/components/canvas/GraphInfoPanel.vue"
click node_map "https://github.com/intforout/sham-wah/blob/main/gui/app/components/canvas/MapCanvas.vue"
click node_chatbot "https://github.com/intforout/sham-wah/blob/main/gui/app/components/sidebar/panels/ChatbotPanel.vue"
click node_cypher "https://github.com/intforout/sham-wah/blob/main/gui/app/components/sidebar/panels/CypherPanel.vue"
click node_main "https://github.com/intforout/sham-wah/blob/main/api/app/main.py"
click node_assetsapi "https://github.com/intforout/sham-wah/blob/main/api/app/routers/assets.py"
click node_graphapi "https://github.com/intforout/sham-wah/blob/main/api/app/routers/graph.py"
click node_dbapi "https://github.com/intforout/sham-wah/blob/main/api/app/routers/db.py"
click node_parser "https://github.com/intforout/sham-wah/blob/main/api/app/core/parsers.py"

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_predefined,node_filters,node_filterstate,node_results,node_graphstate,node_graphcanvas,node_infopanel,node_map,node_chatbot,node_cypher toneBlue
class node_main,node_assetsapi,node_graphapi,node_dbapi toneAmber
class node_mockassets,node_renderer,node_graphutils,node_parser toneMint
class node_neo4j,node_api_service toneRose
class node_user toneIndigo
```

## Components

### GUI

- [Asset search](https://github.com/intforout/sham-wah/blob/main/gui/app/components/sidebar/panels/PredefinedQueryPanel.vue): `gui/app/components/sidebar/panels/PredefinedQueryPanel.vue`
- [Query filters](https://github.com/intforout/sham-wah/blob/main/gui/app/components/sidebar/panels/predefinedQueryPanel/QueryFilters.vue): `gui/app/components/sidebar/panels/predefinedQueryPanel/QueryFilters.vue`
- [Filter state](https://github.com/intforout/sham-wah/blob/main/gui/app/stores/predefined-query-store.ts): `gui/app/stores/predefined-query-store.ts`
- [Query results](https://github.com/intforout/sham-wah/blob/main/gui/app/stores/query-result-store.ts): `gui/app/stores/query-result-store.ts`
- [Graph state](https://github.com/intforout/sham-wah/blob/main/gui/app/stores/graph-store.ts): `gui/app/stores/graph-store.ts`
- [Graph canvas](https://github.com/intforout/sham-wah/blob/main/gui/app/components/canvas/GraphCanvas.vue): `gui/app/components/canvas/GraphCanvas.vue`
- [Asset details](https://github.com/intforout/sham-wah/blob/main/gui/app/components/canvas/GraphInfoPanel.vue): `gui/app/components/canvas/GraphInfoPanel.vue`
- [Map view](https://github.com/intforout/sham-wah/blob/main/gui/app/components/canvas/MapCanvas.vue): `gui/app/components/canvas/MapCanvas.vue`
- [Chatbot panel](https://github.com/intforout/sham-wah/blob/main/gui/app/components/sidebar/panels/ChatbotPanel.vue): `gui/app/components/sidebar/panels/ChatbotPanel.vue`
- [Cypher panel](https://github.com/intforout/sham-wah/blob/main/gui/app/components/sidebar/panels/CypherPanel.vue): `gui/app/components/sidebar/panels/CypherPanel.vue`

### API

- [API application](https://github.com/intforout/sham-wah/blob/main/api/app/main.py): `api/app/main.py`
- [Asset query route](https://github.com/intforout/sham-wah/blob/main/api/app/routers/assets.py): `api/app/routers/assets.py`
- [Graph routes](https://github.com/intforout/sham-wah/blob/main/api/app/routers/graph.py): `api/app/routers/graph.py`
- [Database routes](https://github.com/intforout/sham-wah/blob/main/api/app/routers/db.py): `api/app/routers/db.py`

### Graph processing

- [Demo assets](https://github.com/intforout/sham-wah/blob/main/gui/app/utils/graph/mockData.ts): `gui/app/utils/graph/mockData.ts`
- [Graph renderer](https://github.com/intforout/sham-wah/blob/main/gui/app/composables/useGraphRenderer.ts): `gui/app/composables/useGraphRenderer.ts`
- [Graph utilities](https://github.com/intforout/sham-wah/blob/main/gui/app/utils/graph/graphAdapter.ts): `gui/app/utils/graph/graphAdapter.ts`
- [Asset parser](https://github.com/intforout/sham-wah/blob/main/api/app/core/parsers.py): `api/app/core/parsers.py`

### External systems

- **Knowledge graph**
- **Sham-Wah API**

### Other components

- **Explorer**

## Connections

- Explorer → Asset search: selects query
- Asset search → Query filters: configures
- Query filters → Filter state: updates filters
- Asset search → Query results: runs search
- Query results → Sham-Wah API: posts asset query
- Query results → Demo assets: filters demo data
- Sham-Wah API → API application: routes request
- API application → Asset query route: dispatches
- Asset query route → Knowledge graph: queries
- Asset query route → Asset parser: converts records
- Asset query route → Query results: returns assets
- Explorer → Graph canvas: explores graph
- Graph canvas → Graph renderer: renders graph
- Graph renderer → Graph utilities: uses graph helpers
- Graph canvas → Graph state: reads graph state
- Graph state → Graph routes: requests graph data
- Graph routes → Knowledge graph: accesses graph
- Graph canvas → Asset details: shows selected node
- Explorer → Map view: opens map
- Explorer → Chatbot panel: uses assistant
- Explorer → Cypher panel: enters Cypher
- API application → Graph routes: dispatches
- API application → Database routes: dispatches
- Database routes → Knowledge graph: checks database
