Skip to content
CMD
← Back to Blog

Phoenix STS: Health & Safety Platform

•6 min read•Work

A WordPress-to-Next.js migration for Ireland's leading fire safety and health & safety training provider, featuring a customer portal, Zoho CRM integration, and Stripe payments.

Next.js 15Payload CMS 3React 19TypeScriptPostgreSQLTailwindCSSStripeZoho CRMMicrosoft Graph API

A full-stack platform built for Phoenix Safety & Training Solutions, Ireland's first CPD-certified fire safety training provider for the nursing home sector. The project replaced an aging WordPress site with a modern Next.js application serving both a public website and a self-service customer portal.

Project Overview

Phoenix STS delivers accredited training courses, consultancy services, and safety equipment to organisations across healthcare, construction, hospitality, and the public sector. Their previous site ran on WordPress with 12 plugins, 42 external scripts, and no caching strategy — page loads were slow and the admin experience was painful for non-technical staff.

The rebuild had two goals: a fast, SEO-optimised public site that editors could manage independently, and a customer portal where clients could manage their accounts, view billing, raise support tickets, and access shared documents.

Core Requirements

  • Replace WordPress with a modern, maintainable stack
  • Block-based page builder so editors don't need a developer for content changes
  • Customer portal with account management, billing, support tickets, and file storage
  • Form submissions forwarded to Zoho CRM for sales pipeline tracking
  • Stripe integration for online payments
  • Enterprise email via Microsoft 365
  • CDN caching to match or beat the old site's load times

Technical Architecture

LayerTechnology
FrontendNext.js 15 (App Router), React 19, TypeScript
CMSPayload CMS 3, Lexical Rich Text Editor
DatabasePostgreSQL with connection pooling & migrations
StylingTailwindCSS, shadcn/ui, Radix UI primitives
Media StorageDigitalOcean Spaces (S3-compatible)
PaymentsStripe (payment intents)
CRMZoho Forms integration for lead capture
EmailMicrosoft Graph API with Azure OAuth2
CDNCloudflare with edge caching
TestingVitest (integration), Playwright (E2E)

The application uses Next.js route groups to separate three concerns: the public website (frontend), the admin panel (payload), and the customer portal (portal). Server components handle data fetching and rendering, with client components only where interactivity is needed.


Key Features

1. Block-Based Layout Builder

Editors build pages from a library of 15 content blocks without touching code:

BlockWhat it does
HeroPage header with rich text, links, and optional media or YouTube video. Five variants from full-bleed to minimal.
Card GroupsGrid of icon cards for linking to services, courses, or pages.
Process StepsNumbered or icon-based steps for explaining a workflow or service journey.
StatsKey figures like "10,000+ Trained" or "500+ Organisations" in a row or grid.
Logo GridClient or partner logos displayed as a card grid, compact strip, or auto-scrolling carousel.
TestimonialsCustomer quotes with optional photo, role, and star rating.
Image with TextSide-by-side image and copy, image positionable left or right.
Video with TextSame layout but with a YouTube, Vimeo, or custom video embed.
ContentMulti-column rich text — full width, halves, or thirds.
Call to ActionHeading, paragraph, and action buttons. Used for mid-page and end-of-page conversion points.
BannerAlert-style bar for announcements or notices (info, warning, error, success).
ArchivePulls a filtered grid of posts or pages from a collection query.
FormEmbeds a form built in the admin panel's form builder.
Member CardsTeam or council member cards with photo, name, role, and email.
CodeSyntax-highlighted code snippets.

Each block is a folder with two files — a Payload field config and a React component. Adding a new block to the builder means adding one folder.

2. Customer Portal

A self-service portal that pulls data natively from Zoho — accounts, billing, contacts, tickets, documents, and forms — so customers can manage everything without leaving the site. It runs on the same Next.js instance as the public site but under its own route group with separate layout and access control.

Authentication uses a bridge-login flow. When a CMS user visits /portal, the client checks for an existing portal token. If there isn't one, it hits a bridge endpoint that validates the user's CMS session cookie and issues a short-lived JWT scoped to the portal. That token is stored as a cookie and attached to every subsequent request to the Zoho-proxied API routes. The user never logs in twice — the bridge silently converts the CMS session into portal access.

3. Zoho CRM Integration

Form submissions are automatically forwarded to Zoho CRM with per-form field mapping. Each form maps its fields to the corresponding Zoho form so submissions land directly in the sales pipeline without manual data entry.

4. Stripe Payments

Payments use a two-phase flow. The form submission creates a Stripe payment intent server-side, returning a client secret. The frontend then confirms the payment through Stripe Elements before the form actually submits. The payment and form data are coupled but the secret handling stays server-side.

All form submissions are verified with Cloudflare Turnstile before being accepted — the token is validated server-side before any data is processed or forwarded.

5. Content Publishing

Full editorial workflow with Lexical rich text editing, draft and published states, live preview across three breakpoints (mobile, tablet, desktop), scheduled publishing via cron jobs, hierarchical categories, and author attribution.

6. Cache Invalidation

Cache revalidation is direction-aware. When content is published, the new path and sitemap are invalidated. When content is unpublished, the old path is invalidated to clear it from the CDN — not just a blanket "invalidate on save".

7. WordPress Migration

The migration preserved SEO through 50+ redirect mappings — both pattern-based rewrites (/online-courses/:slug → /:slug) and specific URL redirects for old blog posts. Sitemaps are auto-generated with exclusions for sensitive pages like login and payment forms.

8. Search

Posts are indexed through a search plugin with a custom sync hook. Categories are resolved and stored at sync time rather than at query time, so search results don't need to make additional database lookups to display category labels.

9. Enterprise Email

All transactional email — password resets, form confirmations, notifications — routes through Microsoft 365 via a custom Graph API adapter with Azure OAuth2 authentication. This keeps communications under the organisation's domain rather than relying on a third-party SMTP service.


Performance: Old vs New

After the migration and caching configuration, we benchmarked the old WordPress site against the new build. The numbers below are server-side measurements averaged over multiple requests, both served through Cloudflare.

Server Response

MetricOld (WordPress)New (Next.js)Change
TTFB (avg)57ms47ms18% faster
Total response (avg)74ms74msEqual
HTML (gzipped)40KB47KB+17%
CDN cache statusHITHITBoth cached

Summary

This project replaced a plugin-heavy WordPress site with a single Next.js application that handles public content, admin management, and customer self-service. The block-based editor gives the Phoenix STS team full control over their site without developer involvement, the portal gives their customers direct access to accounts and support, and the Zoho and Stripe integrations keep the operational workflow tight. Performance-wise, it matches the old site on raw speed while shipping significantly less JavaScript, better image loading, and proper security headers.