diff --git a/README.md b/README.md index 598a137..5032442 100644 --- a/README.md +++ b/README.md @@ -24,17 +24,60 @@ A cutting-edge WiFi-based human pose estimation system that leverages Channel St ## ๐ Table of Contents -1. [System Architecture](#system-architecture) -2. [Installation](#installation) -3. [Quick Start](#quick-start) -4. [Documentation](#documentation) -5. [Hardware Setup](#hardware-setup) -6. [Configuration](#configuration) -7. [Testing](#testing) -8. [Deployment](#deployment) -9. [Performance Metrics](#performance-metrics) -10. [Contributing](#contributing) -11. [License](#license) +1. [๐ Key Features](#-key-features) +2. [๐๏ธ System Architecture](#๏ธ-system-architecture) + - [Core Components](#core-components) +3. [๐ฆ Installation](#-installation) + - [Using pip (Recommended)](#using-pip-recommended) + - [From Source](#from-source) + - [Using Docker](#using-docker) + - [System Requirements](#system-requirements) +4. [๐ Quick Start](#-quick-start) + - [Basic Setup](#1-basic-setup) + - [Start the System](#2-start-the-system) + - [Using the REST API](#3-using-the-rest-api) + - [Real-time Streaming](#4-real-time-streaming) +5. [๐ฅ๏ธ CLI Usage](#๏ธ-cli-usage) + - [Installation](#cli-installation) + - [Basic Commands](#basic-commands) + - [Configuration Commands](#configuration-commands) + - [Monitoring Commands](#monitoring-commands) + - [Examples](#cli-examples) +6. [๐ Documentation](#-documentation) + - [Core Documentation](#-core-documentation) + - [Quick Links](#-quick-links) + - [API Overview](#-api-overview) +7. [๐ง Hardware Setup](#-hardware-setup) + - [Supported Hardware](#supported-hardware) + - [Physical Setup](#physical-setup) + - [Network Configuration](#network-configuration) + - [Environment Calibration](#environment-calibration) +8. [โ๏ธ Configuration](#๏ธ-configuration) + - [Environment Variables](#environment-variables) + - [Domain-Specific Configurations](#domain-specific-configurations) + - [Advanced Configuration](#advanced-configuration) +9. [๐งช Testing](#-testing) + - [Running Tests](#running-tests) + - [Test Categories](#test-categories) + - [Mock Testing](#mock-testing) + - [Continuous Integration](#continuous-integration) +10. [๐ Deployment](#-deployment) + - [Production Deployment](#production-deployment) + - [Infrastructure as Code](#infrastructure-as-code) + - [Monitoring and Logging](#monitoring-and-logging) +11. [๐ Performance Metrics](#-performance-metrics) + - [Benchmark Results](#benchmark-results) + - [Performance Optimization](#performance-optimization) + - [Load Testing](#load-testing) +12. [๐ค Contributing](#-contributing) + - [Development Setup](#development-setup) + - [Code Standards](#code-standards) + - [Contribution Process](#contribution-process) + - [Code Review Checklist](#code-review-checklist) + - [Issue Templates](#issue-templates) +13. [๐ License](#-license) +14. [๐ Acknowledgments](#-acknowledgments) +15. [๐ Support](#-support) ## ๐๏ธ System Architecture @@ -199,6 +242,195 @@ async def stream_poses(): asyncio.run(stream_poses()) ``` +## ๐ฅ๏ธ CLI Usage + +WiFi DensePose provides a comprehensive command-line interface for easy system management, configuration, and monitoring. + +### CLI Installation + +The CLI is automatically installed with the package: + +```bash +# Install WiFi DensePose with CLI +pip install wifi-densepose + +# Verify CLI installation +wifi-densepose --version +``` + +### Basic Commands + +#### Start/Stop System +```bash +# Start the WiFi DensePose system +wifi-densepose start + +# Start with custom configuration +wifi-densepose start --config /path/to/config.yaml + +# Start in development mode +wifi-densepose start --dev + +# Stop the system +wifi-densepose stop + +# Restart the system +wifi-densepose restart +``` + +#### System Status +```bash +# Check system status +wifi-densepose status + +# Get detailed health information +wifi-densepose health + +# Show system information +wifi-densepose info +``` + +#### Pose Data Operations +```bash +# Get latest pose data +wifi-densepose pose latest + +# Get pose history +wifi-densepose pose history --hours 24 + +# Stream pose data to console +wifi-densepose pose stream + +# Export pose data +wifi-densepose pose export --format json --output poses.json +``` + +### Configuration Commands + +#### Environment Setup +```bash +# Initialize configuration +wifi-densepose init + +# Create configuration from template +wifi-densepose config create --template healthcare + +# Validate configuration +wifi-densepose config validate + +# Show current configuration +wifi-densepose config show +``` + +#### Hardware Configuration +```bash +# List available WiFi interfaces +wifi-densepose hardware list-interfaces + +# Test hardware connectivity +wifi-densepose hardware test + +# Calibrate environment +wifi-densepose calibrate --duration 10 --environment room_001 + +# Show hardware status +wifi-densepose hardware status +``` + +### Monitoring Commands + +#### Real-time Monitoring +```bash +# Monitor system performance +wifi-densepose monitor + +# Monitor pose detection in real-time +wifi-densepose monitor poses + +# Monitor system logs +wifi-densepose logs --follow + +# Monitor specific component +wifi-densepose monitor --component csi_processor +``` + +#### Analytics and Reports +```bash +# Generate analytics report +wifi-densepose analytics report --period 24h + +# Show fall detection events +wifi-densepose analytics falls --since yesterday + +# Export system metrics +wifi-densepose metrics export --format csv +``` + +### CLI Examples + +#### Complete Setup Workflow +```bash +# 1. Initialize new environment +wifi-densepose init --environment healthcare + +# 2. Configure hardware +wifi-densepose hardware setup --interface wlan0 + +# 3. Calibrate environment +wifi-densepose calibrate --duration 15 + +# 4. Start system +wifi-densepose start + +# 5. Monitor in real-time +wifi-densepose monitor poses +``` + +#### Development Workflow +```bash +# Start in development mode with mock data +wifi-densepose start --dev --mock-hardware + +# Run tests +wifi-densepose test + +# Check code quality +wifi-densepose lint + +# Generate documentation +wifi-densepose docs generate +``` + +#### Production Deployment +```bash +# Deploy to production +wifi-densepose deploy --environment production + +# Check deployment status +wifi-densepose deploy status + +# Scale system +wifi-densepose scale --replicas 3 + +# Update system +wifi-densepose update --version 1.2.0 +``` + +#### Troubleshooting +```bash +# Run system diagnostics +wifi-densepose diagnose + +# Check hardware connectivity +wifi-densepose hardware test --verbose + +# Validate configuration +wifi-densepose config validate --strict + +# Reset to defaults +wifi-densepose reset --confirm +``` + ## ๐ Documentation Comprehensive documentation is available to help you get started and make the most of WiFi-DensePose: diff --git a/ui/README.md b/ui/README.md new file mode 100644 index 0000000..87389ea --- /dev/null +++ b/ui/README.md @@ -0,0 +1,317 @@ +# WiFi DensePose UI + +A modular, modern web interface for the WiFi DensePose human tracking system. This UI provides real-time monitoring, configuration, and visualization of WiFi-based pose estimation. + +## ๐๏ธ Architecture + +The UI follows a modular architecture with clear separation of concerns: + +``` +ui/ +โโโ app.js # Main application entry point +โโโ index.html # Updated HTML with modular structure +โโโ style.css # Complete CSS with additional styles +โโโ config/ # Configuration modules +โ โโโ api.config.js # API endpoints and configuration +โโโ services/ # Service layer for API communication +โ โโโ api.service.js # HTTP API client +โ โโโ websocket.service.js # WebSocket client +โ โโโ pose.service.js # Pose estimation API wrapper +โ โโโ health.service.js # Health monitoring API wrapper +โ โโโ stream.service.js # Streaming API wrapper +โโโ components/ # UI components +โ โโโ TabManager.js # Tab navigation component +โ โโโ DashboardTab.js # Dashboard component with live data +โ โโโ HardwareTab.js # Hardware configuration component +โ โโโ LiveDemoTab.js # Live demo with streaming +โโโ utils/ # Utility functions and helpers +โ โโโ mock-server.js # Mock server for testing +โโโ tests/ # Comprehensive test suite + โโโ test-runner.html # Test runner UI + โโโ test-runner.js # Test framework and cases + โโโ integration-test.html # Integration testing page +``` + +## ๐ Features + +### Real-time Dashboard +- Live system health monitoring +- Real-time pose detection statistics +- Zone occupancy tracking +- System metrics (CPU, memory, disk) +- API status indicators + +### Hardware Configuration +- Interactive antenna array visualization +- Real-time CSI data display +- Configuration panels +- Hardware status monitoring + +### Live Demo +- WebSocket-based real-time streaming +- Signal visualization +- Pose detection visualization +- Interactive controls + +### API Integration +- Complete REST API coverage +- WebSocket streaming support +- Authentication handling +- Error management +- Request/response interceptors + +## ๐ API Coverage + +The UI integrates with all WiFi DensePose API endpoints: + +### Health Endpoints +- `GET /health/health` - System health check +- `GET /health/ready` - Readiness check +- `GET /health/live` - Liveness check +- `GET /health/metrics` - System metrics +- `GET /health/version` - Version information + +### Pose Estimation +- `GET /api/v1/pose/current` - Current pose data +- `POST /api/v1/pose/analyze` - Trigger analysis +- `GET /api/v1/pose/zones/{zone_id}/occupancy` - Zone occupancy +- `GET /api/v1/pose/zones/summary` - All zones summary +- `POST /api/v1/pose/historical` - Historical data +- `GET /api/v1/pose/activities` - Recent activities +- `POST /api/v1/pose/calibrate` - System calibration +- `GET /api/v1/pose/stats` - Statistics + +### Streaming +- `WS /api/v1/stream/pose` - Real-time pose stream +- `WS /api/v1/stream/events` - Event stream +- `GET /api/v1/stream/status` - Stream status +- `POST /api/v1/stream/start` - Start streaming +- `POST /api/v1/stream/stop` - Stop streaming +- `GET /api/v1/stream/clients` - Connected clients +- `DELETE /api/v1/stream/clients/{client_id}` - Disconnect client + +## ๐งช Testing + +### Test Runner +Open `tests/test-runner.html` to run the complete test suite: + +```bash +# Serve the UI directory on port 3000 (to avoid conflicts with FastAPI on 8000) +cd /workspaces/wifi-densepose/ui +python -m http.server 3000 +# Open http://localhost:3000/tests/test-runner.html +``` + +### Test Categories +- **API Configuration Tests** - Configuration and URL building +- **API Service Tests** - HTTP client functionality +- **WebSocket Service Tests** - WebSocket connection management +- **Pose Service Tests** - Pose estimation API wrapper +- **Health Service Tests** - Health monitoring functionality +- **UI Component Tests** - Component behavior and interaction +- **Integration Tests** - End-to-end functionality + +### Integration Testing +Use `tests/integration-test.html` for visual integration testing: + +```bash +# Open http://localhost:3000/tests/integration-test.html +``` + +Features: +- Mock server with realistic API responses +- Visual testing of all components +- Real-time data simulation +- Error scenario testing +- WebSocket stream testing + +## ๐ ๏ธ Usage + +### Basic Setup +```html + + +
+ + + +