> For the complete documentation index, see [llms.txt](https://docs.runvelocity.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.runvelocity.dev/components/manager.md). Agents can also search and read this documentation through its [MCP server](https://docs.runvelocity.dev/~gitbook/mcp).

# Manager

The Manager is the API that handles CRUD operations for Velocity. The API is written in Go with the Echo framework.

### Deployment

You can deploy the manager on any platform that supports running Go applications. We will be making use of fly.io in our case.&#x20;

\
Head over to <https://fly.io> and create a new account if you don't have one already.  Next, download the `flyctl` CLI by following the instructions on [their website](https://fly.io/docs/hands-on/install-flyctl/) for your operating system. Now, run the following command to authenticate the CLI with your credentials.

```
flyctl auth login
```

<figure><img src="https://2271666689-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fniv7YUa4LBNpqc1Fl3Sg%2Fuploads%2FWfCRFHJTIGDwWOEdAy2Z%2Fimage.png?alt=media&amp;token=a84f934b-dc85-427b-9cf2-c5a9fa8848c2" alt=""><figcaption></figcaption></figure>

The actual deployment is as simple as running `flyctl deploy`. This will build your application and start a fly machine running the Manager API.

### Database

The Manager API uses Postgres to store data and as such you need to configure the API to connect to your database. The API expects DSN string set as an environment variable as so

```sh
DSN="user=postgres  password=postgres host=postgres database=postgres"
```

Make sure you replace the values for `user`, `password`, `host` and `database` with appropriate values depending on your setup

### Environment Variables

In addition to the DSN string set above, there are a few more environment variables you need to set.

* S3\_UPLOAD\_BUCKET: This is the name of the S3 bucket where the function code gets deployed.
* AWS\_ACCESS\_KEY\_ID: AWS access key allowing us to upload the function code to the S3 bucket
* AWS\_SECRET\_ACCESS\_KEY: AWS secret access key allowing us to upload the function code to the S3 bucket
* AWS\_REGION: The AWS region of the S3 bucket where the function code gets deployed.
* WORKER\_URL: This is the URL of the Windhoek API. If the Windhoek API is deployed on a single server, make sure you specify the `<ip_address>:<port>`
