Skip to content
FVCase studyIndustrial · Video SurveillanceIn development

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.

Fox VMS — Industrial Video Surveillance interface
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

Consumer camera apps handle a handful of cameras and stop there.
Enterprise VMS platforms are too heavy for a small site team to operate.
Neither covered a plant that needs 150+ cameras, per-camera access control, evidentiary export and viewing from another city.

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

ONVIF device management — onboard by IP, domain or serial
Low-latency live viewing with PTZ control
24×7 recording with policy-driven, mixed-tier retention
Evidentiary export with chain-of-custody
RBAC down to an individual camera
Video wall for control-room operation
Outbound relay for viewing across networks
Health and storage monitoring across the fleet
Server-side video analytics
Native H.264/H.265 decode in the Windows client

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
Designed the system as a modular monolith: one Go module, shared internal packages, one thin binary per process.
Built the API gateway — authentication, RBAC with per-camera grants, device drivers, live streaming and playback.
Built the recorder: continuous segment writing, schedule and motion gating, retention and storage monitoring.
Built the relay that brokers remote access without holding camera credentials.
Built the Next.js operator console, the WinUI 3 control-room client and the Flutter mobile app.
Integrated the Python analytics service running object detection over the frame bus.

05

Product screenshots

Screens from the application itself. Select any image to view it full size.

06

Architecture

System architecture
Two Go processes, an analytics sidecar and a relayA web console, a Windows control-room client, a mobile app and the cameras themselves connect to a Go API gateway. The gateway feeds frames to a Python analytics service, publishes events to NATS JetStream and uses PostgreSQL with TimescaleDB and Redis. A separate Go recorder pulls RTSP from cameras, claims each camera through a Redis lease and writes MPEG-TS segments to storage. A relay brokers remote access.Clients & camerasProcessesInfrastructureliveRTSPtunnelframe buseventsleasesegmentsWeb consoleNext.js 15WebRTC · HLS fallbackControl-room clientWinUI 3 · .NET 8D3D11VA decodeMobile appFlutter · WebRTCCameras · DVR / NVRONVIF · RTSPVendor driversRelay (Go)Remote-access brokerNo DB · no credentialsAPI gateway (Go)REST · WS · JWT · RBACRTSP → WebRTC · LL-HLSAnalytics (Python)gRPC detectorUltralytics YOLORecorder (Go)24×7 MPEG-TS segmentsRetention reaperNATS JetStreamEvent busPostgreSQL 16TimescaleDBEvents · segment indexRedisLeases · device cacheRate limits · denylistStorage volumesRecordings · HLSEvidence exports

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

  1. 01Go 1.25 backend carrying the gateway, recorder, relay, migrations and seed — fully containerized
  2. 02Next.js 15 + React 19 operator console for device management, live view and administration
  3. 03WinUI 3 on .NET 8 control-room client with native H.264/H.265 decode for wall-scale playback
  4. 04Flutter 3 handset app for Android and iOS
  5. 05ONVIF device onboarding by IP, domain or serial with an outbound relay for cross-network viewing
  6. 06Policy-driven retention with mixed storage tiers and per-camera RBAC

Data and API design

  1. 01The gateway exposes REST and WebSocket endpoints; access is granted by role and, below that, per camera.
  2. 02Events, health samples and the recording segment index are time series in TimescaleDB.
  3. 03Migrations are embedded in the binary and applied by a one-shot process.
  4. 04Video-wall layouts are stored on the server and shared across the control room.
  5. 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

JWT authentication with role-based access and grants down to a single camera.
Rate limiting and an audit log at the gateway, with revoked tokens held in a denylist.
The relay holds no database and no camera credentials, so the internet-facing component has nothing to leak.
Evidence export with retention locks on recorded footage.

Scalability

Sized for 150 cameras at 30-second segments over 90 days.
Recorder instances share work safely through per-camera leases.
Clients report what they are displaying so the server can choose the stream tier.
Retention is a chunk drop, so its cost does not grow with the volume recorded.

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.

System fact

150+

Cameras per site

The scale the architecture and storage are sized for.

Design target

≈39M

Segment-index rows at full retention

150 cameras × 30-second segments × 90 days.

Design target

3

Client surfaces

Web console, Windows control-room client and mobile app.

System fact

5

Vendor drivers

ONVIF, Hikvision, Dahua, CP Plus and Uniview, plus generic RTSP.

System fact

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

In development2026
In development — not yet installed at a plant.
A plant installation runs two Go processes plus the analytics service, with PostgreSQL/TimescaleDB, Redis and NATS.
The development stack includes simulated RTSP cameras, one of them deliberately unreliable, to exercise reconnection.
The relay deploys separately on a public host for remote access.

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.

Related work

All projects