A professional desktop application for detecting QR codes from live video feeds (webcam or network streams), generating cryptographic hashes, and triggering webhooks with contact information.
- 🎥 Webcam Support: Use your local webcam - no network setup required! (NEW)
- 📡 Network Streams: Ingest video streams from IP cameras (MJPEG, HLS, WebRTC)
- 🔍 Real-time QR Detection: Automatic QR code detection with visual highlighting
- 🔐 Hash Generation: SHA-256 hash generation for detected QR codes
- 🌐 API Integration: Send QR hashes to configured API endpoints
- 🔔 Webhook Triggers: Automatically trigger webhooks with contact information
- 🎨 Professional UI: Modern, dark-themed interface built with TailwindCSS
- 📊 Activity Monitoring: Real-time activity logs and detection statistics
- 🚫 Duplicate Prevention: Smart filtering to prevent duplicate detections
- Electron: Cross-platform desktop application framework
- TailwindCSS: Modern utility-first CSS framework
- jsQR: Fast QR code detection library
- Node.js: Backend processing for API calls and webhooks
- HTML5 Video: Network video stream handling
- Node.js (v18 or higher)
- npm or yarn
- macOS (primary target, but works on Linux/Windows)
- Webcam (built-in or USB) OR Network camera/video stream source
-
Clone or download the project:
cd /home/global/Documents/QRdetection -
Install dependencies:
npm install
-
Build TailwindCSS:
npm run build:css
This command will generate the output CSS file. For development with auto-rebuild, you can run:
npm run dev
To run the application in development mode with live CSS rebuilding:
npm run devTo run the application:
npm startTo create a distributable package:
npm run packageThis will create a .dmg file for macOS in the dist folder.
On first launch, click the Settings button (gear icon) in the top-right corner to configure:
Option 1: Local Webcam (Recommended for Testing)
- Select "Local Webcam" from the dropdown
- No additional configuration needed
- Click "Start Detection" and allow camera access
- Perfect for quick testing with the included QR generator
Option 2: Network Stream
- Select "Network Stream" from the dropdown
- Network Stream URL: Enter your IP camera stream URL
- Example MJPEG:
http://192.168.1.100:8080/video - Example HLS:
http://192.168.1.100:8080/stream.m3u8 - Example RTSP (via converter): Use a tool like FFmpeg to convert RTSP to HTTP stream
- Example MJPEG:
- API Endpoint URL: The endpoint where QR hashes will be sent
- Example:
https://api.example.com/qr-hashes
- Example:
- API Key (optional): Bearer token for API authentication
- Webhook URL: Endpoint to receive contact information
- Example:
https://webhook.example.com/contact-info - Payload format:
{ "qr_hash": "abc123...", "contact_info": { ... }, "timestamp": "2025-10-18T12:00:00.000Z", "event_type": "qr_detected" }
- Example:
- Scan Interval: Time between scans in milliseconds (100-2000ms)
- Lower values = faster detection but higher CPU usage
- Recommended: 500ms
- Prevent Duplicate Detections: Ignore the same QR code for 5 seconds
- Start the app:
npm start - Click "Start Detection": Webcam is selected by default
- Allow camera access: Grant permission when prompted
- Test with QR code: Open
test-qr-generator.htmlin browser and show to camera
- Configure Settings: Choose webcam or network stream, set API/webhook URLs
- Start Detection: Click the "Start Detection" button
- Monitor Activity: Watch the video feed and activity panel for detections
- View Statistics: Track QR codes detected, API calls, and webhooks triggered
When a QR code is detected, the application sends a POST request:
POST {apiUrl}
Headers:
Authorization: Bearer {apiKey} // if configured
Content-Type: application/json
Body:
{
"qr_hash": "sha256_hash_of_qr_data",
"timestamp": "2025-10-18T12:00:00.000Z"
}Expected response format (for webhook trigger):
{
"contact_info": {
"name": "John Doe",
"email": "john@example.com",
"phone": "+1234567890"
}
}If the API returns contact information, the webhook is triggered:
POST {webhookUrl}
Headers:
Content-Type: application/json
Body:
{
"qr_hash": "sha256_hash_of_qr_data",
"contact_info": { ... }, // from API response
"timestamp": "2025-10-18T12:00:00.000Z",
"event_type": "qr_detected"
}For testing, you can use your smartphone as a network camera:
- Install app like "IP Camera Lite" or "EpocCam"
- Start the camera server
- Use the provided URL in the app settings
- Install "IP Webcam" or "DroidCam"
- Start the server
- Use the provided URL (usually
http://<phone-ip>:8080/video)
Use FFmpeg to stream your webcam:
ffmpeg -f avfoundation -i "0" -f mjpeg -q:v 3 http://localhost:8080/video- Verify the video source URL is correct and accessible
- Check if the stream format is supported (MJPEG works best)
- Ensure your firewall allows access to the stream
- Test the stream URL in a web browser first
- Ensure QR codes are clear and well-lit
- Adjust the scan interval (lower for faster detection)
- Check if the video resolution is sufficient
- Verify the QR code is within the camera frame
- Check the URLs are correct and accessible
- Verify API authentication if required
- Check the activity log for detailed error messages
- Ensure the endpoints accept POST requests with JSON payloads
- Increase the scan interval to reduce CPU usage
- Lower the video stream resolution
- Close other resource-intensive applications
QRdetection/
├── main.js # Electron main process
├── preload.js # Electron preload script (security bridge)
├── index.html # Main application UI
├── package.json # Project dependencies and scripts
├── tailwind.config.js # TailwindCSS configuration
├── src/
│ ├── app.js # Main application logic
│ ├── qr-scanner.js # QR detection module
│ ├── input.css # TailwindCSS source
│ └── output.css # Generated CSS (auto-generated)
└── README.md # This file
- API keys are stored in localStorage (consider encryption for production)
- Video streams should use HTTPS when possible
- Validate all webhook/API endpoints before use
- The application uses Electron's context isolation for security
Uncomment this line in main.js:
mainWindow.webContents.openDevTools();- main.js: Electron main process, handles IPC, API calls, webhooks
- preload.js: Secure bridge between renderer and main process
- app.js: UI logic, state management, event handling
- qr-scanner.js: QR detection algorithm, video processing
- Multiple video source support
- Recording detected QR codes to database
- Export detection history to CSV/JSON
- Advanced filtering and search
- Email notifications
- Custom detection zones
- Multi-language support
- Cloud sync for configuration
MIT License - feel free to use and modify for your needs.
For issues or questions, please check:
- This README for troubleshooting tips
- The activity log in the application for error details
- Browser console (DevTools) for technical errors
Built with ❤️ using Electron and TailwindCSS