MGS Case Study

How we built a 100% self-hosted Payload CMS & Medusa.js platform with 3 custom compliance integrations, 78 UI blocks, and near-static page loads to eliminate SaaS vendor risks.

Challenge

MGS (Guru) needed to execute a major strategic pivot: transitioning from a traditional online seed store into an education-first, content-driven authority platform (80% content / 20% commerce). Their goal was to build organic topical authority through growing guides, news, and expert strain reviews, while keeping a highly reliable, compliant checkout.

However, operating in the regulated cannabis industry introduced extreme structural, commercial, and technical challenges:

SaaS Termination & Brand Vulnerability: Popular e-commerce platforms like Shopify have a history of shutting down cannabis-related accounts overnight without warning.

Prohibitive SaaS Pricing: When approached, standard headless SaaS vendors like Storyblok quoted restrictive enterprise-tier pricing because of the industry vertical. No hosted provider could guarantee long-term service.

Fragmented EU Checkout & Compliance: Shipping regulated products across multiple EU borders required custom integrations for specialized, high-risk payment processors (Fibonatix), dynamic multi-carrier shipping, and automated One-Stop-Shop (OSS) VAT calculations. None of these exist natively in standard SaaS App stores.

The client needed to eliminate all platform dependency. They required a custom, high-performance architecture that they fully owned, from the database level to the frontend code, without risking sudden vendor deplatforming.

mgs-cover1

mgs-cover1

Solution

We replatformed MGS to a self-hosted headless architecture to secure full ownership and eliminate SaaS risks, driven by four key decisions:

Decoupled Content & Commerce

To prevent high content traffic from slowing down transactions, we isolated the editorial and transactional backends. Payload CMS (backed by MongoDB Atlas) handles the content-rich storefront, while Medusa.js (backed by PostgreSQL on Render) runs independently to power the checkout.

Custom Compliance Middleware

Since standard SaaS plugins do not support high-risk markets, we engineered custom Medusa.js integrations from scratch for Fibonatix (payments), SendCloud (fulfillment), and Quaderno (tax). Backed by Redis queues, this setup guarantees zero transaction data loss during third-party API downtime.

PPR & Personalized Caching

We used Next.js Partial Pre-Rendering (PPR) to serve static content instantly from the edge. Dynamic, personalized commerce components (like carts and account data) load asynchronously as separate "islands" using custom cache partitions, ensuring near-static loading speeds across the entire site.

Localized Workflows & Form Engine

We established an automated localization pipeline synced with Crowdin. To overcome HubSpot's lack of native multi-language forms, we built a headless form builder inside Payload CMS, allowing the marketing team to safely launch and translate forms that route data directly to HubSpot.

Results in Numbers

78
composable page builder blocks for complete editorial freedom
3
custom-built Medusa.js providers (Payment, Fulfillment, Tax)
37
custom CMS collections mapped to structured data schemas
100%
codebase and infrastructure ownership with zero SaaS risk
12
third-party service integrations unified into a single platform
20+
custom PostHog and GA4 commerce tracking events

Before Migration vs After Migration

Risk of sudden SaaS account termination due to high-risk industry classification.
Complete infrastructure ownership with a self-hosted, open-source stack on Render and Vercel.
Rigid e-commerce storefront focused solely on direct seed sales.
An education-first platform (80% content) with interactive strain databases and growing guides.
Incompatible payment, tax, and shipping systems for cross-border EU shipping.
Fully automated, custom-built providers for Fibonatix, SendCloud, and Quaderno OSS VAT compliance.
Static forms and content that were difficult to translate and localize across European markets.
Automated Crowdin translation sync and a custom-built, CMS-managed multi-lingual form builder.
Slow dynamic page-load times caused by database-heavy commerce operations.
Near-instant loading speeds powered by Next.js Partial Pre-Rendering (PPR) and personalized cache partitions

Project Tech Stack

Abstract hexagonal geometric logo icon

Payload CMS

An open-source, config-as-code headless CMS embedded directly into the Next.js application, giving editors live preview options and direct database control without third-party API dependencies.

Next.js logo

Next.JS

The framework of choice for building a fast, SEO-friendly storefront using Server Components, PPR, and advanced edge-caching strategies.

Medusa.js

An open-source headless commerce platform deployed to Render. Its module-based architecture allowed us to build custom providers for highly regulated checkout and shipping flows.

Postgres & MongoDB Atlas

Dual database architecture: Atlas handles flexible, highly nested content schemas for the CMS, while managed PostgreSQL handles transactional e-commerce data on Render.

Teal wave logo icon with two curved S-shaped forms

Tailwind

CSS framework that lets you style websites quickly using utility classes instead of writing custom CSS.

Key Features

1 4

Custom High-Risk Checkout & Payments

We built a completely bespoke multi-step checkout utilizing the Medusa SDK. Because standard payment setups reject high-risk markets, we engineered a custom payment module connecting to Fibonatix (Paragon API) from scratch. It handles the complete transactional lifecycle, including secure 3D verification, pre-authorization, capture, and refunds.

2 4

E-E-A-T Optimized Strain Database

To build organic topical authority, we designed a rich strain review database around Google's E-E-A-T guidelines. Authors can write detailed expert reviews containing rich taxonomies (terpene profiles, effects, growing difficulties, and chemical levels). We wrapped this in a server-side faceted search with structured JSON-LD schema markup for rich-snippet search indexing.

3 4

78-Block Visual Page Builder with Live Preview

The marketing team can compose highly customized articles, comparison hubs, and landing pages using 78 responsive, visual blocks inside Payload CMS. Editors can test layout variations in real-time across different device breakpoints directly from the admin panel before publishing.

4 4

Compliant EU Logistics and Tax Automation

We solved cross-border logistical friction by building dedicated Medusa integrations for SendCloud and Quaderno. Shipping fees are dynamically calculated by product weight and the customer's carrier preferences, while multi-jurisdictional EU VAT rates are applied dynamically during checkout with smart caching to ensure speed and compliance.

What our client says

Oliver van der Werf
Oliver van der Werf

I found FocusReactive through ChatGPT and chose them because of their geographic proximity and the exact tech stack we needed.

The team took charge of the research, concepting, planning, and development of our entirely new platform. FocusReactive successfully delivered a fully functional headless website.

From a project management standpoint, FocusReactive has done an amazing job. Everything has been very well communicated via our virtual meetings, and the team has always met deadlines. What impressed me most is that FocusReactive has understood the needs of the project, been flexible, and has brought high-skilled developers. The main project is finished, but we will definitely continue development with them in the future.

Project Contributors

Eugene Boruhov

Eugene Boruhov

Headless CMS Solution Architect | Helping brands choose & build the right composable stack (Sanity, Payload, Storyblok, Contentful) with Next.js.
Petro Orel

Petro Orel

Full-Stack Engineer
Raman Milash

Raman Milash

Engineer at FocusReactive

Payload CMS Deep Dive

Payload CMS overview
Payload CMS logo on dark abstract background

Payload CMS overview

Discover how Payload CMS combines the power of headless content management with developer-focused features for project flexibility and control.
Why Payload CMS is the Best CMS for NextJS
Payload CMS and Next.js logos side by side on dark textured background

Why Payload CMS is the Best CMS for NextJS

This article delves into the unique aspects of Payload CMS in the Next.js ecosystem, and how it outperforms competitors.
Custom Admin Panels With Payload CMS
Payload CMS collections dashboard with dark theme showing field types grid

Custom Admin Panels With Payload CMS

Payload CMS has emerged as the leading solution for developers seeking a powerful, flexible platform to build custom admin panels.

Your project, our CMS craft

  • Respond within a day
  • Intro call to sync
  • Proposal within 2-3 days
Top Clutch Sanity Development 2026
Top Sanity Developers 2024, 2026
Top Clutch Medusa Development 2026
Top Medusa Developers
Top Clutch Nextjs Developer 2026
Top NextJS Developers 2023, 2025, 2026
Top Clutch Sanity Development United Kingdom 2026
#1 in Top Sanity Developers in UK 2026