# Manager

### 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="/files/vy03JYPwBcaEfhKyk6Ty" 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>`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.runvelocity.dev/components/manager.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
