GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - loxdpsy/support-page

BranchesTags
Open more actions menu

Latest commit

 

History

20 Commits
20 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
package.json
package.json
 
 
wrangler.jsonc
wrangler.jsonc
 
 

Repository files navigation

A-F Marbre Support — Cloudflare Worker

Premium support portal for:

https://support.afmarbre.com/

This version uses a Cloudflare Worker Custom Domain. The Worker is the origin for the complete support.afmarbre.com hostname, while afmarbre.com remains your existing WordPress site.

What changed in this version

  • Moved from afmarbre.com/support to support.afmarbre.com
  • Changed the Wrangler configuration from a Worker Route to a Custom Domain
  • Redesigned the page around A-F Marbre's premium marble / natural-stone visual language
  • Uses an A-F Marbre site image for the hero
  • Uses the main afmarbre.com favicon/site icon for browser tabs and Apple home-screen bookmarks
  • Uses the exact showroom map link from the current contact page
  • Added polished desktop + mobile layouts
  • Includes a prominent link to the A-F Marbre chatbot at https://chat.afmarbre.com/
  • Adds Light / Dark / System theme controls to the support portal
  • Shares the selected theme across *.afmarbre.com with the first-party afmarbre_theme cookie
  • Added support workflow sections and FAQ
  • Added /health
  • Keeps Turnstile, form validation, honeypot protection and Cloudflare Email Service
  • Generates unique support references
  • Keeps customer e-mail as Reply-To

1. Important DNS note

The Wrangler config contains:

"routes": [
  {
    "pattern": "support.afmarbre.com",
    "custom_domain": true
  }
]

Cloudflare will create and manage the DNS entry and TLS certificate for the Custom Domain.

If support.afmarbre.com already has an existing CNAME record, remove that CNAME before adding/deploying the Worker Custom Domain. Do not point a separate CNAME at a workers.dev URL.

2. Resend via api.afmarbre.com

This support Worker does not use Cloudflare Email Service. It calls the existing API Worker through a Cloudflare Service Binding.

It sends the validated support ticket server-to-server to:

https://api.afmarbre.com/api/support

That endpoint lives in the existing A-F Marbre API Worker (mistral-agent-chat) and uses the Resend API key already configured there.

The destination is:

[email protected]

The Resend message uses the customer's submitted email as reply_to, so pressing Reply in Gmail addresses the customer directly.

Worker-to-Worker connection

afmarbre-support uses a Cloudflare Service Binding named AFMARBRE_API pointing to the Worker mistral-agent-chat. That avoids a public DNS hop and CORS, while still authenticating with a shared secret.

Set the same SUPPORT_API_TOKEN on both Workers:

# Paul / API Worker (mistral-agent-chat)
npx wrangler secret put SUPPORT_API_TOKEN

# Support portal Worker (this project)
npx wrangler secret put SUPPORT_API_TOKEN

The support Worker sends Authorization: Bearer <SUPPORT_API_TOKEN> on every ticket. The API Worker rejects requests without a matching token (protects the public https://api.afmarbre.com/api/support route as well).

3. Configure Turnstile

Create a Turnstile widget and add:

support.afmarbre.com

as an allowed hostname.

Copy the public site key into wrangler.jsonc:

"TURNSTILE_SITE_KEY": "0x4AAAAAAELV-6t0f-Bafy_y"

Store the Turnstile secret as a Worker secret:

npx wrangler@latest secret put TURNSTILE_SECRET

Paste the secret when Wrangler asks for it.

Never put the secret directly in wrangler.jsonc.

4. Deploy

From this project directory:

npm install
npm run deploy

or without installing dependencies permanently:

npx wrangler@latest deploy

When the deployment finishes, open:

https://support.afmarbre.com/

5. Test the form

Confirm that:

  1. https://support.afmarbre.com/ loads over HTTPS.
  2. The A-F Marbre hero image loads.
  3. Turnstile completes successfully.
  4. A test submission redirects back to /.
  5. A reference similar to AFM-20260809-AB12CD34 appears.
  6. Your configured support inbox receives the ticket.
  7. Pressing Reply addresses the customer's e-mail.

Health endpoint:

https://support.afmarbre.com/health

It should return:

{"ok":true,"service":"afmarbre-support"}

6. Email architecture

Email delivery is handled by Resend in api.afmarbre.com; there is no send_email binding in this Worker.

Project structure

afmarbre-support-worker/
├── src/
│   └── index.js
├── wrangler.jsonc
├── package.json
├── .gitignore
└── README.md

Notes

The support form does not accept file uploads. Customers who need to send photos/videos are directed to WhatsApp. This keeps the public form lightweight and reduces abuse risk.

The hero image is loaded from the existing A-F Marbre WordPress media library. If you later change the WordPress image URL, update BRAND_IMAGE near the top of src/index.js.

Support Gmail / reply flow

This build uses [email protected] as the public support inbox and the primary destination for support-form tickets.

The API sends each ticket to [email protected], privately BCCs [email protected], and keeps the visitor's submitted address as the message Reply-To.

Flow:

  1. Customer submits the support form.
  2. The main ticket arrives at [email protected].
  3. A private BCC copy is also delivered to [email protected].
  4. The customer never sees the Gmail copy address.
  5. Reply from the [email protected] mailbox to keep all customer-facing mail on the A-F Marbre domain.

Only [email protected] is shown publicly on the support page.

Before production, verify [email protected] as a Cloudflare Email Service / Email Routing destination.

Status strip (Better Stack / Better Uptime)

The support page loads a live note from:

GET https://support.afmarbre.com/status-summary

That Worker route fetches your public Better Stack status JSON:

https://status.afmarbre.com/index.json

What you need on Better Stack

  1. A public status page whose custom domain is status.afmarbre.com (or the Better Stack subdomain).
  2. At least one monitor published on that status page (API, website, support, chat, etc.).
  3. Confirm in a browser:
https://status.afmarbre.com/index.json

You should see JSON with data.attributes.aggregate_state (operational, degraded, downtime, or maintenance).

  1. Optional Worker var override:
"STATUS_JSON_URL": "https://status.afmarbre.com/index.json"

No Better Stack API token is required for this public JSON endpoint.

The status strip stays hidden while everything is operational, and appears when the aggregate state is degraded, down, or under maintenance (or when an announcement is set).

About

No description, website, or topics provided.

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.