# monorepo.leisure.com — repo context

> Curated overview for code_search. Source: `bitbucket_server:AD/monorepo.leisure.com` (Bitbucket, project AD). Turborepo monorepo · Node ≥20 · TypeScript · Fastify · Prisma. Default branch `master`.

## Purpose
The **Leisure.com backend** — a Turborepo monorepo of Fastify microservices + shared packages powering the Leisure.com travel/hotel product. This is the server-side counterpart to the `leisure-ui.com` front end (which calls the user / search / booking / payment services here).

## Structure (Turborepo workspaces: `apps/*` + `packages/*`)
**apps/** — Fastify + TypeScript services (each has `src/`, its own `package.json`, `.env.example`, Jest config, README, Postman collection):
- `user-service` — user auth/profile, plus search / wishlist / reviews endpoints.
- `booking-service` — booking lifecycle + pending-booking sessions; integrates the **Amadeus** Booking API (see `apps/booking-service/AMADEUS_BOOKING_API_USAGE.md`).
- `payment-service` — payment APIs, webhook ingestion, and a **BullMQ** worker (`dev:worker`).
- `admin-service` — admin dashboard + admin-domain endpoints.
- `automation-service` — automation / background jobs.

**packages/** — shared libraries:
- `shared` — **Prisma** schema/client (MySQL), response helpers, shared types. **Start here for the data model.**
- `tsconfig` — shared TypeScript config.
- `elasticsearch`, `opensearch` — search helper packages.

## Tech
Turborepo (`turbo.json`) · Node ≥20 / npm ≥10 · TypeScript · Fastify · Prisma + MySQL · Redis + BullMQ (payment worker) · Firebase Admin · PM2 (`ecosystem.config.js`). Root docs: `docs/{architecture,local-setup,development,api,events,testing}.md`, plus `PAYMENT_FLOW_GUIDE.md` and `ELASTICSEARCH_SETUP.md`.

## Search notes
- Per-service logic lives under `apps/<service>/src/`; the cross-service **data model + utilities** live in `packages/shared` (Prisma schema is there).
- Async/event work (webhooks, queues) is in `payment-service` (BullMQ worker) — see `docs/events.md`.
- This is the **backend**; the matching UI is `leisure-ui.com`. `node_modules` / build output are gitignored, so not indexed.
