# libowen371425-crypto/trendradar architecture

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

- Interactive diagram: https://gitdiagram.com/libowen371425-crypto/trendradar
- Repository: https://github.com/libowen371425-crypto/trendradar

## Overview

TrendRadar aggregates trending-news data into dated text and HTML reports, with configurable platforms, keyword filtering, scheduled notification modes, and an MCP server for querying and analyzing stored news. The main crawler and notification implementation is concentrated in main.py, but its internals were not excerpted, so its detailed calls and integrations are not mapped. MCP relationships below are limited to references in the source index or shown excerpts; the README excerpt documents product capabilities but not their wiring.

Main entry points: [`mcp_server/services/data_service.py`](https://github.com/libowen371425-crypto/trendradar/blob/master/mcp_server/services/data_service.py) (Data access), [`main.py`](https://github.com/libowen371425-crypto/trendradar/blob/master/main.py) (Crawler and notifier), [`mcp_server/server.py`](https://github.com/libowen371425-crypto/trendradar/blob/master/mcp_server/server.py) (MCP server), [`mcp_server/utils/validators.py`](https://github.com/libowen371425-crypto/trendradar/blob/master/mcp_server/utils/validators.py) (Parameter validation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Collection and reports"]
  node_main["Crawler and notifier<br/>[main.py]"]
  node_config["Crawler configuration<br/>[config.yaml]"]
  node_keywords["Tracked keywords"]
  node_reports["Dated news reports"]
end

subgraph group_mcp["MCP interface"]
  node_mcpserver["MCP server<br/>[server.py]"]
end

subgraph group_services["Data services"]
  node_dataservice["Data access<br/>[data_service.py]"]
  node_parser["Report and config parser<br/>[parser_service.py]"]
  node_cache[("In-memory cache<br/>[cache_service.py]")]
  node_validators["Parameter validation<br/>[validators.py]"]
  node_dates["Date parsing<br/>[date_parser.py]"]
end

subgraph group_tools["Query and analysis"]
  node_query["Data queries<br/>[data_query.py]"]
  node_analytics["News analytics<br/>[analytics.py]"]
  node_search["News search<br/>[search_tools.py]"]
  node_configtools["Config management<br/>[config_mgmt.py]"]
  node_system["System operations<br/>[system.py]"]
end

node_user(("User"))
node_platforms["News platforms"]
node_channels["Notification channels"]

node_user -.->|"runs monitoring"| node_main
node_main -.->|"fetches trends"| node_platforms
node_main -.->|"reads settings"| node_config
node_main -.->|"uses tracked terms"| node_keywords
node_main -.->|"generates reports"| node_reports
node_main -.->|"sends notifications"| node_channels
node_user -->|"requests tools"| node_mcpserver
node_mcpserver -->|"dispatches tools"| node_query
node_mcpserver -->|"dispatches tools"| node_analytics
node_mcpserver -->|"dispatches tools"| node_search
node_mcpserver -->|"dispatches tools"| node_configtools
node_mcpserver -->|"dispatches tools"| node_system
node_query -->|"queries data"| node_dataservice
node_analytics -.->|"analyzes data"| node_dataservice
node_search -->|"searches data"| node_dataservice
node_configtools -->|"reads config"| node_dataservice
node_system -.->|"uses data service"| node_dataservice
node_dataservice -->|"loads report data"| node_parser
node_dataservice -->|"caches results"| node_cache
node_parser -->|"checks cached data"| node_cache
node_parser -->|"reads dated text"| node_reports
node_query -->|"validates inputs"| node_validators
node_search -.->|"validates inputs"| node_validators
node_validators -->|"parses dates"| node_dates
node_validators -->|"loads platforms"| node_config

click node_main "https://github.com/libowen371425-crypto/trendradar/blob/master/main.py"
click node_config "https://github.com/libowen371425-crypto/trendradar/blob/master/config/config.yaml"
click node_keywords "https://github.com/libowen371425-crypto/trendradar/blob/master/config/frequency_words.txt"
click node_reports "https://github.com/libowen371425-crypto/trendradar/tree/master/output"
click node_mcpserver "https://github.com/libowen371425-crypto/trendradar/blob/master/mcp_server/server.py"
click node_query "https://github.com/libowen371425-crypto/trendradar/blob/master/mcp_server/tools/data_query.py"
click node_analytics "https://github.com/libowen371425-crypto/trendradar/blob/master/mcp_server/tools/analytics.py"
click node_search "https://github.com/libowen371425-crypto/trendradar/blob/master/mcp_server/tools/search_tools.py"
click node_configtools "https://github.com/libowen371425-crypto/trendradar/blob/master/mcp_server/tools/config_mgmt.py"
click node_system "https://github.com/libowen371425-crypto/trendradar/blob/master/mcp_server/tools/system.py"
click node_dataservice "https://github.com/libowen371425-crypto/trendradar/blob/master/mcp_server/services/data_service.py"
click node_parser "https://github.com/libowen371425-crypto/trendradar/blob/master/mcp_server/services/parser_service.py"
click node_cache "https://github.com/libowen371425-crypto/trendradar/blob/master/mcp_server/services/cache_service.py"
click node_validators "https://github.com/libowen371425-crypto/trendradar/blob/master/mcp_server/utils/validators.py"
click node_dates "https://github.com/libowen371425-crypto/trendradar/blob/master/mcp_server/utils/date_parser.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_main,node_config,node_keywords,node_reports,node_user toneBlue
class node_mcpserver toneAmber
class node_dataservice,node_parser,node_cache,node_validators,node_dates toneMint
class node_query,node_analytics,node_search,node_configtools,node_system toneRose
class node_platforms,node_channels toneIndigo
```

## Components

### Collection and reports

- [Crawler and notifier](https://github.com/libowen371425-crypto/trendradar/blob/master/main.py): `main.py`
- [Crawler configuration](https://github.com/libowen371425-crypto/trendradar/blob/master/config/config.yaml): `config/config.yaml`
- [Tracked keywords](https://github.com/libowen371425-crypto/trendradar/blob/master/config/frequency_words.txt): `config/frequency_words.txt`
- [Dated news reports](https://github.com/libowen371425-crypto/trendradar/tree/master/output): `output`

### MCP interface

- [MCP server](https://github.com/libowen371425-crypto/trendradar/blob/master/mcp_server/server.py): `mcp_server/server.py`

### Data services

- [Data access](https://github.com/libowen371425-crypto/trendradar/blob/master/mcp_server/services/data_service.py): `mcp_server/services/data_service.py`
- [Report and config parser](https://github.com/libowen371425-crypto/trendradar/blob/master/mcp_server/services/parser_service.py): `mcp_server/services/parser_service.py`
- [In-memory cache](https://github.com/libowen371425-crypto/trendradar/blob/master/mcp_server/services/cache_service.py): `mcp_server/services/cache_service.py`
- [Parameter validation](https://github.com/libowen371425-crypto/trendradar/blob/master/mcp_server/utils/validators.py): `mcp_server/utils/validators.py`
- [Date parsing](https://github.com/libowen371425-crypto/trendradar/blob/master/mcp_server/utils/date_parser.py): `mcp_server/utils/date_parser.py`

### Query and analysis

- [Data queries](https://github.com/libowen371425-crypto/trendradar/blob/master/mcp_server/tools/data_query.py): `mcp_server/tools/data_query.py`
- [News analytics](https://github.com/libowen371425-crypto/trendradar/blob/master/mcp_server/tools/analytics.py): `mcp_server/tools/analytics.py`
- [News search](https://github.com/libowen371425-crypto/trendradar/blob/master/mcp_server/tools/search_tools.py): `mcp_server/tools/search_tools.py`
- [Config management](https://github.com/libowen371425-crypto/trendradar/blob/master/mcp_server/tools/config_mgmt.py): `mcp_server/tools/config_mgmt.py`
- [System operations](https://github.com/libowen371425-crypto/trendradar/blob/master/mcp_server/tools/system.py): `mcp_server/tools/system.py`

### Other components

- **User**
- **News platforms**
- **Notification channels**

## Connections

- User → Crawler and notifier: runs monitoring
- Crawler and notifier → News platforms: fetches trends
- Crawler and notifier → Crawler configuration: reads settings
- Crawler and notifier → Tracked keywords: uses tracked terms
- Crawler and notifier → Dated news reports: generates reports
- Crawler and notifier → Notification channels: sends notifications
- User → MCP server: requests tools (evidence: `mcp_server/server.py`)
- MCP server → Data queries: dispatches tools (evidence: `mcp_server/server.py`)
- MCP server → News analytics: dispatches tools (evidence: `mcp_server/server.py`)
- MCP server → News search: dispatches tools (evidence: `mcp_server/server.py`)
- MCP server → Config management: dispatches tools (evidence: `mcp_server/server.py`)
- MCP server → System operations: dispatches tools (evidence: `mcp_server/server.py`)
- Data queries → Data access: queries data (evidence: `mcp_server/tools/data_query.py`)
- News analytics → Data access: analyzes data (evidence: `mcp_server/tools/analytics.py`)
- News search → Data access: searches data (evidence: `mcp_server/tools/search_tools.py`)
- Config management → Data access: reads config (evidence: `mcp_server/tools/config_mgmt.py`)
- System operations → Data access: uses data service (evidence: `mcp_server/tools/system.py`)
- Data access → Report and config parser: loads report data (evidence: `mcp_server/services/data_service.py`)
- Data access → In-memory cache: caches results (evidence: `mcp_server/services/data_service.py`)
- Report and config parser → In-memory cache: checks cached data (evidence: `mcp_server/services/parser_service.py`)
- Report and config parser → Dated news reports: reads dated text (evidence: `mcp_server/services/parser_service.py`)
- Data queries → Parameter validation: validates inputs (evidence: `mcp_server/tools/data_query.py`)
- News search → Parameter validation: validates inputs (evidence: `mcp_server/tools/search_tools.py`)
- Parameter validation → Date parsing: parses dates (evidence: `mcp_server/utils/validators.py`)
- Parameter validation → Crawler configuration: loads platforms (evidence: `mcp_server/utils/validators.py`)
