Skip to main content
FilterIQRequest access
Menu
Type to search across all documentation
NavigateEnterOpenEscClose
5 min read

Architecture Overview

Technical architecture of FilterIQ for developers.

Architecture Overview

This page describes the technical architecture of FilterIQ for developers who want to understand how the system works, build custom integrations, or troubleshoot issues.

System Diagram

┌──────────────────────────────────────────────────────────────┐
│                    SHOPIFY STOREFRONT                         │
│  ┌────────────────────────────────────────────────────────┐  │
│  │  Theme App Extension (JavaScript + Liquid)              │  │
│  │  ├── Search Widget (autocomplete, results rendering)    │  │
│  │  ├── Filter Sidebar (faceted filtering UI)              │  │
│  │  └── Event Tracking (clicks, impressions, conversions)  │  │
│  └──────────────────┬─────────────────────────────────────┘  │
│                     │                                         │
│  ┌──────────────────▼─────────────────────────────────────┐  │
│  │  Shopify App Proxy (/apps/search-filter/*)              │  │
│  └──────────────────┬─────────────────────────────────────┘  │
└─────────────────────┼────────────────────────────────────────┘
                      │ HTTPS
┌─────────────────────▼────────────────────────────────────────┐
│                    BACKEND API SERVER                         │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────────┐   │
│  │  Search API   │  │  Config API   │  │  Analytics API    │   │
│  │  /api/search  │  │  /api/config  │  │  /api/analytics   │   │
│  └──────┬───────┘  └──────┬───────┘  └──────┬───────────┘   │
│         │                  │                  │                │
│  ┌──────▼──────────────────▼──────────────────▼───────────┐  │
│  │                    Service Layer                         │  │
│  │  ├── Search Service (query processing, ranking)         │  │
│  │  ├── Filter Service (facet configuration)               │  │
│  │  ├── Merchandising Service (boost/bury/pin/hide rules)  │  │
│  │  ├── Sync Service (Shopify → search engine indexing)    │  │
│  │  └── Analytics Service (event aggregation, reporting)   │  │
│  └──────┬───────────────────┬─────────────────┬───────────┘  │
│         │                   │                  │               │
│  ┌──────▼───────┐  ┌───────▼──────┐  ┌───────▼───────────┐  │
│  │  Search       │  │  Database     │  │  Cache             │  │
│  │  Engine       │  │  (PostgreSQL)  │  │  Layer             │  │
│  └──────────────┘  └──────────────┘  └────────────────────┘  │
└──────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────┐
│                    SHOPIFY ADMIN                              │
│  ┌────────────────────────────────────────────────────────┐  │
│  │  Embedded Admin App (React Router)                       │  │
│  │  ├── Dashboard (overview, sync status)                  │  │
│  │  ├── Search Config (attributes, synonyms, autocomplete) │  │
│  │  ├── Filter Config (filter types, ordering, presets)    │  │
│  │  ├── Merchandising (pin, boost, demote, hide, rules)    │  │
│  │  └── Analytics (search reports, filter reports)          │  │
│  └──────────────────┬─────────────────────────────────────┘  │
│                     │ Authenticated API calls                 │
│                     └─────────────────────────────────────────┘
└──────────────────────────────────────────────────────────────┘

Technology Stack

LayerTechnologyPurpose
StorefrontLiquid + JavaScript (Theme App Extension)Search UI, filter UI, event tracking
AdminReact Router 7, Polaris, TypeScriptAdmin dashboard
API GatewayShopify App ProxySecure routing from storefront to backend
BackendPython, PydanticBusiness logic, API endpoints
Search EngineDedicated search engineFull-text search, faceted filtering
DatabasePostgreSQLConfiguration, analytics, user data
CacheIn-memory cacheSearch cache, session data, rate limiting
Frontend HostingCloud hostingAdmin app hosting
Backend HostingCloud hostingAPI hosting

Multi-Tenant Architecture

FilterIQ is a multi-tenant application. Every data operation is scoped to a shop_domain:

  • Database: All queries include a shop_domain filter. Row-Level Security (RLS) policies enforce tenant isolation at the database level
  • Search Engine: Each shop gets its own search index (named by shop domain)
  • Cache: Cache keys are prefixed with shop domain
  • API: Shop identity is extracted from verified JWT tokens, never from client-provided data

Authentication Flow

1. Merchant installs app → Shopify OAuth flow
2. Shopify provides access token → stored in the database
3. Admin requests use Shopify session tokens (JWT)
4. Storefront requests go through App Proxy (Shopify verifies authenticity)
5. Backend validates JWT on every request → extracts shop_domain

Security rule: The backend never trusts client-provided shop_domain. It's always extracted from the verified session token.

Data Flow: Product Indexing

Shopify Product Webhook (create/update/delete)
    ↓
Backend Webhook Handler
    ↓
Validation + shop_domain extraction
    ↓
Product data transformation (Shopify format → search document)
    ↓
Search index update (add/update/delete document)
    ↓
Search results reflect change (< 1 second)

Data Flow: Search Query

Shopper types in search bar
    ↓
Theme Extension JavaScript debounces input (150ms)
    ↓
Request to /apps/search-filter/api/search?q=...
    ↓
Shopify App Proxy forwards to backend
    ↓
Backend: validate request, check cache
    ↓ (cache miss)
Backend: apply merchandising rules to query
    ↓
Search engine: execute search with filters and facets
    ↓
Backend: format results, cache response
    ↓
Response to storefront (< 50ms total)
    ↓
Theme Extension renders results

API Endpoints

Storefront API (via App Proxy)

EndpointMethodPurpose
/apps/search-filter/api/searchGETExecute search query
/apps/search-filter/api/autocompleteGETAutocomplete suggestions
/apps/search-filter/api/filtersGETGet filter configuration
/apps/search-filter/api/trackPOSTTrack analytics event

Admin API (authenticated)

EndpointMethodPurpose
/api/config/searchGET, PUTSearch configuration
/api/config/filtersGET, PUTFilter configuration
/api/config/merchandisingGET, PUTMerchandising rules
/api/config/synonymsGET, PUT, DELETESynonym management
/api/analytics/*GETAnalytics reports
/api/sync/statusGETProduct sync status

Performance Characteristics

MetricTargetTypical
Search query response< 50ms20-40ms
Autocomplete response< 30ms10-25ms
Product index update< 1s200-500ms
Theme Extension JS size< 30KB gzipped~25KB
Theme Extension CSS size< 5KB gzipped~3KB
EndpointLimit
Search API100 requests/second per shop
Autocomplete API200 requests/second per shop
Analytics tracking50 requests/second per shop
Admin API20 requests/second per shop

Rate limits are enforced per-shop. Exceeding limits returns HTTP 429.

Was this page helpful?