Architecture
Cargovision is made of three services with two deliberately separate data channels.
Channel 1: structured inspection data
The edge device sends results to the REST API over HTTPS with an API key. Writes are per scan session, not per frame: the edge accumulates detections across frames and sends one request when the session completes.
- OCR reads a container number from a camera frame.
- The number must stay stable across several frames before it is accepted.
- Defect and category scans run for the same container session.
- The edge sends
POST /v1/edge/containers/identify, thenPOST /v1/edge/containers/{containerNumber}/scans/defectand.../scans/category. - The API grades the raw detections, updates the container, and makes the result available to the dashboard and reports.
The edge sends raw detections only: class name, confidence, and bounding box. Severity, structural integrity, and the AI decision are always computed by the API. See Inspection lifecycle.
Channel 2: live video
Annotated video frames travel directly from the edge device to the dashboard over WebSocket. The REST API does not relay video, and the REST API and its SDKs have no video endpoints.
Manual uploads
When no edge device is running, operators can upload images through the dashboard. Those requests go to the JWT-authenticated POST /v1/containers/{id}/scans/* endpoints, and the API calls the AI service on the operator’s behalf. Edge ingestion remains the primary production path.
Versioning
All REST routes are served under /v1, which leaves room for a future API version to run alongside it. The changelog records contract changes.
