Healthcare Enrollment AppJuly 2023

MedXpert: Embedded React SPA for WordPress

A portable, embedded React SPA that modernized Optivest’s MedXpert medical-aid plan selection—secure, fast, and independent of WordPress core updates. Delivered as a versioned plugin with custom REST endpoints, nonce security, and Docker-based CI/CD.

Technologies Used

React.jsWordPress REST APIPHP (Custom Endpoints)Tailwind CSSStyled ComponentsContext API (State)MySQL (WordPress)WebpackDocker
MedXpert: Embedded React SPA for WordPress

Project Gallery

MedXpert: Embedded React SPA for WordPress screenshot 1
MedXpert: Embedded React SPA for WordPress screenshot 2
MedXpert: Embedded React SPA for WordPress screenshot 3

Project Metrics

Timeline

2023–2024

Architecture

Embedded React SPA packaged as a WordPress plugin

Security

Nonce-protected API calls; isolated from WP updates

Performance

Zero page reloads; persistent state across steps

Portability

Drop-in plugin install across WordPress instances

DevOps

Docker environments with Git versioning and staged releases

Challenges

  • Replace a legacy multi-page form with a modern, stateful SPA.
  • Maintain strict security for API interactions inside WordPress.
  • Ensure portability and long-term maintainability as a plugin.
  • Support persistence, validation, and resumable progress.
  • Stabilize delivery with a clear dev → staging → production pipeline.

Solutions

  • Packaged the SPA as a self-contained WordPress plugin for clean installs and updates.
  • Built custom WordPress REST endpoints with nonce validation and scoped permissions.
  • Implemented Context API for persistent client-side state and step progression.
  • Added robust form validation, progress tracking, and error handling.
  • Established Dockerized environments and Git-based release flow.

Results

  • Faster, smoother plan exploration with zero page reloads.
  • Hardened API security via nonce tokens and endpoint scoping.
  • Independent from WordPress core/theme updates, reducing maintenance risk.
  • Reusable codebase and plugin architecture enable white-label potential.
  • Clear deployment workflow improves reliability and rollback safety.

Project Overview

Optivest’s MedXpert needed to retire a legacy, form-heavy flow and move to a fast, resilient Single Page Application. We delivered a React SPA embedded inside WordPress as a portable plugin—secure by design, easy to deploy, and independent from WordPress core updates. The result is a modern plan-selection experience with persistent state, robust validation, and a stable DevOps pipeline.

Scale & Performance

The SPA eliminates full-page reloads, keeps user progress intact across steps, and reduces friction on mobile. Client-side state via Context API and targeted API calls to custom REST endpoints keep interactions snappy. The plugin model minimizes runtime dependencies, improving stability across environments.

Key Features

Enrollment & UX

  • Multi-step medical-aid plan selection with guided progression.
  • Persistent state and resumable progress (Context API).
  • Custom validation rules and inline error messaging.
  • Mobile-responsive layout with Tailwind CSS and Styled Components.

Security & Data

  • Nonce-protected WordPress REST endpoints with scoped capabilities.
  • Backend form data handling using custom post-type storage and filters.
  • Sanitization/validation on server-side input.

Admin & Extensibility

  • Portable, versioned plugin for clean installs/updates.
  • Integration-ready to piggyback Gravity Forms or CPT workflows.
  • Structured developer documentation and built-in debug support.

Deployment & Maintainability

  • Dockerized development, staging, and production environments.
  • Git-driven release process for predictable rollouts and rollbacks.
  • Minimal external plugin dependencies for long-term stability.

Technology & Architecture

  • Frontend: React SPA (Context API for global state), Tailwind CSS, Styled Components, Webpack bundling.
  • WordPress Integration: Custom REST routes in PHP secured with nonces and capability checks; data persisted via custom post types.
  • Packaging: Fully self-contained WordPress plugin—no theme coupling, minimal dependency footprint.
  • Data Layer: Uses WordPress MySQL for persistence; API interactions are explicitly scoped and validated.
  • Ops: Docker-based local environments and staged pipelines; Git for version control and release tagging.

Process & Delivery

  1. Audit & Design: Mapped legacy form logic, user journeys, and security requirements.
  2. Incremental Build: Implemented the SPA in discrete modules with shared form logic and validation.
  3. API Hardening: Delivered custom REST endpoints, nonce workflows, and capability checks.
  4. Plugin Packaging: Encapsulated the SPA and APIs into a single, portable plugin.
  5. CI/CD: Established Docker environments and a Git-based deploy path from dev → staging → production.
  6. Handover & Support: Documentation, debug tooling, and client training for ongoing operations.

Outcomes & Impact

  • Experience: Faster plan exploration with zero reloads; clearer progress and fewer user errors.
  • Risk Reduction: Independence from WordPress core/theme updates prevents breakage and reduces maintenance overhead.
  • Speed to Change: Plugin packaging + Dockerized environments accelerate updates and controlled releases.
  • Scalability: Clean separation of concerns and reusable modules support future features and white-label deployment.

Notable Controls & Edge Cases

  • Nonce Rotation & Expiry: Defensive handling for expired/invalid tokens with user-safe recovery states.
  • Autosave & Resume: Client-side persistence preserves progress during tab closes or network hiccups.
  • Validation Fallbacks: Server-side validation mirrors client rules to prevent bypass.
  • Hard Fail States: Clear error boundaries, loading states, and retry actions for unreliable networks.
  • Update Resilience: Plugin remains unaffected by theme swaps or WordPress minor updates.

Ready to Build Something Amazing?

Let's discuss how we can transform your ideas into powerful software solutions.