> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mov-eat.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Infrastructure

> How Moveat is hosted across Vercel, DigitalOcean, Mintlify, Komodo, Grafana and supporting services.

# Infrastructure

Moveat uses a pragmatic infrastructure model: managed hosting where it reduces work, and a DigitalOcean droplet where low-latency backend dependencies are useful.

The goal is not to introduce heavy orchestration too early. The goal is to keep the system understandable, observable and cheap to operate while the product loops are being validated.

## Hosting map

| Surface            | Hosting              | Reason                                                  |
| ------------------ | -------------------- | ------------------------------------------------------- |
| Web client         | Vercel               | Fast frontend deploys, previews and CDN delivery.       |
| Documentation      | Mintlify             | Documentation UI, search, navigation and custom domain. |
| Platform API       | DigitalOcean droplet | Backend close to PostgreSQL and Redis.                  |
| Agent API/webhook  | DigitalOcean droplet | WhatsApp webhook and backend orchestration.             |
| PostgreSQL         | DigitalOcean droplet | Low latency and direct ownership for current stage.     |
| Redis              | DigitalOcean droplet | Low-latency session and conversation state.             |
| Grafana/Loki/Alloy | DigitalOcean droplet | Local operational observability.                        |
| Komodo             | DigitalOcean droplet | Container management UI.                                |

## Domain map

| Domain                 | Owner              | Service               |
| ---------------------- | ------------------ | --------------------- |
| `api.mov-eat.app`      | DigitalOcean/Caddy | Platform.             |
| `agent.mov-eat.app`    | DigitalOcean/Caddy | Agent.                |
| `<grafana-domain>`     | DigitalOcean/Caddy | Grafana.              |
| `<ops-console-domain>` | DigitalOcean/Caddy | Komodo.               |
| `docs.mov-eat.app`     | Mintlify           | Documentation portal. |
| App domain/subdomain   | Vercel             | Frontend application. |

## DigitalOcean stack

The droplet runs the backend stack with Docker Compose. The core production services are:

<CardGroup cols={2}>
  <Card title="Caddy" icon="route">
    Terminates HTTPS and routes public domains to internal Docker services.
  </Card>

  <Card title="Platform" icon="server">
    Business backend and source of truth for product APIs.
  </Card>

  <Card title="Agent" icon="bot">
    Conversational service that receives channel events and calls Platform.
  </Card>

  <Card title="PostgreSQL" icon="database">
    Durable product database for users, meals, workouts and progress.
  </Card>

  <Card title="Redis" icon="memory-stick">
    Short-lived sessions, cache and conversation state.
  </Card>

  <Card title="Grafana + Loki + Alloy" icon="activity">
    Logs, dashboards, correlation search and operational analysis.
  </Card>
</CardGroup>

## Vercel role

Vercel should remain responsible for frontend delivery. The backend should not serve the web app directly unless there is a clear operational reason.

This gives the frontend team:

* Preview deployments.
* Fast rollback.
* CDN distribution.
* Separation from backend container lifecycle.

## Komodo role

Komodo is an operational tool, not the source of truth for the stack. The source of truth remains the `infra` repository and its Docker Compose files.

Use Komodo to inspect containers, restart services, check resource usage and access operational controls. Do not make permanent infrastructure changes only through the UI unless those changes are also reflected in the repository.

## Grafana role

Grafana is the first place to inspect production behavior:

* Platform errors.
* Agent errors.
* Request correlation IDs.
* Container logs.
* Database and service-level operational signals.

Grafana should help answer what happened. It should not become a replacement for structured application logs, tests or runbooks.

## Mintlify role

Mintlify hosts the documentation and reads the `docs` repository. The repository is the source of truth; Mintlify is the renderer and hosting layer.

This matters operationally: if the live docs do not match the repository, check the Mintlify Git connection, branch, deployment activity and root directory.

## Current trade-off

Running PostgreSQL and Redis inside the droplet is reasonable at this stage because it reduces latency and cost. The trade-off is that Moveat owns backups, monitoring and failure recovery.

As traffic grows, moving PostgreSQL to a managed database may become attractive. That decision should be based on operational load, backup requirements and uptime targets, not on architecture preference alone.
