# sammwyy/mikumikubeam architecture

> Architecture diagram of the GitHub repository sammwyy/mikumikubeam, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sammwyy/mikumikubeam
- Repository: https://github.com/sammwyy/mikumikubeam

## Overview

##### Main Components Identification

a) Frontend Layer:
- Located in /src directory
- React-based UI with TypeScript
- Vite as the build tool
- Tailwind CSS for styling

b) Backend Layer:
- Located in /server directory
- Node.js server with TypeScript
- Worker-based architecture for attack handling

c) Data Layer:
- Located in /data directory
- Stores proxies and user agents

##### Architectural Pattern

a) Worker-based Architecture:
- Main server process
- Separate worker processes for different attack types:
- HTTP Flood Worker
- HTTP Slowloris Worker
- Minecraft Ping Worker
- TCP Flood Worker

b) Client-Server Communication:
- WebSocket or HTTP communication between frontend and backend
- Real-time attack statistics and control

##### Component Relationships

a) Frontend to Backend:
- Attack configuration requests
- Real-time status updates
- Proxy/UA management

b) Backend to Workers:
- Worker initialization
- Attack parameter passing
- Status reporting

c) Workers to Targets:
- Attack execution flows
- Proxy utilization

##### Flow Directions

- User interactions → Frontend
- Frontend ↔ Backend communication
- Backend → Worker initialization
- Workers → Target systems
- Data stores → Workers (proxy/UA usage)

##### Additional Elements

Include:
- System boundaries
- External interfaces (target systems)
- Network protocols used (HTTP, TCP, WebSocket)

##### Technical Details

Annotations for:
- Port numbers (3000 for server, 5173 for frontend)
- Worker thread management
- Attack method configurations
- Real-time data flow

Remember to include notes about the scalability aspects of the worker-based architecture and how it enables multiple attack types to run concurrently without impacting the main application's performance.

This system design should effectively communicate both the technical architecture and the user interaction flow while maintaining the project's unique characteristics as a network stress testing tool.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        UI["UI Layer"]:::frontend
        AC["Attack Configuration"]:::frontend
        RV["Real-time Visualization"]:::frontend
        FE["File Editor Interface"]:::frontend
        
        UI --> AC
        UI --> RV
        UI --> FE
    end

    subgraph Backend
        MS["Main Server"]:::backend
        FL["File Loader"]:::backend
        PU["Proxy Utils"]:::backend
        AC_B["Attack Coordinator"]:::backend
        
        MS --> FL
        MS --> PU
        MS --> AC_B
    end

    subgraph Workers
        HF["HTTP Flood Worker"]:::worker
        HS["HTTP Slowloris Worker"]:::worker
        MP["Minecraft Ping Worker"]:::worker
        TF["TCP Flood Worker"]:::worker
    end

    subgraph Data
        PR["Proxies.txt"]:::data
        UA["User Agents.txt"]:::data
    end

    subgraph Utils
        MCU["Minecraft Utils"]:::util
        RU["Random Utils"]:::util
    end

    Frontend <--> MS
    AC_B --> Workers
    PR --> Workers
    UA --> Workers
    MCU --> MP
    RU --> Workers

    %% Click Events
    click UI "https://github.com/sammwyy/MikuMikuBeam/tree/main/src"
    click MS "https://github.com/sammwyy/MikuMikuBeam/blob/main/server/index.ts"
    click FL "https://github.com/sammwyy/MikuMikuBeam/blob/main/server/fileLoader.ts"
    click PU "https://github.com/sammwyy/MikuMikuBeam/blob/main/server/proxyUtils.ts"
    click HF "https://github.com/sammwyy/MikuMikuBeam/blob/main/server/workers/httpFloodAttack.js"
    click HS "https://github.com/sammwyy/MikuMikuBeam/blob/main/server/workers/httpSlowlorisAttack.js"
    click MP "https://github.com/sammwyy/MikuMikuBeam/blob/main/server/workers/minecraftPingAttack.js"
    click TF "https://github.com/sammwyy/MikuMikuBeam/blob/main/server/workers/tcpFloodAttack.js"
    click PR "https://github.com/sammwyy/MikuMikuBeam/blob/main/data/proxies.txt"
    click UA "https://github.com/sammwyy/MikuMikuBeam/blob/main/data/uas.txt"
    click MCU "https://github.com/sammwyy/MikuMikuBeam/blob/main/server/utils/mcUtils.js"
    click RU "https://github.com/sammwyy/MikuMikuBeam/blob/main/server/utils/randomUtils.js"

    %% Styles
    classDef frontend fill:#3b82f6,color:white
    classDef backend fill:#22c55e,color:white
    classDef worker fill:#f97316,color:white
    classDef data fill:#eab308,color:black
    classDef util fill:#a855f7,color:white

    %% Legend
    subgraph Legend
        F[Frontend]:::frontend
        B[Backend]:::backend
        W[Workers]:::worker
        D[Data Storage]:::data
        U[Utilities]:::util
    end
```
