इस प्रोजेक्ट के बारे में
UniPlateTracker एक स्व-होस्टेड, निजी डैशबोर्ड है जो UniFi Protect कैमरों द्वारा कैप्चर की गई लाइसेंस प्लेटों को ट्रैक करता है। यह UniFi NVR से वेबहुक के माध्यम से डिटेक्शन इवेंट प्राप्त करता है, उन्हें PostgreSQL डेटाबेस में रिकॉर्ड करता है, और उन्हें viewing, searching और vehicle activity का विश्लेषण करने के लिए एक वेब इंटरफेस के माध्यम से प्रस्तुत करता है। थंबनेल और वीडियो फाइलें उपयोगकर्ता के अपने सर्वर पर रहती हैं, जिसमें UK DVLA lookup को एकमात्र वर्णित बाहरी डेटा स्रोत के रूप में शामिल किया गया है।
यह क्या करता है
- वास्तविक समय इवेंट प्रोसेसिंग: लाइसेंस प्लेट डिटेक्शन UniFi Protect वेबहुक से आते हैं और जैसे ही वे होते हैं, वैसे ही प्रोसेस किए जाते हैं।
- ऑन-डिमांड वीडियो कैप्चर: एक स्टैंडअलोन Node.js वर्कर कैमरा के RTSP स्ट्रीम से प्रत्येक डिटेक्शन के लिए एक छोटा क्लिप रिकॉर्ड करता है, जिसमें pre- और post-event buffering को एक अलग buffer manager प्रोसेस द्वारा संभाला जाता है।
- वैकल्पिक DVLA इंटीग्रेशन (UK): वाहन के विवरण जैसे make, colour, tax और MOT status को fetches करता है। एक international mode UK-specific फीचर्स को disable करता है ताकि ऐप अन्य क्षेत्रों में चल सके, हालांकि non-UK plates "Unknown" दिखाएंगे जब तक कि ENABLE_INTERNATIONAL_API को कॉन्फ़िगर नहीं किया जाता।
- एडमिन डैशबोर्ड: चार्ट और usage statistics के साथ एक संरक्षित एडमिन एरिया, साथ ही hierarchical admin accounts जहां initial admin अन्य administrators के लिए access grant या revoke कर सकता है; उन actions को review के लिए एक audit trail में लिखा जाता है।
- Detections table: dense और sortable, इसे जल्दी से पढ़ने के लिए बनाया गया है। Sorting और filtering डेटाबेस में चलते हैं, इसलिए ordering केवल current page के लिए नहीं बल्कि पूरे result set के लिए लागू होती है, और table narrow screens पर card list में reflow हो जाता है।
- Status highlighting: taxed vehicles with a valid MOT visually quiet रहते हैं, जबकि expired, untaxed और SORN vehicles को highlighted किया जाता है; "no DVLA record" को एक distinct hollow, dashed chip के रूप में दिखाया जाता है ताकि missing information कभी भी clean result के रूप में न पढ़े।
- Accessibility: labelled controls, keyboard-operable sorting और paging, aria-sort on the table, और prefers-reduced-motion support। प्रोजेक्ट ने stated किया है कि इसे zero violations के साथ audited किया गया था। Light और dark mode system preferences का पालन करते हैं।
Tech stack
Next.js 16 (App Router) with TypeScript, React 19, Tailwind CSS v4 और shadcn/ui; Next.js API routes alongside a standalone Node.js worker/buffer manager; PostgreSQL for storage; FFmpeg for video processing; integrations with UniFi Protect webhooks and the DVLA API. क्योंकि Tailwind v4 अपना theme CSS से लेता है, इसलिए कोई tailwind.config.ts नहीं है — design tokens, plate और status styles src/app/globals.css के @theme block में रहते हैं।
Deployment
The documented baseline is Debian 12 with a UVC-AI-Pro camera (device version 5.1.57) and UniFi Protect 9.4.19, with the note that other configurations are expected to work. दो methods को described किया गया है:
- Manual installation: install Node.js 20+, PostgreSQL और FFmpeg; copy the example environment file to .env.local और values जैसे POSTGRES_URL और SESSION_SECRET को भरें; create the buffer and final capture directories if video capture is enabled; install dependencies for both the app and the worker; run npm run db:init to create tables and register the first admin email; build and start the app, optionally keeping it persistent with PM2.
- Docker: download the compose file and environment template, rename it to .env.local, supply POSTGRES_URL, SESSION_SECRET और NEXTAUTH_URL (using the server's network IP rather than localhost), run a one-off container to initialise the database and create the first admin, then pull and start with Docker Compose. The web interface is documented on port 3000 and the webhook endpoint on port 4000.
In UniFi Protect, an alarm is created under Settings > System > Other Settings > Alarm Manager, triggered on ID > LPR for unknown and known vehicles, scoped to the LPR cameras, and pointed at the app's /webhook URL with thumbnails enabled.
Troubleshooting notes from the README
Detections can show "No clip" because detection and capture are separate paths: the webhook writes the row while the worker records from RTSP, so capture can fail while detections keep arriving. Suggested checks are the newest file date in VIDEO_FINAL_CAPTURE_PATH, whether FFmpeg is still installed and on its expected path, whether camera credentials or the RTSP URL are still valid, whether both background processes are alive, and whether the user running the app can read the capture directory. A dashed "No clip" tile means a clip was expected but missing, while a plain camera icon means the detection never referenced one. Video and thumbnail requests return 404 unless filenames contain only letters, digits, dots, hyphens and underscores with .mp4 or .jpg extensions, and any path that changes when normalised is refused, so directory traversal fails rather than escaping the capture directory. Vehicle details showing "Unknown" mean the DVLA holds no record for that registration or the lookup failed.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.