> ## 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.

# System architecture

> High-level architecture of Moveat and ownership boundaries between services.

# System architecture

Moveat uses a simple service split:

* **Platform** owns business data and rules.
* **Agent** owns conversation orchestration.
* **Client** owns the user interface.
* **Infra** owns runtime composition, reverse proxy, database, Redis and observability.

```mermaid theme={null}
graph LR
    Client[Web Client] --> Platform[Platform API]
    Agent[Agent] --> Platform
    Platform --> Postgres[(PostgreSQL)]
    Platform --> Redis[(Redis)]
    Agent --> Redis
    Agent --> WhatsApp[WhatsApp Cloud API]
    Agent --> LLM[LLM Provider]
    Caddy[Caddy] --> Platform
    Caddy --> Agent
    Caddy --> Grafana[Grafana]
```

## Platform boundary

Platform is the source of truth. It owns:

* Auth sessions.
* Users.
* Profiles.
* Goals.
* Nutrition settings.
* Meal entries.
* Daily summaries.
* Weight logs.
* Workout logs.
* Internal APIs for Agent.

## Agent boundary

Agent does not own durable business data. It owns:

* Incoming channel webhooks.
* Message normalization.
* LLM provider calls.
* Intent detection.
* Clarification flows.
* Short-lived Redis state.
* Calls into Platform internal APIs.

## Why this split exists

The split keeps conversational complexity out of the business backend while ensuring that the official product state remains centralized.

If Agent makes a wrong interpretation, Platform still validates and stores the final business action consistently.

## Deployment shape

The current production setup runs on a DigitalOcean droplet using Docker Compose. Caddy handles HTTPS and reverse proxying.

Current production services include:

* Platform.
* Agent.
* PostgreSQL.
* Redis.
* Caddy.
* Grafana.
* Loki.
* Alloy.
* Komodo.

This is intentionally pragmatic for the current stage. The architecture allows future migration to managed services or orchestration when the product requires it.
