96 lines
3.1 KiB
Markdown
96 lines
3.1 KiB
Markdown
# DIDI Backend
|
|
|
|
Misinformation detection backend — TypeScript/Node.js microservices.
|
|
|
|
## Services
|
|
|
|
| Service | Description | Port | Container |
|
|
|---------|-------------|------|-----------|
|
|
| **Agent V3** | Analysis engine — 4 detection components + verdict | 24803 | didi-agent-v3 |
|
|
| **didiFramework** | Parameters CRUD API, user management, Redis sync | 3005 | didi-framework |
|
|
| **Admin Dashboard** | React admin UI (services, config, history, users) | 3000 | didi-admin |
|
|
| **Kong** | API Gateway (SSL, routing, rate limiting) | 443 | kong |
|
|
| **Keycloak** | Authentication (OAuth2/OIDC, JWT) | 28000 | keycloak |
|
|
| **Redis** | Cache (framework config, session state) | 6379 | didi-cache |
|
|
| **RabbitMQ** | Queue (async analysis, 24 component queues) | 5672 | rabbitmq |
|
|
| **MinIO** | Object storage (media files, per-user buckets) | 9000 | minio |
|
|
| **PostgreSQL** | External cluster (Patroni/HAProxy) | 5000 | — |
|
|
|
|
## Quick Start
|
|
|
|
```bash
|
|
# 1. Start data layer
|
|
cd services/data-layer && docker compose up -d
|
|
|
|
# 2. Start agent-v3 + workers
|
|
cd services/orchestration-layer/agent-v3 && docker compose up -d --build
|
|
|
|
# 3. Start framework
|
|
cd services/orchestration-layer/didiFramework && docker compose up -d --build
|
|
|
|
# 4. Sync parameters
|
|
docker exec didi-framework sh -c 'wget -qO- --post-data="" http://127.0.0.1:3005/api/sync-redis'
|
|
|
|
# 5. Test
|
|
curl http://localhost:24803/api/v3/health
|
|
```
|
|
|
|
## Structure
|
|
|
|
```
|
|
backend/
|
|
├── admin-dashboard/ # React 19, MUI 7 — admin UI
|
|
├── production/ # Production docker-compose + .env
|
|
└── services/
|
|
├── data-layer/ # Redis, RabbitMQ, MinIO, local PG
|
|
├── gateway-auth-layer/ # Kong + Keycloak
|
|
└── orchestration-layer/
|
|
├── agent-v3/ # Analysis engine (TypeScript, Express 5)
|
|
└── didiFramework/ # Parameters API (TypeScript, Express 4)
|
|
```
|
|
|
|
Each service has its own `INDEX.md` with detailed documentation.
|
|
|
|
## Analysis Pipeline
|
|
|
|
```
|
|
Input (text/image/audio/video/URL)
|
|
│
|
|
├─ Worker: media-preprocess (extract text from media)
|
|
│
|
|
├─ Worker: techniques → manipulation_score (0-100)
|
|
├─ Worker: ai-tampered → ai_probability (0-100)
|
|
├─ Worker: claims → credibility_score (0-100)
|
|
├─ Worker: domain → trust_score (0-100)
|
|
│
|
|
└─ Aggregator: verdict → risk_score (0-100) + explanation (RO+EN)
|
|
```
|
|
|
|
All analysis endpoints are **async**: dispatch to RabbitMQ → return 202 → poll for results.
|
|
|
|
## Rebuild Commands
|
|
|
|
```bash
|
|
# Agent V3
|
|
cd services/orchestration-layer/agent-v3
|
|
docker compose up -d --build agent-v3
|
|
|
|
# Framework
|
|
cd services/orchestration-layer/didiFramework
|
|
docker compose up -d --build didi-framework
|
|
|
|
# Admin Dashboard
|
|
cd admin-dashboard
|
|
docker build -t didi-admin:latest .
|
|
cd ../services/data-layer && docker compose up -d --force-recreate didi-admin
|
|
```
|
|
|
|
## Credentials (Staging)
|
|
|
|
| Service | User | Password |
|
|
|---------|------|----------|
|
|
| PostgreSQL (cluster) | bos_interface | interface |
|
|
| Redis | — | redis123 |
|
|
| RabbitMQ | admin | rabbitmq123 |
|
|
| MinIO | minioadmin | minio123 |
|
|
| Keycloak | admin@didi.local | admin123 |
|