# High level overview

The figure below shows a high level architecture of the Uptime Manager.

<figure><img src="https://content.gitbook.com/content/pfnwqCindDJzAQkOR2tA/blobs/Vw4U1RnTeN5VXx0DnU7N/Screenshot%202024-10-04%20at%209.28.27%E2%80%AFAM.png" alt=""><figcaption></figcaption></figure>

### Typical auth request overview

The following diagram describes a typical request to the /auth endpoints.

<figure><img src="https://content.gitbook.com/content/pfnwqCindDJzAQkOR2tA/blobs/a8cPE0SQE2pBFpvjIDLZ/Screenshot%202024-10-04%20at%209.30.30%E2%80%AFAM.png" alt=""><figcaption></figcaption></figure>

### Typical monitor request overview

The following diagram describes a typical request to the `/monitors` endpoints.

<figure><img src="https://content.gitbook.com/content/pfnwqCindDJzAQkOR2tA/blobs/yTyFDtt6Cn5vDqlMyAhO/Screenshot%202024-10-04%20at%2012.13.55%E2%80%AFPM.png" alt=""><figcaption></figcaption></figure>

### JobQueue

The heart of this application is a `JobQueue` class that wraps a BullMQ `Queue`. \
\
A `Monitor` is considered a job, when one is created it is enqueued in the `JobQueue`.\
\
Jobs are handled by a pool of workers in the `JobQueue` and their tasks are executed in the order in which they are enqueued.\
\
Workers are scaled up and down based on the jobs/worker ratio as jobs are enqueued and dequeued.

#### **High level overview of the JobQueue**<br>

<figure><img src="https://content.gitbook.com/content/pfnwqCindDJzAQkOR2tA/blobs/Dc0PrFyoSZpujLRAhwN9/Screenshot%202024-10-04%20at%2012.17.44%E2%80%AFPM.png" alt=""><figcaption></figcaption></figure>

### SSL

SSL is handled by LetsEncrypt and Certbot.  This works by Nginx and Certbot sharing the same volume where the certificates are held.  The following snippet from the docker-compose.yaml file shows how this works.<br>

<figure><img src="https://content.gitbook.com/content/pfnwqCindDJzAQkOR2tA/blobs/dXVWZ8HdEow8TA47P6nP/Screenshot%202024-10-04%20at%2012.20.52%E2%80%AFPM.png" alt=""><figcaption></figcaption></figure>

Please see [this guide](https://phoenixnap.com/kb/letsencrypt-docker) for more information on this setup.

\
\ <br>

\ <br>

<br>
