Kulcare Docs
DeveloperGrowth

Growth Features

⚠️ Stale — describes the superseded parts/ architecture. Campaigns and campaign templates were rebuilt on the new backend/domains/growth / frontend/apps/growth stack; see docs/plans/2026-08-27-001-feat-growth-campaign-templates-plan.md for the current design and frontend/CLAUDE.md's Growth App section for shipped status. Do not use this document's campaign/ad-campaign sections as a reference for current code.

This document provides comprehensive coverage of Kulcare's growth features, designed to help healthcare providers expand their online presence, manage their reputation, and reach more patients through digital marketing tools.

Overview

The Kulcare growth feature suite provides clinics and healthcare providers with comprehensive digital marketing and online presence management tools:

  • Website Hosting: Custom clinic websites with theme selection and domain management
  • Reputation Management: Review management for both Kulcare and Google My Business (GMB)
  • Google My Business Integration: Questions, reviews, posts, and action links management
  • Digital Marketing: Landing pages, ad campaigns, and lead generation
  • SEO Optimization: Search engine optimization tools and analytics
  • Domain Management: Custom domain hosting and SSL certificate management

Key Features

  • Multi-theme website customization
  • Google My Business integration and management
  • Review response automation and management
  • Custom domain hosting with SSL
  • SEO optimization for better search visibility
  • Ad campaign lead capture and management
  • Analytics and reporting dashboard

Architecture

The growth feature follows a multi-repository architecture:

Growth Architecture:
├── kulcare-api-backend/parts/growth/    # Backend API and business logic
├── kulcare-growth/                      # Frontend growth dashboard
└── growth_website/                      # Public clinic websites (Rails)

Parts-Based Structure

parts/growth/
├── controllers/          # API endpoints for growth features
├── interactors/         # Business logic using interactor pattern
├── models/              # Data models for websites, domains, GMB
├── services/            # External integrations (Google, domain providers)
├── policies/            # Authorization policies
├── serializers/         # JSON response formatters
└── routes.rb           # Growth feature routes

Technology Stack

  • Backend: Ruby on Rails 7.1.3.4 with parts-based architecture
  • Frontend: React.js (separate kulcare-growth repository)
  • Public Websites: Ruby on Rails (growth_website repository)
  • Database: PostgreSQL shared across all components
  • External APIs: Google My Business API, Domain registrar APIs
  • Storage: AWS S3 for images and assets

Core Data Models

Website Management

ClinicWebsite

Core model for clinic website management.

# Table: clinic_websites
class ClinicWebsite < ApplicationRecord
  belongs_to :clinic
  has_many :clinic_domain_requests
  has_many :clinic_domains
  has_many :clinic_website_seos
  
  # Key columns:
  # clinic_id: integer           - Associated clinic
  # status: string               - Website status (draft, published)
  # wordpress_url: string        - WordPress site URL
  # current_step: integer        - Setup completion step
  # has_unpublished_data: boolean - Pending changes flag
  # published_at: datetime       - Last publication timestamp
  
  def default_domain
    clinic_domains.where(domain_type: 'DEFAULT').first&.domain_name
  end
  
  def custom_domain
    clinic_domains.where(
      domain_type: 'CUSTOM',
      status: 'ACTIVE'
    ).first&.domain_name
  end
  
  def seos
    # Returns SEO configurations for different page types
    basic_seo_types = %w[homepage about_us gallery doctors services packages reviews]
    # ... SEO management logic
  end
end

WebsiteTheme

Available themes for clinic websites.

# Table: website_themes
class WebsiteTheme < ApplicationRecord
  has_many :clinic_website_themes
  has_many :website_theme_variations
  has_many :theme_fonts
  has_many :theme_color_schemes
  
  # Key columns:
  # name: string                 - Theme name
  # description: text            - Theme description
  # url: string                  - Theme demo URL
  # thumbnail_url: string        - Theme preview image
  # active: boolean              - Theme availability
end

ClinicWebsiteTheme

Applied theme configuration for a clinic website.

# Table: clinic_website_themes
class ClinicWebsiteTheme < ApplicationRecord
  belongs_to :clinic_website
  belongs_to :website_theme
  belongs_to :theme_color_scheme
  belongs_to :theme_font
  
  # Key columns:
  # current: boolean             - Currently active theme
  # published_at: datetime       - Theme publication timestamp
  # custom_settings: jsonb       - Theme customization data
end

Domain Management

ClinicDomain

Custom domains associated with clinic websites.

# Table: clinic_domains
class ClinicDomain < ApplicationRecord
  belongs_to :clinic_website
  has_many :clinic_domain_requests
  
  # Key columns:
  # domain_name: string          - Domain name (e.g., "myclinic.com")
  # domain_type: string          - 'DEFAULT' or 'CUSTOM'
  # status: string               - Domain status (active, inactive)
  # ssl_enabled: boolean         - SSL certificate status
  # created_at: datetime         - Domain creation timestamp
end

ClinicDomainRequest

Domain operation requests (create, verify, delete).

# Table: clinic_domain_requests
class ClinicDomainRequest < ApplicationRecord
  belongs_to :clinic_domain
  belongs_to :clinic
  
  # Key columns:
  # request_type: string         - 'CREATE', 'VERIFY', 'DELETE'
  # status: string               - Request status
  # request_data: jsonb          - Request parameters
  # response_data: jsonb         - Response from domain provider
  # failed_at: datetime          - Failure timestamp
  
  enum request_type: {
    create: 'CREATE',
    verify: 'VERIFY',
    delete: 'DELETE'
  }
  
  enum status: {
    pending: 'PENDING',
    in_progress: 'IN_PROGRESS',
    completed: 'COMPLETED',
    failed: 'FAILED'
  }
end

Google My Business Integration

GmbAccount

Google My Business account connection.

# Table: gmb_accounts
class GmbAccount < ApplicationRecord
  belongs_to :clinic, foreign_key: 'profile_id', optional: true
  has_many :gmb_account_locations
  
  # Key columns:
  # profile_id: integer          - Associated clinic ID
  # account_name: string         - GMB account name
  # account_id: string           - Google account identifier
  # access_token: string         - OAuth access token
  # refresh_token: string        - OAuth refresh token
  # expires_at: datetime         - Token expiration
end

GmbAccountLocation

Individual GMB locations (for multi-location clinics).

# Table: gmb_account_locations
class GmbAccountLocation < ApplicationRecord
  belongs_to :gmb_account
  has_many :gmb_location_questions
  has_many :gmb_location_posts
  
  # Key columns:
  # location_name: string        - Business location name
  # location_id: string          - Google location identifier
  # place_id: string             - Google Places API ID
  # address: string              - Business address
  # phone_number: string         - Contact number
  # website_url: string          - Business website
  # place_action_links: jsonb    - Google action links data
  # qanda_enabled: boolean       - Q&A feature status
end

GoogleReview

Google My Business reviews.

# Table: google_reviews
class GoogleReview < ApplicationRecord
  belongs_to :gmb_account_location
  
  # Key columns:
  # review_id: string            - Google review identifier
  # reviewer_name: string        - Reviewer name
  # rating: integer              - Star rating (1-5)
  # review_text: text            - Review content
  # review_time: datetime        - Review timestamp
  # reply_text: text             - Business reply content
  # reply_time: datetime         - Reply timestamp
end

SEO Management

ClinicWebsiteSeo

SEO configurations for different website pages.

# Table: clinic_website_seos
class ClinicWebsiteSeo < ApplicationRecord
  belongs_to :clinic_website
  
  # Key columns:
  # seo_type: string             - Page type (homepage, about_us, etc.)
  # title: string                - SEO page title
  # description: text            - Meta description
  # keywords: text               - SEO keywords
  # og_title: string             - Open Graph title
  # og_description: text         - Open Graph description
  # og_image_url: string         - Open Graph image
end

Ad Campaign Management

AdCampaignLeadsWebhook

Webhook handling for ad campaign lead capture.

# Table: ad_campaign_leads_webhooks
class AdCampaignLeadsWebhook < ApplicationRecord
  has_many :ad_campaign_leads
  
  # Key columns:
  # webhook_data: jsonb          - Complete webhook payload
  # source: string               - Lead source (facebook, google)
  # processed: boolean           - Processing status
  # error_message: text          - Error details if failed
end

API Endpoints

Growth Profile Management

Profile Operations

GET  /clinics/:clinic_id/growth_profile              # Get profile data
GET  /clinics/:clinic_id/growth_profile/dashboard    # Growth dashboard
GET  /clinics/:clinic_id/growth_profile/reports      # Growth reports
GET  /clinics/:clinic_id/growth_profile/setup_status # Setup completion
POST /clinics/:clinic_id/growth_profile/save_photo_tag # Save photo tags

Dashboard Response:

{
  "success": true,
  "data": {
    "clinic": {
      "id": 123,
      "name": "Heart Care Clinic",
      "total_appointments": 456,
      "website_visits": 789,
      "google_reviews_count": 23,
      "average_rating": 4.8
    },
    "website": {
      "status": "published",
      "domain": "heartcareclinic.com",
      "ssl_enabled": true,
      "last_published": "2024-01-15T10:30:00Z"
    },
    "google_business": {
      "connected": true,
      "locations_count": 2,
      "pending_questions": 3,
      "recent_reviews": 5
    }
  }
}

Website Management

Website Operations

POST /clinics/:clinic_id/clinic_website                    # Create website
GET  /clinics/:clinic_id/clinic_website                    # Get website details
POST /clinics/:clinic_id/clinic_website/initialize_request # Initialize setup
POST /clinics/:clinic_id/clinic_website/current_step      # Update setup step
POST /clinics/:clinic_id/clinic_website/publish           # Publish website

Theme Management

GET  /clinics/:clinic_id/clinic_website_theme              # List themes
POST /clinics/:clinic_id/clinic_website_theme              # Apply theme
GET  /clinics/:clinic_id/clinic_website_theme/:id          # Get theme details

Theme Application Example:

{
  "clinic_website_theme": {
    "website_theme_id": 5,
    "theme_color_scheme_id": 12,
    "theme_font_id": 8,
    "custom_settings": {
      "primary_color": "#2E8B57",
      "secondary_color": "#F0F8FF",
      "logo_url": "https://example.com/logo.png",
      "hero_text": "Welcome to Heart Care Clinic"
    }
  }
}

Domain Management

Domain Operations

GET  /clinics/:clinic_id/clinic_domains                    # List domains
POST /clinics/:clinic_id/clinic_domain_requests            # Request domain
PUT  /clinics/:clinic_id/clinic_domain_requests/:id        # Update request
POST /clinics/:clinic_id/clinic_domain_requests/:id/verify # Verify domain
DELETE /clinics/:clinic_id/clinic_domain_requests/:id      # Delete request

Domain Creation Request:

{
  "clinic_domain_request": {
    "domain_name": "myclinic.com",
    "request_type": "CREATE",
    "request_data": {
      "registrar": "godaddy",
      "nameservers": ["ns1.kulcare.com", "ns2.kulcare.com"]
    }
  }
}

Google My Business Integration

GMB Connection

POST /clinics/:clinic_id/google_my_business              # Connect GMB account
GET  /clinics/:clinic_id/google_my_business/connection   # Check connection status

Location Management

GET  /clinics/:clinic_id/growth_profile/google_locations # List GMB locations
POST /clinics/:clinic_id/growth_profile/google_locations # Update location

Review Management

GET  /clinics/:clinic_id/growth_profile/google_reviews              # List reviews
POST /clinics/:clinic_id/growth_profile/google_reviews/:review_id/review_reply # Reply to review
POST /clinics/:clinic_id/growth_profile/google_reviews/:review_id/review_reply/delete # Delete reply

Posts & Questions

GET  /clinics/:clinic_id/growth_profile/google_posts        # List posts
POST /clinics/:clinic_id/growth_profile/google_posts        # Create post
PUT  /clinics/:clinic_id/growth_profile/google_posts/:id    # Update post
DELETE /clinics/:clinic_id/growth_profile/google_posts/:id  # Delete post
GET  /clinics/:clinic_id/growth_profile/google_posts/:id/insights # Post insights

GET  /clinics/:clinic_id/growth_profile/google_questions       # List Q&A
POST /clinics/:clinic_id/growth_profile/google_questions       # Create question
POST /clinics/:clinic_id/growth_profile/google_questions/:id/answer # Answer question
POST /clinics/:clinic_id/growth_profile/google_questions/create_multiple # Bulk create

Services & Packages

Service Management

GET  /clinics/:clinic_id/growth_profile/services           # List services
PUT  /clinics/:clinic_id/growth_profile/services/:id       # Update service
DELETE /clinics/:clinic_id/growth_profile/services/:id     # Delete service
POST /clinics/:clinic_id/growth_profile/services/copy      # Copy services

Package Management

GET  /clinics/:clinic_id/growth_profile/packages           # List packages
PUT  /clinics/:clinic_id/growth_profile/packages/:id       # Update package
DELETE /clinics/:clinic_id/growth_profile/packages/:id     # Delete package
POST /clinics/:clinic_id/growth_profile/packages/copy      # Copy packages

SEO & Analytics

SEO Management

GET  /clinics/:clinic_id/growth_profile_seo                # Get SEO settings
POST /clinics/:clinic_id/growth_profile_seo                # Update SEO settings

Analytics

GET  /clinics/:clinic_id/growth_profile_analytics          # Get analytics
POST /clinics/:clinic_id/growth_profile_analytics          # Update analytics settings

Reports & Insights

Growth Reports

GET  /clinics/:clinic_id/growth_profile/reports/ad_campaigns    # Ad campaign reports
GET  /clinics/:clinic_id/growth_profile/reports/email_campaigns # Email campaign reports
GET  /clinics/:clinic_id/growth_profile/reports/credits         # Credit usage reports
GET  /clinics/:clinic_id/growth_profile/reports/messaging       # Messaging reports

Ad Campaign Webhooks

Lead Capture

POST /ad_campaign_leads/webhook                          # Webhook endpoint for leads

Business Logic (Interactors)

Website Management

Website Creation Flow

# parts/growth/interactors/clinic_website_management/create.rb
class ClinicWebsiteManagement::Create
  include Interactor
  
  def call
    # 1. Validate clinic eligibility
    # 2. Create website record
    # 3. Set up default theme
    # 4. Initialize SEO settings
    # 5. Create default domain
    # 6. Send creation notifications
  end
end

Publishing Process

# parts/growth/interactors/clinic_website_management/publish.rb
class ClinicWebsiteManagement::Publish
  include Interactor
  
  def call
    # 1. Validate website completeness
    # 2. Generate static website files
    # 3. Deploy to hosting infrastructure
    # 4. Update DNS records
    # 5. Enable SSL certificates
    # 6. Update publication timestamp
  end
end

Domain Management

Custom Domain Setup

# parts/growth/interactors/domains/verify_and_host.rb
class Domains::VerifyAndHost
  include Interactor
  
  def call
    # 1. Verify domain ownership
    # 2. Configure DNS settings
    # 3. Set up SSL certificate
    # 4. Update hosting configuration
    # 5. Test domain accessibility
    # 6. Activate domain
  end
end

Google My Business Integration

GMB Connection

# parts/growth/interactors/gmb_management/add_connection.rb
class GmbManagement::AddConnection
  include Interactor
  
  def call
    # 1. Validate OAuth tokens
    # 2. Fetch GMB account details
    # 3. Import business locations
    # 4. Sync existing reviews
    # 5. Enable webhooks for updates
    # 6. Store connection details
  end
end

Review Reply Management

# parts/growth/interactors/gmb_review_reply/create.rb
class GmbReviewReply::Create
  include Interactor
  
  def call
    # 1. Validate review exists
    # 2. Check reply permissions
    # 3. Post reply to Google
    # 4. Store reply locally
    # 5. Update review status
    # 6. Track reply analytics
  end
end

External Service Integration

Google My Business Services

Profile Synchronization

# parts/growth/services/sync_google_profile.rb
class SyncGoogleProfile
  def self.call(gmb_account_location)
    # Sync business profile data from Google
    # Update local records with latest information
    # Handle API rate limiting
    # Log sync activities
  end
end

Post Management

# parts/growth/services/create_google_post.rb
class CreateGooglePost
  def self.call(location, post_data)
    # Create post on Google My Business
    # Handle different post types (update, offer, event)
    # Upload media if present
    # Return post details
  end
end

Domain Management Services

Automatic Domain Mapping

# parts/growth/services/auto_map_domain_https.rb
class AutoMapDomainHttps
  def self.call(clinic_domain)
    # Configure SSL certificate
    # Update load balancer settings
    # Set up HTTPS redirects
    # Verify SSL configuration
  end
end

SSL Certificate Management

# parts/growth/services/auto_remove_domain.rb
class AutoRemoveDomain
  def self.call(clinic_domain)
    # Remove domain from hosting
    # Revoke SSL certificates
    # Clean up DNS records
    # Update database records
  end
end

Growth Profile Features

Setup Wizard

The growth profile includes a step-by-step setup wizard:

  1. Basic Information: Clinic details, contact information
  2. Services Setup: Configure services and packages
  3. Photo Management: Upload and tag photos
  4. Theme Selection: Choose and customize website theme
  5. SEO Configuration: Set up meta tags and descriptions
  6. Domain Setup: Configure custom domain (optional)
  7. Google Integration: Connect Google My Business
  8. Review Settings: Configure review management

Dashboard Analytics

Key Metrics Tracked

  • Website visitor count and sources
  • Google My Business profile views
  • Review ratings and response rates
  • Appointment bookings from online sources
  • Search engine ranking positions
  • Click-through rates on Google posts

Reporting Features

# Example dashboard data structure
{
  overview: {
    total_visits: 1250,
    new_patients: 45,
    google_profile_views: 890,
    average_rating: 4.7,
    total_reviews: 123
  },
  trends: {
    visits_trend: "↑ 23% from last month",
    reviews_trend: "↑ 12% from last month",
    ratings_trend: "→ Stable"
  },
  top_sources: [
    { source: "Google Search", visits: 456, percentage: 36.5 },
    { source: "Direct", visits: 234, percentage: 18.7 },
    { source: "Social Media", visits: 178, percentage: 14.2 }
  ]
}

Advanced Features

Campaign Management

Lead Capture System

The growth features include a sophisticated lead capture system:

  • Landing Pages: Custom landing pages for marketing campaigns
  • Form Builder: Drag-and-drop form creation
  • Lead Scoring: Automatic lead qualification
  • CRM Integration: Direct integration with clinic patient management
  • Follow-up Automation: Automated email sequences

Marketing Automation

# Example campaign workflow
{
  campaign: {
    name: "New Patient Special",
    target_audience: "Local residents aged 25-45",
    channels: ["google_ads", "facebook_ads"],
    budget: 5000,
    duration: "30 days"
  },
  landing_page: {
    theme: "medical_professional",
    headline: "Get Your Health Check-up Today",
    offer: "50% off first consultation",
    form_fields: ["name", "phone", "email", "preferred_time"]
  },
  automation: {
    immediate_response: "Thank you email with clinic details",
    follow_up_sequence: [
      { delay: "1 hour", action: "appointment_reminder_sms" },
      { delay: "1 day", action: "clinic_information_email" },
      { delay: "3 days", action: "special_offer_reminder" }
    ]
  }
}

Reputation Management

Review Response Templates

# Automated review response suggestions
{
  positive_templates: [
    "Thank you for your wonderful review! We're thrilled that you had such a positive experience.",
    "We appreciate your kind words and are glad we could provide excellent care.",
    "Your feedback means the world to us. Thank you for choosing our clinic!"
  ],
  negative_templates: [
    "We sincerely apologize for your experience. Please contact us directly so we can make this right.",
    "Thank you for bringing this to our attention. We'd like to discuss this further to improve our service.",
    "We take all feedback seriously and would appreciate the opportunity to address your concerns."
  ]
}

Review Monitoring

  • Real-time Alerts: Immediate notifications for new reviews
  • Sentiment Analysis: Automatic categorization of review sentiment
  • Response Tracking: Monitor response times and rates
  • Competitive Analysis: Compare ratings with nearby clinics

Security & Privacy

Data Protection

  1. Patient Privacy: No patient data included in public websites
  2. Secure Authentication: OAuth 2.0 for Google integrations
  3. SSL Encryption: All websites secured with SSL certificates
  4. Access Controls: Role-based permissions for growth features

Compliance

  1. HIPAA Compliance: No PHI in marketing materials
  2. GDPR Compliance: Data retention and deletion policies
  3. Medical Advertising: Compliance with healthcare advertising regulations
  4. Platform Policies: Adherence to Google and Facebook policies

Best Practices

Website Optimization

  1. Mobile-First Design: All themes are mobile-responsive
  2. Fast Loading: Optimized images and caching
  3. SEO-Friendly: Clean URLs and structured data
  4. Accessibility: WCAG compliance for all themes
  5. Local SEO: Location-based optimization

Review Management

  1. Prompt Responses: Reply to reviews within 24 hours
  2. Professional Tone: Maintain clinical professionalism
  3. Address Concerns: Take negative feedback seriously
  4. Encourage Reviews: Systematic patient review requests
  5. Monitor Competitors: Track competitor review strategies

Marketing Campaign Success

  1. Clear Value Propositions: Highlight unique clinic benefits
  2. Local Targeting: Focus on geographic service area
  3. Seasonal Campaigns: Align with health awareness months
  4. A/B Testing: Test different messaging and offers
  5. Track Conversions: Measure appointment bookings from campaigns

Error Handling & Monitoring

Common Issues

  1. Domain Verification Failures: DNS configuration problems
  2. SSL Certificate Issues: Certificate renewal and validation
  3. Google API Limits: Rate limiting and quota management
  4. Website Publishing Failures: Deployment and hosting issues

Monitoring & Alerting

# Growth features health check
def growth_health_check
  {
    websites_published: ClinicWebsite.where(status: 'published').count,
    domains_active: ClinicDomain.where(status: 'ACTIVE').count,
    ssl_expiring_soon: ClinicDomain.where('ssl_expires_at < ?', 30.days.from_now).count,
    gmb_connections_active: GmbAccount.where('expires_at > ?', Time.current).count,
    pending_domain_requests: ClinicDomainRequest.where(status: 'PENDING').count
  }
end

Integration Guidelines

For Frontend Development

  1. Progressive Enhancement: Build for all device types
  2. Real-time Updates: WebSocket integration for live data
  3. Offline Capability: Cache essential data for offline access
  4. User Feedback: Clear progress indicators for long operations
  5. Error Recovery: Graceful handling of API failures

For Marketing Integration

  1. Campaign Tracking: UTM parameter integration
  2. Lead Attribution: Source tracking for all conversions
  3. Pixel Installation: Facebook and Google tracking pixels
  4. Conversion Events: Track appointment bookings and calls
  5. ROI Measurement: Cost per acquisition tracking

On this page

OverviewKey FeaturesArchitectureParts-Based StructureTechnology StackCore Data ModelsWebsite ManagementClinicWebsiteWebsiteThemeClinicWebsiteThemeDomain ManagementClinicDomainClinicDomainRequestGoogle My Business IntegrationGmbAccountGmbAccountLocationGoogleReviewSEO ManagementClinicWebsiteSeoAd Campaign ManagementAdCampaignLeadsWebhookAPI EndpointsGrowth Profile ManagementProfile OperationsWebsite ManagementWebsite OperationsTheme ManagementDomain ManagementDomain OperationsGoogle My Business IntegrationGMB ConnectionLocation ManagementReview ManagementPosts & QuestionsServices & PackagesService ManagementPackage ManagementSEO & AnalyticsSEO ManagementAnalyticsReports & InsightsGrowth ReportsAd Campaign WebhooksLead CaptureBusiness Logic (Interactors)Website ManagementWebsite Creation FlowPublishing ProcessDomain ManagementCustom Domain SetupGoogle My Business IntegrationGMB ConnectionReview Reply ManagementExternal Service IntegrationGoogle My Business ServicesProfile SynchronizationPost ManagementDomain Management ServicesAutomatic Domain MappingSSL Certificate ManagementGrowth Profile FeaturesSetup WizardDashboard AnalyticsKey Metrics TrackedReporting FeaturesAdvanced FeaturesCampaign ManagementLead Capture SystemMarketing AutomationReputation ManagementReview Response TemplatesReview MonitoringSecurity & PrivacyData ProtectionComplianceBest PracticesWebsite OptimizationReview ManagementMarketing Campaign SuccessError Handling & MonitoringCommon IssuesMonitoring & AlertingIntegration GuidelinesFor Frontend DevelopmentFor Marketing IntegrationRelated Documentation