# mohitk009/ai-mlops-kafka-project architecture

> Architecture diagram of the GitHub repository mohitk009/ai-mlops-kafka-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mohitk009/ai-mlops-kafka-project
- Repository: https://github.com/mohitk009/ai-mlops-kafka-project

## Overview

##### Project type and purpose
- This is an AI MLOps pipeline implemented as a set of event-driven microservices.
- The goal is to ingest data, preprocess it, classify it using an ML model, collect results, and expose them via a frontend.
- Kafka (implemented here with Redpanda) is used as the message bus between services.

##### File structure
- Top-level:
- Dockerfile, requirements.txt — base container and dependencies.
- frontend.py, frontend-svc.yaml, frontend.yaml — the “frontend” service that serves results/UI.
- redpanda-deploy.yaml, redpanda-svc.yaml — Kafka (Redpanda) deployment and service definitions.
- Microservice directories (each has Dockerfile, main.py, requirements.txt, deploy.yaml):
- uploader — reads or receives raw data and publishes to the “raw-data” Kafka topic.
- pre-processor — subscribes to “raw-data”, processes it, publishes to “processed-data”.
- classifier — subscribes to “processed-data”, applies the ML model, publishes to “classified-data”.
- result — subscribes to “classified-data” and writes results to storage or makes them available to the frontend.

##### README
- Although minimal, the title “AI-Mlops-Kafka-Project” confirms:
- This is an orchestrated ML inference pipeline.
- Components communicate via Kafka topics.

##### Key points to capture
- All microservices and their Docker artifacts
- Kafka topics as the central bus with clear naming
- Flow of data through each processing stage
- Deployment context (Kubernetes)
- External interfaces (frontend HTTP endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Kubernetes Cluster"
        direction TB
        Uploader["Uploader Service"]:::service
        Raw["raw-data topic"]:::messaging
        Preprocessor["Pre-processor Service"]:::service
        ProcT["processed-data topic"]:::messaging
        Classifier["Classifier Service"]:::service
        ClassT["classified-data topic"]:::messaging
        Result["Result Service"]:::service
        DB[(Result Storage)]:::storage
    end

    Frontend["Frontend Service"]:::frontend

    Uploader -->|"publishes to raw-data"| Raw
    Raw -->|"consumed by Pre-processor"| Preprocessor
    Preprocessor -->|"publishes to processed-data"| ProcT
    ProcT -->|"consumed by Classifier"| Classifier
    Classifier -->|"publishes to classified-data"| ClassT
    ClassT -->|"consumed by Result"| Result
    Result -->|"writes to storage"| DB
    Frontend -->|"HTTP API call"| Result

    click Uploader "https://github.com/mohitk009/ai-mlops-kafka-project/tree/master/uploader/"
    click Preprocessor "https://github.com/mohitk009/ai-mlops-kafka-project/tree/master/pre-processor/"
    click Classifier "https://github.com/mohitk009/ai-mlops-kafka-project/tree/master/classifier/"
    click Result "https://github.com/mohitk009/ai-mlops-kafka-project/tree/master/result/"
    click Frontend "https://github.com/mohitk009/ai-mlops-kafka-project/blob/master/frontend.py"
    click Raw "https://github.com/mohitk009/ai-mlops-kafka-project/blob/master/redpanda-deploy.yaml"
    click ProcT "https://github.com/mohitk009/ai-mlops-kafka-project/blob/master/redpanda-svc.yaml"

    classDef service fill:#AED6F1,stroke:#21618C,color:#1B2631;
    classDef messaging fill:#F5B041,stroke:#B9770E,color:#1B2631;
    classDef storage fill:#ABEBC6,stroke:#239B56,color:#1B2631;
    classDef frontend fill:#D7BDE2,stroke:#7D3C98,color:#1B2631;
```
