2 min read
catscan

A smart cat-flap camera: a camera pointed at the cat flap, a server that turns motion into logged “flap events” with snapshots, and an iOS app to keep an eye on who’s coming and going. Still a work in progress.

catscan dashboard showing the live stream, the latest snapshot, and visit statistics

How it works

RTSP camera ──▶ catscan-server ──▶ catscan (iOS app)
                 ffmpeg capture      dashboard, history,
                 flap events + API   live stream
  • catscan-app — SwiftUI iOS app: dashboard with live stream, latest snapshot and visit stats, full event history, event details. Swift 6 language mode with default MainActor isolation.
  • catscan-server — a Vapor server that supervises an ffmpeg capture of the camera’s RTSP feed, persists flap events to SQLite (Fluent), stores snapshot images, and serves the HTTP API. Split into local Domain / Data / Presentation packages; deployable with Docker.
  • catscan-shared — the CatscanAPI package: the OpenAPI spec plus swift-openapi-generator, so the app’s client and the server’s routes are generated from the same contract.

The whole thing opens as one catscan.xcworkspace in Xcode, app project and server package side by side. The server runs with CAMERA_RTSP_URL=rtsp://camera.example.com/stream swift run, or from the bundled Dockerfile that ships ffmpeg alongside it; without the camera URL it still serves the API, which is handy for development.