Fox VMS — Industrial Video Surveillance
Puts an entire plant’s camera estate — live viewing, 24×7 recording and evidentiary export — behind one access-controlled console.
An ONVIF video management system for plant operations: device onboarding by IP or serial, low-latency live viewing, 24×7 recording with policy-driven retention, evidentiary export and per-camera RBAC — across a web console, a WinUI 3 control-room client and a Flutter handset app.

- Industry
- Heavy Industry / Plant Operations
- Role
- Architect & Full-Stack Engineer
- Team
- Solo — one author in the repository history
- Type
- SaaS Platform
- Year
- 2026
01
Overview
Fox VMS is industrial IP video surveillance built as two products in one codebase. The first is a client platform in the Hik-Connect mould: add a DVR or NVR by IP, domain or serial, view live, drive PTZ, and watch from another city through an outbound relay. The second is an enterprise VMS — 150+ cameras, centralized recording with mixed-tier retention, RBAC down to a single camera, a video wall and server-side analytics.
The enterprise case is the harder constraint and dominates the architecture; the client platform falls out of it as a thin consumer of the same gateway.
A Go backend carries the gateway, recorder and relay. Four surfaces sit on top: a Next.js operator console, a WinUI 3 control-room client on .NET 8 doing native H.264/H.265 decode, and a Flutter app for Android and iOS.
02
Business challenge
Plant surveillance is split between consumer apps that handle a handful of cameras and enterprise VMS platforms that cannot be operated by a small site team. Neither covers a plant that needs 150+ cameras, per-camera access control, evidentiary export and remote viewing from another city.
Before this system
03
Solution
One codebase serving both cases: an enterprise VMS whose constraints drive the architecture, with the consumer-style client platform implemented as a thin consumer of the same gateway rather than a separate product.
What it does
04
My contribution
- Role
- Architect & Full-Stack Engineer
- Team
- Solo — one author in the repository history
- Scope of my work
- Gateway, recorder, relay, analytics service, web console, Windows client and mobile app
05
Product screenshots
Screens from the application itself. Select any image to view it full size.
06
Architecture
Swipe sideways, or expand to zoom.
Two Go processes, an analytics sidecar and a relay
A modular monolith split only where load actually separates. The gateway owns everything interactive — authentication, device drivers, live streaming and playback. The recorder is its own process so that a busy console can never cost a frame of recording, and it claims each camera through a Redis lease so two recorders cannot write the same stream. The relay holds no database and no camera credentials, which keeps the internet-facing piece disposable.
- Interface
- Service
- AI / ML
- Data store
- External system
How it fits together
- 01Go 1.25 backend carrying the gateway, recorder, relay, migrations and seed — fully containerized
- 02Next.js 15 + React 19 operator console for device management, live view and administration
- 03WinUI 3 on .NET 8 control-room client with native H.264/H.265 decode for wall-scale playback
- 04Flutter 3 handset app for Android and iOS
- 05ONVIF device onboarding by IP, domain or serial with an outbound relay for cross-network viewing
- 06Policy-driven retention with mixed storage tiers and per-camera RBAC
Data and API design
- 01The gateway exposes REST and WebSocket endpoints; access is granted by role and, below that, per camera.
- 02Events, health samples and the recording segment index are time series in TimescaleDB.
- 03Migrations are embedded in the binary and applied by a one-shot process.
- 04Video-wall layouts are stored on the server and shared across the control room.
- 05Device drivers cover ONVIF, Hikvision, Dahua, CP Plus and Uniview, with generic RTSP as the fallback.
07
Engineering challenges
01
Two products pulling one architecture in opposite directions
- The difficulty
- A consumer-style client wants simple onboarding — add a recorder by IP or serial and watch. A 150-camera enterprise VMS wants centralised policy, access control and retention.
- Why it mattered
- Built as two implementations, the two products would drift apart and every fix would be made twice.
- What was built
- Designed for the enterprise constraint first and derived the client platform from it, so the simpler product is a restricted view of the same gateway.
- Why this approach
- The stricter set of requirements contains the looser one; the reverse is not true.
- Result
- One codebase serves a small site adding a DVR by serial and a plant running a full control room.
02
A browser cannot drive a control-room video wall
- The difficulty
- Decoding many H.265 streams at full frame rate is beyond what a browser tab sustains, and the web console needs an HLS fallback to play H.265 at all.
- Why it mattered
- The wall is the one screen a control room watches all day; dropped frames there are the product failing in plain sight.
- What was built
- The control-room surface is a native WinUI 3 client on .NET 8 that receives RTP over WebSocket and decodes on the GPU. The web console stays, for administration and single-stream viewing over WebRTC.
- Why this approach
- Each surface does the job it is good at: the browser for reach, native code for sustained multi-stream decode.
- Result
- Native H.265 on the wall, and a client that stops decoding when the wall is off screen and tells the server which stream tier it needs.
03
A recording index of tens of millions of rows, with retention
- The difficulty
- At 150 cameras, 30-second segments and 90 days of retention the segment index is about 39 million rows, and every playback seek queries it by time.
- Why it mattered
- Retention implemented as a mass delete on a table that size competes with recording and playback for the same database.
- Options weighed
- An ordinary table with periodic bulk deletes
- A TimescaleDB hypertable, dropping whole chunks as they expire
- What was built
- Events, health samples and the segment index are hypertables. Playback seeks exclude chunks by time, and retention drops a chunk instead of deleting rows.
- Why this approach
- These are genuine time series, and expiring by chunk turns the most expensive maintenance operation into a cheap one.
- Result
- Seek performance and retention cost stay flat as recorded history grows.
04
An event bus an installer can operate
- The difficulty
- The system needs a durable event bus, but it ships as an appliance run by an installer rather than a platform team.
- Why it mattered
- Infrastructure nobody on site can operate becomes the reason an installation fails.
- Options weighed
- Apache Kafka
- NATS JetStream
- What was built
- NATS JetStream.
- Why this approach
- A single small binary an installer can run is worth more in this setting than Kafka’s throughput ceiling.
- Result
- Durable event delivery with almost no operational surface.
05
Recording must not depend on anything interactive
- The difficulty
- Recording runs around the clock, while the console, cache and analytics are restarted, upgraded and occasionally overloaded.
- Why it mattered
- Footage that was never written cannot be recovered afterwards.
- What was built
- The recorder is its own process and claims each camera through a Redis lease, so two recorders never write the same stream. Redis holds only derived state: the gateway starts without it, and a flush makes the system slower, never incorrect.
- Why this approach
- Splitting at the point where load and failure actually separate protects the one function that cannot be replayed.
- Result
- A busy or restarting console does not cost a frame of recording.
08
Technology stack
- Frontend
- Next.js 15React 19Tailwind CSS 4.NET 8WinUI 3Flutter 3
- Backend
- Go 1.25
- Infrastructure
- ONVIFRTSPH.264 / H.265Docker
Why these choices
- Go
- Gateway, recorder and relay as thin binaries over one shared module.
- TimescaleDB
- Events, health samples and the segment index are time series.
- NATS JetStream
- A durable event bus small enough to ship inside an appliance.
- Redis
- Recorder leases, device-state cache, rate limits and the token denylist — never a source of truth.
- WinUI 3 on .NET 8
- GPU-accelerated decode for the control-room wall.
- Next.js 15
- Operator console for administration and single-stream viewing.
- Flutter
- One handset application for Android and iOS.
- Python + Ultralytics YOLO
- Object detection as a separate gRPC service over the frame bus.
09
Security & scale
Security
Scalability
10
Business impact
Every figure is labelled with where it comes from: a measurement, an estimate, a design target, or a fact of the system as built.
In development
Project stage
Runs against simulated cameras in the development stack.
150+
Cameras per site
The scale the architecture and storage are sized for.
≈39M
Segment-index rows at full retention
150 cameras × 30-second segments × 90 days.
3
Client surfaces
Web console, Windows control-room client and mobile app.
5
Vendor drivers
ONVIF, Hikvision, Dahua, CP Plus and Uniview, plus generic RTSP.
What changed
- Scale
- BeforeConsumer apps built for a handful of cameras.
- AfterOne platform from a single DVR to a 150-camera plant.
- Operability
- BeforeEnterprise platforms a small site team could not run.
- AfterTwo Go processes and an analytics service per plant.
- Access and evidence
- BeforeNo single tool with per-camera access control, evidentiary export and remote viewing.
- AfterAll three in one platform, on web, Windows and mobile.
A single platform covering both a small site adding a DVR by serial and a plant running 150+ cameras with tiered retention, per-camera permissions and evidentiary export — reachable from a browser, a Windows control room or a phone.
11
Project status
What I took from it
- When two products share a codebase, designing for the stricter constraint and deriving the looser one prevents the two from diverging.
- Native decode is still the right call for wall-scale multi-stream playback; the browser is the wrong tool for that specific job.
A video management system designed from its hardest requirement outwards: recording that never depends on anything interactive, a database shaped for time, and a native client where a browser is the wrong tool.
Next step
Need a similar solution for your business?
Tell me what you are trying to build or fix. I will come back with how I would approach it, what it realistically takes and where the risks are.

