- Overview
- Features
- Architecture
- Tech Stack
- Prerequisites
- Installation
- Configuration
- Running the Application
- Project Structure
- API Documentation
- Contributing
VisionGuard.ai is a comprehensive security monitoring solution that combines cutting-edge AI technology with real-time video processing to detect suspicious activities and potential theft. The system features a modern web interface for monitoring multiple camera feeds, reviewing alerts, and managing security across multiple shop locations.
- Real-time AI Detection: Process video feeds in real-time using advanced AI models for anomaly detection
- WebRTC Streaming: Low-latency video streaming directly to web browsers
- Multi-shop Management: Support for multiple locations with role-based access control
- Telegram Integration: Instant notifications and remote monitoring via Telegram bot
- Persistent WebSocket Connections: Real-time alerts with automatic reconnection and heartbeat monitoring
- Authentication & Authorization: Secure JWT-based authentication with owner and manager roles
- π Real-time Dashboard - Monitor system metrics, active cameras, and detection accuracy
- πΉ Live Feed - WebRTC camera streaming with AI processing
- π¨ Suspicious Activity - Review, filter, and manage detected security events
- πͺ Shop Management - Multi-location support with shop-specific configurations
- π Real-time Notifications - Instant alerts via WebSocket connections
- π¨ Modern UI - Dark/light theme with gradient accents and smooth animations
- π± Responsive Design - Seamless experience across desktop, tablet, and mobile
- π Secure Authentication - JWT-based auth with role-based access control
- β AI Video Processing - Real-time frame processing with configurable AI models
- β WebRTC Signaling - SDP offer/answer exchange for peer connections
- β WebSocket Support - Persistent connections for real-time notifications
- β Telegram Bot - Bi-directional communication and remote control
- β Database Management - PostgreSQL with Alembic migrations
- β RESTful API - OpenAPI 3.0 compliant endpoints
- β CORS Support - Configurable cross-origin resource sharing
- β Health Monitoring - Connection tracking and health check endpoints
- β Training Data Collection - Reinforcement learning data storage
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β VisionGuard.ai System β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββ ββββββββββββββββββββ
β Next.js Client β β FastAPI Backend β
β (Frontend) β β (Python) β
β β WebRTC Video β β
β ββββββββββββββ ββββββββββ(Encrypted)βββββββββββββ€ ββββββββββββββ β
β β Live Feed β β β β Signaling β β
β β (WebRTC) β β β β Router β β
β ββββββββββββββ β WebSocket β ββββββββββββββ β
β ββββββββ(Notifications)ββββββββββββ€ β
β ββββββββββββββ β β ββββββββββββββ β
β β Dashboard β β REST API β β AI Stream β β
β β & Alerts β ββββββββ(JSON Data)βββββββββββββββ€ β Track β β
β ββββββββββββββ β β ββββββββ¬ββββββ β
β β β β β
β ββββββββββββββ β β ββββββββΌββββββ β
β β Auth & β β β β AI β β
β β Shops β β β β Processor β β
β ββββββββββββββ β β ββββββββ¬ββββββ β
ββββββββββββββββββββ β β β
β ββββββββΌββββββ β
ββββββββββββββββββββ β β PostgreSQL β β
β Telegram Bot ββββββββββ(Polling)ββββββββββββββββ€ β Database β β
β (Notifications) β β ββββββββββββββ β
ββββββββββββββββββββ ββββββββββββββββββββ
- Framework: Next.js 14 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- Charts: Recharts
- Icons: Lucide React
- Animations: Framer Motion
- AI Models: TensorFlow.js with COCO-SSD
- HTTP Client: Axios
- State Management: React Context API
- Framework: FastAPI 0.121.0
- Language: Python 3.8+
- WebRTC: aiortc 1.14.0
- Video Processing: OpenCV, PyAV
- AI/ML: TensorFlow 2.x, Keras
- Database: PostgreSQL with Alembic migrations
- Authentication: JWT (PyJWT)
- Real-time: WebSockets
- Telegram: python-telegram-bot
- CORS: FastAPI CORS middleware
- Node.js: 18+
- Python: 3.8 or higher
- PostgreSQL: 13+
- FFmpeg: Required for video processing
- Git: For version control
- Telegram Bot Token: For notification features
- CUDA: For GPU-accelerated AI processing (optional)
git clone <repository-url>
cd visionguardFor detailed installation instructions:
- Backend Setup: See backend-visionguard-ai/README.md
- Frontend Setup: See visionguardai-frontend/README.md
For detailed configuration instructions:
- Backend Configuration: See backend-visionguard-ai/README.md for environment variables, database setup, and Telegram bot configuration
- Frontend Configuration: See visionguardai-frontend/README.md for Next.js environment setup
Backend: cd backend-visionguard-ai && python main.py β http://localhost:8000
Frontend: cd visionguardai-frontend && npm run dev β http://localhost:3000
For detailed instructions including Telegram bot setup and production deployment:
- Backend: See backend-visionguard-ai/README.md
- Frontend: See visionguardai-frontend/README.md
visionguard/
βββ backend-visionguard-ai/ # Python FastAPI Backend
β βββ app/ # Application code
β β βββ ai/ # AI models and processors
β β βββ api/ # API endpoints
β β βββ core/ # Core utilities
β β βββ db/ # Database configuration
β β βββ models/ # SQLAlchemy models
β β βββ schemas/ # Pydantic schemas
β βββ docs/ # Backend documentation
β βββ main.py # Application entry point
β βββ README.md # Backend documentation
β
βββ visionguardai-frontend/ # Next.js Frontend
β βββ app/ # Next.js app directory
β βββ components/ # React components
β βββ context/ # React contexts
β βββ hooks/ # Custom hooks
β βββ lib/ # API and services
β βββ README.md # Frontend documentation
β
βββ README.md # This file
For detailed project structure:
Once the backend is running, visit:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
For detailed API endpoint documentation, see:
VisionGuard uses JWT-based authentication with role-based access control:
- OWNER: Full access to all features, can manage shops and users
- MANAGER: Limited access to shop management and monitoring
- User logs in with credentials
- Server returns access token (30 min) and refresh token
- Access token is sent with each API request
- Refresh token is used to get new access token when expired
- Persistent connection with exponential backoff reconnection
- Heartbeat mechanism (30s ping/pong)
- Automatic stale connection cleanup
- Real-time anomaly alerts
- Low-latency peer-to-peer video streaming
- STUN server configuration for NAT traversal
- Automatic connection management
- Frame-by-frame AI processing
The system includes a Telegram bot for remote monitoring:
- Receive instant alerts for detected anomalies
- View camera snapshots
- Check system status
- Remote shop management
For testing instructions, see:
For more detailed information, see: