> For the complete documentation index, see [llms.txt](https://tyrix.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tyrix.gitbook.io/docs/script-resources/tyrix-droply/installation.md).

# Installation

## Steps

{% stepper %}
{% step %}

## Drop the resource

Drop the resource into `resources/[addons]/tyrix_droply`.
{% endstep %}

{% step %}

## Add to `server.cfg`

Add to `server.cfg`, **after** its dependencies:

```ini
ensure es_extended        # or qb-core / qbx_core
ensure oxmysql
ensure ox_lib
ensure ox_inventory
ensure ox_target
ensure lb-phone
ensure tyrix_business
ensure tyrix_droply
```

{% endstep %}

{% step %}

## Restart the server

Restart the server. Schema auto-creates on first start — no SQL import needed. You should see `[Droply] tables ready` in the console.
{% endstep %}

{% step %}

## Assign a crafting station

In-game as an **admin**, open the Business Manager (`/business`) → **Droply** tab and assign at least one crafting station to a business.
{% endstep %}

{% step %}

## Open the app as the boss

As the **boss** of that business, open the Droply app on your phone, price the menu, and tap **Open**.
{% endstep %}
{% endstepper %}

Steps 4 and 5 are covered in detail on the [Storefront Setup](/docs/script-resources/tyrix-droply/storefront-setup.md) page.

`schema.sql` is optional — useful only if you want to pre-provision the schema or hand it to a DBA as reference. The runtime DDL in `server/database.lua` is kept in sync with it.

## Dependencies

| Dependency       | Required                          | Purpose                                                              |
| ---------------- | --------------------------------- | -------------------------------------------------------------------- |
| `tyrix_business` | Yes                               | Businesses, crafting stations, menu projection, delivery HUD, boxes. |
| `lb-phone`       | Yes                               | Hosts the Droply app via `AddCustomApp`.                             |
| `ox_inventory`   | Yes                               | Item counts, carry checks, and the item transfer at handover.        |
| `ox_lib`         | Yes                               | Progress bars and notifications.                                     |
| `ox_target`      | Yes                               | The "Hand over delivery" option on the customer's ped.               |
| `oxmysql`        | Yes                               | Database driver.                                                     |
| `es_extended`    | Yes (one of the three frameworks) | Framework — ESX.                                                     |
| `qb-core`        | Yes (one of the three frameworks) | Framework — QBCore.                                                  |
| `qbx_core`       | Yes (one of the three frameworks) | Framework — QBox.                                                    |

The framework is auto-detected at runtime by `bridge/server.lua` — you do not set it anywhere. Detection order is ESX → QBCore → QBox, keyed off `Config.Bridge.ResourceNames`.

## Framework Support

| Framework | Status |
| --------- | ------ |
| ESX       | ✅      |
| QBCore    | ✅      |
| QBox      | ✅      |

## Load order matters

Droply must start **after** `tyrix_business` and `lb-phone`:

* It calls `exports.tyrix_business:*` on its hot paths (menu projection, employee index, box enumeration).
* `client/app.lua` blocks until `lb-phone` reports `started` before registering the app, and re-registers automatically if lb-phone restarts.

If Droply starts first, the app will still register on the lb-phone restart handler, but storefront menus will be empty until tyrix\_business is up.

## No item setup required

Droply does not add any `ox_inventory` items of its own. The box-carry path reuses the `business_box` item that tyrix\_business already registers — if you completed the tyrix\_business [Item Setup](https://tyrix.gitbook.io/docs/script-resources/tyrix-business/item-setup), you are done.

## Escrow

The resource ships escrow-protected. These files are **open** and fully editable:

| File                | Contents                                             |
| ------------------- | ---------------------------------------------------- |
| `config.lua`        | All gameplay, economy, branding, and limit settings. |
| `config_sv.lua`     | Server-only Discord webhook configuration.           |
| `bridge/client.lua` | Client-side notification bridge.                     |
| `bridge/server.lua` | Framework detection, money, job, and society bridge. |

Everything else is escrowed. The phone UI ships pre-built in `ui/dist/` — there is no build step.
