App Rescue: How We Took Over a Real Estate App Several Vendors Left Broken

A real estate marketplace in Libya came to us for one payment integration. The code audit showed it needed rescuing first. Here's how we rebuilt it without losing data.

المقالات منشورة باللغة الإنجليزية.

Laptop showing the Beyut Libya sign-in screen, with the Add New Property wizard behind it

Rashid Kadura didn't come to us for a rescue. He came for one payment integration on Beyut Libya, his property marketplace for Libya. It was a small, clear job, and he had a budget for exactly that. We could have taken it, plugged in the gateway and moved on.

We read the code first, and that changed the conversation.

What we found when we opened the code

Several development teams had worked on Beyut before us, one after another. Each one had left something half-done, and nobody had cleaned up after the last. When we looked closely, three things stood out:

  • The apps weren't really talking to the backend. Parts of the website and the mobile app weren't connected to the API at all, so features that looked finished didn't work end to end.
  • The server was one machine updated by hand. The whole platform ran on a single AWS EC2 server. No containers, no pipeline. Every update meant someone logging in and changing files on the live box.
  • The code couldn't grow. It was tangled enough that every fix risked breaking something else. Adding users or features would only make it worse.

A payment gateway on top of that would have worked for a while. Then the first time the server had a bad day, it would have taken payments down with everything else.

Why we told him not to spend money on the job he asked for

This is the hard part of any app rescue. The client has already paid for the app, sometimes more than once, and the last thing they want to hear is that it needs more work. But if we'd said nothing, Rashid would have paid us for the integration and then paid someone else to fix the foundation later.

So we wrote it down. The audit listed what was broken, why it mattered and what it would take to fix, with examples from his own code. Then we got on a call and walked him through it, file by file, until he could see what we were seeing. He didn't have to take our word for it.

He asked us to fix it properly.

Rebuilding a live marketplace without losing anything

The platform had real listings, real photos and real users. A rescue that throws that away isn't a rescue, so the rule was simple: every listing, every image, every account and every feature had to survive.

We rebuilt it in layers:

  1. Backend first. We moved the API to NestJS, with Prisma ORM on MySQL, with a clear structure that a new developer can read in a day.
  2. Then the website. The front end moved to Next.js, in Arabic and English, right to left and left to right.
  3. Then the data. Listings and accounts came across with checks on both sides. Photos moved to Amazon S3, so they're no longer sitting on the web server's disk.
  4. Then the plumbing. Redis caches the searches people run most. BullMQ runs slow work in the background, like resizing images and sending notifications, so nobody waits for it. Prometheus and Grafana watch the servers, so we see a problem before a user does.
  5. Then the server. The same EC2 machine now runs Docker containers, and every change ships through a CI/CD pipeline. Nobody edits files on the live server anymore.

On top of that, Rashid got a new admin panel to manage listings, categories and user verification himself.

Then the payment integration he came for

Only once the base was solid did we do the original job. Libya has its own payment networks, so we connected Tadawul, a Libyan payment gateway, to the marketplace. This time the payment integration sits on a platform that can carry it.

The mobile app had the same problems

Once the website was stable, Rashid asked us to audit the mobile app. Same story, same honest report: the code wasn't fit to build on.

So we rebuilt the app in Flutter, with Firebase underneath it:

  • Push notifications through Firebase Cloud Messaging
  • In-app messaging between buyers and agents
  • Search on a map, so people can see where a property actually is
  • In-app purchases for listing slots: sellers buy slots on a yearly plan through Google Play or the App Store, and each slot lets them put one property up for sale. This is how the marketplace makes its money, so billing had to be right on both stores.
  • Arabic and English throughout

It's live on Google Play and the App Store as بيوت ليبيا, and it has passed 10,000 downloads on Android. The marketplace now carries more than 1,200 verified listings across more than 15 Libyan cities.

How to tell if your app needs rescuing

If you've gone through more than one developer and things still don't work, you're probably asking whether to fix what you have or start again. These are the signs we look for in an audit:

  • Features that look done but don't work end to end. Usually the front end and the API were built by different people who never finished connecting them.
  • Deploys that happen by hand. If updating the app means someone logging into a server, every release is a risk.
  • Fixes that break other things. That's a sign the code has no structure, or no tests, or both.
  • Nobody can explain how it works. If your current developer can't walk you through the code, the next one won't be able to either.
  • You don't control the accounts. The code, the server and the app store listings should all be in your name. If they aren't, sort that out before anything else.

None of these means you have to throw everything away. Sometimes a stabilise-and-clean-up is enough. With Beyut, the data and the business were worth keeping, and the code wasn't, so we kept one and replaced the other.

Common questions about app rescue

Should I rewrite my app or fix it? It depends on what the audit finds. If the structure is sound and the problems are bugs, fix it. If every change breaks something else and nothing is deployed properly, a staged rebuild usually costs less than patching it forever.

Can you take over an app from another developer? Yes, as long as you can give us the code, the server access and the app store accounts. If you don't have all three, getting them back is step one.

Will I lose my data in a rebuild? You shouldn't. On Beyut, every listing, photo and account came across. Data migration is planned and checked, not done in one go at the end.

What does a code audit include? A written report: what's broken, why it matters, what it would cost to fix and what we'd do first. We walk you through it on a call, with examples from your own code.

Is your app in the same state?

If you've been through a few developers and you're not sure what you've got, start with an audit. You'll get a written report and an honest answer on whether to fix or rebuild, even if you don't hire us for the work. See our software rescue service, read the Beyut Libya case study, or book a 30-minute call.

تريد بناء مشروعك بهذه الطريقة؟

أجب عن ثلاثة أسئلة سريعة وسنرسل لك خطة مكتوبة تشمل النطاق والفريق والجدول الزمني والتكلفة التقديرية.

احصل على خطة مشروع مجانية

النشرة الشهرية

احصل على رسالة عملية واحدة كل شهر عن بناء البرمجيات بوكلاء الذكاء الاصطناعي

ما نجح في مشاريع عملاء حقيقية، وما لم ينجح، والأرقام وراء ذلك. قصيرة بما يكفي لتقرأها مع قهوتك.

بلا رسائل مزعجة. رسالة واحدة شهريا. ألغ الاشتراك متى شئت.

EHMS charity funds screen showing zakat, sadqa and trust fund balances on separate ledgers

Zakat & Charity Fund Software for Trust Hospitals in Pakistan

Zakat management software for trust hospitals in Pakistan: how EHMS keeps zakat, sadqa and charity money on separate ledgers, from a hospital in Chishtian.

اقرأ المقال
EHMS hospital management software dashboard showing what needs attention, collections, cash and bank, receivables and charity fund balances

The Story Behind EHMS: Hospital Software for a Trust Eye Hospital in Chishtian

How we built hospital management software for a trust eye hospital in Chishtian, moved it to the web as EHMS, and why it beat SAP and Odoo for them.

اقرأ المقال
EHMS ہسپتال مینجمنٹ سسٹم کی اردو سائن اِن اسکرین، نستعلیق فونٹ کے ساتھ

Hospital Software in Urdu: ہسپتال مینجمنٹ سسٹم اردو میں، ٹرسٹ اور آنکھوں کے ہسپتال کے لیے

Hospital software in Urdu: Hospital Management System kya hai, OPD، لیب، فارمیسی، بلنگ اور زکوٰۃ فنڈ ایک سسٹم میں، اردو میں مکمل رہنمائی۔

اقرأ المقال