Work makorefinery
web

Mako Refinery

AI-powered content and commerce platform — WebAuthn checkout, USPS-rate shipping, lab reports, and an OpenRouter AI assistant on a Go + PostgreSQL backend.

Mako Refinery is a full content-and-commerce platform for branded vertical storefronts: passkey auth, an OpenRouter-backed AI chat assistant with per-user credit metering, products / orders / coupons / tax groups / lab reports, USPS-integrated shipping zones, configurable payment methods, an articles / news CMS, age-verification gating, and a maintenance-mode kill switch with auto-reopen. A Go backend (chi + PostgreSQL) serves a JSON API and WebAuthn ceremonies behind nginx; the front end is a React + Vite single-page app.

Last updateDec 21, 2025 PrimaryJavaScript
  • Go
  • chi
  • PostgreSQL
  • pgx
  • WebAuthn
  • WebSocket
  • React
  • Vite
  • JavaScript
  • Tailwind CSS
  • OpenRouter
  • USPS API
  • Postmark
  • nginx
  • systemd
Mako Refinery — AI-powered content and commerce platform — WebAuthn checkout, USPS-rate shipping, lab reports, and an OpenRouter AI assistant on a Go + PostgreSQL backend.
Mako Refinery media
Mako Refinery media
Mako Refinery media
Mako Refinery media

Mako Refinery is a content-and-commerce platform built for branded vertical storefronts that need more than a Shopify theme — passkey auth on the customer side, OpenRouter-driven AI chat with per-user credit metering, real USPS rate calculation at checkout, age-verified product gates, lab-report attachments per batch, and a full articles CMS so the same instance ships the storefront, the marketing site, and the back-office tooling.

Customer-facing

  • Passkey-first auth. WebAuthn is the primary login path (server-side go-webauthn, browser @simplewebauthn); the autofill ceremony surfaces saved credentials on supported browsers, with a fallback flow for those that don't.
  • Storefront with category browsing — All Products, sub-categories, filtering, age-gated detail pages, product images, lab reports, batch numbers.
  • USPS-integrated checkout. Shipping zones define geographical bands; carriers and services define rate options; the cart calls the live USPS API at checkout and shows real numbers, with configurable markup. Fallback rates kick in when the API is unavailable.
  • AI chat assistant available to logged-in customers — OpenRouter under the hood over a WebSocket, multi-model support, credit metering, "AI is typing" status, persistent conversations.

Admin / operator surface

  • Dashboard, products, orders, articles, lab reports, tax groups, coupons — full CRUD on every merchandising primitive, with decimal-precise pricing.
  • Shipping configurator — carriers (UPS, USPS, custom), services per carrier, geographical zones, pricing markup, USPS API credential management.
  • Payment methods — bank wire, card, custom payment instructions, per-method enable/disable.
  • Site controls — basic info + branding, maintenance-mode toggle with custom message and auto-reopen schedule, registration toggles, contact email.
  • AI model management — sync models, adjust per-user credits, configure OpenRouter API keys, monitor usage limits.
  • Mail system — Postmark send + inbound webhook, templated transactional email, API-key management.

How it's wired

The backend is Go (chi router + CORS) exposing a JSON API, WebAuthn ceremonies, and a chat WebSocket, backed by PostgreSQL (pgx/lib-pq, schema + migrations + PL/pgSQL). QR codes and lab-report label images are generated server-side. The front end is a React + Vite single-page app (JavaScript, Tailwind). In production the Go binary runs as a systemd service behind nginx (TLS 1.2+, rate limiting, CSP/HSTS, SameSite=Strict CSRF cookies); it was migrated off PM2 to systemd for stability.

Why "Mako Refinery"

Mako Refinery exists because regulated vertical storefronts (the "lab-report-required, age-gated, branded experience" pattern) keep needing the same five integrations — passkeys, real shipping rates, lab-report attachments, AI customer support, and an articles CMS — and none of the off-the-shelf cart frameworks ship all five cleanly. Mako Refinery is what we point at that pattern when a client shows up needing the whole stack.

Straight from the source

The project's own README.

Rendered in place — every link, image, and code block carried over from the repo. The page below is what a contributor would see opening the project for the first time.

Mako Refinery Documentation Index

🚀 Getting Started

📊 Database & Architecture

🛍️ E-Commerce Systems

👤 User Systems

📧 Communication

  • mail.md - Email system with Postmark

🔧 Operations

📋 Planning & TODOs


Quick Reference

Most Important Docs

  1. Start Here: quick-start.md - Commands and basic workflow
  2. What's Broken: todo/current.md - Current issues and priorities
  3. Database: database-schema.md - Table structures
  4. Shop: shop-system.md - E-commerce functionality
  5. Payments: payment-system.md - Payment implementation plan

System Status

  • Working: Basic shop, auth, admin panel
  • 🟡 Partial: Checkout, shipping, taxes
  • Not Working: Payments, refunds, USPS integration

Key Missing Features

  1. Payment Processing - Currently simulated only
  2. Tax Calculations - Groups exist but not applied
  3. Shipping Integration - USPS planned but not implemented
  4. Complete Checkout - Several issues need fixing

Development Commands

# Deploy changes
./deploy.sh deploy

# Check status
./deploy.sh status

# View logs
./deploy.sh logs

# Database access
PGPASSWORD=mako_secure_pass_2025 psql -h localhost -U makouser -d makorefinery

Support

Email: [email protected]


Last Updated: August 2025

Gallery

The full set.

Build something like this

Want a tool like this for your shop?

We've shipped this kind of thing before. Twenty-minute intro call, no slides.