---
title: "Setup"
description: "From a fresh clone to every app running locally."
url: https://docs-staging-lehoetel.findmalek.engineer/docs/setup
markdown: https://docs-staging-lehoetel.findmalek.engineer/docs/setup.md
---

# Setup

You need node 24, pnpm, bun and docker.

```bash
pnpm install
pnpm db:up
pnpm dev
```

`pnpm db:up` starts a local postgres from `docker/docker-compose.yml`. The api applies migrations on start and, when `SEED=demo`, fills an empty database with sample data.

## Demo data

`pnpm db:seed`, the api with `SEED=demo` and the Playwright run all use the same deterministic seed (`packages/db/src/seed`, fixed random seed, only dates move with today). It runs on an empty database only and is all fake:

- four hotels with their own branding: Dar Zitouna (Monastir guesthouse), Sunset Bay Resort (Hammamet), Villa Mimosa Spa (Djerba), Riad Dattier (Tozeur)
- about 440 guests with Tunisian, French, Arabic and international names and phone formats, in fr, ar and en, with consents and an append-only `consent_events` log (some withdrawn)
- accounts on `@demo.le-hoetel.test`, never deliverable: a super admin `admin@demo.le-hoetel.test` and one owner per hotel, `owner.dar-zitouna@`, `owner.sunset-bay@`, `owner.villa-mimosa@`, `owner.riad-dattier@`. They share the password `DEMO_PASSWORD` (default `demo-le-hoetel-2026`)

A feature that adds tables adds its own section to `seedDemo` and a test in `packages/db/src/seed`.

## End-to-end tests

`pnpm test:e2e` (needs `pnpm db:up`) builds web and dashboard, starts the api on a fresh database with `SEED=demo` and runs Playwright from `apps/e2e`. Three projects: `desktop`, `iphone` (iPhone 14) and `android` (Pixel 7). Phone profiles run in chromium and only the `web` and `dashboard` specs, which check each language (en, fr, ar) for `lang`, `dir` (RTL in Arabic) and no sideways scroll. `fixtures.ts` has the shared helpers. Sign in as a demo account with the credentials above. The api allows 10 sign-in posts a minute per ip, so keep UI sign-ins few.

| App | Url |
| --- | --- |
| web | http://localhost:3000 |
| api | http://localhost:3001 |
| dashboard | http://localhost:3002 |
| docs | http://localhost:3003 |

Sign in to the dashboard with `ADMIN_EMAIL` and `ADMIN_PASSWORD` from `.env`. The admin is created or reset on every api start.

## Working on one app

```bash
pnpm dev:web        # web and api
pnpm dev:dashboard  # dashboard and api
```

## Before you push

```bash
pnpm lint
pnpm check-types
pnpm test
pnpm build
```
