Claude/crm architecture analysis 1x33dx - #95
Closed
zaynrahman005-beep wants to merge 9 commits into
Closed
Conversation
release: promote main
…es--release chore: release release
release: promote main
release: promote main
release: promote main
release: promote main
Turns the existing agent-first CRM into an internal agency platform: - ClientAccount as first-class entity; every record can be scoped to which agency client it belongs to without breaking single-tenant. - SMS via Twilio: threads, unified inbox UI, signed inbound webhook, SMS activities. - Forms: builder + public submit endpoint that finds-or-creates contact and fires a FORM_SUBMISSION activity. - Workflow automation scaffold: triggers, JSON step list, WorkflowRun queue (runner still to build). - Deals: Kanban board view (?view=board) with drag-drop reorder. - Overview: agency KPI strip (clients / unread inbox / live workflows / published forms). - Sidebar rail: Clients, Inbox, Forms, Workflows. Prisma migration 20260808120000_zayn_scales_agency adds ClientAccount, Sms*, Form*, Workflow*, Booking* models plus clientAccountId/tags on Company/Contact/Deal, boardOrder on Deal, and new ActivityType values SMS/FORM_SUBMISSION/WORKFLOW. Adds TWILIO_* env vars (all optional, capability-off pattern). Verified: api/app typecheck, api/app lint, 119 app tests pass. API tests that hit the DB fail with DatabaseNotReachable — expected in this container. See adrs/zayn-scales-agency-crm.md for the full log of what shipped, design decisions, and the honest not-done list.
The postinstall script runs 'prisma generate', which only needs the
schema — it doesn't connect to the database. But 'prisma.config.ts' was
calling 'env("DATABASE_URL")' from '@prisma/config', which throws
'PrismaConfigEnvError: Cannot resolve environment variable' at config
load whenever DATABASE_URL is unset. On Vercel's install phase this
fails the whole 'bun install' because postinstall exits 1.
Use 'process.env.DATABASE_URL' directly and pass 'datasource'
conditionally, so the URL is resolved lazily and only when actually
needed by migrate/seed commands. Generate now succeeds without any
DATABASE_URL, migrate keeps working with it set.
Verified locally:
- 'bun install' with no .env and DATABASE_URL unset — passes
- 'prisma generate' with DATABASE_URL unset — passes
- 'prisma migrate status' with a real DB — reports 38 migrations
applied
- api build — passes
- api/app check-types — pass
|
@claude is attempting to deploy a commit to the Comp AI - PoC Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
Retargeted this onto
Nothing is wrong with your branch. If the diff now shows commits that are already on git fetch origin main
git rebase origin/main
git push --force-with-lease |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by cubic
Adds an agency CRM layer: client accounts, SMS inbox via Twilio, lead‑capture forms with public submit, workflow automation scaffold, and a Kanban board for deals. Updates the dashboard KPIs and sidebar to surface the new features.
New Features
boardOrder.SMSactivities. New Inbox UI and TRPC routes.FORM_SUBMISSIONactivities.clientAccountIdandtagson core records; newActivityTypevaluesSMS,FORM_SUBMISSION,WORKFLOW.Migration
20260808120000_zayn_scales_agency.TWILIO_ACCOUNT_SID,TWILIO_AUTH_TOKEN, plusTWILIO_FROM_NUMBERorTWILIO_MESSAGING_SERVICE_SID; exposePOST /internal/sms/inboundpublicly and point Twilio to it.packages/dbno longer requiresDATABASE_URLforprisma generate; keep it set for migrate/seed/runtime as usual.Written for commit 109e4c9. Summary will update on new commits.