Skip to content

Installation

Follow these steps to add TradeX to your server. The app installs like any lb-phone app, inside the [phone] folder of your resources.

Prerequisites

ItemDetail
lb-phoneRequired, installed and working
ox_libRequired (callbacks)
oxmysqlRequired (data persistence)
A frameworkRequired — qb-core, qbx_core or es_extended
A banking scriptOptional — only for the stock revenue mode

NOTE

The framework is auto-detected on startup. No banking script is needed as long as you stay in volatility mode (the default setting).

1. Add the resource

Place the lo_tradex folder inside resources/[phone]/:

resources/
└── [phone]/
    └── lo_tradex/
        ├── fxmanifest.lua
        ├── shared/
        │   ├── config.lua
        │   ├── locales.lua
        │   ├── utils.lua
        │   └── framework.lua
        ├── client/client.lua
        ├── server/
        │   ├── db.lua
        │   └── server.lua
        ├── locales/          ← 2 language files (en, fr)
        └── ui/
            └── dist/         ← already-compiled interface

2. Start order

In server.cfg, start TradeX after its dependencies:

cfg
ensure oxmysql
ensure ox_lib
ensure lb-phone
ensure lo_tradex

WARNING

If lo_tradex starts before lb-phone, the app will not register in the phone. Respect the order: oxmysqlox_liblb-phonelo_tradex. Your framework (and your banking script, if any) must also start before it.

3. Database

The schema is created automatically on first start via oxmysql — no SQL import is needed. TradeX creates all of its tables (player accounts, crypto and stock market state, holdings, transactions, watchlists, price and portfolio history, bank operations).

NOTE

Tables are prefixed with phone_trade_ to avoid conflicts. History data older than Config.MaxHistoryDays is pruned automatically.

4. Interface (UI)

The interface is already compiled: the ui/dist/ folder is shipped and served to the phone by fxmanifest.lua. No build step is required to use the app.

TIP

There is nothing to do here in the standard case: the bundled UI is ready to use. To add your own coin icons, drop them in ui/dist/assets/coins/ and reference them as nui://lo_tradex/ui/dist/assets/coins/yourfile.png.

Verification

  1. Start the server (or ensure lo_tradex on a live server).
  2. Check the console: the phone_trade_* tables should be created without error on first launch, and the Framework: ... line should report your detected framework.
  3. On the in-game phone, open the App Store: TradeX should appear, ready to download.
  4. Install it, create a trading account and place a first buy order to confirm everything works.

TIP

To pre-install the app on every player's phone (skipping the App Store), set Config.DefaultApp = true in shared/config.lua.

Once the install is verified, tune the behavior via the Configuration.