Python / PostgreSQL / React

PGG CRM

Customer relationship and outreach platform built alongside the ERP — pipeline tracking, automated client communication, and deal-stage analytics.

12

CRUD + pipeline ops

PGG CRM

Showcase

Product Walkthrough

Four screens from the live PGG Outreach CRM — generated from the production EJS templates and Express routes.

PGG CRM — Lead Pipeline Kanban — six-stage flow from NEW to WON/LOST with ICP score rings, vertical badges, and source c
Lead Pipeline Kanban — six-stage flow from NEW to WON/LOST with ICP score rings, vertical badges, and source chips.
PGG CRM — Lead Detail · Sales Intel tab — procurement signals, competitor footprint, news events, and AI-recommended out
Lead Detail · Sales Intel tab — procurement signals, competitor footprint, news events, and AI-recommended outreach action.
PGG CRM — Quote Builder with live A4 PDF preview — 18 rate cards, dynamic line items with HSN codes, Puppeteer-rendered
Quote Builder with live A4 PDF preview — 18 rate cards, dynamic line items with HSN codes, Puppeteer-rendered output.
PGG CRM — Outreach Composer — dual editor for Email (Resend) and WhatsApp (Baileys), filtered segment of 47 leads, live
Outreach Composer — dual editor for Email (Resend) and WhatsApp (Baileys), filtered segment of 47 leads, live delivery tracking.

Leadership Lens

01 The Call

Chose to build a purpose-fit CRM over adopting an off-the-shelf solution (Salesforce, HubSpot, Zoho CRM), recognising that PGG operates two distinct verticals — Paper & Board (relationship-driven Pune region) and PP Corrugated (specification-driven pan-India) — with fundamentally different ICP profiles and lead sources. A commercial CRM would force a generic pipeline onto a business that needs per-vertical ICP scoring, IndiaMART/GeM/LinkedIn scrape ingestion, and integrated quote generation with a rate-card pricing engine: capabilities that either don't exist in SaaS tools or require costly customisation.

02 The Bet

Bet that a server-rendered, no-SPA architecture (Express 5 + EJS + Prisma) combined with a tight 4-model data schema would be sufficient for a multi-channel outreach CRM — accepting that it would never have the reporting depth or mobile apps of a commercial platform, but would ship faster and be fully tailored to PGG's exact lead-to-quote workflow.

03 The Trade-off

Sacrificed advanced analytics dashboards, mobile apps, and CRM ecosystem integrations (Outlook, Sheets sync) in exchange for a system that runs as a single Node.js process, has zero per-seat licensing cost, and encodes PGG's exact pipeline logic — 6 stages with dormant re-entry, per-vertical ICP scoring, and 18 rate-card-based quote generation — which no commercial CRM would offer out of the box.

04 The Outcome

Pune Global Group gained a production-ready CRM covering the full outreach lifecycle: 12 leads and 13 contacts seeded, 12 Express routes powering pipeline operations, 18 rate cards loaded for instant PDF quote generation via Puppeteer, and multi-channel outreach across email (Resend, 3,000/mo) and WhatsApp (Baileys) with webhook-based delivery tracking. The platform replaced manual phone and inbox-based follow-up with centralized pipeline visibility and templated outreach across 6 message templates.

05 Coordinated

Aligned with Pune Global Group on the two-vertical structure (Paper & Board vs PP Corrugated) and the distinct ICP profiles each requires — a Pune corrugator behaves nothing like a pan-India FMCG procurement team, so both pipeline scoring and outreach templates were configured differently per vertical. Scoped the system to an internal sales tool for a small team, which meant the sign-off condition was delivering a working quote-to-outreach flow rather than a training programme or multi-department rollout.

06 Where this goes next

Add per-vertical conversion analytics and a pipeline velocity dashboard; build a WhatsApp inbox view for two-way conversation tracking; extend the quote module with revision history and accepted-quote-to-order handoff; explore IndiaMART webhook integration to auto-ingest leads without manual scraping sessions.

01 Chapter 1

The Business Problem

Pune Global Group (PGG) is an industrial packaging company serving two distinct verticals across different geographies and buyer profiles. Before this CRM existed, leads arrived from four or more channels with no centralised tracking, quotes were generated manually, and outreach happened through personal phones and inboxes with no visibility into performance.

Vertical A — Paper & Board

Corrugators, box makers, and printers concentrated in the Pune region. Relationship-driven B2B sales with repeat orders and long-term contracts.

Vertical B — PP Corrugated

Automotive, pharma, electronics, and FMCG companies across pan-India markets. Specification-driven procurement with formal RFQ processes.

Core Challenge

Managing leads from 4+ sources (IndiaMART, Google, GeM, LinkedIn) with fundamentally different ICP profiles — a Pune corrugator has nothing in common with a pan-India FMCG buyer, yet both need to flow through the same pipeline with tailored scoring and outreach.

Lead Sources

4+

IndiaMART, Google, GeM, LinkedIn

Rate Cards

18

Loaded in system

Outreach Channels

2

Email + WhatsApp

Pipeline Stages

6

Plus dormant re-entry

02 Chapter 2

Module A — Lead Database & Pipeline

The lead module is the backbone of the CRM — 12 Express routes powering a full pipeline from raw lead to closed deal. Every lead is tracked through a 5-stage pipeline with ICP scoring, activity logging, and a tabbed detail view for deep context on each prospect.

Express Routes

12

CRUD + pipeline ops

Demo Leads

12

In database

Contacts

13

Linked to leads

Activities

12

Logged interactions

Pipeline Stages

Leads progress through six active stages. Any stage can transition to DORMANT, and dormant leads can re-enter the pipeline at any stage — reflecting the reality that industrial sales cycles can go quiet for months and then reactivate.

Lead pipeline flow

NEW
RESEARCHED
CONTACTED
QUALIFIED
QUOTED
WON / LOST

ICP Fit Engine

Computes a fit score for each lead based on vertical alignment, company size, geography, and procurement signals. Paper & Board leads are scored differently from PP Corrugated leads — vertical-specific weights ensure the scoring reflects actual conversion likelihood for each buyer type.

Lead Detail View

Tabbed interface showing Info, Contacts, Activity, and Sales Intel for full context on every prospect. The filter query builder allows searching by stage, source, vertical, score range, and free-text across all fields.

03 Chapter 3

Module B — Quote Generator + Supplier RFQ

The quoting engine turns rate cards into pixel-perfect PDF quotes in seconds. With 18 rate cards loaded into the system, the sales team selects products, adjusts quantities, and the pricing engine computes totals with applicable margins. Puppeteer renders the final quote as a professional PDF ready for email attachment.

Rate Cards

18

Loaded in system

PDF Engine

Puppeteer

Pixel-perfect rendering

Lifecycle

Managed

Draft → sent → accepted

Quote generation flow

Select Products
Rate Card Lookup
Pricing Engine
Puppeteer PDF
Send to Lead

Why Puppeteer?

Industrial packaging quotes need precise formatting — product specifications, GST breakdowns, delivery terms, and company branding. Puppeteer renders the EJS template to PDF with full CSS support, ensuring the quote looks identical whether viewed on screen or printed.

StageDescriptionActions
DraftQuote created, products and pricing configurededit, preview, delete
SentPDF generated and sent to lead via email/WhatsAppresend, revise, track
AcceptedLead accepts terms, deal moves to WONconvert, archive
RejectedLead declines, feedback captured for future referencerevise, close

04 Chapter 4

Module C — Outreach Engine

Multi-channel outreach from a single platform — email via Resend and WhatsApp via Baileys. The outreach engine supports templated campaigns, batch sends, and webhook-based delivery tracking so the team knows exactly which messages land and which bounce.

Email Capacity

3K/mo

Via Resend API

Template Types

6

For different scenarios

Channels

2

Email + WhatsApp

Resend Integration (Email)

Transactional and campaign emails through Resend's API. 3,000 emails per month with delivery webhooks for open/bounce tracking. Templates render dynamically with lead and company data.

Baileys Integration (WhatsApp)

WhatsApp messaging via the Baileys library for direct outreach. Same templates work across both channels, ensuring consistent messaging whether the prospect prefers email or WhatsApp.

#TemplateUse CaseChannel
1Cold IntroductionFirst touch after lead researchEmail + WhatsApp
2Product CatalogueShare capabilities and product rangeEmail
3Quote Follow-upNudge after quote sent, no responseEmail + WhatsApp
4Meeting RequestSchedule factory visit or callEmail + WhatsApp
5Re-engagementRevive dormant leads with new offersEmail + WhatsApp
6Batch CampaignBulk outreach to filtered lead segmentsEmail

Webhook Tracking

Every email sent through Resend fires delivery, open, and bounce webhooks back to the CRM. The activity log on each lead automatically updates, giving the sales team real-time visibility into outreach performance without leaving the platform.

05 Chapter 5

Data Model

The Prisma schema defines four core models backed by a shared PostgreSQL instance. The outreach database handles all CRM data, with relationships between leads, contacts, activities, and scrape batches.

ModelPurposeKey Fields
LeadCompany-level prospect recordname, vertical, stage, source, icpScore
ContactIndividual people at a lead companyname, email, phone, role, leadId
ActivityLogged interactions and eventstype, channel, note, leadId, contactId
ScrapeBatchLead sourcing session metadatasource, query, count, scrapedAt

Lead Sourcing Workflow

Leads are sourced through Claude Code terminal sessions that scrape IndiaMART, Google, GeM, and LinkedIn. Each scraping run creates a ScrapeBatch record, linking the raw source data to the leads it produced for full traceability.

Data relationships

Lead
1:N
Contact
Lead
1:N
Activity
ScrapeBatch
1:N
Lead

06 Chapter 6

Architecture

The system follows a classic server-rendered architecture — Express handles routing, Prisma manages the data layer, and EJS templates render the UI. No SPA complexity needed: the CRM is an internal tool where server-side rendering provides fast page loads and straightforward deployment.

End-to-end architecture

Lead Sources (IndiaMART / Google / GeM / LinkedIn)
Scraping (Claude Code sessions)
PostgreSQL
Express API
EJS Templates

Output channels

EJS Templates
Puppeteer
PDF Quotes
EJS Templates
Resend
Email
EJS Templates
Baileys
WhatsApp

Architecture Rationale

No React, no SPA, no client-side state management. This is an internal sales tool used by a small team — server-rendered EJS pages with full-page navigation are faster to build, easier to maintain, and deploy as a single process. The complexity budget was spent where it matters: the ICP scoring engine, rate-card pricing, PDF renderer, and multi-channel outreach integrations.

07 Chapter 7

Tech Stack

A deliberate choice of mature, well-documented tools optimised for a server-rendered internal CRM. Express 5 provides the routing layer, Prisma handles database access with type safety, and EJS keeps the view layer simple and fast.

LayerTechnologyRole
ServerExpress 5HTTP routing, middleware, API endpoints
ViewsEJSServer-side HTML templating
ORMPrismaType-safe database client and migrations
DatabasePostgreSQLShared instance, "outreach" database
PDFPuppeteerHeadless Chrome for pixel-perfect PDF rendering
EmailResendTransactional and campaign email API
WhatsAppBaileysWhatsApp Web API for direct messaging
AuthbcryptPassword hashing for admin login
Express 5EJSPrismaPostgreSQLPuppeteerResendBaileysbcryptNode.jsJavaScript