# junsoo-kim/myanalyst architecture

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

- Interactive diagram: https://gitdiagram.com/junsoo-kim/myanalyst
- Repository: https://github.com/junsoo-kim/myanalyst

## Overview

MyAnalyst is a RAG-based company-analysis report service. Users configure a report in the React app, submit a generation job, and receive a generated report for reading. The README documents a job-to-worker pipeline, retrieval over a knowledge base, and event-driven report saving and replication; it also describes glossary, market-data, chat, voice, and notification capabilities. These branches are retained, but several service-to-service links are documented only at a high level, so the graph does not infer detailed runtime calls beyond the shown excerpts and README.

Main entry points: [`FE/src/App.js`](https://github.com/junsoo-kim/myanalyst/blob/main/FE/src/App.js) (React application), [`services/generation-service/src/main/java/khu_swcon/myanalyst/shared/kafka/KafkaMessagingConfig.java`](https://github.com/junsoo-kim/myanalyst/blob/main/services/generation-service/src/main/java/khu_swcon/myanalyst/shared/kafka/KafkaMessagingConfig.java) (Kafka events), [`services/chat-service/src/main/java/khu_swcon/myanalyst/chat/ChatService.java`](https://github.com/junsoo-kim/myanalyst/blob/main/services/chat-service/src/main/java/khu_swcon/myanalyst/chat/ChatService.java) (Report chat), [`services/api-gateway/src/main/java/khu_swcon/myanalyst/gateway/ApiGatewayApplication.java`](https://github.com/junsoo-kim/myanalyst/blob/main/services/api-gateway/src/main/java/khu_swcon/myanalyst/gateway/ApiGatewayApplication.java) (API gateway)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_frontend["React application<br/>[App.js]"]
end

subgraph group_core["Identity and reports"]
  node_gateway["API gateway"]
  node_auth["Authentication"]
  node_users[("User accounts<br/>[UserService.java]")]
  node_reports[("Report service<br/>[ReportService.java]")]
  node_kafka["Kafka events"]
end

subgraph group_generation["Report generation"]
  node_report_jobs["Generation jobs"]
  node_worker["Report worker<br/>[worker.py]"]
  node_pipeline["Section RAG pipeline<br/>[pipeline.py]"]
  node_llm_tasks["LLM tasks<br/>[llm_tasks.py]"]
end

subgraph group_data["Knowledge and market data"]
  node_knowledge_api["Knowledge service<br/>[main.py]"]
  node_retrieval["Hybrid retrieval<br/>[hybrid_search.py]"]
  node_vector_store[("Milvus store<br/>[milvus_store.py]")]
  node_ingestion["Knowledge ingestion<br/>[ingest.py]"]
  node_market_data["Market data<br/>[main.py]"]
  node_news_stock["News and stock crawling<br/>[crawling.py]"]
end

subgraph group_assist["Reading assistance"]
  node_dictionary["Term dictionary"]
  node_chat["Report chat<br/>[ChatService.java]"]
  node_qa["Question answering<br/>[main.py]"]
  node_stt["Speech transcription<br/>[main.py]"]
  node_notifications["Job notifications"]
end

node_investor(("Investor"))
node_llm_provider["LLM provider"]
node_external_sources["External finance sources"]

node_investor -->|"uses"| node_frontend
node_frontend -.->|"calls APIs"| node_gateway
node_gateway -.->|"routes identity"| node_auth
node_auth -.->|"checks accounts"| node_users
node_gateway -.->|"routes jobs"| node_report_jobs
node_report_jobs -->|"dispatches generation"| node_worker
node_worker -.->|"runs sections"| node_pipeline
node_pipeline -->|"retrieves context"| node_knowledge_api
node_pipeline -->|"generates sections"| node_llm_tasks
node_llm_tasks -->|"requests completions"| node_llm_provider
node_knowledge_api -.->|"searches knowledge"| node_retrieval
node_retrieval -->|"queries vectors"| node_vector_store
node_ingestion -->|"indexes documents"| node_vector_store
node_market_data -->|"crawls sources"| node_news_stock
node_market_data -->|"fetches updates"| node_external_sources
node_report_jobs -->|"publishes save event"| node_kafka
node_kafka -->|"delivers save request"| node_reports
node_reports -->|"publishes report events"| node_kafka
node_kafka -->|"replicates report terms"| node_dictionary
node_kafka -->|"replicates report content"| node_chat
node_chat -->|"asks questions"| node_qa
node_chat -->|"transcribes audio"| node_stt
node_frontend -.->|"views terms"| node_dictionary
node_frontend -.->|"views market updates"| node_market_data
node_frontend -.->|"asks report questions"| node_chat
node_frontend -.->|"tracks job progress"| node_notifications

click node_frontend "https://github.com/junsoo-kim/myanalyst/blob/main/FE/src/App.js"
click node_gateway "https://github.com/junsoo-kim/myanalyst/blob/main/services/api-gateway/src/main/java/khu_swcon/myanalyst/gateway/ApiGatewayApplication.java"
click node_auth "https://github.com/junsoo-kim/myanalyst/blob/main/services/auth-service/src/main/java/khu_swcon/myanalyst/auth/web/SessionController.java"
click node_users "https://github.com/junsoo-kim/myanalyst/blob/main/services/user-service/src/main/java/khu_swcon/myanalyst/user/UserService.java"
click node_report_jobs "https://github.com/junsoo-kim/myanalyst/blob/main/services/generation-service/src/main/java/khu_swcon/myanalyst/generation/ReportJobService.java"
click node_worker "https://github.com/junsoo-kim/myanalyst/blob/main/services/generation-worker/worker.py"
click node_pipeline "https://github.com/junsoo-kim/myanalyst/blob/main/services/generation-worker/pipeline.py"
click node_llm_tasks "https://github.com/junsoo-kim/myanalyst/blob/main/services/generation-worker/llm_tasks.py"
click node_knowledge_api "https://github.com/junsoo-kim/myanalyst/blob/main/services/knowledge/main.py"
click node_retrieval "https://github.com/junsoo-kim/myanalyst/blob/main/services/knowledge/hybrid_search.py"
click node_vector_store "https://github.com/junsoo-kim/myanalyst/blob/main/services/knowledge/milvus_store.py"
click node_ingestion "https://github.com/junsoo-kim/myanalyst/blob/main/services/knowledge/ingest.py"
click node_market_data "https://github.com/junsoo-kim/myanalyst/blob/main/services/market-data/main.py"
click node_news_stock "https://github.com/junsoo-kim/myanalyst/blob/main/services/market-data/crawling.py"
click node_reports "https://github.com/junsoo-kim/myanalyst/blob/main/services/report-service/src/main/java/khu_swcon/myanalyst/report/ReportService.java"
click node_kafka "https://github.com/junsoo-kim/myanalyst/blob/main/services/generation-service/src/main/java/khu_swcon/myanalyst/shared/kafka/KafkaMessagingConfig.java"
click node_dictionary "https://github.com/junsoo-kim/myanalyst/blob/main/services/dictionary-service/src/main/java/khu_swcon/myanalyst/dictionary/DictionaryService.java"
click node_chat "https://github.com/junsoo-kim/myanalyst/blob/main/services/chat-service/src/main/java/khu_swcon/myanalyst/chat/ChatService.java"
click node_qa "https://github.com/junsoo-kim/myanalyst/blob/main/services/qa/main.py"
click node_stt "https://github.com/junsoo-kim/myanalyst/blob/main/services/stt/main.py"
click node_notifications "https://github.com/junsoo-kim/myanalyst/blob/main/services/notification-service/src/main/java/khu_swcon/myanalyst/notification/web/ReportJobEventsController.java"

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_frontend toneBlue
class node_gateway,node_auth,node_users,node_reports,node_kafka toneAmber
class node_report_jobs,node_worker,node_pipeline,node_llm_tasks toneMint
class node_knowledge_api,node_retrieval,node_vector_store,node_ingestion,node_market_data,node_news_stock toneRose
class node_dictionary,node_chat,node_qa,node_stt,node_notifications,node_investor,node_llm_provider,node_external_sources toneIndigo
```

## Components

### Web experience

- [React application](https://github.com/junsoo-kim/myanalyst/blob/main/FE/src/App.js): `FE/src/App.js`

### Identity and reports

- [API gateway](https://github.com/junsoo-kim/myanalyst/blob/main/services/api-gateway/src/main/java/khu_swcon/myanalyst/gateway/ApiGatewayApplication.java): `services/api-gateway/src/main/java/khu_swcon/myanalyst/gateway/ApiGatewayApplication.java`
- [Authentication](https://github.com/junsoo-kim/myanalyst/blob/main/services/auth-service/src/main/java/khu_swcon/myanalyst/auth/web/SessionController.java): `services/auth-service/src/main/java/khu_swcon/myanalyst/auth/web/SessionController.java`
- [User accounts](https://github.com/junsoo-kim/myanalyst/blob/main/services/user-service/src/main/java/khu_swcon/myanalyst/user/UserService.java): `services/user-service/src/main/java/khu_swcon/myanalyst/user/UserService.java`
- [Report service](https://github.com/junsoo-kim/myanalyst/blob/main/services/report-service/src/main/java/khu_swcon/myanalyst/report/ReportService.java): `services/report-service/src/main/java/khu_swcon/myanalyst/report/ReportService.java`
- [Kafka events](https://github.com/junsoo-kim/myanalyst/blob/main/services/generation-service/src/main/java/khu_swcon/myanalyst/shared/kafka/KafkaMessagingConfig.java): `services/generation-service/src/main/java/khu_swcon/myanalyst/shared/kafka/KafkaMessagingConfig.java`

### Report generation

- [Generation jobs](https://github.com/junsoo-kim/myanalyst/blob/main/services/generation-service/src/main/java/khu_swcon/myanalyst/generation/ReportJobService.java): `services/generation-service/src/main/java/khu_swcon/myanalyst/generation/ReportJobService.java`
- [Report worker](https://github.com/junsoo-kim/myanalyst/blob/main/services/generation-worker/worker.py): `services/generation-worker/worker.py`
- [Section RAG pipeline](https://github.com/junsoo-kim/myanalyst/blob/main/services/generation-worker/pipeline.py): `services/generation-worker/pipeline.py`
- [LLM tasks](https://github.com/junsoo-kim/myanalyst/blob/main/services/generation-worker/llm_tasks.py): `services/generation-worker/llm_tasks.py`

### Knowledge and market data

- [Knowledge service](https://github.com/junsoo-kim/myanalyst/blob/main/services/knowledge/main.py): `services/knowledge/main.py`
- [Hybrid retrieval](https://github.com/junsoo-kim/myanalyst/blob/main/services/knowledge/hybrid_search.py): `services/knowledge/hybrid_search.py`
- [Milvus store](https://github.com/junsoo-kim/myanalyst/blob/main/services/knowledge/milvus_store.py): `services/knowledge/milvus_store.py`
- [Knowledge ingestion](https://github.com/junsoo-kim/myanalyst/blob/main/services/knowledge/ingest.py): `services/knowledge/ingest.py`
- [Market data](https://github.com/junsoo-kim/myanalyst/blob/main/services/market-data/main.py): `services/market-data/main.py`
- [News and stock crawling](https://github.com/junsoo-kim/myanalyst/blob/main/services/market-data/crawling.py): `services/market-data/crawling.py`

### Reading assistance

- [Term dictionary](https://github.com/junsoo-kim/myanalyst/blob/main/services/dictionary-service/src/main/java/khu_swcon/myanalyst/dictionary/DictionaryService.java): `services/dictionary-service/src/main/java/khu_swcon/myanalyst/dictionary/DictionaryService.java`
- [Report chat](https://github.com/junsoo-kim/myanalyst/blob/main/services/chat-service/src/main/java/khu_swcon/myanalyst/chat/ChatService.java): `services/chat-service/src/main/java/khu_swcon/myanalyst/chat/ChatService.java`
- [Question answering](https://github.com/junsoo-kim/myanalyst/blob/main/services/qa/main.py): `services/qa/main.py`
- [Speech transcription](https://github.com/junsoo-kim/myanalyst/blob/main/services/stt/main.py): `services/stt/main.py`
- [Job notifications](https://github.com/junsoo-kim/myanalyst/blob/main/services/notification-service/src/main/java/khu_swcon/myanalyst/notification/web/ReportJobEventsController.java): `services/notification-service/src/main/java/khu_swcon/myanalyst/notification/web/ReportJobEventsController.java`

### Other components

- **Investor**
- **LLM provider**
- **External finance sources**

## Connections

- Investor → React application: uses
- React application → API gateway: calls APIs
- API gateway → Authentication: routes identity
- Authentication → User accounts: checks accounts
- API gateway → Generation jobs: routes jobs
- Generation jobs → Report worker: dispatches generation
- Report worker → Section RAG pipeline: runs sections
- Section RAG pipeline → Knowledge service: retrieves context (evidence: `services/generation-worker/pipeline.py`)
- Section RAG pipeline → LLM tasks: generates sections (evidence: `services/generation-worker/pipeline.py`)
- LLM tasks → LLM provider: requests completions (evidence: `services/generation-worker/llm_tasks.py`)
- Knowledge service → Hybrid retrieval: searches knowledge
- Hybrid retrieval → Milvus store: queries vectors (evidence: `services/knowledge/evals/retrieval_engine.py`)
- Knowledge ingestion → Milvus store: indexes documents (evidence: `services/knowledge/ingest.py`)
- Market data → News and stock crawling: crawls sources (evidence: `services/market-data/main.py`)
- Market data → External finance sources: fetches updates
- Generation jobs → Kafka events: publishes save event (evidence: `services/generation-service/src/main/java/khu_swcon/myanalyst/generation/ReportJobService.java`)
- Kafka events → Report service: delivers save request
- Report service → Kafka events: publishes report events (evidence: `services/report-service/src/main/java/khu_swcon/myanalyst/report/ReportService.java`)
- Kafka events → Term dictionary: replicates report terms (evidence: `services/dictionary-service/src/main/java/khu_swcon/myanalyst/dictionary/DictionaryService.java`)
- Kafka events → Report chat: replicates report content (evidence: `services/chat-service/src/main/java/khu_swcon/myanalyst/chat/ChatService.java`)
- Report chat → Question answering: asks questions (evidence: `services/chat-service/src/main/java/khu_swcon/myanalyst/chat/ChatService.java`)
- Report chat → Speech transcription: transcribes audio (evidence: `services/chat-service/src/main/java/khu_swcon/myanalyst/chat/ChatService.java`)
- React application → Term dictionary: views terms
- React application → Market data: views market updates
- React application → Report chat: asks report questions
- React application → Job notifications: tracks job progress
