# sharkz0912/creditcard-fraud-detection architecture

> Architecture diagram of the GitHub repository sharkz0912/creditcard-fraud-detection, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sharkz0912/creditcard-fraud-detection
- Repository: https://github.com/sharkz0912/creditcard-fraud-detection

## Overview

##### Project type and purpose
- This is a machine-learning pipeline project (“creditcard-fraud-detection”) focused on detecting fraudulent credit-card transactions.
- Key indicators:
- data/ and data/processed/ directories for raw and cleaned data
- notebooks/ folder with EDA, feature engineering, modeling notebooks
- mlruns/ directory suggests use of MLflow for experiment tracking
- src/ directory for code modules and tests/ for unit/integration tests
- Dockerfile and requirements.txt for containerization and reproducible environment

##### File structure
- Top-level directories:
- data/ – source of truth for raw and processed data
- notebooks/ – exploratory and iterative pipeline steps
- mlruns/ – experiment tracking and metadata storage
- src/ – production code (data ingestion, preprocessing, model training, inference)
- tests/ – test suite for code quality and correctness
- Configuration/deployment files:
- Dockerfile – container build instructions
- requirements.txt – Python dependencies

##### README
- Although minimal, project name reveals its domain: credit-card fraud detection.
- No further architecture notes, so everything comes from directory conventions.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Data Storage Layer
    subgraph "Data Storage"
        Raw["Raw Data Store"]:::dataStore
        Processed["Processed Data Store"]:::dataStore
    end

    %% Data Processing Layer
    subgraph "Data Processing Module"
        EDA["Exploratory Data Analysis"]:::compute
        FE["Preprocessing & Feature Engineering"]:::compute
    end

    %% Modeling Layer
    subgraph "Modeling Module"
        Modeling["Training & Validation"]:::compute
    end

    %% Experiment Tracking Service
    Experiment["MLflow Server"]:::service

    %% Inference Layer
    Inference["Inference/Scoring Endpoint"]:::service

    %% Code & Tests
    subgraph "Codebase & Tests"
        Src["src/ (Production Code)"]:::code
        Tests["tests/ (Test Suite)"]:::code
    end

    %% Deployment Environment
    Req["requirements.txt"]:::infra
    Deploy["Docker Container"]:::infra

    %% Data Flow
    Raw -->|"input for EDA"| EDA
    EDA -->|"features defined"| FE
    FE -->|"output processed data"| Processed
    Processed -->|"trains model"| Modeling
    Modeling -->|"model artifacts"| Inference

    %% Experiment Tracking
    FE -->|"logs metrics"| Experiment
    Modeling -->|"logs experiments"| Experiment

    %% Code & Tests Dependencies
    Src -->|"implements logic"| FE
    Src -->|"implements logic"| Modeling
    Src -->|"implements logic"| Inference
    Tests -->|"validates logic"| FE
    Tests -->|"validates logic"| Modeling

    %% Deployment Relationships
    Req -->|"defines deps"| Deploy
    Deploy -.->|"env for"| FE
    Deploy -.->|"env for"| Modeling
    Deploy -.->|"env for"| Experiment
    Deploy -.->|"env for"| Inference

    %% Click Events
    click Raw "https://github.com/sharkz0912/creditcard-fraud-detection/tree/main/data/"
    click Processed "https://github.com/sharkz0912/creditcard-fraud-detection/tree/main/data/processed/"
    click FE "https://github.com/sharkz0912/creditcard-fraud-detection/blob/main/notebooks/Feature_Engineering.ipynb"
    click Modeling "https://github.com/sharkz0912/creditcard-fraud-detection/blob/main/notebooks/Modeling.ipynb"
    click EDA "https://github.com/sharkz0912/creditcard-fraud-detection/blob/main/notebooks/EDA.ipynb"
    click Experiment "https://github.com/sharkz0912/creditcard-fraud-detection/tree/main/mlruns/"
    click Src "https://github.com/sharkz0912/creditcard-fraud-detection/tree/main/src/"
    click Tests "https://github.com/sharkz0912/creditcard-fraud-detection/tree/main/tests/"
    click Deploy "https://github.com/sharkz0912/creditcard-fraud-detection/tree/main/Dockerfile"
    click Req "https://github.com/sharkz0912/creditcard-fraud-detection/blob/main/requirements.txt"

    %% Styles
    classDef dataStore fill:#BBDEFB,stroke:#1E88E5,stroke-width:2px;
    classDef compute fill:#C8E6C9,stroke:#388E3C,stroke-width:2px;
    classDef service fill:#FFE0B2,stroke:#F57C00,stroke-width:2px;
    classDef code fill:#E0E0E0,stroke:#616161,stroke-width:2px;
    classDef infra fill:#D1C4E9,stroke:#5E35B1,stroke-width:2px;
```
