All checks were successful
Build & Release APK / build (push) Successful in 1m52s
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1.7 KiB
1.7 KiB
Kin server (the crm container)
Personal relationships CRM — serves the Kin mobile app and the web UI at
https://crm.rehbock.xyz. Source of truth is the git repo
git.rehbock.xyz/marcus/kin (server/ directory); the copy at
~/personal/crm on the VPS is a deploy target. Don't edit it in place —
edit in the repo (~/kin on the desktop), then:
rsync -a --delete --exclude .env --exclude .env.token.local --exclude node_modules \
server/ rehbock.xyz:personal/crm/
ssh rehbock.xyz 'cd ~/personal/crm; and docker compose up -d --build'
Restart is NOT enough — the Dockerfile bakes source in.
Stack
- Bun + Hono,
postgres(porsager) client, DBpersonalin the sharedpersonal-dbcontainer.DATABASE_URL,PORT,API_TOKENin./.env(VPS-only, never in git). - Migrations:
migrations/*.sqlapplied at boot, recorded inschema_migrations. Add numbered files; never edit applied ones.
Auth
- Browser → Caddy basic_auth (
~/personal/proxy/Caddyfile, useradmin). - Kin app →
Authorization: Bearer $API_TOKEN; Caddy passes Bearer requests through,src/index.tsmiddleware validates. - Docker-network access is unauthenticated by design; never publish port 3000.
API (src/routes/)
people.ts: stats, tags, people CRUD, interactions add/delete, relationships add/delete.due.ts:GET /api/due(urgency = days_since / cadence_days, sections computed client-side),POST /api/people/:id/snooze.
Schema notes
people.cadence_daysnull = no reminders;archivedhides from everything;snoozed_untilhides from due list; logging an interaction clears snooze.last_contacted/interaction_countcomputed frominteractionsat query time, not stored.