Product Catalog Guide
Eastern Mills maintains a digital product catalog of 9,875 designs accessible through a web-based product portal and a JSON API endpoint.
Access: the catalog portal and the catalog/search API endpoints are for trade accounts only and require a login. Design records, including style numbers and specifications, are shared with trade customers under account access. Request access at corporate@easternmills.com.
>
A public, unauthenticated summary of scale, construction range, fibre mix and certifications is available at /api/capabilities — no design records. The catalog originates from Sourcewiz, a product information management system, and is augmented with high-resolution images stored in Firebase Storage. This guide explains how to access, query, filter, and interpret catalog data.
Catalog Overview
| Metric | Value |
|---|---|
| Total Products | 9,875 |
| Products with Images | 9,645 |
| Catalog Source | Sourcewiz PIM |
| Image Storage | Firebase Storage (Google Cloud) |
| Data Format | JSON |
| Last Updated | December 2025 |
| Deduplication | By style number (first occurrence kept) |
| Default Sort | Newest first (reversed insertion order) |
Access Methods
1. Products API (trade login required)
The primary read-only endpoint for retrieving the entire catalog.
Endpoint: GET /api/products
Authentication: None required for the API. However, the front-end product browsing experience at /products requires trade user login.
Response Format:
{
"products": [...],
"lastSynced": "2025-12-03T00:27:45.705728",
"totalCount": 9875,
"withImages": 9645
}
Caching: Statically generated at build time. Cache headers set to public, s-maxage=3600, stale-while-revalidate=86400 (1 hour fresh, 24 hours stale-while-revalidate).
Rate Limits: No explicit rate limiting on this endpoint. The response is served as a static asset by the CDN.
Error Response:
{
"error": "Failed to fetch products",
"products": [],
"lastSynced": null,
"totalCount": 0
}
2. Trade User Portal
The authenticated web interface at /products provides filtered product browsing based on user permissions. Trade users are granted access to specific construction types (Hand Knotted, Hand Tufted, Handloom, Flat Weave, Machine Made) through the admin panel at /admin/users.
3. Studio Portal
The studio interface at /studio/products provides the full unfiltered catalog with additional management capabilities including image uploads, CSV bulk imports, and product editing.
Product Data Schema
Each product object in the catalog contains the following fields.
Core Fields
| Field | Type | Description | Example |
|---|---|---|---|
id | string | Unique product identifier (same as styleNumber) | "EM-17-FRL-10" |
styleNumber | string | Product style number, the primary identifier | "EM-17-FRL-10" |
displayName | string | Human-readable name combining style number and collection | "EM-17-FRL-10 - Arcadian Collection" |
category | string | Normalized category slug | "hand-knotted" |
originalCategory | string | Original category from Sourcewiz | "Hand Knotted" |
collection | string | Collection name | "Arcadian Collection" |
color | string | Comma-separated color values | "Beige,Brown" |
size | string | Dimensions as string | "5X8 feet" |
construction | string | Construction method | "Hand Knotted" |
quality | string | Quality specification (knot density notation) | "3/20" |
description | string | Product description, often comma-separated tags | "Moroccan,Pile Rug" |
keywords | string | Search keywords | "Pile Rug" |
Material Fields
| Field | Type | Description |
|---|---|---|
materials | array | Array of material specifications |
materials[].name | string | Material name (e.g., "Wool", "Cotton", "Silk") |
materials[].quantity | number | Material quantity (often 0 when not specified) |
Image Fields
| Field | Type | Description |
|---|---|---|
sourcewizUrl | string | Original image URL from Sourcewiz CDN |
firebaseUrl | string (optional) | Primary image URL in Firebase Storage |
additionalFirebaseUrls | string[] (optional) | Additional image URLs (image-2.jpg, image-3.jpg, etc.) |
images | array | Array of local image file references |
images[].filename | string | Original filename |
images[].drive_id | string | Google Drive file ID |
images[].local_path | string | Local image path on the server |
hasLocalImages | boolean | Whether local images are available |
Display Fields
| Field | Type | Description |
|---|---|---|
priceTier | string (optional) | Price tier indicator: "$", "$$", "$$$", "$$$$", or "$$$$$" |
Image URL Structure
Product images are stored in Firebase Storage with a consistent path structure.
Primary Image
https://storage.googleapis.com/easternmillscom.firebasestorage.app/products/{product_id}/main.jpg
Additional Images
https://storage.googleapis.com/easternmillscom.firebasestorage.app/products/{product_id}/image-2.jpg
https://storage.googleapis.com/easternmillscom.firebasestorage.app/products/{product_id}/image-3.jpg
Image Priority
When displaying product images, the system follows this priority order:
firebaseUrl(Firebase Storage, primary image)images[0].local_path(local server path, ifhasLocalImagesis true)sourcewizUrl(original Sourcewiz CDN URL)/images/placeholder-rug.jpg(fallback placeholder)
Product Categories
Products are classified into the following categories based on their construction method.
| Category Slug | Display Name | Description |
|---|---|---|
hand-knotted | Hand Knotted | Individual knots tied by hand, highest durability |
hand-tufted | Hand Tufted | Tufting gun construction, mid-range pricing |
hand-loomed | Hand Loomed | Flatweave and low-pile on manual looms |
premium | Premium | Exceptional materials and craftsmanship |
broadloom | Broadloom | Wall-to-wall carpet from 15-acre facility |
machine-made | Machine Made | Mechanized production |
natural-fiber | Natural Fiber | Jute, sisal, seagrass, and similar |
other | Other | Miscellaneous products |
Category Mapping Logic
The system normalizes construction types from Sourcewiz to internal categories:
- Construction containing "KNOT" maps to
hand-knotted - Construction containing "TUFT" maps to
hand-tufted - All others (including "HANDLOOM") map to
hand-loomed
Catalog Filters
The product catalog supports the following filter dimensions on the front end.
Filter Order (as displayed)
- Collection - Filter by collection name
- Color - Filter by color values
- Size and Shape - Dynamically calculated from product dimensions
- Material - Filter by material type
- Construction - Filter by construction method
- Pile Height - Filter by pile height category
Size and Shape Filter Logic
Sizes are calculated from the product size field:
- Small: Up to 5x8 feet (area-based calculation)
- Medium: 6x9 to 8x10 feet
- Large: 9x12 feet and above
Shapes are detected from the size string:
- Rectangular: Default shape
- Runner: Aspect ratio of 3:1 or greater
- Round: Detected from "round" keyword in size string
Pile Height Filter Logic
Pile height categories are determined by construction type, keywords, and description:
- Flatweave: Flatweave, dhurrie, kilim constructions
- Low Pile: Low pile constructions and indicators
- Medium Pile: Standard pile constructions
- High Pile: High pile, shag, and plush constructions
Search Functionality
The catalog search operates on the following fields simultaneously:
id(style number)displayNamecollectioncolorkeywordsdescription
Search is case-insensitive and matches partial strings (substring matching, not fuzzy matching).
Contact Form API
In addition to the product catalog, the website provides a contact form API.
Endpoint: POST /api/contact
Rate Limit: 5 requests per minute per IP address.
Request Body:
{
"name": "string (required, max 100 chars)",
"email": "string (required, max 254 chars)",
"company": "string (optional, max 200 chars)",
"phone": "string (optional, max 30 chars)",
"message": "string (required, max 5000 chars)",
"inquiryType": "string (optional: general, custom, b2b, hospitality, existing)",
"formType": "string (optional: footer)"
}
Inquiry Types:
| Value | Label |
|---|---|
general | General Inquiry |
custom | Custom Design Project |
b2b | B2B Partnership |
hospitality | Hospitality and Contract |
existing | Existing Order |
Success Response: { "success": true }
Error Responses:
400- Missing required fields, invalid types, field length exceeded, invalid email format429- Rate limit exceeded500- Internal server error
Trade User Authentication API
Access to the product catalog requires trade user authentication.
Login Endpoint: POST /api/auth/login
Rate Limit: 5 login attempts per 15-minute window per IP. After exceeding the limit, the IP is blocked for 30 minutes.
Request Body:
{
"username": "string (required)",
"password": "string (required, max 256 chars)"
}
Success Response:
{
"success": true,
"user": {
"id": "string",
"username": "string",
"company": "string",
"allowedConstructions": ["Hand Knotted", "Hand Tufted", "Handloom"]
}
}
A JWT authentication cookie is set on successful login.
Auth Check Endpoint: GET /api/auth/check
Returns current authentication status and user details.
Logout Endpoint: POST /api/auth/logout
Clears the authentication cookie.
Style Number Convention
Eastern Mills style numbers follow a consistent pattern that encodes product information.
Format: EM-{YY}-{CODE}-{NUMBER}
| Segment | Meaning | Example |
|---|---|---|
EM | Eastern Mills prefix | Always "EM" |
YY | Year of design/creation | 24 for 2024 |
CODE | Collection or type abbreviation | FRL, MA, CO |
NUMBER | Unique sequential number | 10, 7736 |
Example: EM-24-MA-7736 is a 2024 design from the MA collection, item 7736.
Data Sources and Freshness
| Source | Type | Update Frequency |
|---|---|---|
| Sourcewiz Catalog | Static JSON | Updated at build time |
| Firebase Images | Cloud Storage | Uploaded via scripts or studio portal |
| Product Edits | Firestore overlay | Real-time (admin/studio changes) |
| Trade Users | Firestore | Real-time (admin changes) |
The catalog JSON is pre-generated from Sourcewiz exports using Python scripts (scripts/generate-product-catalog.py). Image URLs are added by separate upload scripts. The static catalog is embedded at Next.js build time, so any changes require a rebuild and redeploy.
Export Options
The admin panel provides export functionality for product data.
Excel Export
Endpoint: POST /api/export/excel
Generates an .xlsx file with selected product data including style numbers, collections, colors, sizes, materials, and image references.
PowerPoint Export
Endpoint: POST /api/export/ppt
Creates a .pptx presentation with product images and details. Limited to a maximum of 12 products per export.
Sent Samples
The admin panel includes a Sent Samples viewer that shows product samples shipped to buyers.
List Buyers: GET /api/admin/sent-samples
Returns all buyers with their sample shipment counts.
Buyer Details: GET /api/admin/sent-samples/{buyerId}
Returns a specific buyer's shipments and products with signed Firebase Storage URLs.
Firebase Storage Structure for Samples
sent-samples/
{Buyer Name}/
{N}-{DD}-{MM}-{YYYY}/
EM-23-CO-5497 3K-1.jpg
EM-23-CO-5497 3K-1 (2).jpg
EM-23-CO-5497 AH-1.jpg
Images are grouped by normalizing filenames. Files like EM-23-CO-5497 3K-1.jpg and EM-23-CO-5497 3K-1 (2).jpg are treated as multiple angles of the same product and color, while EM-23-CO-5497 AH-1.jpg (different color code) is treated as a separate entry.