# intel-retail/automated-self-checkout architecture

> Architecture diagram of the GitHub repository intel-retail/automated-self-checkout, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/intel-retail/automated-self-checkout
- Repository: https://github.com/intel-retail/automated-self-checkout

## Overview

##### Project Type and Purpose
- This project is an integrated, containerized solution for automated self-checkout in retail environments.
- Its primary purpose is to run deep learning pipelines (object detection using models such as YOLOv5) to facilitate automated checkout. The solution relies on multiple pipelines, services, and integrations to handle video streams, sensor data, and analytics.

##### Major Components from the File Structure
- Deployment & Orchestration:
- Helm directory: Contains Kubernetes charts, Docker Compose configurations, and environment files. It indicates that the project is designed to be deployed in containers across various environments including Kubernetes and Docker Swarm.
- .github/workflows: CI/CD workflows for building, testing, code analysis, and image security scanning.

- Core Processing Components:
- src/pipeline-server: This directory is central to managing and executing object detection pipelines. It contains multiple configurations (pipeline JSONs) for different detection implementations (yolov5, yolov5_effnet, etc.), along with Docker files, and integration and status scripts.
- src/common-service: Hosts auxiliary applications such as barcode scanning, lidar handling, and weight measurement. They likely feed into or complement the core object detection pipelines.
- src/extensions: Contains extension modules (e.g., OCR processing, image filtering) that provide additional post-processing or data transformation functionalities.
- src/pipelines: Bash scripts that trigger specific pipeline variants, e.g., for different YOLOv5 configurations.

- Data Flow & Integration:
- The Mosquitto configuration (src/mosquitto-custom) implies the use of MQTT messaging for communication between components.
- Grafana dashboards and provisioning directories in both src/grafana-custom and src/pipeline-server/grafana indicate that system telemetry, logging, and visualization are an important part of the overall architecture.

- Observability and Monitoring:
- The telegraf folder includes configurations and Dockerfiles for telemetry and monitoring. This component is important for capturing metrics from the containers, the underlying hardware (e.g., Intel GPU telemetry), and possibly the pipelines in operation.

- Supporting Tools and Notebooks:
- notebooks: Contains demonstration Jupyter notebooks (e.g., automated-checkout.ipynb) and Dockerfiles to set up an interactive environment for experimentation.
- Helm files and Dockerfiles in multiple locations (e.g., in the helm folder, src, and not just one place) highlight a heavy emphasis on containerized deployment and reproducible environments.

## Diagram (Mermaid)

```mermaid
flowchart TD 
    %% Deployment & Orchestration
    subgraph "Deployment & Orchestration"
        Helm["Helm Charts"]:::deployment
        CI_CD["CI/CD Workflows"]:::deployment
    end

    %% Core Processing Engine
    subgraph "Core Processing Engine"
        Pipeline_Server["Pipeline Server"]:::processing
        Pipeline_Scripts["Pipeline Scripts"]:::processing
    end

    %% Auxiliary / Common Services
    subgraph "Common Services"
        Common_Services["Common Services"]:::common
        Extensions["Extensions"]:::common
    end

    %% Data Integration & Communication
    subgraph "Data Integration & Communication"
        Mosquitto["MQTT Broker (Mosquitto)"]:::integration
        Grafana_Custom["Grafana (Custom)"]:::integration
        Grafana_Pipeline["Grafana (Pipeline Server)"]:::integration
    end

    %% Observability & Monitoring
    subgraph "Observability & Monitoring"
        Telegraf["Telegraf"]:::monitoring
    end

    %% User Interaction & Demo
    subgraph "User Interaction & Demo"
        Notebooks["Notebooks"]:::interaction
    end

    %% Connections
    Helm -->|"deploys"| Pipeline_Server
    CI_CD -->|"deploys"| Pipeline_Server
    Pipeline_Server -->|"triggers"| Pipeline_Scripts
    Pipeline_Server -->|"communicates"| Common_Services
    Pipeline_Server -->|"enhances"| Extensions
    Pipeline_Server -->|"publishes"| Mosquitto
    Mosquitto -->|"routesData"| Grafana_Custom
    Pipeline_Server -->|"sendsMetrics"| Grafana_Pipeline
    Telegraf -->|"feeds"| Grafana_Custom
    Pipeline_Server -->|"monitoredBy"| Telegraf
    Notebooks -->|"demos"| Pipeline_Server

    %% Click Events
    click Helm "https://github.com/intel-retail/automated-self-checkout/tree/main/helm"
    click CI_CD "https://github.com/intel-retail/automated-self-checkout/tree/main/.github/workflows"
    click Pipeline_Server "https://github.com/intel-retail/automated-self-checkout/tree/main/src/pipeline-server"
    click Pipeline_Scripts "https://github.com/intel-retail/automated-self-checkout/tree/main/src/pipelines"
    click Common_Services "https://github.com/intel-retail/automated-self-checkout/tree/main/src/common-service"
    click Extensions "https://github.com/intel-retail/automated-self-checkout/tree/main/src/extensions"
    click Mosquitto "https://github.com/intel-retail/automated-self-checkout/tree/main/src/mosquitto-custom"
    click Grafana_Custom "https://github.com/intel-retail/automated-self-checkout/tree/main/src/grafana-custom"
    click Grafana_Pipeline "https://github.com/intel-retail/automated-self-checkout/tree/main/src/pipeline-server/grafana"
    click Telegraf "https://github.com/intel-retail/automated-self-checkout/tree/main/telegraf"
    click Notebooks "https://github.com/intel-retail/automated-self-checkout/tree/main/notebooks"

    %% Styles
    classDef deployment fill:#D5E8D4,stroke:#82B366,stroke-width:2px;
    classDef processing fill:#F8CECC,stroke:#B85450,stroke-width:2px;
    classDef common fill:#FFF2CC,stroke:#D6B656,stroke-width:2px;
    classDef integration fill:#DAE8FC,stroke:#6C8EBF,stroke-width:2px;
    classDef monitoring fill:#E1D5E7,stroke:#9673A6,stroke-width:2px;
    classDef interaction fill:#F5F5DC,stroke:#AAAAAA,stroke-width:2px;
```
