growthGrid

Architecture

Rewrites stall products for months. How we move a PHP app to a modern stack one module at a time, with old and new running side by side.

2 min read

Migration router panel sending each module to the new app or the legacy PHP app, with rollback switches
On this page

Most PHP apps that need modernizing aren’t broken. They work, people rely on them every day — and that’s exactly what makes a rewrite so risky. For months the business gets nothing new while a second system tries to catch up with the first.

Our own 2022 learning portal is a good example: institute, faculty and student dashboards, SQL inside the templates, PHP sessions for sign-in. Here’s how we approach re-platforming it without a big-bang cutover.

Inventory before architecture

Start with a list of every page: what it reads and writes, and who uses it. It’s unglamorous work and the most useful document in the project, because it turns “the old system” into a set of modules you can move one at a time.

  • Pages and routes: every URL, grouped by module.
  • Data: the tables each page reads and writes.
  • People: which role uses it, and how often.
  • Risk: what breaks, and for whom, if it goes wrong.

Put an API in front of the data

Before moving a single screen, put a typed API in front of the existing database. New screens use it from day one, and old pages can be pointed at it gradually. Both apps read the same records, so there’s never a second copy of the truth to reconcile.

Route by module, not by release

A small routing layer sits in front of both apps and decides, path by path, which one serves the request. Moving a module means adding one line, and moving it back is just as quick.

typescript
// Send migrated modules to the new app; everything else stays on PHP.
const MIGRATED = ["/login", "/students", "/timetable"];

export function upstreamFor(pathname: string) {
  return MIGRATED.some((path) => pathname.startsWith(path)) ? NEW_APP : LEGACY_PHP;
}
One list decides who serves each module. Rolling back is a one-line change.

Share sign-in early

Nothing erodes trust faster than being asked to log in twice. Swapping PHP sessions for a token both apps can verify is the first move, before any screen people would notice.

Measure the boring things

  1. Error rate per module, old versus new.
  2. Load time for the screens people use most.
  3. Support questions after each move.
  4. Time from a change request to it going live.
A rewrite asks for trust up front. Moving module by module earns it one screen at a time.
— growthGrid engineering notes

When the last PHP page stops receiving traffic, there’s no dramatic switch-off. The old app simply goes quiet — which is exactly how a modernization should end.

  • Modernization
  • PHP
  • Next.js
  • Architecture

Share

Insights

Put it into practice

Let’s turn fresh perspectives into practical solutions built around your product and business goals.

Booking new projects for Q4 2026

We reply to every enquiry within one business day.