# shuja-01/otest_1 architecture

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

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

## Overview

Application Knowledge Hub is a local Jira-centered knowledge hub. Users connect Jira, select a domain/application and JQL to extract issue context, and can also load Bitbucket repositories, Confluence pages, documents, or program-project data. API routes manage these source workflows; in-memory services index and search the loaded material, while AI routes use the retrieval context to answer questions. The README describes deterministic extraction as the current result rather than built-in LLM-generated context. Several source excerpts are partial, so edges for unsampled capabilities are limited to indexed references or explicit documentation.

Main entry points: [`lib/routes/ai-routes.js`](https://github.com/shuja-01/otest_1/blob/main/lib/routes/ai-routes.js) (AI routes), [`lib/routes`](https://github.com/shuja-01/otest_1/tree/main/lib/routes) (Source routes), [`server.js`](https://github.com/shuja-01/otest_1/blob/main/server.js) (HTTP server), [`lib/routes/jira-routes.js`](https://github.com/shuja-01/otest_1/blob/main/lib/routes/jira-routes.js) (Jira routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_server["HTTP server<br/>[server.js]"]
  node_jira_routes["Jira routes<br/>[jira-routes.js]"]
  node_source_routes["Source routes"]
  node_ai_routes["AI routes<br/>[ai-routes.js]"]
  node_profile_routes["Profile routes<br/>[profile-routes.js]"]
  node_http_helpers["HTTP helpers<br/>[http-helpers.js]"]
  node_session_state["Session and context<br/>[state.js]"]
  node_document_routes["Document routes<br/>[document-routes.js]"]
end

subgraph group_sources["Knowledge Sources"]
  node_jira_service["Jira client<br/>[state.js]"]
  node_jira_analytics["Jira analytics<br/>[jira-analytics.js]"]
  node_program_project["Program projects"]
  node_bitbucket_ingest["Bitbucket loading<br/>[loader.js]"]
  node_bitbucket_service["Bitbucket index"]
  node_bitbucket_diagrams["Repository diagrams"]
  node_confluence_ingest["Confluence loading<br/>[loader.js]"]
  node_confluence_service["Confluence index"]
  node_document_service["Document processing"]
  node_document_store["Document store"]
  node_onboarding["Onboarding context"]
  node_workspace_profiles["Workspace profiles"]
end

subgraph group_intelligence["Search and AI"]
  node_unified_search["Unified search"]
  node_prompts["Assistant prompts"]
  node_ai_client["Internal AI client<br/>[ai-client.js]"]
end

subgraph group_experience["User Experience"]
  node_web_ui["Knowledge hub UI"]
end

node_user(("Hub user"))
node_jira_system["Jira service"]
node_confluence_system["Confluence service"]
node_bitbucket_system["Bitbucket service"]
node_llm_system["Internal LLM"]

node_user -.->|"uses"| node_web_ui
node_web_ui -.->|"sends requests"| node_server
node_server -->|"dispatches"| node_jira_routes
node_server -->|"dispatches"| node_source_routes
node_server -->|"dispatches"| node_ai_routes
node_server -->|"dispatches"| node_profile_routes
node_server -->|"logs requests"| node_http_helpers
node_jira_routes -->|"reads requests"| node_http_helpers
node_jira_routes -->|"reads and updates"| node_session_state
node_jira_routes -->|"fetches Jira data"| node_jira_service
node_jira_routes -->|"builds analytics"| node_jira_analytics
node_jira_routes -->|"builds project context"| node_program_project
node_jira_service -->|"requests"| node_jira_system
node_source_routes -->|"loads repositories"| node_bitbucket_ingest
node_source_routes -->|"manages repository context"| node_bitbucket_service
node_source_routes -->|"generates diagrams"| node_bitbucket_diagrams
node_source_routes -->|"loads pages"| node_confluence_ingest
node_source_routes -->|"manages page context"| node_confluence_service
node_confluence_ingest -->|"fetches pages"| node_confluence_system
node_source_routes -->|"fetches repository data"| node_bitbucket_system
node_document_routes -->|"processes documents"| node_document_service
node_document_routes -->|"stores documents"| node_document_store
node_profile_routes -->|"manages profiles"| node_workspace_profiles
node_profile_routes -->|"loads Jira context"| node_jira_service
node_profile_routes -->|"loads Confluence sources"| node_confluence_ingest
node_ai_routes -->|"reads session"| node_session_state
node_ai_routes -->|"searches knowledge"| node_unified_search
node_ai_routes -->|"builds assistant prompts"| node_prompts
node_ai_routes -->|"requests responses"| node_ai_client
node_ai_client -->|"sends prompts"| node_llm_system
node_ai_routes -->|"uses repository context"| node_bitbucket_service
node_ai_routes -->|"uses page context"| node_confluence_service
node_ai_routes -->|"uses document context"| node_document_store
node_ai_routes -->|"uses project context"| node_program_project
node_ai_routes -->|"uses onboarding context"| node_onboarding
node_unified_search -->|"uses search prompt"| node_prompts
node_profile_routes -->|"loads profile sources"| node_bitbucket_ingest

click node_server "https://github.com/shuja-01/otest_1/blob/main/server.js"
click node_jira_routes "https://github.com/shuja-01/otest_1/blob/main/lib/routes/jira-routes.js"
click node_source_routes "https://github.com/shuja-01/otest_1/tree/main/lib/routes"
click node_ai_routes "https://github.com/shuja-01/otest_1/blob/main/lib/routes/ai-routes.js"
click node_profile_routes "https://github.com/shuja-01/otest_1/blob/main/lib/routes/profile-routes.js"
click node_http_helpers "https://github.com/shuja-01/otest_1/blob/main/lib/server/http-helpers.js"
click node_session_state "https://github.com/shuja-01/otest_1/blob/main/lib/server/state.js"
click node_jira_service "https://github.com/shuja-01/otest_1/blob/main/lib/server/state.js"
click node_jira_analytics "https://github.com/shuja-01/otest_1/blob/main/lib/server/jira-analytics.js"
click node_program_project "https://github.com/shuja-01/otest_1/blob/main/lib/program-project-service.js"
click node_bitbucket_ingest "https://github.com/shuja-01/otest_1/blob/main/lib/bitbucket/loader.js"
click node_bitbucket_service "https://github.com/shuja-01/otest_1/blob/main/lib/bitbucket-service.js"
click node_bitbucket_diagrams "https://github.com/shuja-01/otest_1/blob/main/lib/bitbucket-diagram-service.js"
click node_confluence_ingest "https://github.com/shuja-01/otest_1/blob/main/lib/confluence/loader.js"
click node_confluence_service "https://github.com/shuja-01/otest_1/blob/main/lib/confluence-service.js"
click node_document_routes "https://github.com/shuja-01/otest_1/blob/main/lib/routes/document-routes.js"
click node_document_service "https://github.com/shuja-01/otest_1/blob/main/lib/document-service.js"
click node_document_store "https://github.com/shuja-01/otest_1/blob/main/lib/multi-document-store.js"
click node_onboarding "https://github.com/shuja-01/otest_1/blob/main/lib/onboarding-service.js"
click node_unified_search "https://github.com/shuja-01/otest_1/blob/main/lib/unified-search-service.js"
click node_prompts "https://github.com/shuja-01/otest_1/tree/main/lib/prompts"
click node_ai_client "https://github.com/shuja-01/otest_1/blob/main/lib/ai-client.js"
click node_workspace_profiles "https://github.com/shuja-01/otest_1/blob/main/lib/workspace-profile-service.js"
click node_web_ui "https://github.com/shuja-01/otest_1/tree/main/public/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_server,node_jira_routes,node_source_routes,node_ai_routes,node_profile_routes,node_http_helpers,node_session_state,node_document_routes,node_user toneBlue
class node_jira_service,node_jira_analytics,node_program_project,node_bitbucket_ingest,node_bitbucket_service,node_bitbucket_diagrams,node_confluence_ingest,node_confluence_service,node_document_service,node_document_store,node_onboarding,node_workspace_profiles toneAmber
class node_unified_search,node_prompts,node_ai_client toneMint
class node_web_ui toneRose
class node_jira_system,node_confluence_system,node_bitbucket_system,node_llm_system toneIndigo
```

## Components

### HTTP API

- [HTTP server](https://github.com/shuja-01/otest_1/blob/main/server.js): `server.js`
- [Jira routes](https://github.com/shuja-01/otest_1/blob/main/lib/routes/jira-routes.js): `lib/routes/jira-routes.js`
- [Source routes](https://github.com/shuja-01/otest_1/tree/main/lib/routes): `lib/routes`
- [AI routes](https://github.com/shuja-01/otest_1/blob/main/lib/routes/ai-routes.js): `lib/routes/ai-routes.js`
- [Profile routes](https://github.com/shuja-01/otest_1/blob/main/lib/routes/profile-routes.js): `lib/routes/profile-routes.js`
- [HTTP helpers](https://github.com/shuja-01/otest_1/blob/main/lib/server/http-helpers.js): `lib/server/http-helpers.js`
- [Session and context](https://github.com/shuja-01/otest_1/blob/main/lib/server/state.js): `lib/server/state.js`
- [Document routes](https://github.com/shuja-01/otest_1/blob/main/lib/routes/document-routes.js): `lib/routes/document-routes.js`

### Knowledge Sources

- [Jira client](https://github.com/shuja-01/otest_1/blob/main/lib/server/state.js): `lib/server/state.js`
- [Jira analytics](https://github.com/shuja-01/otest_1/blob/main/lib/server/jira-analytics.js): `lib/server/jira-analytics.js`
- [Program projects](https://github.com/shuja-01/otest_1/blob/main/lib/program-project-service.js): `lib/program-project-service.js`
- [Bitbucket loading](https://github.com/shuja-01/otest_1/blob/main/lib/bitbucket/loader.js): `lib/bitbucket/loader.js`
- [Bitbucket index](https://github.com/shuja-01/otest_1/blob/main/lib/bitbucket-service.js): `lib/bitbucket-service.js`
- [Repository diagrams](https://github.com/shuja-01/otest_1/blob/main/lib/bitbucket-diagram-service.js): `lib/bitbucket-diagram-service.js`
- [Confluence loading](https://github.com/shuja-01/otest_1/blob/main/lib/confluence/loader.js): `lib/confluence/loader.js`
- [Confluence index](https://github.com/shuja-01/otest_1/blob/main/lib/confluence-service.js): `lib/confluence-service.js`
- [Document processing](https://github.com/shuja-01/otest_1/blob/main/lib/document-service.js): `lib/document-service.js`
- [Document store](https://github.com/shuja-01/otest_1/blob/main/lib/multi-document-store.js): `lib/multi-document-store.js`
- [Onboarding context](https://github.com/shuja-01/otest_1/blob/main/lib/onboarding-service.js): `lib/onboarding-service.js`
- [Workspace profiles](https://github.com/shuja-01/otest_1/blob/main/lib/workspace-profile-service.js): `lib/workspace-profile-service.js`

### Search and AI

- [Unified search](https://github.com/shuja-01/otest_1/blob/main/lib/unified-search-service.js): `lib/unified-search-service.js`
- [Assistant prompts](https://github.com/shuja-01/otest_1/tree/main/lib/prompts): `lib/prompts`
- [Internal AI client](https://github.com/shuja-01/otest_1/blob/main/lib/ai-client.js): `lib/ai-client.js`

### User Experience

- [Knowledge hub UI](https://github.com/shuja-01/otest_1/tree/main/public/js): `public/js`

### Other components

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

## Connections

- Hub user → Knowledge hub UI: uses
- Knowledge hub UI → HTTP server: sends requests
- HTTP server → Jira routes: dispatches (evidence: `server.js`)
- HTTP server → Source routes: dispatches (evidence: `server.js`)
- HTTP server → AI routes: dispatches (evidence: `server.js`)
- HTTP server → Profile routes: dispatches (evidence: `server.js`)
- HTTP server → HTTP helpers: logs requests (evidence: `server.js`)
- Jira routes → HTTP helpers: reads requests (evidence: `lib/routes/jira-routes.js`)
- Jira routes → Session and context: reads and updates (evidence: `lib/routes/jira-routes.js`)
- Jira routes → Jira client: fetches Jira data (evidence: `lib/server/state.js`)
- Jira routes → Jira analytics: builds analytics (evidence: `lib/routes/jira-routes.js`)
- Jira routes → Program projects: builds project context (evidence: `lib/routes/jira-routes.js`)
- Jira client → Jira service: requests (evidence: `lib/server/state.js`)
- Source routes → Bitbucket loading: loads repositories (evidence: `lib/routes/bitbucket-routes.js`)
- Source routes → Bitbucket index: manages repository context (evidence: `lib/routes/bitbucket-routes.js`)
- Source routes → Repository diagrams: generates diagrams (evidence: `lib/routes/bitbucket-routes.js`)
- Source routes → Confluence loading: loads pages (evidence: `lib/routes/confluence-routes.js`)
- Source routes → Confluence index: manages page context (evidence: `lib/routes/confluence-routes.js`)
- Confluence loading → Confluence service: fetches pages (evidence: `lib/confluence/loader.js`)
- Source routes → Bitbucket service: fetches repository data
- Document routes → Document processing: processes documents (evidence: `lib/routes/document-routes.js`)
- Document routes → Document store: stores documents (evidence: `lib/routes/document-routes.js`)
- Profile routes → Workspace profiles: manages profiles (evidence: `lib/routes/profile-routes.js`)
- Profile routes → Jira client: loads Jira context (evidence: `lib/routes/profile-routes.js`)
- Profile routes → Confluence loading: loads Confluence sources (evidence: `lib/routes/profile-routes.js`)
- AI routes → Session and context: reads session (evidence: `lib/routes/ai-routes.js`)
- AI routes → Unified search: searches knowledge (evidence: `lib/routes/ai-routes.js`)
- AI routes → Assistant prompts: builds assistant prompts (evidence: `lib/routes/ai-routes.js`)
- AI routes → Internal AI client: requests responses (evidence: `lib/routes/ai-routes.js`)
- Internal AI client → Internal LLM: sends prompts (evidence: `lib/ai-client.js`)
- AI routes → Bitbucket index: uses repository context (evidence: `lib/routes/ai-routes.js`)
- AI routes → Confluence index: uses page context (evidence: `lib/routes/ai-routes.js`)
- AI routes → Document store: uses document context (evidence: `lib/routes/ai-routes.js`)
- AI routes → Program projects: uses project context (evidence: `lib/routes/ai-routes.js`)
- AI routes → Onboarding context: uses onboarding context (evidence: `lib/routes/ai-routes.js`)
- Unified search → Assistant prompts: uses search prompt (evidence: `lib/unified-search-service.js`)
- Profile routes → Bitbucket loading: loads profile sources (evidence: `lib/routes/profile-routes.js`)
