# cuddles47/data-mining-team-assignment architecture

> Architecture diagram of the GitHub repository cuddles47/data-mining-team-assignment, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cuddles47/data-mining-team-assignment
- Repository: https://github.com/cuddles47/data-mining-team-assignment

## Overview

##### Project Type and Purpose
- This is a full-stack data mining tool focused on executing the Apriori algorithm (and related FPTree implementations) to discover frequent itemsets and generate association rules.
- It provides a simple user interface (via HTML/CSS and TypeScript) for inputting transaction data and displaying mining results.
- Key technologies include TypeScript, Node.js, Docker for containerization, and Webpack as the build tool.

##### Break Down the File Structure into Architectural Components
- Backend / Algorithm Engine:
– Located in the “src” folder, the primary logic is implemented in files like apriori.ts and fptree.ts.
– This component contains core algorithm implementations for data mining.
- Frontend / Presentation Layer:
– Found under the “web” directory with files such as app.ts, index.html, and styles.css.
– It serves as the UI layer where the user inputs data, configures parameters like Minimum Support/Confidence, and views the results.
- Data Management:
– Although minimal, the “data” directory (with data.csv) represents the data source input.
- Build and Configuration Tools:
– The presence of webpack.config.js, tsconfig.json, and package.json indicates the use of a modern TypeScript build/deployment system.
– GitHub workflows (deployment.yaml, webpack.yml) signify an integrated CI/CD pipeline.
- Containerization:
– Docker and Docker Compose files (as mentioned in the README) support containerized deployments, though these files might be placed at the top-level or integrated as part of the build process.

– User Interface / Client Browser: Represent the front-end web interface (index.html, app.ts, and styles.css).
– Application Server / Node.js Runtime: This is where the application runs using Node.js, integrating both the UI (served via web folder) and algorithm engine.
– Algorithm Engine: Specifically, the “src” code (apriori.ts, fptree.ts) that processes input transactions and computes itemsets and association rules.
– Data Source: The “data” folder (e.g., data.csv) as the input data that might be dynamically provided or preloaded.

b. Relationships and Data Flow:
– The User interacts with the UI (Client browser) by entering transaction data.
– The UI (using web/app.ts) sends the data to the Application Server.
– The server then calls the Algorithm Engine (from src) to process the transaction data.
– The processed results (frequent itemsets and association rules) are returned to the UI for display.
– Optionally, indicate how Docker and CI/CD are involved for deployment—showing that code moves from a repository through GitHub workflows, then into a Dockerized environment for consistent runtime conditions.

c. Important Architectural Patterns or Design Choices:
– Separation of Concerns: Clear division between the UI (web) and algorithm logic (src).
– Modular Design: Using separate modules for the algorithm implementations allows possible future extension (for additional data mining techniques).
– CI/CD Integration: Incorporation of GitHub workflows to automate build and deployment processes.

d. Technologies and Tools to be Highlighted:
– TypeScript is used throughout, both in the UI (web/app.ts) and the algorithm engine (src folder).
– Node.js as the runtime environment.
– Webpack as the bundler.
– Docker for containerization.
– GitHub Actions to automate deployment and build processes.

## Diagram (Mermaid)

```mermaid
graph TD
    USER["User Browser"]:::frontend

    subgraph "Frontend / Presentation Layer"
        UI["UI (web)"]:::frontend
        HTML["index.html"]:::frontend
        APP["app.ts"]:::frontend
        CSS["styles.css"]:::frontend
    end

    SERVER["Node.js Application Server"]:::backend

    subgraph "Backend / Algorithm Engine"
        APR["Apriori Algorithm"]:::backend
        FPT["FPTree Algorithm"]:::backend
    end

    DS["Data Source (CSV data)"]:::data

    subgraph "Build and Configuration Tools"
        WEBPACK["webpack.config.js"]:::infrastructure
        TSCONFIG["tsconfig.json"]:::infrastructure
        PKG["package.json"]:::infrastructure
    end

    subgraph "CI/CD Pipeline"
        DEPLOY["deployment.yaml"]:::infrastructure
        WEBPACK_YML["webpack.yml"]:::infrastructure
    end

    DOCKER["Docker Container"]:::infrastructure
    REPO["Code Repository"]:::infrastructure

    %% Data flow connections
    USER -->|"input data"| UI
    UI -->|"send request"| SERVER
    SERVER -->|"executes apriori"| APR
    SERVER -->|"executes fptree"| FPT
    APR -->|"returns results"| SERVER
    FPT -->|"returns results"| SERVER
    SERVER -->|"displays results"| UI
    DS -->|"provides data"| SERVER

    %% Deployment and build connections
    REPO -->|"triggers build"| DEPLOY
    REPO -->|"triggers build"| WEBPACK_YML
    DEPLOY -->|"deploys"| DOCKER
    WEBPACK_YML -->|"deploys"| DOCKER
    DOCKER -->|"runs"| SERVER
    WEBPACK -->|"bundles"| SERVER
    TSCONFIG -->|"configures"| SERVER
    PKG -->|"manages deps"| SERVER

    %% Click Events
    click HTML "https://github.com/cuddles47/data-mining-team-assignment/blob/main/web/index.html"
    click APP "https://github.com/cuddles47/data-mining-team-assignment/blob/main/web/app.ts"
    click CSS "https://github.com/cuddles47/data-mining-team-assignment/blob/main/web/styles.css"
    click APR "https://github.com/cuddles47/data-mining-team-assignment/blob/main/src/apriori.ts"
    click FPT "https://github.com/cuddles47/data-mining-team-assignment/blob/main/src/fptree.ts"
    click DS "https://github.com/cuddles47/data-mining-team-assignment/blob/main/data/data.csv"
    click WEBPACK "https://github.com/cuddles47/data-mining-team-assignment/blob/main/webpack.config.js"
    click TSCONFIG "https://github.com/cuddles47/data-mining-team-assignment/blob/main/tsconfig.json"
    click PKG "https://github.com/cuddles47/data-mining-team-assignment/blob/main/package.json"
    click DEPLOY "https://github.com/cuddles47/data-mining-team-assignment/blob/main/.github/workflows/deployment.yaml"
    click WEBPACK_YML "https://github.com/cuddles47/data-mining-team-assignment/blob/main/.github/workflows/webpack.yml"

    %% Styles
    classDef frontend fill:#A8E6CF,stroke:#56ab7c,stroke-width:2px;
    classDef backend fill:#FFD3B6,stroke:#FF8C00,stroke-width:2px;
    classDef data fill:#D1C4E9,stroke:#673AB7,stroke-width:2px;
    classDef infrastructure fill:#FFAAA7,stroke:#FF5722,stroke-width:2px;
```
