# Deployment Guide

## Target

```text
root@187.77.119.32:/root/hermes-projects/Activity Reminder Bot
```

Always quote the remote path:

```bash
cd "/root/hermes-projects/Activity Reminder Bot"
```

## VPS Setup

```bash
ssh root@187.77.119.32
mkdir -p "/root/hermes-projects/Activity Reminder Bot"
cd "/root/hermes-projects/Activity Reminder Bot"
cp .env.example .env
nano .env
```

Required values:

```text
TELEGRAM_BOT_TOKEN
GOOGLE_SHEETS_SPREADSHEET_ID
GOOGLE_SERVICE_ACCOUNT_JSON_BASE64
```

## Encode Google Service Account JSON

On a trusted local machine:

```bash
base64 -w 0 service-account.json
```

Paste the result into:

```text
GOOGLE_SERVICE_ACCOUNT_JSON_BASE64=...
```

Share the target spreadsheet with the service account email as editor.

## Run

```bash
docker compose build
docker compose up -d
docker compose ps
curl http://127.0.0.1:8022/health
curl http://127.0.0.1:8022/ready
```

## Logs

```bash
docker compose logs -f api
docker compose logs -f bot
```

## Recreate After Env Changes

```bash
docker compose up -d --force-recreate
```

## Manual Smoke Test

1. Open the bot in Telegram and run `/start`.
2. Send `Besok jam 08:00 meeting dengan klien`.
3. Confirm the preview.
4. Check the row in Google Sheets.
5. Create a reminder due in 1-2 minutes.
6. Confirm the alarm arrives.
7. Test snooze, reschedule, done, delete, search, today, and week views.

