d5a304ebe9
Both flows now POST into the smb-crm DB API instead of appending to Sheets, so Postgres stays the source of truth and the DB->Sheets mirror keeps the Sheet current. Telegram notifications unchanged. - lead-intake: Webhook -> Build lead row -> POST /api/leads -> Telegram (dropped the direct Sheets append + the redundant activity-log nodes; the DB service logs + mirrors activity itself). - onboarding: Webhook -> Compute -> POST /api/clients (DB assigns C-id) -> Build project w/ returned id -> POST /api/projects -> Telegram. DB computes renewal_date; go-live = start + 14d. - Token injected at deploy time; repo keeps the __CRM_TOKEN__ placeholder. Verified end-to-end on the live webhooks: lead and client+project land in the DB and mirror to Sheets; test data cleaned; DB/Sheets consistent. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3.9 KiB
3.9 KiB
TODO / Backlog
Rethink the tier model — decouple tier from business type
Goal: tiers should NOT be tied to a kind of business. Which "tier" (and whether a client's site is self-hosted or runs on Google's free services) is a decision made between me and the client, case by case — not something baked into a demo.
Implications to work through:
- Demos are stack-agnostic starters.
Drop tier/stack labels and jargon (self-hosted, Cal.com, Google-Stack, "≈ 0 €") from the public-facing demos & chooser.DONE 2026-06-25: chooser reworded; all three demo pages neutralised — demo bars now read "Beispielseite · So könnte Ihr Online-Auftritt aussehen", booking widgets relabelled to generic "Online-Terminbuchung"/"Sichere Buchung", Google-Kalender/Cal.com/self-hosted/Tier labels removed from rendered copy and HTML comments, demo booking dates now render on the current week via JS so nothing looks stale. - After a client signs, I decide hosting: self-host the page on the homelab, or stand it
up on the client's free Google account. The CRM already has
tier+stack_notescolumns to record that decision per client. - Revisit the
Clients.tierfield semantics: keep A/B as an internal effort/price band, or replace with something hosting-agnostic (e.g.hosting = google | selfhosted,plan = …). - Onboarding form + workflow currently ask for Tier A/B — realign once the model is settled.
Onboard dashboard → manage Leads & Clients (CRUD) — DONE 2026-06-25
Built as a DB-first back-office (architecture pivot: Postgres is the source of truth, Sheets
is a one-way mirror — see backoffice/ and the smb-db-source-of-truth memory). Live at
onboard.mivanchenko.de/crm behind the existing basic-auth.
- Read: Leads & Clients tables, served by
smb-crmstraight from Postgres. - Add: "+ Neu" modal per entity; auto-IDs (C-#### / L-epoch), renewal auto-compute.
- Edit: per-row ✎ modal, token-protected PATCH.
- Delete: per-row 🗑 (token-protected), audit-logged — replaces the scratchpad cleanup.
- Behind Caddy basic-auth; mutations gated by
CRM_API_TOKEN; all changes audit-logged. - One-way DB→Sheets mirror keeps the Sheet overview current after every change.
- n8n ingest swap:
lead-intake&onboardingnow POST into the DB API (not Sheets); Telegram notify unchanged.renewal-reminderstill reads Sheets (fine — Sheets mirrors DB).
Follow-ups (not yet done):
- Extend CRUD UI beyond Leads/Clients (projects, bookings, invoices, activity) if useful.
- Daily backup of the
smb-dbPostgres volume. - Make the DB→Sheets overwrite atomic (currently clear-then-write; brief mid-write window a reader could catch the cleared sheet — harmless for a human overview).
Other
- Harden n8n auth: compose still has deprecated
N8N_BASIC_AUTH_*with passwordpassword(legacy/ignored by modern n8n owner-login). Confirm the owner account is strong; remove the dead env. - Orders: the pizzeria demo posts orders into the
Leadstab via the lead-intake webhook as a stop-gap. Build a proper Orders flow + sheet tab (items, total, mode, status) when the order-management product is real. - Booking-sync workflow (Tier-B Cal.com webhook + Tier-A Google Calendar poll).
Done
- 2026-06-25 — Latency fix (n8n executions 1–4 min → ~6 s; DNS + PostHog telemetry).
- 2026-06-25 — Chooser reworded to client-friendly, jargon-free copy.
- 2026-06-25 — Pizzeria demo with online ordering added.
- 2026-06-25 — Barbershop "Google Kalender" dot-overlap styling fixed.
- 2026-06-25 — All three demo pages neutralised (stack-agnostic, non-stale dates).
- 2026-06-25 — DB-first back office: Postgres source of truth + Sheets mirror + CRUD + n8n ingest swap (lead-intake/onboarding → DB API). Live at onboard.mivanchenko.de/crm.