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
- Product changes in BigCommerce trigger webhooks
- WordPress receives webhook and queues import
- Cron job processes queue
- Product data stored as custom post type
- 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
- Customer adds products to cart in WordPress
- Cart data synced to BigCommerce via API
- Checkout redirects to BigCommerce
- Order created in BigCommerce
- SLoyalty processes points earning
- 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
| Service | Purpose | Version/Key |
|---|---|---|
| BigCommerce | E-commerce platform | BC4WP v5.0.7.17 |
| SLoyalty | Loyalty program | API Key: e6838c7d |
| Narvar | Order tracking | v1.2.20 |
| Klaviyo | Email marketing | Company: VE7rVK |
| BazaarVoice | Reviews | Integrator v1.1.4 |
| FacetWP | Faceted search | v4.3.5 |
| Algolia | Instant search | v2.8.2 |
| Google Analytics | Analytics | GA4 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
-
Local Development
- Laravel Herd or Local by Flywheel
- Local MySQL database
- BigCommerce sandbox store
-
Staging
- Staging subdomain
- Separate BigCommerce test store
- SLoyalty test environment
-
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