Skip to content

Campaign Service

The campaign-service is a microservice responsible for managing marketing campaigns, including their creation, execution, and tracking.

Core Responsibilities

  • Campaign Management: Handles the full lifecycle of campaigns, from creation to completion.
  • Step Management: Manages the sequence of steps within each campaign.
  • Lead Enrollment: Enrolls leads into campaigns and tracks their progress.
  • Execution Tracking: Tracks the execution of each step for each lead.
  • Metrics and Analytics: Calculates and stores metrics like response rates and appointments set.

Data Models

The Campaign Service is the primary owner of the following data models. For more details, see the Database Schema documentation.

  • Campaigns: The core model for a marketing campaign.
  • CampaignSteps: Defines the individual steps or activities within a campaign.
  • StepExecutions: Tracks the execution status of each step for each lead.
  • CampaignLeads: Stores data about a lead's progress and engagement within a specific campaign.

Campaign Lifecycle

The status field in the Campaigns model follows a specific lifecycle, which is represented by the CampaignStatus enum.

  • DRAFT: The campaign is being created and is not yet active.
  • ACTIVE: The campaign is currently running and engaging with leads.
  • PAUSED: The campaign has been temporarily stopped.
  • COMPLETED: The campaign has finished.
  • ARCHIVED: The campaign is no longer active and has been archived for historical purposes.

Campaign Email SendOut

API Endpoints

This section will document the API endpoints for the Campaign Service, including routes, request/response formats, and examples.

API Endpoints

Structure

The campaign service is located in the apps/campaign-service directory.

apps/campaign-service
├── src
│   ├── controllers
│   │   ├── campaignController.ts
│   │   └── index.ts
│   ├── repositories
│   │   └── campaginRepository.ts
│   ├── routes
│   │   └── campaign.ts
│   ├── schemas
│   │   ├── campaignSchemas.ts
│   │   └── index.ts
│   ├── services
│   │   └── campaignService.ts
│   ├── index.ts
│   └── server.ts
├── package.json
├── tsconfig.json
└── turbo.json