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.
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 defaultMainActorisolation.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 localDomain/Data/Presentationpackages; deployable with Docker.catscan-shared— theCatscanAPIpackage: 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.