The problem
Short-term rentals in Algeria lived in classifieds and social media groups. There was no way to verify a host and no shared booking or review history. Vehicle rental was dominated by offline agencies with no digital booking at all. International platforms such as Airbnb and Booking had thin Algerian inventory, and they did not support local payment methods or full Arabic and French interfaces.
Baytup has three kinds of users:
- Guests browse stays or vehicles, book and pay, save favorites, message hosts and leave reviews.
- Hosts apply for verification, list properties or vehicles, manage availability and pricing, approve bookings, reply to reviews and withdraw earnings.
- Admins moderate listings, review host applications, manage users, handle disputes and process payouts.
What I built
I designed and built Baytup as one marketplace for two asset classes. Hosts list properties (apartments, houses, villas, studios, rooms, riads, guesthouses, hotel rooms) and vehicles (cars, motorcycles, vans, SUVs, trucks, buses, bicycles, scooters, boats). Guests discover, book, pay for and review both through the same flows, in three languages and two currencies.
Discovery and booking
- A homepage split into Stays and Vehicles, with featured listings.
- Search on an interactive Google Map with marker clustering.
- Filters for location, dates, price, guest count, type, amenities or vehicle features, instant book and rating.
- Listing pages with a photo carousel, embedded map, amenities, host profile, reviews and an inline booking widget.
- A date-range calendar with a live price breakdown: nightly rate × length of stay, plus cleaning fee, service fee, taxes and deposit.
- Per-guest wishlists.
Host tooling
- Multi-step onboarding: ID front and back, proof of address, profile photo, property intent and terms.
- One listing wizard for stays and vehicles, with category-specific fields.
- Pricing with a base price, cleaning fee, service fee and security deposit, charged per hour, day, night, week or month.
- Availability with blocked dates and minimum and maximum stay.
- An earnings dashboard with revenue charts and booking history.
- Payout requests to local rails: RIB, IBAN, CCP and BaridiMob.
Admin console
- User management: activate, deactivate, delete and change roles.
- Listing moderation: approve, reject and feature.
- Host application review with accept, reject and feedback.
- Booking oversight, cancellations and dispute handling.
- Platform-wide analytics.
Messaging and notifications
- In-app messaging between guests and hosts over Socket.IO.
- Conversations scoped to a listing or booking, with per-participant read receipts.
- Typed messages: text, image, file and system.
- Live notifications for more than 40 event types across the booking lifecycle, payments, reviews, payouts, moderation and account events.
- A notification center with an unread badge, filters, bulk mark-as-read and automatic cleanup of old entries.
Localization
- English, French and Arabic, with a full RTL layout in Arabic.
- Prices shown in DZD or EUR across the UI.
- Language and currency preferences saved per user.
- A font per script: Noto Sans Arabic for Arabic, Inter for English and French.
Trust and safety
- Email verification with tokenized links, and a password reset flow.
- Google OAuth alongside email and password.
- Host identity verification with ID documents and proof of address.
- Reviews with an overall rating plus six sub-ratings (cleanliness, communication, check-in, accuracy, location, value), and host responses.
- A Superhost badge for consistently high-rated hosts.
- Rate limiting, Helmet security headers, input validation and sanitization.
Payments
Card payments go through SlickPay, an Algerian payment gateway. A webhook confirms each payment, and a scheduled job moves the booking forward once it does. Hosts request payouts from their dashboard, and an admin approves each one before it is processed.
Architecture
The client and server are two separate projects: a Next.js 14 app on the App Router with server rendering, and an Express API. They talk over REST and WebSocket, and each deploys on its own schedule.
- Role-based dashboards. One
/dashboardURL renders the admin, host or guest experience based on the signed-in user's role. Express middleware (protect,authorize(role),hostOrAdmin,ownerOrAdmin) enforces the same rules on the server. - One listing model for two asset types. A single
Listingschema covers stays and vehicles through acategorydiscriminator plusstayDetailsandvehicleDetailssub-documents. Search, booking, reviews and wishlists behave the same for both, while each category keeps its own fields and filters. - Geo search. Listings store a GeoJSON point,
{ type: 'Point', coordinates: [lng, lat] }, with a2dsphereindex. That index backs the radius and bounding-box queries behind the map. - Notification engine. A general
Notificationmodel has 40+ enumerated types and severity levels. Every domain event creates an in-app notification, delivers it live over Socket.IO and, for important events, also sends an email. A TTL index prunes old entries. - Conversations. Conversations are first-class documents, optionally tied to a listing or booking, with a
lastReadAtper participant for read receipts. - Dual currency. Each listing stores its price in one canonical currency. The UI renders it in the user's preferred currency everywhere.
- RTL-first styling. I tested the Tailwind config and components in both LTR and RTL. The root
<html dir>attribute flips when the language changes, so every page mirrors correctly.
Hard problems
Two asset types, one search
Stays and vehicles share a schema but need very different filters. A guest looking for a riad cares about amenities; a guest looking for a car cares about vehicle features. I wrote a category-aware query builder and a filter-data endpoint that returns the right facet set for the selected category, so the UI does not hard-code filters for either type.
Targeted real-time delivery
Each connected user joins a Socket.IO room keyed by their user ID. When a domain event fires, the server persists a Notification document and emits only to the recipients' rooms. Nothing is broadcast to everyone, and a user who was offline still finds the notification when they return.
Three languages, one of them RTL
User-facing copy lives in JSON locale bundles, one per page. Arabic needs a mirrored layout and its own font stack. Tailwind's rtl: variant handles the mirroring, and the font is scoped to the active language.
Local payout rails
Algerian banking uses a 20-digit RIB, plus CCP and BaridiMob. The Payout model supports each of them, alongside IBAN, with validation per method.
Three dashboards at one URL
/dashboard renders three entirely different UIs. The role is resolved at render time from the authenticated user, and matching guards on the server mean the API enforces the same boundaries as the UI.
Booking state machine
A booking moves pending → confirmed → completed, or ends in cancelled or dispute. Payment status is tracked separately (pending, completed, failed, refunded), so a payment problem never has to be encoded as a booking state. A cron job advances bookings once payment is confirmed.
Data model
| Model | What it holds |
|---|---|
| User | Identity, role, profile, preferences, host profile and stats |
| Listing | A stay or vehicle with pricing, availability, images and location |
| Booking | Listing, guest and host, dates, price breakdown, payment and status |
| Review | Bidirectional reviews with six sub-ratings and host responses |
| Conversation and Message | Listing- or booking-scoped chat with read receipts |
| Notification | Typed, prioritized in-app events that expire through a TTL index |
| HostApplication | Identity documents, host intent and the admin review workflow |
| Payout | Local bank details, status and admin processing |
| Wishlist | Listings a user has saved |
In production
- Deployed on an Ubuntu 24.04 VPS behind Nginx, with Let's Encrypt certificates and PM2 supervising both the client and the server.
- Transactional email for account verification, password resets, booking confirmations and notifications.
- Structured logging with Winston and Morgan, plus rate limiting against abuse.
- Seed scripts for reproducible development environments.
What it demonstrates
- Modelling two different rental products on one schema without forking the search, booking and review code.
- Building for a specific market: local payment and payout rails, Arabic RTL and dual-currency pricing designed in from the start.
- A real-time layer that targets individual users and is backed by persisted notifications.
- Authorization that stays consistent between the UI and the API.