# donivishal/mlops-core-project architecture

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

- Interactive diagram: https://gitdiagram.com/donivishal/mlops-core-project
- Repository: https://github.com/donivishal/mlops-core-project

## Overview

Loksai is a sentiment-analysis application: feedback entered in the Streamlit UI is sent to a FastAPI prediction endpoint, which returns a sentiment predicted by a trained model. A Kubeflow pipeline separately downloads review data, validates and preprocesses it, then trains and uploads a model artifact. The graph reflects the sampled pipeline and runtime code; the README is empty, and deployment manifests and other unsampled subsystems are not expanded.

Main entry points: [`src/train.py`](https://github.com/donivishal/mlops-core-project/blob/master/src/train.py) (Model training), [`src/preprocessing.py`](https://github.com/donivishal/mlops-core-project/blob/master/src/preprocessing.py) (Text preprocessing), [`api/main.py`](https://github.com/donivishal/mlops-core-project/blob/master/api/main.py) (Prediction API), [`pipeline.py`](https://github.com/donivishal/mlops-core-project/blob/master/pipeline.py) (Kubeflow pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pipeline["Pipeline orchestration"]
  node_pipeline["Kubeflow pipeline<br/>[pipeline.py]"]
end

subgraph group_training["Model training"]
  node_validate["Data validation<br/>[data_validation.py]"]
  node_preprocess["Text preprocessing<br/>[preprocessing.py]"]
  node_train["Model training<br/>[train.py]"]
  node_rawdata[("Review data")]
  node_cleaned[("Clean reviews")]
  node_modelartifact[("Model artifact")]
end

subgraph group_serving["Prediction serving"]
  node_ui["Feedback UI<br/>[app.py]"]
  node_api["Prediction API<br/>[main.py]"]
  node_loadedmodel["Loaded model<br/>[main.py]"]
  node_prediction["Sentiment result<br/>[main.py]"]
end

node_user(("Feedback user"))
node_s3[("S3 bucket")]
node_mlflow["MLflow tracking"]

node_user -->|"enters feedback"| node_ui
node_ui -->|"requests prediction"| node_api
node_api -->|"transforms and predicts"| node_loadedmodel
node_loadedmodel -->|"returns sentiment"| node_prediction
node_prediction -->|"displays result"| node_ui
node_pipeline -->|"dispatches validation"| node_validate
node_pipeline -->|"dispatches after validation"| node_preprocess
node_pipeline -->|"dispatches after preprocessing"| node_train
node_validate -->|"downloads reviews"| node_s3
node_preprocess -->|"downloads reviews"| node_s3
node_train -->|"downloads reviews"| node_s3
node_validate -->|"reads reviews"| node_rawdata
node_preprocess -->|"reads reviews"| node_rawdata
node_preprocess -->|"writes cleaned data"| node_cleaned
node_train -->|"reads training data"| node_cleaned
node_train -->|"saves model"| node_modelartifact
node_train -->|"uploads model"| node_s3
node_train -->|"logs metric"| node_mlflow
node_api -->|"downloads model at startup"| node_s3
node_api -->|"loads model and vectorizer"| node_loadedmodel

click node_pipeline "https://github.com/donivishal/mlops-core-project/blob/master/pipeline.py"
click node_validate "https://github.com/donivishal/mlops-core-project/blob/master/src/data_validation.py"
click node_preprocess "https://github.com/donivishal/mlops-core-project/blob/master/src/preprocessing.py"
click node_train "https://github.com/donivishal/mlops-core-project/blob/master/src/train.py"
click node_rawdata "https://github.com/donivishal/mlops-core-project/tree/master/data/raw"
click node_cleaned "https://github.com/donivishal/mlops-core-project/tree/master/data/processed"
click node_modelartifact "https://github.com/donivishal/mlops-core-project/tree/master/models"
click node_ui "https://github.com/donivishal/mlops-core-project/blob/master/ui/app.py"
click node_api "https://github.com/donivishal/mlops-core-project/blob/master/api/main.py"
click node_loadedmodel "https://github.com/donivishal/mlops-core-project/blob/master/api/main.py"
click node_prediction "https://github.com/donivishal/mlops-core-project/blob/master/api/main.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_pipeline,node_user toneBlue
class node_validate,node_preprocess,node_train,node_rawdata,node_cleaned,node_modelartifact,node_s3 toneAmber
class node_ui,node_api,node_loadedmodel,node_prediction toneMint
class node_mlflow toneIndigo
```

## Components

### Pipeline orchestration

- [Kubeflow pipeline](https://github.com/donivishal/mlops-core-project/blob/master/pipeline.py): `pipeline.py`

### Model training

- [Data validation](https://github.com/donivishal/mlops-core-project/blob/master/src/data_validation.py): `src/data_validation.py`
- [Text preprocessing](https://github.com/donivishal/mlops-core-project/blob/master/src/preprocessing.py): `src/preprocessing.py`
- [Model training](https://github.com/donivishal/mlops-core-project/blob/master/src/train.py): `src/train.py`
- [Review data](https://github.com/donivishal/mlops-core-project/tree/master/data/raw): `data/raw`
- [Clean reviews](https://github.com/donivishal/mlops-core-project/tree/master/data/processed): `data/processed`
- [Model artifact](https://github.com/donivishal/mlops-core-project/tree/master/models): `models`

### Prediction serving

- [Feedback UI](https://github.com/donivishal/mlops-core-project/blob/master/ui/app.py): `ui/app.py`
- [Prediction API](https://github.com/donivishal/mlops-core-project/blob/master/api/main.py): `api/main.py`
- [Loaded model](https://github.com/donivishal/mlops-core-project/blob/master/api/main.py): `api/main.py`
- [Sentiment result](https://github.com/donivishal/mlops-core-project/blob/master/api/main.py): `api/main.py`

### Other components

- **Feedback user**
- **S3 bucket**
- **MLflow tracking**

## Connections

- Feedback user → Feedback UI: enters feedback
- Feedback UI → Prediction API: requests prediction
- Prediction API → Loaded model: transforms and predicts
- Loaded model → Sentiment result: returns sentiment
- Sentiment result → Feedback UI: displays result
- Kubeflow pipeline → Data validation: dispatches validation
- Kubeflow pipeline → Text preprocessing: dispatches after validation
- Kubeflow pipeline → Model training: dispatches after preprocessing
- Data validation → S3 bucket: downloads reviews
- Text preprocessing → S3 bucket: downloads reviews
- Model training → S3 bucket: downloads reviews
- Data validation → Review data: reads reviews
- Text preprocessing → Review data: reads reviews
- Text preprocessing → Clean reviews: writes cleaned data
- Model training → Clean reviews: reads training data
- Model training → Model artifact: saves model
- Model training → S3 bucket: uploads model
- Model training → MLflow tracking: logs metric
- Prediction API → S3 bucket: downloads model at startup
- Prediction API → Loaded model: loads model and vectorizer
