Skip to main content

Local setup

LogLife is developed and tested on Linux. If you are on Windows, use WSL. macOS may work but is not fully tested — proceed at your own risk.
Prerequisites:
  • Node.js 19+, pnpm
  • OpenClaw installed (see Self-hosting)
  • Two phone numbers: one for the OpenClaw bot (its WhatsApp account) and one to message from (your personal phone). You cannot send messages to yourself on WhatsApp.
1

Start the OpenClaw gateway

cd ~/openclaw
./openclaw.mjs gateway --allow-unconfigured
The gateway runs on port 18789 by default. The LogLife plugin is loaded automatically if installed (see Self-hosting for plugin installation).
2

Start the website

cd loglife/website
pnpm install
pnpm dev
The dashboard is at http://localhost:3000/dashboard.
3

Edit, restart, test

When you change plugin/index.ts, restart the local gateway to pick up the changes. The website hot-reloads automatically.Use the helper script:
bash plugin/scripts/restart-local-gateway.sh

CI/CD

LogLife uses two CI/CD pipelines: GitHub Actions for testing and plugin deployment, and Vercel for the website.

GitHub Actions secrets

If you fork this repository, you need to add the following secrets in Settings > Secrets and variables > Actions:
SecretUsed byDescription
SERVER_HOSTdeploy.ymlPublic IP or hostname of the production server
SERVER_USERdeploy.ymlSSH username on the production server
SSH_PRIVATE_KEYdeploy.ymlPrivate SSH key authorized on the server (see below)
LOGLIFE_API_KEYdeploy.ymlLogLife plugin API key — used for post-deploy health checks
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEYci.ymlClerk publishable key — needed for the website build step
Generate a dedicated deploy key instead of using your personal SSH key:
ssh-keygen -t ed25519 -f ~/.ssh/loglife_deploy -N "" -C "loglife-deploy"
cat ~/.ssh/loglife_deploy.pub >> ~/.ssh/authorized_keys
cat ~/.ssh/loglife_deploy  # paste this as SSH_PRIVATE_KEY

Vercel environment variables

Set these in your Vercel project settings:
VariableDescription
OPENCLAW_API_URLProduction API URL (e.g. https://api.loglife.co)
OPENCLAW_API_KEYSame key as LOGLIFE_API_KEY above
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEYClerk publishable key
CLERK_SECRET_KEYClerk secret key (server-side only)

Plugin deployment

When plugin changes are pushed to main, the deploy workflow (.github/workflows/deploy.yml):
  1. SSHes into the production server
  2. Pulls the latest code
  3. Restarts the OpenClaw gateway (graceful — waits for in-flight replies to drain)
  4. Runs a health check against the plugin endpoints
Sessions are not lost on restart — they are persisted to disk in sessions.json. In-memory verification codes are cleared, but that’s expected (5-minute TTL, users simply re-request).

Health checks

The deploy workflow verifies two things after each restart:
  • GET /loglife/sessions?phone=healthcheck returns 404 (plugin loaded, searched, found nothing)
  • POST /loglife/verify/check with dummy data returns 200 (verify endpoint loaded)
If either check fails, the deploy is marked as failed in GitHub Actions.

Website deployment

The website deploys to Vercel automatically on push to main. No gateway restart needed — the website is a separate deployment that connects to the plugin via OPENCLAW_API_URL.

User lifecycle and onboarding tests

Use these commands to verify the V1 onboarding flow and monitor user state while testing.

Monitor registered users

One-time check:
bash plugin/scripts/check-registered-users.sh
Live monitoring:
bash plugin/scripts/check-registered-users.sh --watch --interval 2

Remove a user quickly

Use the helper script:
bash plugin/scripts/unregister-user.sh --phone 15551234567
You can also call the endpoint directly:
curl -s -X POST "http://127.0.0.1:18789/loglife/unregister" \
  -H "Authorization: Bearer test-key-for-local-dev" \
  -H "Content-Type: application/json" \
  -d '{"phone":"+15551234567"}'
To clear all registered users (clean slate):
bash plugin/scripts/unregister-user.sh --all

V1 onboarding test checklist

1

Start from a clean user state

Remove your test phone with unregister-user.sh.
Confirm /loglife/users shows your phone is no longer registered.
2

Run dashboard onboarding

In the dashboard, enter your phone number and continue the V1 flow:
  1. register first, 2) send/check verification code.
You should receive a verification code on WhatsApp and complete verification.
3

Verify backend state

Query /loglife/users and confirm your user appears.
The count increases and your phone appears in users.
4

Verify idempotency

Repeat the same registration for the same phone.
Registration should not create duplicates.
5

Verify removal path

Remove the same phone using /loglife/unregister.
/loglife/users no longer includes that user.

Docs preview

To preview documentation changes locally:
npm i -g mint
cd docs
mint dev
A local preview will be available at http://localhost:3000.