Skip to main content

CRM & Marketing Platform Specification

Version: 2.0 Date: December 2024 Status: Draft

Documents in This Section

DocumentSectionsDescription
Core Concepts4-7CustomerProfile, Identity Resolution, Timeline, Scoring
Segmentation8Dynamic segments, rules, Messaging sync
AI Segment Builder8.1Natural language to segment criteria via LLM
Campaigns9Campaign types, workflow, execution
Marketing Automation10Journeys, triggers, step types
Social Integration11OAuth, publishing, platforms
Event Promotion12Auto-promote tournaments and events
Technical13-17Event integration, API design, security, performance
ML Scoring18ML-powered scoring, SMART segments, feature engineering
AI Marketing Automation19LLM content generation, send time optimization, NL segments, journey optimization, churn interventions
Marketing + ML + AI Flow20Unified flow showing how marketing automation, ML scoring, and AI enhancement work together

Executive Summary

What is the CRM & Marketing Platform?

A unified customer intelligence and marketing platform that:

  1. Aggregates customer data from SCL (membership), TeeTime (golf), and Messaging (communications)
  2. Enables smart segmentation using cross-service data
  3. Automates marketing campaigns and customer journeys
  4. Publishes content to social media platforms
  5. Promotes events and tournaments across all channels

The Four Pillars

┌─────────────────────────────────────────────────────────────────────────────┐
│ CRM & MARKETING PLATFORM │
├─────────────────┬─────────────────┬─────────────────┬─────────────────────┤
│ CUSTOMER │ MARKETING │ CAMPAIGN │ SOCIAL │
│ INTELLIGENCE │ AUTOMATION │ MANAGER │ INTEGRATION │
├─────────────────┼─────────────────┼─────────────────┼─────────────────────┤
│ - Unified │ - Journeys │ - Segments │ - FB/IG/Twitter │
│ Profiles │ - Triggers │ - Targeting │ - Event Promotion │
│ - Timeline │ - Scheduling │ - A/B Testing │ - Content Calendar │
│ - Scoring │ - Sequences │ - Analytics │ - Engagement │
└─────────────────┴─────────────────┴─────────────────┴─────────────────────┘

Why Build It?

Current ProblemPlatform Solution
Member in SCL ≠ Player in TeeTime ≠ Contact in MessagingUnified CustomerProfile with identity resolution
Staff manually cross-reference systemsSingle API/UI for 360° view
No way to identify at-risk membersEngagement scoring + churn prediction
Basic segmentation on Contact data onlySmart segments using cross-service data
Manual campaign creation and sendsAutomated journeys and triggers
Separate tools for social mediaIntegrated social publisher
Manual tournament promotionAuto-promotion to all channels

Goals & Non-Goals

Goals

#GoalPriorityPhase
G1Unified customer profile across all servicesP01
G2Identity resolution with multi-key matchingP01
G3Activity timeline aggregationP02
G4Smart segmentation (cross-service data)P03
G5Campaign manager (create, schedule, target)P13
G6Customer notes and tagsP12
G7Engagement scoringP17
G8Marketing automation (journeys, triggers)P24
G9Social integration (FB, IG, Twitter)P25
G10Event/tournament promotionP25
G11Churn risk predictionP27
G12A/B testingP34
G13Content calendarP35

Non-Goals

#Non-GoalReason
NG1Replace SCL for membership managementSCL remains source of truth
NG2Replace TeeTime for bookingsTeeTime remains source of truth
NG3Send messages directlyMessaging service handles delivery
NG4Process paymentsSCL Billing handles payments
NG5Manage consentMessaging owns consent (legal compliance)
NG6Real-time sync (under 100ms)Near real-time (seconds) is sufficient
NG7Social inbox/DM managementFuture scope

Architecture Overview

High-Level Architecture

┌─────────────────────────────────────────────────────────────────────────────┐
│ EXTERNAL CLIENTS │
│ (Admin UI, Mobile App, Staff Portal, Club Dashboard) │
└─────────────────────────────────────┬───────────────────────────────────────┘


┌─────────────────────────────────────────────────────────────────────────────┐
│ CRM & MARKETING PLATFORM │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ REST/ │ │ Identity │ │ Campaign │ │ Social │ │
│ │ GraphQL │ │ Resolution │ │ Orchestrator│ │ Publisher │ │
│ │ API │ │ Engine │ │ │ │ │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Activity │ │ Engagement │ │ Journey │ │ Event │ │
│ │ Timeline │ │ Scoring │ │ Engine │ │ Promoter │ │
│ │ Aggregator │ │ Engine │ │ │ │ │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘ │
│ │ │ │ │ │
│ └────────────────┴────────────────┴────────────────┘ │
│ │ │
│ ┌───────▼───────┐ │
│ │ CRM Database │ │
│ │ (PostgreSQL) │ │
│ └───────────────┘ │
└─────────────────────────────────────────────────────────────────────────────┘
│ │ │
▼ ▼ ▼
┌───────────────┐ ┌───────────────┐ ┌───────────────┐
│ Messaging │ │ Social APIs │ │ SCL / TeeTime │
│ Service │ │ (FB, IG, X) │ │ (Events) │
│ ───────────── │ │ │ │ │
│ Delivery │ │ Publishing │ │ DomainOutbox │
│ Consent │ │ Engagement │ │ │
└───────────────┘ └───────────────┘ └───────────────┘

Technology Stack

ComponentTechnologyRationale
APINestJS + GraphQLConsistent with existing services
DatabasePostgreSQLConsistent with existing services
ORMPrismaConsistent with existing services
Event TransportRedis + BullMQAlready in use, sufficient for v1
CacheRedisFast profile lookups
SearchPostgreSQL FTS (v1), Elasticsearch (v2)Start simple, scale later
Social APIsOfficial SDKsFacebook, Instagram, Twitter
Job SchedulingBullMQ + cronCampaign scheduling

Service Boundaries

Key Design Decision

ServiceResponsibilityOwns
CRM/Marketing PlatformWHO, WHAT, WHEN, WHEREProfiles, Segments, Campaigns, Automation, Social
Messaging ServiceHOW (delivery)Templates, Multi-channel delivery, Consent, Providers
SCL ServiceMembership dataMembers, Tiers, Payments → publishes events
TeeTime ServiceGolf dataPlayers, Bookings, Tournaments → publishes events

Consent Management: Messaging service owns consent (GDPR/POPIA compliance). CRM denormalizes opt-in flags for query convenience but does NOT manage consent.


Rollout Plan

Phase 1: Foundation (MVP)

  • Database schema and migrations
  • Identity resolution service
  • Profile CRUD API
  • Basic event consumption

Phase 2: Timeline & Notes

  • Activity model and API
  • SCL/TeeTime/Messaging event integration
  • Customer notes

Phase 3: Marketing Core

  • Segment management (CRM-owned)
  • Segment sync to Messaging
  • Campaign manager
  • Basic scheduling

Phase 4: Automation

  • Journey builder
  • Event triggers
  • A/B testing

Phase 5: Social Integration

  • Social connections (OAuth)
  • Social publisher
  • Event promotion
  • Content calendar

Phase 6: Backfill

  • MCA v1 ZA migration
  • MCA v1 UK migration
  • Data reconciliation

Phase 7: Intelligence

  • Engagement scoring
  • Churn prediction
  • Analytics dashboard