bitreka

Software Engineering Leader | AI-Assisted Development | .NET & C# | FinTech & Payments | E-Commerce | Architecture • Backend • Microservices • DevOps • Test Automation • AI Agents

All work

Argus

Samples RTSP camera feeds, detects objects with AI and streams the events to a live dashboard.

Status
prototypeAn exploration that proves the idea, not a finished product.
Role
Sole engineer: architecture, backend, worker pipeline, dashboard and the local camera simulator.
Started
Categories
Video analytics
Parts
Web

Purpose

Turn a set of IP cameras into a stream of detected events that someone can watch live, without recording and reviewing hours of footage.

The problem

Continuous video is expensive to store and nobody watches it. Most of the value is in the moments when something appears, and those moments need to reach a person while they still matter.

What I built

  • A sampling pipeline: Celery beat schedules frame capture from each RTSP camera, a worker runs detection, draws the boxes on the frame and stores an event in PostgreSQL.
  • A pluggable detection layer — a mock provider by default, YOLOv8 on CPU, or AWS Rekognition — where heavy libraries load only for the selected provider.
  • Live delivery: the worker hands each event to the FastAPI backend, which pushes it over WebSocket to a React 19 dashboard with camera, camera-detail and event views.
  • An RTSP simulator built from MediaMTX and FFmpeg containers that loop demo videos as six cameras, so the whole stack runs with one Docker Compose command.
  • Fail-closed access: token authentication on every router and on the WebSocket, an environment-driven CORS allowlist, security headers, and API docs only in debug mode.
  • Limits that come from configuration rather than code: frame interval, concurrent streams, WebSocket connections and a timed demo mode.

Features

  • RTSP camera management with encrypted credentials and a stream reachability check.
  • Periodic frame sampling, every 10 seconds by default.
  • A selectable detection engine: mock, YOLO or AWS Rekognition.
  • An events list filterable by camera and type, with annotated frame thumbnails.
  • A live dashboard updated over WebSocket, with stat cards.
  • A camera detail page with the last frame and an event gallery.
  • Demo start, stop and status backed by an RTSP simulator with six cameras.
  • JWT sign-in with route protection and a seeded demo user.

Stack

  • Python
  • FastAPI
  • Celery
  • Redis
  • PostgreSQL
  • YOLO
  • WebSocket
  • React
  • TypeScript
  • Docker

AI in this project

In the product

  • This is computer vision, not a language model: every sampled frame goes to an object detector. The engine is a setting: a mock that returns random labels for demos, YOLO (YOLOv8n, keeping 17 security-relevant labels) or AWS Rekognition. The production configuration uses YOLO.
  • There is no human in the loop. Detections become events and are streamed to the dashboard, with the detections drawn onto the frame.
  • Guards: a Rekognition error is logged and yields no detections instead of failing the worker, the heavy ML libraries load lazily, frames and camera credentials are never logged, and camera passwords are encrypted at rest.
  • The detectors are tested with fakes: a fake detector library and a Rekognition stub.

In how it was built

  • 57 of 63 commits carry a Claude co-author trailer.
  • A shared gate checks every change, with an 80% line-coverage minimum, and a rule file records the architecture and known gaps.

Key flows

Steps

From a camera frame to a live event

  1. Step 1 of 4: Sign in

    The operator signs in; every camera, event, frame and demo endpoint requires a token.

  2. Step 2 of 4: Start the demo

    A timed demo starts sampling the simulated cameras at the configured frame interval.

  3. Step 3 of 4: Detect

    Each sampled frame goes through the selected detection provider; detections are drawn on the frame and saved as an event.

  4. Step 4 of 4: Watch live

    New events appear on the dashboard over WebSocket, and the operator can open a camera or browse the event list.

Limitations

  • A prototype: the database schema is still created at startup rather than through migrations, and the pipeline logic has little test coverage.
  • ONVIF camera discovery is a placeholder; cameras are registered by hand.

Want something like this?

Tell me about your project — I reply within two working days.

Start a project