Skip to main content

Platform Architecture

ScentLok uses a headless commerce architecture combining WordPress for content management with BigCommerce for e-commerce functionality.

System Overview

┌─────────────────────────────────────────────────────────────┐
│ Frontend Layer │
│ WordPress 6.6.2 + Suma Elementor Theme v3.0.0 │
│ - Content pages │
│ - Product display (BigCommerce data) │
│ - Customer account pages │
│ - SLoyalty widget integration │
└─────────────────────────────────────────────────────────────┘

│ REST API / GraphQL

┌─────────────────────────────────────────────────────────────┐
│ Integration Layer │
│ BigCommerce for WordPress (Suma v5.0.7.17) │
│ - Product sync │
│ - Inventory management │
│ - Cart & checkout │
│ - Order processing │
└─────────────────────────────────────────────────────────────┘
│ │ │
│ │ │
▼ ▼ ▼
┌─────────────┐ ┌─────────────────┐ ┌──────────────┐
│ BigCommerce │ │ SLoyalty │ │ Narvar │
│ Platform │ │ Loyalty API │ │ Tracking │
│ │ │ (e6838c7d) │ │ │
└─────────────┘ └─────────────────┘ └──────────────┘

Core Components

WordPress (CMS)

Version: 6.6.2
Database: MySQL 8.0+
PHP: 8.1+

WordPress serves as the content management system handling:

  • Page and post content
  • Navigation and menus
  • User management
  • Media library
  • Custom post types

BigCommerce (Commerce Engine)

Integration: Suma BC4WP v5.0.7.17 (custom fork)

BigCommerce provides the e-commerce backbone:

  • Product catalog management
  • Inventory and pricing
  • Cart functionality
  • Secure checkout
  • Order processing
  • Payment gateway integration

Key Features:

  • Bi-directional sync control
  • Real-time inventory updates
  • Webhook-based product updates
  • Gift certificate support
  • Custom pricing rules

SLoyalty (Loyalty Program)

API Key: e6838c7d
Integration Method: JavaScript widget + API

SLoyalty provides customer loyalty features:

  • Points earning on purchases
  • Account widget for customers
  • Checkout integration
  • Custom domain configuration

Narvar (Order Tracking)

Middleware: BigCommerce Middleware for Narvar v1.2.20

Narvar provides post-purchase experience:

  • Order tracking pages
  • Shipment notifications
  • Delivery updates
  • Webhook processing

Data Flow

Product Display Flow

BigCommerce → Webhook → WordPress → Import Queue → 
Custom Post Types → Product Pages → Customer View
  1. Product changes in BigCommerce trigger webhooks
  2. WordPress receives webhook and queues import
  3. Cron job processes queue
  4. Product data stored as custom post type
  5. Theme renders product pages with BC data

Checkout Flow

Customer → Add to Cart → WordPress (temp) → 
BigCommerce Cart API → BigCommerce Checkout →
Order Created → SLoyalty Points → Narvar Tracking
  1. Customer adds products to cart in WordPress
  2. Cart data synced to BigCommerce via API
  3. Checkout redirects to BigCommerce
  4. Order created in BigCommerce
  5. SLoyalty processes points earning
  6. Narvar receives tracking information

Loyalty Points Flow

Order Complete → SLoyalty API → Points Calculated → 
Customer Account Updated → Email Notification

Infrastructure

Hosting Environment

  • Web Server: Nginx
  • Application Server: PHP-FPM 8.1
  • Database: MySQL 8.0
  • Caching: Redis (object cache)
  • CDN: Cloudflare
  • SSL: Let's Encrypt

Performance Optimizations

Caching Strategy:

  • Redis object cache for WordPress
  • Browser caching for static assets
  • API response caching (5-minute TTL)
  • BigCommerce product cache (15-minute TTL)

Asset Optimization:

  • Laravel Mix for CSS/JS bundling
  • Webpack code splitting
  • Image lazy loading
  • SVG sprites for icons

Security

WordPress Security:

  • WPS Hide Login v1.9.17.1 (custom login URL)
  • WP 2FA v2.8.0 (two-factor authentication)
  • WP Activity Log v5.3.3 (audit trail)
  • Headers Security v5.0.42 (security headers)

BigCommerce Security:

  • OAuth token authentication
  • Webhook HMAC signature validation
  • API rate limiting
  • Secure checkout domain

Integrations Overview

ServicePurposeVersion/Key
BigCommerceE-commerce platformBC4WP v5.0.7.17
SLoyaltyLoyalty programAPI Key: e6838c7d
NarvarOrder trackingv1.2.20
KlaviyoEmail marketingCompany: VE7rVK
BazaarVoiceReviewsIntegrator v1.1.4
FacetWPFaceted searchv4.3.5
AlgoliaInstant searchv2.8.2
Google AnalyticsAnalyticsGA4 via GTM

API Endpoints

BigCommerce APIs Used

# Product API
GET /v3/catalog/products
GET /v3/catalog/products/{id}

# Cart API
POST /v3/carts
GET /v3/carts/{id}
POST /v3/carts/{id}/items

# Customer API
GET /v3/customers
POST /v3/customers

# Webhook API
POST /v3/hooks (registration)

SLoyalty API

# Points Balance
GET https://api.sloyalty.com/v1/customers/{email}/balance

# Add Points
POST https://api.sloyalty.com/v1/transactions

# Widget Configuration
GET https://api.sloyalty.com/v1/widget/config

WordPress REST API Endpoints

# Custom BigCommerce endpoints
GET /wp-json/bigcommerce/v1/products
GET /wp-json/bigcommerce/v1/cart
POST /wp-json/bigcommerce/v1/cart/add

# SLoyalty integration
GET /wp-json/sloyalty/v1/customer
POST /wp-json/sloyalty/v1/points

Database Schema

Key Custom Tables

-- BigCommerce product cache
wp_bigcommerce_products
- bc_id (BigCommerce product ID)
- post_id (WordPress post ID)
- sku
- price
- inventory_level
- last_sync

-- SLoyalty customer data
wp_sloyalty_customers
- user_id
- sloyalty_customer_id
- points_balance
- tier_level
- last_sync

Deployment Architecture

Environments

  1. Local Development

    • Laravel Herd or Local by Flywheel
    • Local MySQL database
    • BigCommerce sandbox store
  2. Staging

    • Staging subdomain
    • Separate BigCommerce test store
    • SLoyalty test environment
  3. Production

    • scentlok.com domain
    • Production BigCommerce store
    • Live SLoyalty integration
    • CDN enabled

Deployment Process

# 1. Build assets
npm run production

# 2. Deploy code
git push origin main

# 3. Run migrations (if needed)
wp db query < migrations/migration.sql

# 4. Clear caches
wp cache flush
wp rewrite flush

# 5. Test critical paths
# - Product display
# - Add to cart
# - Checkout redirect
# - SLoyalty widget

Monitoring & Logging

Application Monitoring

  • Error Logging: WordPress debug.log
  • Activity Log: WP Activity Log plugin
  • Performance: Query Monitor plugin
  • API Monitoring: BigCommerce webhook logs

Key Metrics

  • Product sync success rate
  • Cart-to-checkout conversion
  • API response times
  • SLoyalty points processing
  • Search query performance

Backup Strategy

  • Database: Daily automated backups (7-day retention)
  • Files: Weekly full site backups (30-day retention)
  • BigCommerce: Native BC platform backups
  • Git: Version control for theme and custom code