# mathangi18/docmcp-knowledge architecture

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

- Interactive diagram: https://gitdiagram.com/mathangi18/docmcp-knowledge
- Repository: https://github.com/mathangi18/docmcp-knowledge

## Overview

Reguverse is an open medical-device regulatory knowledge base: its documented content spans EU MDR/IVDR, FDA, NMPA, and shared standards, with bilingual Markdown and JSON intended for browsing and DocMCP consumption. The tree also contains regulatory ingestion/maintenance scripts and separate community and learning Workers. Their visible workflow is HTTP request → authentication/routing → domain handlers → responses and, where shown, D1 or DingTalk. The supplied tree omits the documented content and site directories, so those capabilities are noted but not assigned invented paths; unsampled script behavior is not inferred.

Main entry points: [`community-worker/src/index.ts`](https://github.com/mathangi18/docmcp-knowledge/blob/main/community-worker/src/index.ts) (Community API Router), [`learn-worker/src/index.ts`](https://github.com/mathangi18/docmcp-knowledge/blob/main/learn-worker/src/index.ts) (Learning API Router), [`community-worker/src/dingtalk.ts`](https://github.com/mathangi18/docmcp-knowledge/blob/main/community-worker/src/dingtalk.ts) (DingTalk Notifications), [`scripts/fetch_updates.py`](https://github.com/mathangi18/docmcp-knowledge/blob/main/scripts/fetch_updates.py) (Update Fetching)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_regulatory["Regulatory Knowledge"]
  node_regulatory_data["Regulatory Content"]
  node_update_fetch["Update Fetching<br/>[fetch_updates.py]"]
  node_notice_sources["Official Notices"]
  node_tier_checks["Tier Checks<br/>[tier2_checkers.py]"]
  node_auto_pipeline["Regulatory Pipeline"]
  node_superseded["Superseded Detection"]
  node_fda_clean["FDA Full-Text Cleanup"]
  node_md_conversion["JSON to Markdown"]
  node_eu_sync["EU Document Sync"]
  node_eu_fulltext["EU Full Text<br/>[eu_fulltext.py]"]
end

subgraph group_community["Community Worker"]
  node_community_api["Community API Router<br/>[index.ts]"]
  node_community_auth["Community Authentication<br/>[auth.ts]"]
  node_feature_requests["Feature Requests<br/>[features.ts]"]
  node_discussions["Discussions<br/>[discussions.ts]"]
  node_billboard["Priority Billboard<br/>[billboard.ts]"]
  node_comments["Comments<br/>[comments.ts]"]
  node_dingtalk["DingTalk Notifications<br/>[dingtalk.ts]"]
end

subgraph group_learning["Learning Worker"]
  node_learning_api["Learning API Router<br/>[index.ts]"]
  node_learning_auth["Learning Authentication<br/>[auth.ts]"]
  node_courses["Courses and Questions<br/>[courses.ts]"]
  node_live["Live Sessions<br/>[live.ts]"]
  node_practice["Course Practice<br/>[practice.ts]"]
  node_workshop["Workshop Groups<br/>[workshop.ts]"]
end

subgraph group_shared["Worker Services"]
  node_community_db[("Community D1")]
  node_learning_db[("Learning D1")]
end

node_maintainer(("Maintainer"))
node_community_user(("Community User"))
node_learner(("Learner or Host"))

node_maintainer -.->|"maintains updates"| node_update_fetch
node_update_fetch -->|"uses notices"| node_notice_sources
node_update_fetch -->|"uses checks"| node_tier_checks
node_auto_pipeline -->|"checks supersession"| node_superseded
node_fda_clean -->|"uses conversion"| node_md_conversion
node_eu_sync -->|"uses full text"| node_eu_fulltext
node_eu_sync -->|"uses conversion"| node_md_conversion
node_regulatory_data -.->|"renders content"| node_md_conversion
node_community_user -.->|"sends requests"| node_community_api
node_community_api -->|"verifies token"| node_community_auth
node_community_api -->|"routes features"| node_feature_requests
node_community_api -->|"routes discussions"| node_discussions
node_community_api -->|"routes billboard"| node_billboard
node_community_api -->|"routes comments"| node_comments
node_feature_requests -->|"reads and writes"| node_community_db
node_discussions -->|"reads and writes"| node_community_db
node_billboard -->|"reads and writes"| node_community_db
node_comments -->|"reads and writes"| node_community_db
node_feature_requests -->|"notifies new requests"| node_dingtalk
node_discussions -->|"notifies new discussions"| node_dingtalk
node_comments -->|"notifies new comments"| node_dingtalk
node_dingtalk -.->|"optional integration"| node_community_db
node_learner -.->|"sends requests"| node_learning_api
node_learning_api -->|"verifies token"| node_learning_auth
node_learning_api -->|"routes course requests"| node_courses
node_learning_api -->|"routes live sessions"| node_live
node_learning_api -->|"routes practice"| node_practice
node_learning_api -->|"routes workshop"| node_workshop
node_courses -.->|"reads data"| node_learning_db
node_live -.->|"reads and writes"| node_learning_db
node_practice -.->|"reads and writes"| node_learning_db
node_workshop -.->|"reads and writes"| node_learning_db

click node_update_fetch "https://github.com/mathangi18/docmcp-knowledge/blob/main/scripts/fetch_updates.py"
click node_notice_sources "https://github.com/mathangi18/docmcp-knowledge/blob/main/scripts/official_notices.py"
click node_tier_checks "https://github.com/mathangi18/docmcp-knowledge/blob/main/scripts/tier2_checkers.py"
click node_auto_pipeline "https://github.com/mathangi18/docmcp-knowledge/blob/main/scripts/auto_regulatory_pipeline.py"
click node_superseded "https://github.com/mathangi18/docmcp-knowledge/blob/main/scripts/detect_superseded_insights.py"
click node_fda_clean "https://github.com/mathangi18/docmcp-knowledge/blob/main/scripts/clean_fda_fulltext.py"
click node_md_conversion "https://github.com/mathangi18/docmcp-knowledge/blob/main/scripts/json_to_markdown.py"
click node_eu_sync "https://github.com/mathangi18/docmcp-knowledge/blob/main/scripts/sync_eu_documents.py"
click node_eu_fulltext "https://github.com/mathangi18/docmcp-knowledge/blob/main/scripts/eu_fulltext.py"
click node_community_api "https://github.com/mathangi18/docmcp-knowledge/blob/main/community-worker/src/index.ts"
click node_community_auth "https://github.com/mathangi18/docmcp-knowledge/blob/main/community-worker/src/auth.ts"
click node_feature_requests "https://github.com/mathangi18/docmcp-knowledge/blob/main/community-worker/src/features.ts"
click node_discussions "https://github.com/mathangi18/docmcp-knowledge/blob/main/community-worker/src/discussions.ts"
click node_billboard "https://github.com/mathangi18/docmcp-knowledge/blob/main/community-worker/src/billboard.ts"
click node_comments "https://github.com/mathangi18/docmcp-knowledge/blob/main/community-worker/src/comments.ts"
click node_dingtalk "https://github.com/mathangi18/docmcp-knowledge/blob/main/community-worker/src/dingtalk.ts"
click node_learning_api "https://github.com/mathangi18/docmcp-knowledge/blob/main/learn-worker/src/index.ts"
click node_learning_auth "https://github.com/mathangi18/docmcp-knowledge/blob/main/learn-worker/src/auth.ts"
click node_courses "https://github.com/mathangi18/docmcp-knowledge/blob/main/learn-worker/src/courses.ts"
click node_live "https://github.com/mathangi18/docmcp-knowledge/blob/main/learn-worker/src/live.ts"
click node_practice "https://github.com/mathangi18/docmcp-knowledge/blob/main/learn-worker/src/practice.ts"
click node_workshop "https://github.com/mathangi18/docmcp-knowledge/blob/main/learn-worker/src/workshop.ts"

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_regulatory_data,node_update_fetch,node_notice_sources,node_tier_checks,node_auto_pipeline,node_superseded,node_fda_clean,node_md_conversion,node_eu_sync,node_eu_fulltext,node_community_user toneBlue
class node_community_api,node_community_auth,node_feature_requests,node_discussions,node_billboard,node_comments,node_dingtalk toneAmber
class node_learning_api,node_learning_auth,node_courses,node_live,node_practice,node_workshop toneMint
class node_community_db,node_learning_db toneRose
class node_maintainer,node_learner toneIndigo
```

## Components

### Regulatory Knowledge

- **Regulatory Content**
- [Update Fetching](https://github.com/mathangi18/docmcp-knowledge/blob/main/scripts/fetch_updates.py): `scripts/fetch_updates.py`
- [Official Notices](https://github.com/mathangi18/docmcp-knowledge/blob/main/scripts/official_notices.py): `scripts/official_notices.py`
- [Tier Checks](https://github.com/mathangi18/docmcp-knowledge/blob/main/scripts/tier2_checkers.py): `scripts/tier2_checkers.py`
- [Regulatory Pipeline](https://github.com/mathangi18/docmcp-knowledge/blob/main/scripts/auto_regulatory_pipeline.py): `scripts/auto_regulatory_pipeline.py`
- [Superseded Detection](https://github.com/mathangi18/docmcp-knowledge/blob/main/scripts/detect_superseded_insights.py): `scripts/detect_superseded_insights.py`
- [FDA Full-Text Cleanup](https://github.com/mathangi18/docmcp-knowledge/blob/main/scripts/clean_fda_fulltext.py): `scripts/clean_fda_fulltext.py`
- [JSON to Markdown](https://github.com/mathangi18/docmcp-knowledge/blob/main/scripts/json_to_markdown.py): `scripts/json_to_markdown.py`
- [EU Document Sync](https://github.com/mathangi18/docmcp-knowledge/blob/main/scripts/sync_eu_documents.py): `scripts/sync_eu_documents.py`
- [EU Full Text](https://github.com/mathangi18/docmcp-knowledge/blob/main/scripts/eu_fulltext.py): `scripts/eu_fulltext.py`

### Community Worker

- [Community API Router](https://github.com/mathangi18/docmcp-knowledge/blob/main/community-worker/src/index.ts): `community-worker/src/index.ts`
- [Community Authentication](https://github.com/mathangi18/docmcp-knowledge/blob/main/community-worker/src/auth.ts): `community-worker/src/auth.ts`
- [Feature Requests](https://github.com/mathangi18/docmcp-knowledge/blob/main/community-worker/src/features.ts): `community-worker/src/features.ts`
- [Discussions](https://github.com/mathangi18/docmcp-knowledge/blob/main/community-worker/src/discussions.ts): `community-worker/src/discussions.ts`
- [Priority Billboard](https://github.com/mathangi18/docmcp-knowledge/blob/main/community-worker/src/billboard.ts): `community-worker/src/billboard.ts`
- [Comments](https://github.com/mathangi18/docmcp-knowledge/blob/main/community-worker/src/comments.ts): `community-worker/src/comments.ts`
- [DingTalk Notifications](https://github.com/mathangi18/docmcp-knowledge/blob/main/community-worker/src/dingtalk.ts): `community-worker/src/dingtalk.ts`

### Learning Worker

- [Learning API Router](https://github.com/mathangi18/docmcp-knowledge/blob/main/learn-worker/src/index.ts): `learn-worker/src/index.ts`
- [Learning Authentication](https://github.com/mathangi18/docmcp-knowledge/blob/main/learn-worker/src/auth.ts): `learn-worker/src/auth.ts`
- [Courses and Questions](https://github.com/mathangi18/docmcp-knowledge/blob/main/learn-worker/src/courses.ts): `learn-worker/src/courses.ts`
- [Live Sessions](https://github.com/mathangi18/docmcp-knowledge/blob/main/learn-worker/src/live.ts): `learn-worker/src/live.ts`
- [Course Practice](https://github.com/mathangi18/docmcp-knowledge/blob/main/learn-worker/src/practice.ts): `learn-worker/src/practice.ts`
- [Workshop Groups](https://github.com/mathangi18/docmcp-knowledge/blob/main/learn-worker/src/workshop.ts): `learn-worker/src/workshop.ts`

### Worker Services

- **Community D1**
- **Learning D1**

### Other components

- **Maintainer**
- **Community User**
- **Learner or Host**

## Connections

- Maintainer → Update Fetching: maintains updates (evidence: `README.md`)
- Update Fetching → Official Notices: uses notices (evidence: `scripts/fetch_updates.py`)
- Update Fetching → Tier Checks: uses checks (evidence: `scripts/fetch_updates.py`)
- Regulatory Pipeline → Superseded Detection: checks supersession (evidence: `scripts/auto_regulatory_pipeline.py`)
- FDA Full-Text Cleanup → JSON to Markdown: uses conversion (evidence: `scripts/clean_fda_fulltext.py`)
- EU Document Sync → EU Full Text: uses full text (evidence: `scripts/sync_eu_documents.py`)
- EU Document Sync → JSON to Markdown: uses conversion (evidence: `scripts/sync_eu_documents.py`)
- Regulatory Content → JSON to Markdown: renders content (evidence: `README.md`)
- Community User → Community API Router: sends requests
- Community API Router → Community Authentication: verifies token (evidence: `community-worker/src/index.ts`)
- Community API Router → Feature Requests: routes features (evidence: `community-worker/src/index.ts`)
- Community API Router → Discussions: routes discussions (evidence: `community-worker/src/index.ts`)
- Community API Router → Priority Billboard: routes billboard (evidence: `community-worker/src/index.ts`)
- Community API Router → Comments: routes comments (evidence: `community-worker/src/index.ts`)
- Feature Requests → Community D1: reads and writes (evidence: `community-worker/src/features.ts`)
- Discussions → Community D1: reads and writes (evidence: `community-worker/src/discussions.ts`)
- Priority Billboard → Community D1: reads and writes (evidence: `community-worker/src/billboard.ts`)
- Comments → Community D1: reads and writes (evidence: `community-worker/src/comments.ts`)
- Feature Requests → DingTalk Notifications: notifies new requests (evidence: `community-worker/src/features.ts`)
- Discussions → DingTalk Notifications: notifies new discussions (evidence: `community-worker/src/discussions.ts`)
- Comments → DingTalk Notifications: notifies new comments (evidence: `community-worker/src/comments.ts`)
- DingTalk Notifications → Community D1: optional integration
- Learner or Host → Learning API Router: sends requests
- Learning API Router → Learning Authentication: verifies token (evidence: `learn-worker/src/index.ts`)
- Learning API Router → Courses and Questions: routes course requests (evidence: `learn-worker/src/index.ts`)
- Learning API Router → Live Sessions: routes live sessions (evidence: `learn-worker/src/index.ts`)
- Learning API Router → Course Practice: routes practice (evidence: `learn-worker/src/index.ts`)
- Learning API Router → Workshop Groups: routes workshop (evidence: `learn-worker/src/index.ts`)
- Courses and Questions → Learning D1: reads data
- Live Sessions → Learning D1: reads and writes
- Course Practice → Learning D1: reads and writes
- Workshop Groups → Learning D1: reads and writes
