# shuja-01/otest architecture

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

- Interactive diagram: https://gitdiagram.com/shuja-01/otest
- Repository: https://github.com/shuja-01/otest

## Overview

Application Knowledge Hub is a local web application for loading Jira test-case context and exploring related knowledge from documents, Bitbucket, Confluence, and Program/Project data. Users interact through the hub pages; `server.js` routes requests, coordinates integrations and context services, and returns results to the browser. The README describes deterministic context extraction, with optional later LLM assistance. Several server sections and service implementations were only partially excerpted, so uncertain connections are omitted or marked unverified.

Main entry points: [`server.js`](https://github.com/shuja-01/otest/blob/main/server.js) (HTTP routes), [`index.html`](https://github.com/shuja-01/otest/blob/main/index.html) (Jira dashboard), [`document-hub.html`](https://github.com/shuja-01/otest/blob/main/document-hub.html) (Document hub), [`bitbucket-hub.html`](https://github.com/shuja-01/otest/blob/main/bitbucket-hub.html) (Bitbucket hub)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Hub Interface"]
  node_jira_ui["Jira dashboard<br/>[index.html]"]
  node_document_ui["Document hub<br/>[document-hub.html]"]
  node_bitbucket_ui["Bitbucket hub<br/>[bitbucket-hub.html]"]
  node_confluence_ui["Confluence hub"]
end

subgraph group_runtime["Local Server"]
  node_server["HTTP routes<br/>[server.js]"]
end

subgraph group_jira["Jira Knowledge"]
  node_jira_client["Jira API client<br/>[jira-client.js]"]
  node_metadata["Domain metadata"]
  node_program_project["Program project context"]
end

subgraph group_sources["Knowledge Sources"]
  node_document_service["Document extraction"]
  node_bitbucket_client["Bitbucket API client"]
  node_bitbucket_service["Repository context"]
  node_confluence_client["Confluence API client"]
  node_confluence_service["Confluence context"]
end

subgraph group_assistant["Context Assistant"]
  node_prompt["Jira assistant prompt"]
  node_ai_client["Internal LLM client<br/>[ai-client.js]"]
end

node_user(("Hub user"))
node_jira["Jira instance"]
node_bitbucket["Bitbucket instance"]
node_confluence["Confluence instance"]
node_llm["Internal LLM service"]

node_user -->|"opens"| node_jira_ui
node_user -->|"opens"| node_document_ui
node_user -->|"opens"| node_bitbucket_ui
node_user -->|"opens"| node_confluence_ui
node_jira_ui -->|"requests"| node_server
node_document_ui -.->|"uploads"| node_server
node_bitbucket_ui -.->|"requests"| node_server
node_confluence_ui -.->|"requests"| node_server
node_server -.->|"queries"| node_jira_client
node_server -.->|"loads options"| node_metadata
node_server -->|"handles questions"| node_program_project
node_server -->|"uses prompt"| node_prompt
node_server -->|"calls"| node_ai_client
node_server -.->|"extracts text"| node_document_service
node_server -->|"loads repository data"| node_bitbucket_client
node_server -.->|"loads context"| node_bitbucket_service
node_server -->|"loads pages"| node_confluence_client
node_server -.->|"sets context"| node_confluence_service
node_jira_client -.->|"fetches issues"| node_jira
node_metadata -->|"fetches options"| node_jira
node_bitbucket_client -->|"fetches repository data"| node_bitbucket
node_confluence_client -->|"fetches pages"| node_confluence
node_ai_client -->|"sends chat request"| node_llm

click node_jira_ui "https://github.com/shuja-01/otest/blob/main/index.html"
click node_document_ui "https://github.com/shuja-01/otest/blob/main/document-hub.html"
click node_bitbucket_ui "https://github.com/shuja-01/otest/blob/main/bitbucket-hub.html"
click node_confluence_ui "https://github.com/shuja-01/otest/blob/main/confluence-hub.html"
click node_server "https://github.com/shuja-01/otest/blob/main/server.js"
click node_jira_client "https://github.com/shuja-01/otest/blob/main/lib/jira-client.js"
click node_metadata "https://github.com/shuja-01/otest/blob/main/lib/metadata-service.js"
click node_program_project "https://github.com/shuja-01/otest/blob/main/lib/program-project-service.js"
click node_prompt "https://github.com/shuja-01/otest/blob/main/lib/prompts/jira-knowledge-assistant.js"
click node_ai_client "https://github.com/shuja-01/otest/blob/main/lib/ai-client.js"
click node_document_service "https://github.com/shuja-01/otest/blob/main/lib/document-service.js"
click node_bitbucket_client "https://github.com/shuja-01/otest/blob/main/lib/bitbucket-client.js"
click node_bitbucket_service "https://github.com/shuja-01/otest/blob/main/lib/bitbucket-service.js"
click node_confluence_client "https://github.com/shuja-01/otest/blob/main/lib/confluence-client.js"
click node_confluence_service "https://github.com/shuja-01/otest/blob/main/lib/confluence-service.js"

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_jira_ui,node_document_ui,node_bitbucket_ui,node_confluence_ui,node_user toneBlue
class node_server toneAmber
class node_jira_client,node_metadata,node_program_project toneMint
class node_document_service,node_bitbucket_client,node_bitbucket_service,node_confluence_client,node_confluence_service toneRose
class node_prompt,node_ai_client,node_jira,node_bitbucket,node_confluence,node_llm toneIndigo
```

## Components

### Hub Interface

- [Jira dashboard](https://github.com/shuja-01/otest/blob/main/index.html): `index.html`
- [Document hub](https://github.com/shuja-01/otest/blob/main/document-hub.html): `document-hub.html`
- [Bitbucket hub](https://github.com/shuja-01/otest/blob/main/bitbucket-hub.html): `bitbucket-hub.html`
- [Confluence hub](https://github.com/shuja-01/otest/blob/main/confluence-hub.html): `confluence-hub.html`

### Local Server

- [HTTP routes](https://github.com/shuja-01/otest/blob/main/server.js): `server.js`

### Jira Knowledge

- [Jira API client](https://github.com/shuja-01/otest/blob/main/lib/jira-client.js): `lib/jira-client.js`
- [Domain metadata](https://github.com/shuja-01/otest/blob/main/lib/metadata-service.js): `lib/metadata-service.js`
- [Program project context](https://github.com/shuja-01/otest/blob/main/lib/program-project-service.js): `lib/program-project-service.js`

### Knowledge Sources

- [Document extraction](https://github.com/shuja-01/otest/blob/main/lib/document-service.js): `lib/document-service.js`
- [Bitbucket API client](https://github.com/shuja-01/otest/blob/main/lib/bitbucket-client.js): `lib/bitbucket-client.js`
- [Repository context](https://github.com/shuja-01/otest/blob/main/lib/bitbucket-service.js): `lib/bitbucket-service.js`
- [Confluence API client](https://github.com/shuja-01/otest/blob/main/lib/confluence-client.js): `lib/confluence-client.js`
- [Confluence context](https://github.com/shuja-01/otest/blob/main/lib/confluence-service.js): `lib/confluence-service.js`

### Context Assistant

- [Jira assistant prompt](https://github.com/shuja-01/otest/blob/main/lib/prompts/jira-knowledge-assistant.js): `lib/prompts/jira-knowledge-assistant.js`
- [Internal LLM client](https://github.com/shuja-01/otest/blob/main/lib/ai-client.js): `lib/ai-client.js`

### Other components

- **Hub user**
- **Jira instance**
- **Bitbucket instance**
- **Confluence instance**
- **Internal LLM service**

## Connections

- Hub user → Jira dashboard: opens (evidence: `README.md`)
- Hub user → Document hub: opens (evidence: `README.md`)
- Hub user → Bitbucket hub: opens (evidence: `README.md`)
- Hub user → Confluence hub: opens (evidence: `README.md`)
- Jira dashboard → HTTP routes: requests (evidence: `README.md`)
- Document hub → HTTP routes: uploads
- Bitbucket hub → HTTP routes: requests
- Confluence hub → HTTP routes: requests
- HTTP routes → Jira API client: queries (evidence: `server.js`)
- HTTP routes → Domain metadata: loads options (evidence: `server.js`)
- HTTP routes → Program project context: handles questions (evidence: `server.js`)
- HTTP routes → Jira assistant prompt: uses prompt (evidence: `server.js`)
- HTTP routes → Internal LLM client: calls (evidence: `server.js`)
- HTTP routes → Document extraction: extracts text (evidence: `server.js`)
- HTTP routes → Bitbucket API client: loads repository data (evidence: `server.js`)
- HTTP routes → Repository context: loads context (evidence: `server.js`)
- HTTP routes → Confluence API client: loads pages (evidence: `server.js`)
- HTTP routes → Confluence context: sets context (evidence: `server.js`)
- Jira API client → Jira instance: fetches issues
- Domain metadata → Jira instance: fetches options (evidence: `lib/metadata-service.js`)
- Bitbucket API client → Bitbucket instance: fetches repository data (evidence: `lib/bitbucket-client.js`)
- Confluence API client → Confluence instance: fetches pages (evidence: `lib/confluence-client.js`)
- Internal LLM client → Internal LLM service: sends chat request (evidence: `lib/ai-client.js`)
