Getting Started

Get started using the Red Mountain pricing calculator and learn more about this tool.

What’s new in v1.0.1
  • Catalog (March 2026): Production data is loaded from the latest sheet (363 products): Item Name/Description, Product Line, MSRP, and Red Club. The Python importer replaces the entire PricingItem table (truncate and insert); pricing matches the sheet.
  • Missing prices: Some rows have no MSRP or Red Club price in the sheet. Those store as null in the database; the list and grid show “-”. The Patient Quote still adds them; dollar math treats missing prices as zero.
  • Pricing layout: The calculator opens in Grid view by default; switch to List anytime. List view columns are Item Name/Description, Product Line, MSRP, and Red Club, with optional Red Club savings ($) and (%) in the column menu. Supplements stay hidden from the catalog.
  • Patient Quote: Adding a catalog line defaults to quantity 12 and Monthly so totals reflect a full year; change qty or frequency anytime. The Red Club startup fee still defaults to quantity 1; its quantity is editable on the quote table.
  • Print / PDF: The Cost Comparison section (chart and comparison cards) always begins on a new printed page after the line-item table so charts aren’t cut off. Benefits content still leads multi-page printouts as before.
  • Installable app (PWA): Use the white Install app button in the top bar (next to Patient Quote) or the browser install prompt when it appears. On iPhone/iPad use Share → Add to Home Screen. The app opens in its own window; a banner warns if you go offline on Pricing, Quote, or Admin—live catalog prices always require a connection (the service worker does not cache API pricing).
  • Branding: Horizontal Red Mountain lockup in the header and hero; browser tab icon is a crisp square RM on brand red.

How it works

The Red Mountain Pricing Calculator helps team members browse products, compare MSRP vs. Red Club pricing, and build a Patient Quote. This guide walks through every screen and term used from Home → Pricing Calculator → Patient Quote.

Home

  • Go to Pricing Calculator: opens the catalog in Grid view by default; switch to List if you prefer.
  • Install app: white button in the top bar (left of Patient Quote) opens the browser install flow when available, or shows a short toast with instructions (e.g. Share → Add to Home Screen on iOS). Hidden when the app is already running in installed/standalone mode.
  • Patient Quote: green button at the top right; the badge shows how many line‑item units are on the quote. Opens your in‑progress quote.

Pricing Calculator

Browse products from the live catalog. Supplement rows are hidden; all other items from the database appear, including lines where a price is missing (shown as “-”). Use Search to filter by name. The column menu still lists optional savings columns and saves your choices per browser (storage key updated for this release).

List: Primary columns match the sheet—Item Name/Description, Product Line, MSRP, and Red Club. Turn on Red Club savings ($) or (%) if you need them. Use Clear search to reset the search box; sorting by MSRP or Red Club leaves blank prices at the end of the list.

Grid: Same fields on each card (name, product line, prices or “-”).

Toggle List vs. Grid. Prices use thousands separators where numeric. Default order is alphabetical by name. The green cart adds the line to the Patient Quote.

Patient Quote

Line items show per‑unit MSRP and Red Club pricing, quantity, and subscription type (Monthly / Annual / Custom). You can remove lines, edit quantities, clear the quote, or print.

  • Default quantity: catalog products you add from the calculator default to quantity 12 and Monthly so yearly impact is visible immediately. Change quantity or subscription type for any line, including the Red Club startup fee.
  • Shipping policy: non‑members pay $15 per medication shipment per unit; Red Club shipping is free.
  • Startup fee: a one‑time Red Club fee can be added when you add an item; the savings widget lets you include or exclude it from savings math.
  • Estimated Total Cost & Savings: table compares yearly MSRP (line items plus a separate shipping row for non‑members) vs. Red Club (with free shipping). “Estimated Total Savings with the Red Club” matches that table total. Cost Comparison MSRP figures are product pricing only (shipping is not rolled into MSRP); use Estimated Totals for shipping.

Totals and currency formatting in the quote match the calculator. Printing produces a clean multi‑page layout: benefits and disclaimers first, then the line-item table (which may span pages), then Cost Comparison on its own page, then estimated totals—so charts and cards are not clipped by long tables.

Tips & Notes

  • Filters and column selections are saved per browser profile and device.
  • Two users on different devices/browsers won’t affect each other’s UI state.
  • To refresh data, import the latest CSV; the app will show new pricing automatically.
  • PWA: Install and full service-worker behavior work on HTTPS (including production). Use a production build locally (next build && next start) to test install prompts; next dev does not register the worker.

Device compatibility

Device TypeOperating SystemSupported
DesktopmacOS
DesktopWindows (PC)
LaptopmacOS / Windows (PC)
TabletiOS
TabletAndroid
MobileiOS (iPhone)
MobileAndroid

Tips

Here are recommended best practices and usage tips based on the workflow above:

General Usage Tips

  • Use List View when you need fast searching, sorting, or filtering.
  • Use Grid View when browsing visually or reviewing product images with patients.
  • The green cart icon is the universal “add to quote” action in both views.
  • The Patient Quote button illuminates green once items are added—this ensures you never accidentally forget an item.

Efficiency Tips

  • Use the search bar in List View for quicker lookups, especially with long lists.
  • Use the column menu to show or hide optional savings columns; core catalog columns stay aligned with the price sheet.
  • Clear your Quote before starting with a new patient to avoid mixing items.

Consultation Tips

  • Use the MSRP vs. Red Club price side-by-side rows to clearly explain the Red Club value.
  • Show the patient the Savings section to demonstrate monthly vs. annual savings.
  • Use Print Quote so patients can take a physical copy of the proposal home.

Technical & Workflow Tips

  • Works best with strong Wi-Fi or LTE.
  • Bookmark the Home screen on clinic devices for fast access.
  • The Red Club shipping benefit (free shipping) is automatically applied—no manual action needed.

For developers

This section provides architectural and data-modeling information for engineers extending or maintaining the application.

Patient Quote – Cost Comparison

  • Summary chart is a custom inline SVG (no external chart lib) in src/app/quote/page.tsx.
  • Arrays monthsMsrp and monthsRedClub derive from base‑basket totals; MSRP excludes shipping. Month 1 adds startup fee on Red Club only.
  • Filters compute per‑month factors from annual counts (count ÷ 12) and only render for categories present in the quote.
  • Tooltips wrap long text, list itemized contributors, and reposition above/left/right to avoid covering value labels; Y‑axis has +$100 headroom to prevent clipping.
  • Summary/Details toggle uses FontAwesome icons; chart can be included in print via a filter flag.

Print Layout

  • Print‑only Page 1 rendered before quote details; enforced page break after intro.
  • Applied breakInside: "avoid" and pageBreakInside: "avoid" on large blocks to minimize splitting.
  • Cost Comparison chart block uses print-friendly wrapping and legend spacing.

Software Architecture Overview

The Red Club Pricing Calculator is built with a modern, scalable, cloud-ready architecture supporting rapid iteration and enterprise-grade reliability.

Front-End

  • Next.js (App Router)
  • Tailwind CSS for fast component styling
  • Responsive UI compatible across desktop, tablet, and mobile

Back-End

  • Next.js API Routes serve backend logic without a separate server
  • PostgreSQL (Neon for production; Docker Compose for local development)
  • Docker ensures consistent local environments
  • Prisma ORM for schema types and querying

Data Ingestion / ETL Pipeline

  • Python importer (scripts/import_pricing.py) reads the March 2026-style sheet (Item Name/Description, Product Line, MSRP, Red Club), maps product line to category, and writes via psycopg2.
  • Blank or “-” prices import as SQL NULL; the API exposes null in JSON.
  • Importer TRUNCATEs PricingItem and inserts every CSV row (full catalog replace).
  • Default catalog file in-repo: data/catalog-march-2026.csv. Run with DATABASE_URL set (Neon: sslmode=require).
  • Prisma schema keeps a composite unique key for legacy rows; new imports leave typeOfTreatment / medicationMethod null.

Why This Architecture Was Chosen

✔ Scalability & Maintainability

Next.js + Prisma + Postgres allows modular growth as new features (e.g., membership tiers, dynamic rules) are added.

✔ Developer Velocity

Tailwind + Next.js enables rapid UI development with highly reusable components.

✔ Operational Reliability

Docker containers provide predictable behavior across all environments, minimizing “it works on my machine” issues.

✔ Secure Data Management

Postgres provides strong transactional consistency and referential integrity for pricing data.

✔ Extendability

Python importer + CSV allow pricing updates and catalog changes without touching app logic.

Data Model (Prisma Schema)

PricingItem Model

Represents individual items shown in the calculator.

schema.prisma
model PricingItem {
  id               Int      @id @default(autoincrement())
  displayName      String
  category         String?   // Product line (sheet + API as productLine)
  supplyType       String?
  itemType         String?   // legacy / prefix hint (PKG, SHOT, …)
  typeOfTreatment  String?
  medicationMethod String?
  isCalvinScott    Boolean   @default(false)
  msrp             Decimal?
  redClubPrice     Decimal?
  isActive         Boolean   @default(true)
  createdAt        DateTime  @default(now())
  updatedAt        DateTime  @updatedAt

  @@unique([displayName, category, typeOfTreatment, medicationMethod])
}

Core API Endpoints

GET /api/pricing

Fetch pricing items with full filter support.

Query Parameters:

  • membership = standard | redclub
  • q = search term (product name)
  • priceMin, priceMax (applies to MSRP or Red Club depending on membership)
  • Optional filters still accepted for admin or other clients: productType, typeOfTreatment / typeOfMedication, medicationMethod, isCalvinScott. The main calculator UI does not expose these anymore.

Price filter applies to MSRP for standard or Red Club price for redclub membership.

response.json
{
  "membership": "standard",
  "items": [
    {
      "id": 1,
      "name": "Example Product",
      "productName": "Example Product",
      "productLine": "Weight Loss",
      "productType": "Weight Loss",
      "category": "Weight Loss",
      "itemType": "PKG",
      "msrp": 299,
      "redClubPrice": 149,
      "price": 299
    },
    {
      "id": 2,
      "name": "Med Spa Service",
      "productLine": "Med Spa",
      "category": "Med Spa",
      "msrp": null,
      "redClubPrice": null,
      "price": null
    }
  ]
}

Responses include productLine (same value as category). For compatibility, requests may still use typeOfTreatment or typeOfMedication as query parameters where supported.