Skip to content

Who calls what

BookDirect is a property management system (hotels, shortlets, apartments are all property) built as three repos. The Vue frontend still talks to Convex in production today. These docs describe the target stack.

Build new work against Core + Middleware, not Convex. The current user app is Vue 3; archived Next.js lives in _legacy/ and bookdirect-legacy-code.

mermaid
flowchart LR
  subgraph fe [Frontend Vue]
    GuestUI[Guest marketplace]
    OwnerUI[Extranet dashboard]
  end
  subgraph mw [Middleware NestJS]
    Pay[payments]
    Refund[refunds]
    Mail[emails]
    Google[google-rates]
    Avail[availability]
  end
  subgraph core [Core 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-appScreens
Middlewaremiddleware-bookdirect-nestjsProcessors and workers
Corebackend-nellalink-laravelRecommended usage

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

Routing preference

  1. Only Core has the operation → frontend calls Core (register, login, create property in v1).
  2. Middleware later adds the same job (example: upload property that also pushes Google) → playbooks switch to Middleware. Core is what Middleware 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 explorer and Middleware explorer before editing playbooks. See prompts/iterate-docs.md.

What must not happen

  • Do not persist bookings or properties in Middleware 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 Laravel.
  • Do not compute availability only in the browser. v1 winner is Middleware availability/check, which reads Core.

Folder map (Middleware)

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

FolderMountFrontend calls it?
availability/api/v1/bookdirect/availabilityYes
payments/api/v1/bookdirect/paymentsYes
refunds/api/v1/bookdirect/refundsYes
emails/api/v1/bookdirect/emailsYes (or Middleware triggers after webhook)
google-rates/api/v1/bookdirect/google-ratesOwner / admin
file-manager/api/v1/nellalink/file-managerYes (already live)

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