Real e-commerce rescue story: Fixing a broken headless setup

Sometimes, even the most modern tech stack can’t save a badly built platform. That’s exactly the situation that happened to our client. This is a headless e-commerce rescue story.

Despite using Medusa.js, Next.js, and Strapi, their e-commerce platform was a disaster: unstable, unreliable, and full of critical errors. Over 2,500 hours had already been sunk by a previous agency – yet the system was nowhere near ready for real business operations.

Transactions failed. The product data was broken. Integrations didn’t work. There wasn’t even basic deployment or documentation in place.

With customers impacted and business at risk, they needed stabilization fast, and they needed it without rebuilding everything from scratch.

What we inherited: more than technical debt

When we stepped in, here’s what we found:

  • No documentation. No README files. No .env configurations.
  • No proper deployment pipelines – production updates had to be done manually.
  • Broken or missing staging environments.
  • Backend chaos: failed ERP integrations, data inconsistencies, endless 500 errors.
  • Frontend chaos: unstable rendering, outdated dependencies, validation issues.
  • Security risks: sensitive production data exposed in logs.

It was more than just technical debt. It was an operational risk, and it had to be addressed immediately.

Yet, we took control: we secured the existing codebase, restored staging environments, stabilized production, and started uncovering deep-rooted problems that had been hidden or ignored.

Our approach: stabilize first, improve next

We treated the project like an emergency rescue mission – with a clear goal: restore stability first, improve next.

In the first critical phase, we:

  • Set up a full backup of the production environment immediately after takeover.
  • Deployed a new staging environment to separate testing from production.
  • Diagnosed major architecture gaps in frontend, backend, and infrastructure layers.

Over the following months, through 350+ hours of focused engineering, we systematically addressed one issue after another.

Backend (Medusa.js)

  • Repaired critical PCMarket ERP integrations syncing 160,000+ products.
  • Secured API endpoints and fixed major data serialization bugs.
  • Cleaned up the service layer, removing abandoned and risky dependencies.
  • Restored voucher systems, shipping logic, and correct stock handling.

Frontend (Next.js 14)

  • Completed the migration to the App Router architecture.
  • Fixed hydration issues and dynamic rendering errors.
  • Rebuilt broken forms using Formik and Yup for reliable validation.
  • Repaired product galleries, landing pages, and checkout flows.

Infrastructure (Digital Ocean & Vercel)

  • Organized environment variables across all environments.
  • Set up basic CI/CD pipelines for safe, repeatable deployments.
  • Upgraded server resources to stabilize heavy ERP synchronizations (~4h runtime).

CMS (Strapi v4)

  • Refined content publishing workflows to improve SEO and operational stability.
  • Customized the CMS editor experience to meet real business needs.

All of this, without causing downtime or disrupting customers.

The tech stack we worked with

To bring the platform back to life, we worked across:

  • Frontend: Next.js 14, React, TailwindCSS, Formik, Yup
  • Backend: Medusa.js (Node.js), TypeORM, JWT, REST APIs
  • CMS: Strapi v4 (customized with CKEditor 5)
  • Integrations: PCMarket ERP, Autopay payments, Apaczka logistics
  • Databases: PostgreSQL (separate domains for Medusa and Strapi)
  • Deployment: Vercel (frontend), Digital Ocean (backend with Docker & EasyPanel), custom CI/CD setup

From barely functional to future-ready

Today, the platform is stable, secure, and ready for real business operations. Thanks to structured takeover, rapid technical diagnosis, and focused development work:

  • The store is now stable, with full order management, correct product and inventory handling, and working payment and shipping flows.
  • The architecture is future-ready – modular, clean, and scalable.
  • Critical environments (staging and production) are now synchronized, secured, and operational.
  • Clients and customers experience a reliable platform – the foundation needed to support sales and business growth.

What started as an emergency “please fix it” turned into a long-term platform rescue. The client now has the technical foundation they need to support their business  – and to build something even better.

Summary

A modern tech stack isn’t enough. Even the best tools can fail if the project is poorly built. This case proved that you don’t always need to start over – you just need to clean up the mess, act fast, and know what you’re doing. In the end, platform stability isn’t about the stack. It’s about having the right team behind it.

GET IN TOUCH

Facing a similar issue with your headless stack?
Talk to us about your e-commerce rescue.

Table of Contents