- Add comprehensive Vida detection algorithm documentation to CLAUDE.md - Detection architecture overview - Core module descriptions with line counts - Detection parameters (FireballDetector K1=4, MeteorDetector K1=1.5) - FTP compression format explanation - Detection pipeline workflow - Performance benchmarks (~100ms/block) - Rewrite README.md with clearer structure - Add system architecture diagram - Add project structure table - Add quick start guide - Add Vida detection algorithm summary - Organize development commands by component - Update TESTING.md - Add edge client testing section - Add Vida detection test commands - Add memory management test commands - Update version to 2.0.0 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
134 lines
4.8 KiB
Markdown
134 lines
4.8 KiB
Markdown
# Meteor Fullstack - Distributed Monitoring Network
|
||
|
||
## Overview
|
||
|
||
Meteor Fullstack 是一个覆盖边缘设备、云端 API、数据处理和 Web 前端的完整流星监测网络。采用 npm workspace 管理前后端,通过 Go、Rust 等多语言组件连接实时观测、事件验证和结果展示。
|
||
|
||
### Key Features
|
||
|
||
- **Vida Detection Algorithm**: 基于 Vida et al. 2016 论文的科学级流星检测
|
||
- **Advanced Memory Management**: 零拷贝架构、分层帧池、自适应内存管理
|
||
- **Real-time Processing**: ~100ms/block 处理延迟
|
||
- **Full Stack**: 边缘客户端 → 后端 API → 前端展示完整链路
|
||
|
||
## System Architecture
|
||
|
||
```
|
||
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
|
||
│ Edge Client │────▶│ Web Backend │────▶│ Frontend │
|
||
│ (Rust) │ │ (NestJS) │ │ (Next.js) │
|
||
└────────┬────────┘ └────────┬────────┘ └─────────────────┘
|
||
│ │
|
||
│ ▼
|
||
│ ┌─────────────────┐
|
||
│ │ Compute Service │
|
||
│ │ (Go) │
|
||
│ └────────┬────────┘
|
||
│ │
|
||
▼ ▼
|
||
┌─────────────────┐ ┌─────────────────┐
|
||
│ Camera/Video │ │ PostgreSQL │
|
||
│ Input │ │ + AWS (S3/SQS)│
|
||
└─────────────────┘ └─────────────────┘
|
||
```
|
||
|
||
## Project Structure
|
||
|
||
| 目录 | 技术栈 | 说明 |
|
||
|------|--------|------|
|
||
| `meteor-edge-client/` | Rust, Tokio | 边缘客户端,摄像头采集 + Vida 检测 |
|
||
| `meteor-web-backend/` | NestJS, TypeORM | Web API,认证、设备、事件管理 |
|
||
| `meteor-frontend/` | Next.js 15, React 19 | 前端应用,仪表盘、图库、分析 |
|
||
| `meteor-compute-service/` | Go 1.24 | 事件处理服务,SQS 消费者 |
|
||
| `infrastructure/` | Terraform | AWS 基础设施 (RDS, S3, SQS) |
|
||
|
||
## Quick Start
|
||
|
||
```bash
|
||
# 安装依赖
|
||
npm install
|
||
|
||
# 启动开发服务器 (前端 + 后端)
|
||
npm run dev
|
||
|
||
# 构建边缘客户端
|
||
cd meteor-edge-client && cargo build --release
|
||
|
||
# 测试 Vida 流星检测
|
||
./target/release/meteor-edge-client test-vida video.mp4
|
||
```
|
||
|
||
## Vida Detection Algorithm
|
||
|
||
边缘客户端实现了 Vida 流星检测算法(与 RMS/克罗地亚流星网络兼容):
|
||
|
||
- **FTP 压缩**: 256帧 → maxpixel, avepixel, stdpixel, maxframe
|
||
- **双路径检测**:
|
||
- FireballDetector (K1=4): 检测明亮火球
|
||
- MeteorDetector (K1=1.5): 检测普通流星
|
||
- **形态学处理**: 清理、桥接、闭合、Zhang-Suen 细化
|
||
- **Hough 变换**: 2D 直线检测 + 3D 点云分析
|
||
|
||
详见 `CLAUDE.md` 中的完整文档。
|
||
|
||
## Development Commands
|
||
|
||
### Full Stack
|
||
```bash
|
||
npm run dev # 启动前端和后端
|
||
npm run build # 构建所有服务
|
||
npm run test:fullstack # 运行完整测试套件
|
||
npm run lint # 代码检查
|
||
```
|
||
|
||
### Edge Client (Rust)
|
||
```bash
|
||
cd meteor-edge-client
|
||
cargo build --release
|
||
cargo test
|
||
./target/release/meteor-edge-client run --camera device:0 # 使用摄像头
|
||
./target/release/meteor-edge-client run --camera file:v.mp4 # 使用视频文件
|
||
./target/release/meteor-edge-client test-vida video.mp4 # 测试检测
|
||
```
|
||
|
||
### Backend (NestJS)
|
||
```bash
|
||
cd meteor-web-backend
|
||
npm run start:dev # 开发模式
|
||
npm run migrate:up # 运行迁移
|
||
npm run test # 单元测试
|
||
npm run test:integration # 集成测试
|
||
```
|
||
|
||
### Frontend (Next.js)
|
||
```bash
|
||
cd meteor-frontend
|
||
npm run dev # 开发服务器
|
||
npm run build # 生产构建
|
||
npm run test # Jest 测试
|
||
npm run test:e2e # Playwright E2E
|
||
```
|
||
|
||
## Testing
|
||
|
||
| 类型 | 命令 | 说明 |
|
||
|------|------|------|
|
||
| 单元测试 | `npm run test` | Jest (前端+后端) |
|
||
| 集成测试 | `npm run test:integration` | 后端 API + 数据库 |
|
||
| E2E 测试 | `npm run test:e2e` | Playwright |
|
||
| 边缘客户端 | `cargo test` | Rust 单元测试 |
|
||
| 全栈测试 | `npm run test:fullstack` | 完整测试套件 |
|
||
|
||
测试环境需要 Docker: `./test-setup.sh`
|
||
|
||
## Documentation
|
||
|
||
- `CLAUDE.md` - 完整技术文档和 Claude Code 指引
|
||
- `TESTING.md` - 详细测试矩阵
|
||
- `docs/EDGE_DEVICE_REGISTRATION_COMPLETE.md` - 设备注册规范
|
||
- `infrastructure/README.md` - 基础设施部署
|
||
|
||
## License
|
||
|
||
MIT
|