# Technical Documentation: VERT-sh/VERT

> ℹ️ **Provenance:** Multi-Tier Ingestion · [CodeWiki Reference](https://codewiki.google/github.com/VERT-sh/VERT)

### Overview (`README.md`)

<p align="center">
  <img src="https://github.com/user-attachments/assets/bf441748-0ec5-4c8a-b3e5-11301ee3f0bd" alt="VERT's logo" height="100">
</p>
<h1 align="center"><a href="https://vert.sh">VERT.sh</a></h1>

VERT is a file conversion utility that uses WebAssembly to convert files on your device instead of a cloud. Check out the live instance at [vert.sh](https://vert.sh).

VERT is built in Svelte and TypeScript.

## Screenshots

|                     Upload page                      |                     Conversion page                      |
| :--------------------------------------------------: | :------------------------------------------------------: |
|  |  |

## Features

- Convert files directly on your device using WebAssembly\*
- No file or file size limits
- Convert images, audio, documents, and video\*
- Supports over **250+** file formats
- Conversion settings
- User-friendly interface built with Svelte

<sup>\* Local video conversion in-browser is supported, but some conversion may require server-side processing. Server video conversion is available with our official instance, but the [daemon](https://github.com/VERT-sh/vertd) is easily self-hostable to maintain privacy and fully local functionality.</sup>

## Documentation

- [FAQ](./docs/FAQ.md)
- [Getting Started](./docs/GETTING_STARTED.md)
- [Using Docker](./docs/DOCKER.md)
- [Video Conversion](./docs/VIDEO_CONVERSION.md)

## Contributing

Refer to our contributing guidelines before opening an issue or pull request here: [CONTRIBUTING.md](./CONTRIBUTING.md)

## License

This project is licensed under the AGPL-3.0 License, please see the [LICENSE](LICENSE) file for details.

## Star History

<a href="https://star-history.dera.page/#VERT-sh/VERT&Date">
 <picture>
   <source media="(prefers-color-scheme: dark)" srcset="https://star-history.dera.page/svg?repos=VERT-sh/VERT&type=Date&theme=dark" />
   <source media="(prefers-color-scheme: light)" srcset="https://star-history.dera.page/svg?repos=VERT-sh/VERT&type=Date" />
   <img alt="Star History Chart" src="https://star-history.dera.page/svg?repos=VERT-sh/VERT&type=Date" />
 </picture>
</a>

---

### DOCKER (`docs/DOCKER.md`)

## Using Docker

This file covers how to run VERT under a Docker container.

- [Manually building the image](#manually-building-the-image)
- [Using an image from the GitHub Container Registry](#using-an-image-from-the-github-container-registry)

### Manually building the image

First, clone the repository:

```shell
git clone https://github.com/VERT-sh/VERT
cd VERT/
```

Then build a Docker image with:

```shell
docker build -t vert-sh/vert \
    --build-arg PUB_ENV=production \
    --build-arg PUB_HOSTNAME=vert.sh \
    --build-arg PUB_PLAUSIBLE_URL=https://plausible.example.com \
    --build-arg PUB_VERTD_URL=https://vertd.vert.sh \
    --build-arg PUB_DONATION_URL=https://donations.vert.sh \
	--build-arg PUB_DISABLE_ALL_EXTERNAL_REQUESTS=false \
    --build-arg PUB_STRIPE_KEY="" .
```

You can then run it by using:

```shell
docker run -d \
    --restart unless-stopped \
    -p 3000:80 \
    --name "vert" \
    vert-sh/vert
```

This will do the following:

- Use the previously built image as the container `vert`, in detached mode
- Continuously restart the container until manually stopped
- Map `3000/tcp` (host) to `80/tcp` (container)

We also have a [`docker-compose.yml`](/docker-compose.yml) file available. Use `docker compose up` if you want to start the stack, or `docker compose down` to bring it down. You can pass `--build` to `docker compose up` to rebuild the Docker image (useful if you've changed any of the environment variables) as well as `-d` to start it in detached mode. You can read more about Docker Compose in general [here](https://docs.docker.com/compose/intro/compose-application-model/).

### Using an image from the GitHub Container Registry

While there's an image you can pull instead of cloning the repo and building the image yourself, you will not be able to update any of the environment variables (e.g. `PUB_PLAUSIBLE_URL`) as they're baked directly into the image and not obtained during runtime. If you're okay with this, you can simply run this command instead:

```shell
docker run -d \
    --restart unless-stopped \
    -p 3000:80 \
    --name "vert" \
    ghcr.io/vert-sh/vert:latest
```

---

### FAQ (`docs/FAQ.md`)

## FAQ

This file covers frequently asked questions.

- [Why VERT?](#why-vert)
- [What happens with video files?](#what-happens-with-video-files)
- [Can I host my own video file converter?](#can-i-host-my-own-video-file-converter)
- [What about analytics?](#what-about-analytics)
- [What libraries does VERT use?](#what-libraries-does-vert-use)
- [Is it possible to fully prevent VERT from making requests to external services?](#is-it-possible-to-fully-prevent-vert-from-making-requests-to-external-services)

### Why VERT?

**File converters have always disappointed us.** They're ugly, riddled with ads, and most importantly; slow. We decided to solve this problem once and for all by making an alternative that solves all those problems, and more.

All non-video files are converted completely on-device; this means that there's no delay between sending and receiving the files from a server, and we never get to snoop on the files you convert.

### What happens with video files?

Video files get uploaded to our lightning-fast RTX 4000 Ada server. Your videos stay on there for an hour if you do not convert them. If you do convert the file, the video will stay on the server for an hour, or until it is downloaded. The file will then be deleted from our server.

### Can I host my own video file converter?

Yes. Check out the [Video Conversion](./VIDEO_CONVERSION.md) page.

### What about analytics?

We use [Plausible](https://plausible.io/privacy-focused-web-analytics), a privacy-focused analytics tool, to gather completely anonymous statistics. All data is anonymized and aggregated, and no identifiable information is ever sent or stored. You can view the analytics [here](https://ats.vert.sh/vert.sh) and choose to opt out in the [Settings](https://vert.sh/settings/) page.

### Is it possible to fully prevent VERT from making requests to external services?

Yes! If you would prefer VERT to not make any requests to external services (video conversion, analytics, among others), you can set the `PUB_DISABLE_ALL_EXTERNAL_REQUESTS` environment variable to `true` **during build time**.

### What libraries does VERT use?

VERT uses FFmpeg for audio and video conversion, imagemagick for images and Pandoc for documents. A big thanks to them for maintaining such excellent libraries for so many years.

---

### GETTING STARTED (`docs/GETTING_STARTED.md`)

## Getting Started

This file covers how to get started with VERT.

- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Running Locally](#running-locally)
- [Building for Production](#building-for-production)
- [Using Docker](#using-docker)

### Prerequisites

Make sure you have the following installed:

- [Bun](https://bun.sh/)

### Installation

First, clone the repository:

```sh
git clone https://github.com/VERT-sh/VERT
cd VERT/
```

Install dependencies:

```sh
bun i
```

And finally, make sure you create a `.env` file in the root of the project. We've included a [`.env.example`](../.env.example) file which you can use to get started.

### Running Locally

To run the project locally, run `bun dev`.

This will start a development server. Open your browser and navigate to `http://localhost:5173` to see the application.

### Building for Production

To build the project for production, run `bun run build`.

This will build the site to the `build` folder. You should then use a web server like [nginx](https://nginx.org) to serve the files inside that folder.

### Using Docker

Check the dedicated [Docker](./DOCKER.md) page.

---

### VIDEO CONVERSION (`docs/VIDEO_CONVERSION.md`)

## Video conversion

This file covers how video conversion works when using VERT.

On VERT, video processing is done locally in your browser whenever possible using [Mediabunny](https://mediabunny.dev). However, some conversions may require server-side processing if it's unsupported or too slow to do it in the browser for some reason.

Server-side processing is done through [`vertd`](https://github.com/VERT-sh/vertd), which is a simple FFmpeg wrapper built in Rust. If you don't understand all that technical jargon, it basically allows you to convert videos using the full capacity of your computer, which results in more conversions supported and being much faster. It runs on your computer (or a server somewhere, if you know what you're doing), and the VERT web interface reaches out to it in order to convert your videos, if it requests for it.

We host an official instance of [`vertd`](https://github.com/VERT-sh/vertd) so you do not have to host it yourself for convenience, but considering you're here, you probably want to host it for yourself. Essentially:

- Download the latest release of `vertd` for your machine [here](https://github.com/VERT-sh/vertd/releases)
- Run the server
- Connect the VERT UI to your local `vertd` instance by entering its IP & port
    - By default, `vertd` runs a HTTP server on port `24153`, so you would put `http://localhost:24153` in the "Instance URL" setting found in VERT's settings (assuming you are running it on your own PC)

---

--- METRICS ---
- Files Extracted: 5
- Estimated Token Budget: ~2367 tokens
- Canonical Reference: https://codewiki.google/github.com/VERT-sh/VERT
