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.
- Go
- chi
- PostgreSQL
- pgx
- WebAuthn
- WebSocket
- React
- Vite
- JavaScript
- Tailwind CSS
- OpenRouter
- USPS API
- Postmark
- nginx
- systemd
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
quick-start.md- START HERE - Essential commands and workflowproject-structure.md- Complete directory and file structuretechnologies.md- Tech stack and tools overview
📊 Database & Architecture
database-schema.md- All tables, columns, and relationshipsrefactor-plan.md- Code refactoring strategy
🛍️ E-Commerce Systems
shop-system.md- Core shop functionality and APIpayment-system.md- Payment processing architecture (planned)shipping-system.md- Shipping calculation and carriersshipping-usps.md- USPS integration detailstax-system.md- Tax calculation and management
👤 User Systems
auth.md- WebAuthn/Passkey authenticationadmin-panel.md- Admin interface documentationchat-system.md- AI chat integration
📧 Communication
mail.md- Email system with Postmark
🔧 Operations
backup.md- Backup and restore procedures
📋 Planning & TODOs
todo/current.md- ACTIVE TASKS - Current TODO list and prioritiestodo/admin-settings.md- ADMIN SETTINGS - Backend implementation neededtodo/feature-ideas.md- Future feature possibilities
Quick Reference
Most Important Docs
- Start Here:
quick-start.md- Commands and basic workflow - What's Broken:
todo/current.md- Current issues and priorities - Database:
database-schema.md- Table structures - Shop:
shop-system.md- E-commerce functionality - 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
- Payment Processing - Currently simulated only
- Tax Calculations - Groups exist but not applied
- Shipping Integration - USPS planned but not implemented
- 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
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.