Intermediate

Build Your Own Custom CRM with Claude Code

What this gives you: Tell Claude Code what your business needs and it builds you a complete CRM - contacts, pipelines, deals, follow-ups, dashboards. No monthly SaaS fees. No feature bloat. Just the exact system your business needs, owned by you.

Paste this guide into Claude Code and it will walk you through every step interactively.

Why Build Your Own

GoHighLevel costs $97-497/month. Salesforce starts at $25/user/month and scales fast. HubSpot gets expensive the moment you need real features. For most small businesses, 90% of those features go unused.

Claude Code can build you a CRM that does exactly what you need, hosted on Vercel for free, with a database that costs pennies. Total ongoing cost: under $5/month.

You own it entirely. No vendor lock-in. No price hikes. No support tickets. When you need a new feature, you ask Claude Code and it is done in minutes.

The Stack

Minimal by design. Every choice optimises for speed to build and zero infrastructure to manage.

TechnologyRole
Next.jsApp Router, TypeScript. Server components handle data fetching. API routes give you CRUD endpoints.
Tailwind CSSUtility classes, dark theme. No CSS files to maintain.
Prisma v5 + SQLiteSimple file-based database. Migrate to Supabase Postgres when you need multi-device or team access.
VercelPush to git, auto-deploys. Zero config. HTTPS automatic.

Project Structure

my-crm/ ├── app/ │ ├── login/page.tsx # Password gate │ └── (dashboard)/ │ ├── contacts/page.tsx # Contact list + search │ ├── pipeline/page.tsx # Deal pipeline (kanban) │ ├── deals/[id]/page.tsx # Individual deal view │ ├── tasks/page.tsx # Follow-up tasks │ └── analytics/page.tsx # Revenue + pipeline metrics ├── app/api/ │ ├── contacts/route.ts # CRUD for contacts │ ├── deals/route.ts # CRUD for deals │ └── tasks/route.ts # CRUD for tasks └── lib/ ├── db.ts # Database connection └── auth.ts # Simple auth

Step 1: Define Your Pipeline

Before you build anything, write down your sales stages. Claude Code needs this to build the pipeline view correctly. Here is an example for a service business:

  1. New Lead
  2. Contacted
  3. Discovery Call Booked
  4. Proposal Sent
  5. Negotiation
  6. Won
  7. Lost

Think about your actual sales process. What happens between first contact and closed deal? Each distinct handoff is a stage. Keep it to 5-8 stages maximum - more than that and the pipeline becomes noise.

Once you have your stages written down, drop them into the build prompt in the next step.

Step 2: The Build Prompt

This is the single prompt you give Claude Code to scaffold the entire project. Replace the pipeline stages with your own:

Build me a CRM dashboard with these features: - Contact management (name, email, phone, company, notes, tags) - Deal pipeline with drag-and-drop kanban board - Pipeline stages: New Lead, Contacted, Discovery Call Booked, Proposal Sent, Negotiation, Won, Lost - Task/follow-up system with due dates - Basic analytics (deals won this month, total pipeline value, conversion rate) - Password-protected login - Dark theme, clean UI Stack: Next.js App Router, TypeScript, Tailwind CSS, SQLite with Prisma v5. Deploy to Vercel.

Claude Code will scaffold the entire project, install dependencies, write every component, set up the database schema, and wire up the API routes. You will have a working CRM in a single session.

Step 3: Contact Management

Claude Code builds you a searchable contact list with filters, individual contact pages with notes and activity timeline, CSV import/export, and tag-based segmentation.

The contacts API route handles all CRUD operations:

// app/api/contacts/route.ts import { NextRequest, NextResponse } from 'next/server' import { prisma } from '@/lib/db' export async function GET(req: NextRequest) { const { searchParams } = new URL(req.url) const search = searchParams.get('search') ?? '' const tag = searchParams.get('tag') const contacts = await prisma.contact.findMany({ where: { AND: [ search ? { OR: [ { name: { contains: search } }, { email: { contains: search } }, { company: { contains: search } } ] } : {}, tag ? { tags: { contains: tag } } : {} ] }, orderBy: { updatedAt: 'desc' } }) return NextResponse.json(contacts) } export async function POST(req: NextRequest) { const body = await req.json() const contact = await prisma.contact.create({ data: body }) return NextResponse.json(contact, { status: 201 }) }

Step 4: Deal Pipeline

The kanban board is the core of the CRM. Each deal card shows: contact name, deal value, last activity, and days in stage. Drag and drop between stages updates the deal immediately. The deal detail view shows full history, notes, and linked tasks.

The Prisma schema for deals:

// prisma/schema.prisma model Deal { id String @id @default(cuid()) title String value Float stage String contactId String contact Contact @relation(fields: [contactId], references: [id]) notes String? createdAt DateTime @default(now()) updatedAt DateTime @updatedAt } model Contact { id String @id @default(cuid()) name String email String? phone String? company String? notes String? tags String? # comma-separated deals Deal[] tasks Task[] createdAt DateTime @default(now()) updatedAt DateTime @updatedAt }

Step 5: Follow-Up System

Tasks with due dates attached to contacts or deals. Claude Code builds task creation from deal pages, overdue task highlighting in red, and a daily digest of tasks due today pinned to the top of the dashboard.

To add email reminders, give Claude Code this follow-up prompt:

Add email reminders for tasks due today. Use Resend to send a daily digest at 8am with all tasks due today, grouped by contact. Include a link to each deal in the email. Store the Resend API key in .env.local as RESEND_API_KEY.

Claude Code will add the Resend package, create an API route, and set up a cron job via Vercel's cron configuration. No external scheduler needed.

Step 6: Analytics Dashboard

Real-time metrics calculated from your database: deals won this month, total pipeline value, average deal size, conversion rate by stage, and revenue forecast based on weighted pipeline.

To add specific charts, prompt Claude Code with exactly what you want:

Add a bar chart showing deals closed per month for the last 6 months, and a funnel chart showing conversion rate at each pipeline stage. Use Recharts. Dark theme, match the existing colour palette.

Claude Code generates the chart components, wires them to the database queries, and drops them into the analytics page. The whole thing takes one prompt.

Step 7: Deploy

  1. Push your project to a GitHub repository
  2. Import it at vercel.com
  3. Add environment variables in Project Settings (database URL, auth secret)
  4. Deploy - first build takes about 60 seconds
# Subsequent deploys - Vercel auto-detects the push git add . git commit -m "add email reminders" git push origin main # Live in ~60 seconds

If the auto-deploy does not trigger, use vercel --prod from the project directory as a fallback.

Adding AI Features

This is where Claude Code really shines. Once the base CRM is running, add AI features one at a time. Each is a single prompt to Claude Code.

FeaturePrompt to Claude Code
Auto-generate follow-up emails"Add a button on each deal page that drafts a follow-up email using Claude, based on the deal notes and last activity."
Summarise meeting notes"Add a text area on contact pages where I can paste meeting notes. Claude summarises them into bullet-point action items and saves them."
Lead scoring"Score each contact 1-10 based on email opens, deal activity, and days since last contact. Show the score as a badge on the contact list."
Draft proposals"Add a Generate Proposal button on deal pages. Claude reads the deal data and contact info, then outputs a structured proposal I can copy."

Connecting External Tools

Use Claude Code MCP servers to connect your CRM to other tools in your stack. Each integration is a single conversation.

# Google Calendar integration Add Google Calendar integration. When a deal moves to the "Discovery Call Booked" stage, automatically create a calendar event using the Google Calendar MCP server. Pull the contact's name and email for the event description. # Stripe integration Connect deals to Stripe payments. When a deal is marked Won, look up the contact's email in Stripe and show their payment history on the deal page. # Email logging Add Gmail integration via MCP. When I open a contact page, show the last 5 emails exchanged with that contact, pulled live from Gmail.

Cost Comparison

ItemGoHighLevelYour CRM
Hosting$97-497/mo$0 (Vercel free)
DatabaseIncluded~$5/mo (Supabase) or free (SQLite)
CustomizationLimitedUnlimited
AI featuresExtra costBuilt-in (Claude)
Total per year$1,164-5,964~$60
Tip: Start with the minimum viable CRM: contacts, pipeline, and tasks. Add features only when you actually need them. Claude Code can add any feature in minutes, so there is no need to over-build upfront. A simple CRM you actually use beats a complex one you avoid.
Warning: Use Prisma v5 for SQLite projects, not v7. Prisma v7 requires driver adapters and has ESM compatibility issues that will waste your time. Claude Code knows this if you specify v5 in your prompt.
Tip: If you already use GoHighLevel or another CRM, you can still use Claude Code to build a custom dashboard on top of it. Connect via the GHL MCP server and build the exact views you need - without replacing the system your team already knows.

Want a custom CRM built for your business?

I can design and deploy a CRM tailored to your exact workflow in a single session.

Book a Call
Next Guide
Talk to Your AI from Anywhere