Skip to content

Who calls what ​

BookDirect is a property management system (hotels, shortlets, apartments are all property) built as three repos. The Next.js app talks to Core Backend (auth + some entity GETs) and Middleware Backend (availability, file-manager). Playbooks name Middleware as winner wherever that folder is live.

Archived Convex/Next lives in _legacy/ and bookdirect-legacy-code.

mermaid
flowchart LR
  subgraph fe [Frontend Next.js]
    GuestUI[Frontend Marketplace]
    OwnerUI[Frontend Extranet]
  end
  subgraph mw [Middleware Backend NestJS]
    Pay[payments]
    Refund[refunds]
    Mail[emails]
    Google[google-rates]
    Avail[availability]
  end
  subgraph core [Core Backend Laravel Nellalink]
    Auth[users and JWT]
    Entities[smart-meta-manager]
    Meta[meta-data]
  end
  GuestUI -->|"auth, CRUD entities"| core
  OwnerUI -->|"auth, CRUD entities"| core
  GuestUI -->|"pay, refund, email, rates, availability"| mw
  OwnerUI -->|"pay, refund, ARI, emails"| mw
  mw -->|"save or update entities"| core

Layers ​

LayerRepoPlaybook
Frontendfrontend-bookdirect-user-appFrontend — Marketplace · Frontend — Extranet
Middleware Backendmiddleware-bookdirect-nestjsLogic / Functions
Core Backendbackend-nellalink-laravelRecommended usage
Project Managementthis docs repoActivation matrix · ENV / Metadata Catalog

Legacy reference (do not build new features here): bookdirect-legacy-code.

Routing preference ​

  1. Only Core Backend has the operation → frontend calls Core Backend (register, login, create property in v1).
  2. Middleware Backend later adds the same job (example: upload property that also pushes Google) → playbooks switch to Middleware Backend. Core Backend is what Middleware Backend calls, not what the frontend calls.
  3. One winner. The old URL moves to Do not call (superseded).

That is why every iteration must re-read Core Backend explorer and Middleware Backend explorer before editing playbooks. See prompts/iterate-docs.md.

What must not happen ​

  • Do not persist bookings or properties in Middleware Backend Mongo. The WIP branch feature/core-booking-platform-endpoints does this today — do not follow it.
  • Do not add Paystack, Resend, or Google Hotel logic to Core Backend Laravel.
  • Do not compute availability only in the browser. v1 winner is Middleware Backend availability/check, which reads Core Backend.

Folder map (Middleware Backend) ​

Enable each folder in config/routes.json and register it in src/common/loaders/feature-loader.ts.

FolderMountFrontend calls it?
properties/api/v1/nellalink/propertiesYes (winner; app may still hit Core — switch)
rates-packages/api/v1/nellalink/rates-packagesYes
bookings/api/v1/nellalink/bookingsYes
availability/api/v1/bookdirect/availabilityYes
payments/api/v1/bookdirect/paymentsYes
reservations/api/v1/nellalink/reservationsExtranet
file-manager/api/v1/nellalink/file-managerYes
refunds / emails / google-ratesnot in routes.jsonto implement

API-first. Middleware Backend wins over Core Backend when both exist.