Aquarel logo
aquarel.io
RESCUE CASE STUDY • Multi-Tier B2B Workspace SaaS (Anonymized — Ready for Named Toggle) PHP 8.3 & Yii 2 • Angular 22 SPA • Ratchet WebSockets • Multi-Tier AGENTS.md • Zero-Downtime CI/CD

B2B Workspace Platform Modernization, WebSocket Hardening & AI-Ready Handover

How Aquarel stabilized and modernized a multi-tier B2B workspace platform without production downtime—upgrading the backend to PHP 8.3 and the SPA to Angular 22, resolving multi-client Ratchet WebSocket broadcast crashes and deployment script failures, and authoring multi-tier AGENTS.md guardrails for safe AI-assisted engineering.

PHP 8.3 + Angular 22
Full-stack runtime modernization shipped with zero downtime
3 Tiers
Backend, REST API, and SPA locked behind AGENTS.md guardrails
0 Crashes
Post-fix Ratchet WebSocket multi-client broadcast stability
4-Quadrant Engineering Diagnostic Grid
01 / BUSINESS SYMPTOM & RISK

Legacy server-rendered modules, runtime incompatibilities blocking PHP 8.3 upgrades, WebSocket broadcast crashes under concurrent multi-workspace sessions, and fragile deployment scripts risking partial production outages.

02 / ROOT TECHNICAL DIAGNOSIS

Uncaught payload serialization failures in the Ratchet WebSocket loop, unguarded shell commands in CI/CD scripts lacking set -e and process isolation, and undocumented architectural boundaries across backend/API/frontend tiers.

03 / SURGICAL ENGINEERING FIX

Migrated legacy modules (Strategers, Settings, Constructors) to clean REST API + Angular 22 SPA modules, hardened WebSocket connection state handling, isolated supervisorctl workers, and wrote tier-specific AGENTS.md specifications.

04 / MEASURABLE OUTCOME

Zero-downtime production cutover to PHP 8.3 & Angular 22, stable real-time multi-client synchronization, deterministic deployments, and an AI-safe repository ready for rapid ongoing feature delivery.

✓ Talk to Dositej directly (no sales reps) ✓ Keep repo access private until we talk & sign an NDA ✓ Free 48h Initial Codebase Audit ($0, zero obligation) ✓ Rescues from $1,000
Engineering Deep-Dive & Architecture Walkthrough

Modernizing a Multi-Tier B2B Workspace Platform & Installing AGENTS.md Guardrails

Complex B2B platforms rarely live in a single framework. On this engagement, we upgraded a live multi-tier workspace and process-management platform across PHP 8.3 / Yii 2, Ratchet WebSockets, and Angular 22, eliminated real-time broadcast crashes, hardened deployment automation, and delivered a comprehensive Vibe-Safe Handover via tier-specific AGENTS.md specifications.

1. Zero-Downtime PHP 8.3 & Angular 22 Strangler-Fig Migration

The platform combined legacy server-rendered Yii 2 views with a growing single-page application, creating friction whenever new workspace capabilities were introduced:

  • Runtime Upgrade to PHP 8.3 & Angular 22: Audited and resolved strict typing, deprecation, and dependency incompatibilities across both the Yii 2 backend and the Angular SPA so the entire stack could run on modern, supported runtimes.
  • Module-by-Module Extraction (Strategers, Settings, Constructors): Migrated critical legacy workspace modules (Strategers, Settings, and Constructors) out of coupled server-rendered templates into clean, versioned REST API controllers consumed by modular Angular 22 components.

2. Ratchet WebSocket Hardening & Deterministic supervisorctl Deployments

Real-time collaboration across B2B workspaces depended on a long-running Ratchet WebSocket server that periodically crashed or dropped broadcasts during multi-client sessions and deployments:

  • Fault-Tolerant WebSocket Broadcast Loop: Isolated connection state management and guarded payload serialization inside the Ratchet event loop so a malformed client frame or disconnected socket could never terminate the broadcast daemon for other active workspaces.
  • Fail-Fast Deployment Scripts (set -e & supervisorctl Isolation): Re-engineered deployment scripts with strict set -e error trapping, atomic asset builds, and clean supervisorctl worker lifecycle restarts so broken builds could never partially deploy to production.

3. Multi-Tier AGENTS.md Vibe-Safe Handover

To ensure the engineering team could safely use AI coding assistants (Claude Code, Cursor) across a multi-repository/multi-tier architecture without introducing cross-tier regressions, we authored root and tier-specific AGENTS.md contracts documenting frozen authentication filters, REST payload schemas, WebSocket frame contracts, and deployment invariants.

Matching Rescue Services & Deliverable Preview

Hire Aquarel for a Surgical Rescue Sprint in This Domain

4-Point Engineer-Grade Trust Stack

Why Non-Technical Founders Hand Over Production Keys With Zero Anxiety

01 / IDENTITY & NDA FIRST

Talk First Before Repo Access

Meet Dositej live on a 20-min Triage Call, verify credentials, and sign an NDA before granting repo access.

02 / ZERO COWBOY EDITS

"Do No Harm" Staging & PRs

No editing live production files. Every fix ships in isolated PRs tested in staging with rollback safety.

03 / PLAIN-ENGLISH CLARITY

10–15 Min Loom Walkthroughs

Every audit and sprint includes a plain-English video walkthrough of the root cause and the fix—zero jargon.

04 / KEEP PROMPTING SAFELY

100% IP & Vibe-Safe Handover

You own all code, keys, and custom CLAUDE.md & AGENTS.md guardrails so future prompts never break production.

Direct Answers for Founders & Operators

Frequently Asked Questions

What did the multi-tier AGENTS.md handover include on this project? +

We authored explicit repository instruction contracts across the backend, REST API, WebSocket daemon, and Angular SPA tiers so AI coding assistants respect authentication boundaries, strict typing, and deployment scripts.

How did you migrate legacy server-rendered modules without breaking active customer workspaces? +

Using the strangler-fig pattern: we extracted clean REST endpoints and Angular SPA feature modules slice by slice, verifying each module in staging before cutting over traffic.

Why did the deployment and supervisorctl scripts require surgical hardening? +

Without strict shell fail-fast flags (set -e) and isolated supervisorctl worker restarts, a failed build step or stale WebSocket daemon could leave production in a split-brain state between the PHP 8.3 API and Angular 22 frontend.

Ready to Find Out What's Actually Broken—For Free?

Book a 20-minute Triage Call or send your broken app asynchronously. We talk first, sign a mutual NDA, and if we're a fit, I deliver your 48-hour Codebase Audit and Loom walkthrough at zero cost.

✓ Talk to Dositej directly (no sales reps) ✓ Keep repo access private until we talk & sign an NDA ✓ Free 48h Initial Codebase Audit ($0, zero obligation) ✓ Rescues from $1,000