# passeway/snell architecture

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

- Interactive diagram: https://gitdiagram.com/passeway/snell
- Repository: https://github.com/passeway/snell

## Overview

##### Project type and purpose
- This is an open-source “one-click” deployment tool (Bash scripts) for automatically installing and configuring a Snell proxy server on a Linux VPS (Debian/Ubuntu).
- Users simply run a single curl-pipe-bash command to fetch the installer (hosted via Vercel) and have a ready-to-go Snell service with randomized port and PSK, plus a client configuration URL.

##### File structure
- Top-level scripts:
- Snell.sh – the main installer (fetches Snell, sets up systemd, writes /etc/snell/snell-server.conf, outputs client URL)
- Snell-docker.sh + Snell-docker.md – alternative Docker-based deployment (pull Snell image, configure container)
- ipv6.sh – optional script to enable/configure IPv6 on the host before installing Snell
- Configuration/hosting:
- vercel.json – defines routing for the installer endpoint on Vercel
- Metadata:
- README.md – instructions, features, commands
- CHANGELOG, LICENSE

##### Key insights from README
- Project goal: fully automated Snell proxy server setup
- Users retrieve client config via a generated URL
- Common management commands via systemd are documented

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User initiates installer fetch
    User["User Local Machine"]:::infra
    Vercel["Vercel Installer Endpoint"]:::infra
    User -->|“curl GET”| Vercel
    Vercel -->|“returns Snell.sh”| VPS

    subgraph "VPS Host OS" 
        direction LR
        SnellInstaller["Snell.sh"]:::script
        IPv6Script["ipv6.sh"]:::script
        DockerInstaller["Snell-docker.sh"]:::script
        Systemd["snell.service"]:::service
        DockerEngine["Docker Engine"]:::service
        SnellNative["Snell Server (native)"]:::service
        SnellContainer["Snell Server (container)"]:::service
    end

    %% Installer execution flow
    VPS["VPS Host OS"]:::infra
    Vercel --> VPS
    VPS --> SnellInstaller
    SnellInstaller -->|“may invoke”| IPv6Script
    SnellInstaller -->|“native install”| SnellNative
    SnellInstaller -->|“if Docker”| DockerInstaller
    DockerInstaller --> DockerEngine
    DockerEngine --> SnellContainer
    SnellNative --> Systemd
    Systemd --> SnellNative

    %% Client connection
    Client["Client Device"]:::client
    Client -->|“Snell TCP connection”| SnellNative
    Client -->|“Snell TCP connection”| SnellContainer

    %% Documentation and Metadata
    subgraph "Project Metadata"
        direction TB
        Readme["README.md"]:::doc
        Changelog["CHANGELOG"]:::doc
        License["LICENSE"]:::doc
        DockerDoc["Snell-docker.md"]:::doc
        VercelConfig["vercel.json"]:::config
    end

    %% Click Events
    click SnellInstaller "https://github.com/passeway/snell/blob/main/Snell.sh"
    click IPv6Script "https://github.com/passeway/snell/blob/main/ipv6.sh"
    click DockerInstaller "https://github.com/passeway/snell/blob/main/Snell-docker.sh"
    click DockerDoc "https://github.com/passeway/snell/blob/main/Snell-docker.md"
    click VercelConfig "https://github.com/passeway/snell/blob/main/vercel.json"
    click Readme "https://github.com/passeway/snell/blob/main/README.md"
    click Changelog "https://github.com/passeway/snell/tree/main/CHANGELOG"
    click License "https://github.com/passeway/snell/tree/main/LICENSE"

    %% Styles
    classDef script fill:#f9f,stroke:#333,stroke-width:1px
    classDef service fill:#bbf,stroke:#333,stroke-width:1px
    classDef infra fill:#ddd,stroke:#333,stroke-width:1px
    classDef client fill:#afa,stroke:#333,stroke-width:1px
    classDef doc fill:#ffd,stroke:#333,stroke-width:1px
    classDef config fill:#dfd,stroke:#333,stroke-width:1px
```
