dashboard/backend/README.md

67 lines
1.2 KiB
Markdown
Raw Normal View History

# 🖥️ Dashboard - Backend
시스템 모니터링 데이터를 제공하는 Rust 기반 API 서버입니다.
![Rust](https://img.shields.io/badge/Rust-1.70+-000000?logo=rust)
![Actix](https://img.shields.io/badge/Actix--web-4-ffffff?logo=rust)
---
## 🛠️ 기술 스택
| 기술 | 설명 |
| ------------- | ---------------------- |
| **Rust** | 시스템 프로그래밍 언어 |
| **Actix-web** | 고성능 웹 프레임워크 |
| **Sysinfo** | 시스템 정보 수집 |
| **Tokio** | 비동기 런타임 |
---
## 📡 API 엔드포인트
### `GET /ws` (WebSocket)
실시간 시스템 정보를 스트리밍합니다.
**Response (2초 간격):**
```json
{
"cpu": 25.5,
"memory": {
"used": 8192,
"total": 16384
},
"disk": {
"used": 512000,
"total": 1024000
},
"network": {
"rx": 1024,
"tx": 512
},
"services": [{ "id": "portainer", "status": "healthy" }]
}
```
---
## 🚀 실행 방법
```bash
# 개발 모드
cargo run
# 릴리즈 빌드
cargo build --release
```
서버는 **포트 8000**에서 실행됩니다.
---
## ⚙️ 환경 설정
서비스 헬스체크 대상은 `src/main.rs``SERVICES` 상수에서 설정합니다.