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

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




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
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
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.
| Stage | Description | Actions |
|---|---|---|
| Draft | Quote created, products and pricing configured | edit, preview, delete |
| Sent | PDF generated and sent to lead via email/WhatsApp | resend, revise, track |
| Accepted | Lead accepts terms, deal moves to WON | convert, archive |
| Rejected | Lead declines, feedback captured for future reference | revise, 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.
| # | Template | Use Case | Channel |
|---|---|---|---|
| 1 | Cold Introduction | First touch after lead research | Email + WhatsApp |
| 2 | Product Catalogue | Share capabilities and product range | |
| 3 | Quote Follow-up | Nudge after quote sent, no response | Email + WhatsApp |
| 4 | Meeting Request | Schedule factory visit or call | Email + WhatsApp |
| 5 | Re-engagement | Revive dormant leads with new offers | Email + WhatsApp |
| 6 | Batch Campaign | Bulk outreach to filtered lead segments |
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.
| Model | Purpose | Key Fields |
|---|---|---|
| Lead | Company-level prospect record | name, vertical, stage, source, icpScore |
| Contact | Individual people at a lead company | name, email, phone, role, leadId |
| Activity | Logged interactions and events | type, channel, note, leadId, contactId |
| ScrapeBatch | Lead sourcing session metadata | source, 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
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
Output channels
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.
| Layer | Technology | Role |
|---|---|---|
| Server | Express 5 | HTTP routing, middleware, API endpoints |
| Views | EJS | Server-side HTML templating |
| ORM | Prisma | Type-safe database client and migrations |
| Database | PostgreSQL | Shared instance, "outreach" database |
| Puppeteer | Headless Chrome for pixel-perfect PDF rendering | |
| Resend | Transactional and campaign email API | |
| Baileys | WhatsApp Web API for direct messaging | |
| Auth | bcrypt | Password hashing for admin login |