71 Commits

Author SHA1 Message Date
fc05a8b459 feat(bot): add Baileys session wrapper
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 16:18:11 +08:00
dd1eb711df feat(bot): add QR PNG renderer 2026-05-09 16:16:09 +08:00
20f24270d9 feat(bot): add telegram bot with whitelist, /start, /help, audit 2026-05-09 16:15:17 +08:00
3f3b090caa feat(bot): add audit log writer 2026-05-09 16:12:53 +08:00
4a790b9a60 feat(bot): scaffold env, logger, db, health, shutdown
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 16:10:37 +08:00
8167872415 chore: add bot Dockerfile and bot service in dev compose 2026-05-09 16:07:46 +08:00
bf22c177a4 fix(env): quote SEED_OPERATOR_NAME so bash sourcing tolerates parens 2026-05-09 16:06:52 +08:00
3c3b5165b8 feat(scripts): add db.sh wrapper and stubs for plans 2/4 2026-05-09 15:43:01 +08:00
cd50aa1415 chore: fix tools pnpm install + populate .env.development
Replace corepack-prepared pnpm with `npm install -g pnpm@9.12.0` so the
binary lives in /usr/local/bin (readable by any UID) instead of root's
corepack cache. Avoids re-downloading pnpm on every container restart
when running as a non-root host user.

Also populate .env.development with real dev credentials (Postgres at
192.168.0.210/wabot, dev Telegram bot, operator Telegram ID 818380985).
2026-05-09 15:29:56 +08:00
fa4970a76c feat(db): add drizzle schema for all tables + initial migration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 15:19:36 +08:00
09a9f5f348 feat(shared): add rrule, media-path, timezone helpers 2026-05-09 15:16:46 +08:00
8396e80334 chore: bootstrap pnpm install via tools container 2026-05-09 15:14:18 +08:00
f1831b8a56 chore: add gen_auth_secret + bootstrap env files 2026-05-09 15:12:09 +08:00
30168ad793 feat(scripts): add dev.sh with exec/pnpm/shell subcommands 2026-05-09 15:11:02 +08:00
c49c0a75dc chore: add tools container + base/dev compose 2026-05-09 15:10:06 +08:00
a553b538a5 chore: initialize pnpm workspace + Turbo config 2026-05-09 15:09:08 +08:00
f48fba5361 chore: add .gitignore and configure remote 2026-05-09 15:08:08 +08:00
2122182c56 docs(plan): refactor plan 1 to Docker-first
Reorganize plan 1 so a long-lived `tools` container running Node 22 + pnpm
is the entry point for every install/test/typecheck/migration command. The
host only needs Docker — no Node or pnpm install required. Tasks reordered
so the tools container exists before any pnpm operation; new tasks added
for the bootstrap install and env-file population.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 15:05:49 +08:00
c3750147eb docs: add plan 1 — foundation & WhatsApp pairing MVP
End-state of the plan: monorepo, all DB tables migrated, dev Docker stack
running the bot service, and Telegram-driven WhatsApp pairing working
end-to-end (QR delivered, scanned, account connected, groups synced,
auto-reconnect on disconnect, restart-survival via useMultiFileAuthState).

Plans 2-4 (reminder scheduling, web dashboard, production deploy) are
referenced but not yet written.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 14:49:17 +08:00
0f949284b1 docs: lock in subdomain, timezone, retention defaults
Replace open-questions section with confirmed values from brainstorming
review: wabot.04080616.xyz subdomain, Asia/Kuala_Lumpur default timezone,
90-day media retention, 5-minute minimum recurrence interval. Postgres
pg_hba check kept as a pre-deploy verification step.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 14:40:37 +08:00
42caa0d37a docs: initial design spec for WhatsApp reminder bot
Captures the validated design from the brainstorming session: two-service
topology (Next.js web + Node bot) communicating via Postgres LISTEN/NOTIFY,
Baileys for WhatsApp, grammy for Telegram, pg-boss for scheduling, Drizzle
for the data model, and Docker/Gitea-registry deploy flow.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 14:36:39 +08:00