# ruddhaani/disposable-browser-docker architecture

> Architecture diagram of the GitHub repository ruddhaani/disposable-browser-docker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ruddhaani/disposable-browser-docker
- Repository: https://github.com/ruddhaani/disposable-browser-docker

## Overview

##### Project type and purpose
- This is a small, containerized “Disposable Browser” tool. It’s neither a full-stack web app nor a compiler; instead, it’s an open-source privacy/security utility packaged in Docker.
- Purpose: Launch a Firefox browser in an isolated container, route all traffic through Tor, and use a non-root user. Mount the X11 socket so the GUI appears on the host.

##### File structure
- Top level:
- Dockerfile – the only build artifact.
- README.md – describes usage, features, network setup.
- No source subfolders; the container image encapsulates all logic.
- Dockerfile likely:
- Starts from Ubuntu 20.04
- Installs Tor, Firefox
- Adds a non-root user
- Configures Tor as a SOCKS proxy
- Exposes GUI via X11 socket mount
- No microservices or MVC; this is a single-container design with host-to-container integrations.

##### Key insights from README
- Core components: Docker image, Ubuntu base, Firefox, Tor network
- Two deployment modes:
- Direct run (mount X11, DISPLAY env)
- Isolated network run (custom Docker bridge network)
- Use cases: anonymous browsing, app testing in isolation, privacy protection

a. Main components
1. Host machine
- Docker Engine
- X11 server
2. Docker container
- OS layer (Ubuntu 20.04)
- Tor daemon (local SOCKS proxy)
- Firefox browser (non-root user)
3. External Tor network
b. Relationships & interactions
- Host X11 socket → mounted into container → Firefox draws GUI → X server on host displays windows
- Firefox → SOCKS proxy at localhost:9050 (Tor) → Tor network → Internet
- Docker Engine → manages container lifecycle
- (Optional) Docker bridge network isolates container’s network namespace
c. Architectural patterns / principles
- Containerization for isolation
- Principle of least privilege (non-root user inside container)
- Defense in depth (isolated Docker network if needed)
d. Technologies / frameworks
- Docker (image build & runtime)
- Ubuntu 20.04 base image
- Tor (anonymity network)
- Firefox (GUI application)
- X11 (display forwarding)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Host Layer
    subgraph "Host Machine"
        direction TB
        DockerEngine["Docker Engine"]:::host
        X11Server["X11 Server"]:::host
    end

    %% Container Layer
    subgraph "Docker Container"
        direction TB
        Ubuntu["Ubuntu 20.04"]:::container
        TorDaemon["Tor Daemon\n(SOCKS Proxy localhost:9050)"]:::container
        Firefox["Firefox\n(non-root user)"]:::container
    end

    %% External Layer
    subgraph "External Systems"
        direction TB
        TorNetwork["Tor Network"]:::external
        Internet["Internet"]:::external
    end

    %% Project Artifacts
    subgraph "Project Artifacts"
        direction TB
        Dockerfile["Dockerfile"]:::artifacts
        README["README.md"]:::artifacts
    end

    %% Connections
    DockerEngine -->|manages container| Ubuntu
    X11Server -->|X11 socket mount\nDISPLAY env| Firefox
    Firefox -->|connects to SOCKS proxy| TorDaemon
    TorDaemon -->|routes traffic| TorNetwork
    TorNetwork -->|exits to| Internet

    %% Click Events
    click Dockerfile "https://github.com/ruddhaani/disposable-browser-docker/tree/main/Dockerfile"
    click README "https://github.com/ruddhaani/disposable-browser-docker/blob/main/README.md"

    %% Styles
    classDef host fill:#fdf6e3,stroke:#b58900,stroke-width:1px;
    classDef container fill:#eee8d5,stroke:#859900,stroke-width:1px;
    classDef external fill:#f0fff4,stroke:#2aa198,stroke-width:1px;
    classDef artifacts fill:#fbe9e7,stroke:#d84315,stroke-width:1px;
```
