# itmc-dev/icast-server-infinity architecture

> Architecture diagram of the GitHub repository itmc-dev/icast-server-infinity, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/itmc-dev/icast-server-infinity
- Repository: https://github.com/itmc-dev/icast-server-infinity

## Overview

##### Project Type & Purpose
- This is a containerized audio streaming server solution that leverages Icecast. Its goal is to provide a quick way to set up an Icecast server (with a pre-configured icecast.xml) so that streamers can broadcast audio using clients such as BUTT.

##### Main Components
a. Docker Host:
- Physical/virtual host running Docker.
- This is where the Docker daemon and docker-compose provide orchestration.
b. Docker Container (Icecast Server):
- A container built using the Dockerfile.
- Contains the Icecast server software configured using the icecast.xml file.
- Container’s exposed ports (e.g., port 4500 for admin/dashboard, port 8000 or the relevant mount point for streaming/audio).
c. docker-compose Orchestration:
- Docker-compose configuration as an orchestration layer that manages the lifecycle of the Icecast server container.
d. External Clients & Tools:
- BUTT, Liquidsoap, or any other streaming software that sends the audio stream.
- Web browsers or API clients that access the Icecast admin interface and stream playback endpoints.
e. Network and Port Mappings:
- How the host's ports (4500 for admin, 8000/stream for audio) are mapped to the container, allowing external access to the Icecast server.
- Data flow from the client to the Docker container and vice versa.

##### Relationships and Interactions
- A connection between the docker-compose orchestration and the Docker container (Icecast Server) to emphasize that docker-compose is used to build, run, and manage the container lifecycle.

##### Architectural Patterns and Technologies
- Containerization: Clearly specify that Docker is the primary technology for encapsulating the Icecast service.
- Configuration as Code: Show that the icecast.xml and Dockerfile provide the environment and configuration needed to deploy the service.
- Microservice (Single Service): While this project runs a single service, note the separation between the service (Icecast) and the client connections that trigger streaming and admin requests.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Clients
    extStream["Streaming Client (BUTT, Liquidsoap)"]:::external
    extAdmin["Web Browser (Admin Interface)"]:::external

    %% Network Port Mapping Subgraph
    subgraph "Network Port Mapping"
        adminPort["Host Port 4500 (Admin)"]:::port
        streamPort["Host Port 8000 (Streaming)"]:::port
    end

    %% Docker Host Subgraph
    subgraph "Docker Host"
        compose["Docker Compose (Orchestration)"]:::orchestration
        container["Icecast Server Container"]:::container
    end

    %% Configuration & Build Files (External to Docker Host)
    build["Dockerfile (Build & Setup)"]:::build
    config["icecast.xml (Configuration)"]:::config

    %% Connections from External Clients to Network Mapping
    extStream -->|"sends_stream"| streamPort
    extAdmin  -->|"accesses"| adminPort

    %% Connections from Network Mapping to Docker Container
    streamPort -->|"maps_to"| container
    adminPort  -->|"maps_to"| container

    %% Docker Compose managing the Container
    compose -->|"deploys"| container

    %% Dockerfile and Configuration used by the Container
    build -->|"builds"| container
    config -->|"mounts_to"| container

    %% Click Events for Component Mapping
    click build "https://github.com/itmc-dev/icast-server-infinity/tree/dev/./Dockerfile"
    click config "https://github.com/itmc-dev/icast-server-infinity/blob/dev/./icecast.xml"
    click compose "https://github.com/itmc-dev/icast-server-infinity/blob/dev/./docker-compose.yml"

    %% Styles
    classDef external fill:#f9e79f,stroke:#d35400,stroke-width:2px;
    classDef port fill:#aed6f1,stroke:#1f618d,stroke-width:2px;
    classDef orchestration fill:#f5b7b1,stroke:#943126,stroke-width:2px;
    classDef container fill:#a9dfbf,stroke:#196f3d,stroke-width:2px;
    classDef build fill:#f9c7c7,stroke:#c0392b,stroke-width:2px;
    classDef config fill:#fad7a0,stroke:#ca6f1e,stroke-width:2px;
```
