# kollinikhilkumar/ai-powered-smart-mall-management-system architecture

> Architecture diagram of the GitHub repository kollinikhilkumar/ai-powered-smart-mall-management-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kollinikhilkumar/ai-powered-smart-mall-management-system
- Repository: https://github.com/kollinikhilkumar/ai-powered-smart-mall-management-system

## Overview

##### Project type and purpose
- This is a full-stack AI-driven Smart Mall Management System.
- Backend: Python-based ML pipeline + FastAPI microservice.
- Frontend: React/Vite dashboard for real-time analytics.
- Purpose: ingest camera feeds, detect & recognize faces, compute foot-traffic analytics, and display insights to mall administrators.

##### File structure
- Top-level:
- Backend/
– Fast-Apis/: FastAPI endpoints (main.py)
– Main/: ML pipeline package (src/components, src/pipeline), entrypoint app.py, artifacts, logs
- Dashboard/: React code (src/pages, src/components, charts), Vite build (dist/)
- setup.py, requirements.txt: Python packaging & dependencies
- README.md: methodology & usage instructions
- Patterns:
- “components” & “pipeline” modules implement a modular ML workflow.
- Fast-API folder serves REST API.
- Dashboard folder is a self-contained frontend application.
- Deploy/config files: package.json, vite.config.js, setup.py, requirements.txt

##### README for insights
- Four modules:
1. Parallel camera input (multiprocessing)
2. YOLO-v8 face detection
3. Face encoding & comparison
4. Customer analytics
- Usage: run FastAPI, run app.py (pipeline), run React dev/build.

##### Detail is essential
- Python module as a sub-component if needed (data_ingestion.py, model_trainer.py, etc.).
- How FastAPI imports or invokes parts of the ML package, if applicable.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Data Ingestion & Processing"
        direction TB
        Cam["Cameras (Video Sources)"]:::external
        PipelineEntrypoint["Pipeline Entrypoint\n(app.py)"]:::api
        Reader["Ingestion Service\n(reader_pipeline.py)"]:::ml
        Detector["Detection Service\n(comparision_pipeline.py)"]:::ml
        DataTrans["Data Transformation\n(data_transformation.py)"]:::ml
        ModelTrain["Model Trainer\n(model_trainer.py)"]:::ml
        Analytics["Analytics Module\n(processing_pipeline.py)"]:::ml
    end

    subgraph "Storage & Artifacts"
        direction TB
        ArtifactsPT["YOLO Weights\n(yolov8n-face.pt)"]:::artifact
        ArtifactsDir["Artifacts Directory"]:::artifact
        LogsDir["Logs Directory"]:::artifact
        Logger["Logger Implementation\n(logger.py)"]:::artifact
        DataStore["Future AnalyticsDB"]:::db
    end

    subgraph "API Layer"
        direction TB
        FastAPI["FastAPI Service\n(main.py)"]:::api
        Packaging["Packaging & Dependencies\n(setup.py, requirements.txt)"]:::artifact
    end

    subgraph "Frontend"
        direction TB
        DashboardSrc["React Dashboard Source\n(Dashboard/src/)"]:::frontend
        DashboardDist["Frontend Build Artifacts\n(Dashboard/dist/)"]:::frontend
        Tooling["Tooling & Config\n(package.json, vite.config.js)"]:::frontend
        Users["External Users\n(Mall Admins, Traders)"]:::external
    end

    Cam -->|feeds into| Reader
    PipelineEntrypoint -->|starts| Reader
    Reader -->|streams frames| Detector
    Detector -->|detections| DataTrans
    DataTrans -->|transformed data| ModelTrain
    ModelTrain -->|encoded faces| Analytics
    Analytics -->|stores metrics| DataStore
    Analytics -->|writes artifacts| ArtifactsPT
    Analytics -->|writes artifacts| ArtifactsDir
    Analytics -->|logs events| LogsDir
    Analytics -->|uses logger| Logger

    FastAPI -->|queries| DataStore
    FastAPI -->|reads logs| LogsDir
    FastAPI -->|calls pipeline| PipelineEntrypoint

    DashboardSrc -->|builds to| DashboardDist
    Users -->|interacts with| DashboardSrc
    DashboardSrc -->|sends HTTP| FastAPI

    FastAPI -->|packaged with| Packaging

    click Reader "https://github.com/kollinikhilkumar/ai-powered-smart-mall-management-system/blob/main/Backend/Main/src/pipeline/reader_pipeline.py"
    click Detector "https://github.com/kollinikhilkumar/ai-powered-smart-mall-management-system/blob/main/Backend/Main/src/pipeline/comparision_pipeline.py"
    click DataTrans "https://github.com/kollinikhilkumar/ai-powered-smart-mall-management-system/blob/main/Backend/Main/src/components/data_transformation.py"
    click ModelTrain "https://github.com/kollinikhilkumar/ai-powered-smart-mall-management-system/blob/main/Backend/Main/src/components/model_trainer.py"
    click Analytics "https://github.com/kollinikhilkumar/ai-powered-smart-mall-management-system/blob/main/Backend/Main/src/pipeline/processing_pipeline.py"
    click ArtifactsPT "https://github.com/kollinikhilkumar/ai-powered-smart-mall-management-system/blob/main/Backend/Main/artifacts/yolov8n-face.pt"
    click ArtifactsDir "https://github.com/kollinikhilkumar/ai-powered-smart-mall-management-system/tree/main/Backend/Main/artifacts/"
    click LogsDir "https://github.com/kollinikhilkumar/ai-powered-smart-mall-management-system/tree/main/Backend/Main/logs/"
    click Logger "https://github.com/kollinikhilkumar/ai-powered-smart-mall-management-system/blob/main/Backend/Main/src/logger.py"
    click FastAPI "https://github.com/kollinikhilkumar/ai-powered-smart-mall-management-system/blob/main/Backend/Fast-Apis/main.py"
    click PipelineEntrypoint "https://github.com/kollinikhilkumar/ai-powered-smart-mall-management-system/blob/main/Backend/Main/app.py"
    click DashboardSrc "https://github.com/kollinikhilkumar/ai-powered-smart-mall-management-system/tree/main/Dashboard/src/"
    click DashboardDist "https://github.com/kollinikhilkumar/ai-powered-smart-mall-management-system/tree/main/Dashboard/dist/"
    click Packaging "https://github.com/kollinikhilkumar/ai-powered-smart-mall-management-system/blob/main/setup.py"
    click Packaging "https://github.com/kollinikhilkumar/ai-powered-smart-mall-management-system/blob/main/requirements.txt"
    click Tooling "https://github.com/kollinikhilkumar/ai-powered-smart-mall-management-system/blob/main/Dashboard/package.json"
    click Tooling "https://github.com/kollinikhilkumar/ai-powered-smart-mall-management-system/blob/main/Dashboard/vite.config.js"

    classDef ml fill:#D0E8FF,stroke:#0366D6
    classDef api fill:#DFF5E1,stroke:#2E8B57
    classDef frontend fill:#FFD8A8,stroke:#FF8C00
    classDef artifact fill:#F0F0F0,stroke:#A9A9A9
    classDef db fill:#FFF5BA,stroke:#F4C430
    classDef external fill:#FFFFFF,stroke:#000000
```
