Next.js website for Rocky Mountain Vending company featuring: - Product catalog with Stripe integration - Service areas and parts pages - Admin dashboard with Clerk authentication - SEO optimized pages with JSON-LD structured data Co-authored-by: Cursor <cursoragent@cursor.com>
118 lines
3.3 KiB
Markdown
118 lines
3.3 KiB
Markdown
# Site Configuration Guide
|
|
|
|
This document explains how to configure the site to show different manufacturer sets across three different websites.
|
|
|
|
## Overview
|
|
|
|
The system supports three site tiers with different manufacturer counts:
|
|
|
|
1. **rockymountainvending.com** (Tier 1) - Least manufacturers (7 top manufacturers)
|
|
2. **vending.support** (Tier 2) - Medium manufacturers (15 manufacturers)
|
|
3. **quickfreshvending.com** (Tier 3) - All manufacturers
|
|
|
|
## Environment Variable Setup
|
|
|
|
Set the `NEXT_PUBLIC_SITE_DOMAIN` environment variable to configure which site tier to use.
|
|
|
|
### For rockymountainvending.com (Tier 1)
|
|
```bash
|
|
NEXT_PUBLIC_SITE_DOMAIN=rockymountainvending.com
|
|
```
|
|
|
|
**Manufacturers included:**
|
|
- Crane (includes BevMax, Merchant-Series)
|
|
- Royal Vendors
|
|
- GPL
|
|
- AP (Automatic Products)
|
|
- Dixie-Narco
|
|
- USI
|
|
- Vendo
|
|
- Payment Components (Coin-Mechs, Bill-Mechs, Card-Readers)
|
|
|
|
**Minimum manual count:** 3 per manufacturer
|
|
|
|
### For vending.support (Tier 2)
|
|
```bash
|
|
NEXT_PUBLIC_SITE_DOMAIN=vending.support
|
|
```
|
|
|
|
**Manufacturers included:**
|
|
- All Tier 1 manufacturers, plus:
|
|
- Merchant-Series
|
|
- BevMax
|
|
- DSVending
|
|
- Seaga
|
|
- AMS
|
|
- Rowe
|
|
- Payment Components (Coin-Mechs, Bill-Mechs, Card-Readers)
|
|
|
|
**Minimum manual count:** 2 per manufacturer
|
|
|
|
### For quickfreshvending.com (Tier 3)
|
|
```bash
|
|
NEXT_PUBLIC_SITE_DOMAIN=quickfreshvending.com
|
|
```
|
|
|
|
**Manufacturers included:**
|
|
- ALL manufacturers including:
|
|
- All from Tier 1 and Tier 2
|
|
- Other folder (uncategorized)
|
|
- Savamco, Cavalier, Wurlitzer, Vendcraft, Hot, Fastcorp, FRD, etc.
|
|
|
|
**Minimum manual count:** 1 per manufacturer
|
|
|
|
## Configuration Files
|
|
|
|
### site-manufacturer-mapping.json
|
|
This file contains the complete mapping of manufacturers to each site tier. It's located at:
|
|
```
|
|
code/lib/site-manufacturer-mapping.json
|
|
```
|
|
|
|
### site-config.ts
|
|
This file provides helper functions to:
|
|
- Get the current site domain
|
|
- Get allowed manufacturers for a site
|
|
- Get minimum manual count
|
|
- Handle manufacturer alias matching
|
|
|
|
## How It Works
|
|
|
|
1. The system reads `NEXT_PUBLIC_SITE_DOMAIN` environment variable (defaults to `rockymountainvending.com`)
|
|
2. It loads the site configuration from `site-manufacturer-mapping.json`
|
|
3. Manuals are filtered in this order:
|
|
- Filter by MDB compatibility (existing)
|
|
- Filter by site tier/allowed manufacturers (new)
|
|
- Filter by minimum manual count per manufacturer (new)
|
|
4. Only manuals matching all criteria are displayed
|
|
|
|
## Deployment
|
|
|
|
For each site deployment, set the appropriate environment variable:
|
|
|
|
### Vercel/Netlify
|
|
Add the environment variable in your deployment platform's settings:
|
|
- Key: `NEXT_PUBLIC_SITE_DOMAIN`
|
|
- Value: `rockymountainvending.com`, `vending.support`, or `quickfreshvending.com`
|
|
|
|
### Local Development
|
|
Create a `.env.local` file in the `code` directory:
|
|
```
|
|
NEXT_PUBLIC_SITE_DOMAIN=rockymountainvending.com
|
|
```
|
|
|
|
## Manufacturer Aliases
|
|
|
|
The system automatically handles manufacturer name variations using aliases defined in `site-manufacturer-mapping.json`. For example:
|
|
- "Royal-Vendors" (directory name) → "Royal Vendors" (canonical)
|
|
- "BevMax" → "Crane"
|
|
- "Merchant-Series" → "Crane"
|
|
|
|
This ensures manuals are correctly matched regardless of how the manufacturer name appears in directory or file names.
|
|
|
|
## Payment Components
|
|
|
|
Payment components (Coin-Mechs, Bill-Mechs, Card-Readers) are included on all sites as they are universal and work with all vending machines.
|
|
|
|
|
|
|