# RMDC Module Dependencies

## Dependency Matrix

```
                    rmdc-common  rmdc-core  audit-log  user-auth  project-mgmt  exchange-hub  watchdog  jenkins-dac
rmdc-core              ✓           -          ✓          ✓            ✓             ✓           -           ✓
rmdc-jenkins-dac       ✓           -          ✓          -            -             -           -           -
rmdc-exchange-hub      ✓           -          ✓          -            ✓             -           -           -
rmdc-watchdog          ✓           -          -          -            -             -           -           -
rmdc-project-mgmt      ✓           -          ✓          -            -             ✓           -           -
rmdc-audit-log         ✓           -          -          -            -             -           -           -
rmdc-user-auth         ✓           -          ✓          -            -             -           -           -
```

## Dependency Rules

### Allowed Dependencies

| Module | Can Import |
|--------|------------|
| rmdc-core | All business modules (as router aggregator) |
| Business modules | rmdc-common, rmdc-audit-log (for logging) |
| rmdc-exchange-hub | rmdc-project-mgmt (for project validation) |

### Prohibited Dependencies

- **Business → Business**: 业务模块间禁止直接依赖
- **Circular**: 任何形成环的依赖关系
- **Edge → Platform**: watchdog 不可依赖平台侧模块（仅通过 MQTT 通信）

## External Service Dependencies

| Module | External Service | Protocol | Purpose |
|--------|-----------------|----------|---------|
| rmdc-jenkins-dac | Jenkins | REST API | Build management |
| rmdc-jenkins-dac | MinIO | S3 API | Artifact storage |
| rmdc-exchange-hub | MQTT Broker | MQTT | Message relay |
| rmdc-watchdog | K8S API Server | HTTPS | Container orchestration |
| All modules | PostgreSQL | TCP/5432 | Data persistence |

## Data Flow Direction

```
Platform Side                          Edge Side
┌─────────────┐                       ┌─────────────┐
│ rmdc-core   │                       │  watchdog   │
│     ↓       │                       │     ↓       │
│ Business    │ ──MQTT via ExHub──→   │ node/agent  │
│ Modules     │ ←─MQTT via ExHub───   │             │
└─────────────┘                       └─────────────┘
```

## Version Compatibility

| Component | Min Version | Recommended |
|-----------|-------------|-------------|
| Go | 1.21 | 1.24+       |
| PostgreSQL | 13 | 15+         |
| MQTT Broker | 3.1.1 | 5.0         |
| Kubernetes | 1.24 | 1.28+       |
