Why We Kept the Backends
The temptation was to rewrite everything. The reality was that the backends were stable, well-tested, and processed business logic that was too complex and too risky to rewrite under time pressure. The JSP frontend was the pain point — slow, not mobile-friendly, and requiring a browser that most employees had stopped using.
The pragmatic decision: replace only the frontend. Build a Next.js application that calls the existing .NET and Java services through a BFF (Backend for Frontend) layer. The BFF handled authentication, aggregated responses from multiple services, and provided a clean API for the new frontend.
What the Migration Actually Required
The BFF layer was written in Next.js API routes — close to the frontend team, easy to iterate. Each API route called the appropriate backend service, handled errors consistently, and returned a shape optimised for the UI rather than for the backend's internal model.
The session migration was the hardest part. The old system used server-side sessions tied to the JSP container. Moving to JWT-based authentication required coordinating with the .NET team, which meant a few weeks of parallel running where both auth systems were active.
Key takeaways
- A BFF (Backend for Frontend) layer in Next.js API routes lets you modernise the frontend without touching stable backend systems — aggregate, transform, and simplify in the BFF
- Replace the presentation layer first — the riskiest part of modernisation is usually the data layer, and keeping it stable while replacing the UI gives you quick wins
- Run old and new authentication systems in parallel during migration — a hard cutover on auth is high risk; a gradual transition with fallback is much safer
Conclusion
Modernisation doesn't have to mean rewrite. Replacing the frontend while preserving stable backends is often the right call — faster, lower risk, and achieves the user-visible goal. The full rewrite is a separate project to plan separately.
Enjoyed this article?

Vivek Kumar Singh
Technical Expert · Full Stack Cloud Engineer · Tokyo, Japan
Related articles
The Java Stream API Saved My Sanity on a Legacy Codebase
October 1, 2024 · 7 min read
Java 8 Is Over a Decade Old and It's Running Everything in Production
December 20, 2024 · 6 min read
Spring Boot Microservices in Production: My Checklist After 5 Shipped Services
August 20, 2025 · 10 min read