A full two-sided booking marketplace (Airbnb / Gathern-style) for short-term rentals in Saudi Arabia — guest and host web app, a native Flutter iOS app sharing one JSON API, and a full guest/host mode switch.
Architecture sketch
Swipe sideways to see the whole sketch →
Home page
Search
Property page
Guest — browse & book
Host — manage properties
Web appLaravel, Inertia.js, React 19 + TS, Tailwind v4
Mobile appNative Flutter (iOS), shared JSON API
Booking engineRace-safe date holds, overnight and evening bookings, post-stay reviews
MessagingGuest/host chat with a strict, separate support channel
LanguageArabic RTL default + English, custom design system
Two guests booking the same nights at the same moment: the listing row is locked first, then availability is re-checked under the lock, so only one booking goes through. · app/Services/BookingService.php
return DB::transaction(function () use (/* … */): Booking {
// Serialize concurrent attempts for one listing — first statement in the transaction.
$this->lockProperty($property);
// Re-checked under the lock: a second guest sees the dates as taken.
if (! $this->availability->isAvailable($property, $checkin, $checkout, $period)) {
throw new BookingException('booking.error.dates_taken');
}
// … price the stay, then store the booking
});
private function lockProperty(Property $property): void
{
// The listing row always exists, so even its very first booking is covered.
Property::query()->whereKey($property->id)->lockForUpdate()->first(['id']);
}
بنيت بمفردي منصة حجز عقارات ثنائية الاتجاه (على غرار Airbnb أو Gathern) للإيجار قصير المدى في السعودية — تطبيق ويب للضيوف والمضيفين، وتطبيق جوال أصلي بـ Flutter لنظام iOS يشارك واجهة برمجية (API) واحدة مع تطبيق الويب، مع إمكانية التبديل الكامل بين وضع الضيف ووضع المضيف.
مخطط البنية
← اسحب أفقياً لرؤية المخطط كاملاً
الصفحة الرئيسية
البحث
صفحة العقار
ضيف — تصفّح واحجز
مضيف — إدارة العقارات
تطبيق الويبLaravel وInertia.js وReact 19 مع TypeScript وTailwind v4
تطبيق الجوالFlutter أصلي لنظام iOS، بنفس الـ API
محرك الحجوزاتحجز آمن للتواريخ، حجوزات ليلية ومسائية، تقييمات بعد الإقامة
المحادثاتمحادثات فورية ضيف/مضيف، دعم منفصل، خصوصية صارمة
ضيفان يحجزان الليالي نفسها في اللحظة نفسها: يُقفل صف العقار أولًا، ثم يُعاد التحقق من التوفر تحت القفل، فيمرّ حجز واحد فقط. · app/Services/BookingService.php
return DB::transaction(function () use (/* … */): Booking {
// Serialize concurrent attempts for one listing — first statement in the transaction.
$this->lockProperty($property);
// Re-checked under the lock: a second guest sees the dates as taken.
if (! $this->availability->isAvailable($property, $checkin, $checkout, $period)) {
throw new BookingException('booking.error.dates_taken');
}
// … price the stay, then store the booking
});
private function lockProperty(Property $property): void
{
// The listing row always exists, so even its very first booking is covered.
Property::query()->whereKey($property->id)->lockForUpdate()->first(['id']);
}