Overview
The CRM plugin adds a lightweight, embedded sales pipeline to your Codapult project. Your users get company and contact management, a visual Kanban deal pipeline, activity tracking, custom fields, and AI-powered lead scoring and deal prediction — all within the dashboard, no external tool needed.
Package: @codapult/plugin-crm · Price: $49 (one-time)
Install with:
npx @codapult/cli plugins add @codapult/plugin-crm
Features
Companies & Contacts
Full contact management with organizational hierarchy:
- Company profiles — name, domain, industry, size, website, notes
- Contact profiles — name, email, phone, job title, linked company
- Custom fields — add text, number, date, or select fields per entity type (company, contact, deal)
- Tags — flexible tagging system across companies, contacts, and deals
- Lead score — AI-assigned 0–100 score stored on each contact, updated automatically or on demand
Visual Deal Pipeline
Kanban-style board for managing sales opportunities:
- Configurable stages — create custom stages with names, colors, and win probability percentages
- Drag-and-drop — move deals between stages visually
- Multiple pipelines — create separate pipelines per team or product line; designate one as default
- Stage reordering — drag stages to change the pipeline flow
- Deal lifecycle — track deals as open, won, or lost; reopen closed deals
- SLA dates — expected close date and actual close date tracking
- Value tracking — deal amount and currency per deal
Activity Timeline
Complete interaction history for every entity:
- Activity types — notes, calls, emails, meetings, and tasks
- Linked entities — associate activities with a deal, contact, or company
- Due dates — set deadlines for tasks and follow-ups
- Completion tracking — mark activities as complete; filter upcoming and overdue items
- AI summaries — generate an AI roll-up of recent activities per entity
AI Capabilities
Three AI-powered features built on the Vercel AI SDK:
- Lead scoring — analyzes contact activity, engagement patterns, and deal history to assign a 0–100 score with factor breakdown
- Deal win prediction — predicts deal outcome likelihood based on historical data, pipeline position, and activity patterns
- Activity summarization — generates concise summaries of recent interactions for a contact, company, or deal
Analytics Dashboard
Built-in reporting on pipeline performance:
- Pipeline overview — total deals, total value, win rate
- Stage breakdown — deals and value per stage
- Activity metrics — activity counts by type and time period
- Conversion rates — stage-to-stage conversion tracking
Dashboard Pages
The plugin adds 6 pages to the dashboard under /dashboard/crm/:
| Page | Path | Description |
|---|---|---|
| People (Contacts) | /dashboard/crm/contacts | Contact list with search and filters |
| Companies | /dashboard/crm/companies | Company directory |
| Deals | /dashboard/crm/deals | Kanban board view of deal pipeline |
| Deal Detail | /dashboard/crm/deals/[id] | Single deal with activities and AI tools |
| Pipelines | /dashboard/crm/pipelines | Pipeline and stage configuration |
| Analytics | /dashboard/crm/analytics | Pipeline performance dashboard |
API Routes
All routes are served under /api/plugins/crm/. The plugin registers 47 API routes including:
GET|POST|PUT|DELETE /companies— company CRUDGET|POST|PUT|DELETE /people— contact CRUDGET|POST|PUT|DELETE /deals+POST /deals/move|won|lost|reopen+GET /deals/by-stage— deal lifecycleGET|POST|PUT|DELETE /activities+POST /activities/complete+GET /activities/upcoming|overdue— activity managementGET|POST|PUT|DELETE /pipelines+POST /pipelines/stages/reorder+PUT /pipelines/default— pipeline configurationGET|POST|DELETE /tags— tagging systemGET /analytics/overview|stages|activities— reportingPOST /ai/lead-score+POST /ai/deal-predict+POST /ai/summarize— AI features
Database Tables
The plugin creates 9 tables prefixed with crm_:
| Table | Purpose |
|---|---|
crm_company | Companies: name, domain, industry, size, website, notes |
crm_person | Contacts: name, email, phone, job title, lead score |
crm_pipeline | Per-org pipelines with default flag |
crm_stage | Pipeline stages: name, order, win probability |
crm_deal | Deals: value, currency, status, stage, owner, close dates |
crm_activity | Activities: type, content, due date, completion timestamp |
crm_tag | Tags per entity (composite PK: entity type + id + tag) |
crm_custom_field | Field definitions per entity type (text/number/date/select) |
crm_custom_field_value | Stored values per field per entity |
Environment Variables
| Variable | Default | Description |
|---|---|---|
CRM_AI_MODEL | "gpt-4o-mini" | Model for lead scoring, deal prediction, and summarization |
CRM_DEFAULT_CURRENCY | "USD" | Default currency for new deals |
CRM_DEFAULT_PIPELINE | "default" | Identifier for the default pipeline |
Integration with Core Modules
| Module | How CRM Uses It |
|---|---|
Vercel AI SDK (ai) | Lead scoring, deal prediction, activity summarization |
logActivity() | Audit trail for CRM operations |
checkOrgQuota() | Enforce crmContacts and crmDeals resource limits |
onUserDeleted | Clears ownerId on deals when a user is removed |
| Database (Drizzle) | All data storage |