Skip to content

Development ​

Layout ​

fxmanifest.lua                globs only
shared/lib/                   NpClothing namespace, utils, pieces and outfits (ids, sanitising), locale loader
shared/config/                00_core 01_slots 02_labels 03_economy 04_client + catalogue stores wardrobe factions
shared/np_admin_settings.lua  settings staff edit in np_admin
shared/locales/{en,de}/       strings per feature
bridge/np_admin.lua           the np_admin integration lib (vendored, np_admin stays optional)
bridge/framework/             client + server: esx, qbx, qb, standalone
bridge/inventory/server/      np, ox, qb, none
integrations/                 one file per np_* sibling, loaded on both sides
server/core/                  init, schema + data layer, RPC, events, hooks, timers, log, notify, sync, pay,
                              ownership, look + locks, exports, staff tools
server/modules/               catalogue, stores, wardrobe, factions
server/boot.lua               last: schema, boot hooks, ready
client/core/                  state, NUI bridge + screens, RPC, sync, helpers, camera, look, exports,
                              natives.lua (the only file that calls the collection natives)
client/modules/               the client half of every feature
web/                          NUI (React 18 + Vite + TS strict + zustand, Nimbus UI)
assets/logos/svg/             store, label and faction logos (stores/ for the 15 store logos)
thumbs/                       rendered piece thumbnails
sql/install.sql               the schema (also applied at every start)
tests/                        plain-Lua harness + run.sh

A feature module only adds files: shared/config/<feature>.lua, server/modules/<feature>/, client/modules/<feature>/, its locale files and its tests. The manifest uses globs, so nothing else changes.

NUI ​

sh
cd web
npm install
npm run dev            # browser mock mode
npm run build          # FiveM backdrop guard + typecheck + vite build → web/dist
npm test               # contract check + vitest

npm run build also runs check:fivem, which fails the build on CSS FiveM can't render (backdrop-filter). check:contract compares the RPC names, screens and actions of the web with the Lua side and fails when a typed RPC has no mock.

In the browser, mock mode answers every request with sample data:

URL parameter Values
screen store, store.auth, dressing, wardrobe, uniform, locker, packs, kit (every component)
variant store: luxury, counterfeit, empty, error; wardrobe: empty, full, female, shared, menu, expired; uniform: new, choice, rank, certs, log, female; locker: civilian, empty, female, locked, noduty, offduty; packs: pack, pieces, missing, import, importing, empty, readonly; dressing: simple, wardrobe; store.auth: pending, genuine
locale en, de
shot 1: no dev bar, no animations (for screenshots)

Screenshots ​

sh
cd web
npm run screenshots              # every screen and variant → web/screenshots/<id>[@variant].png
bash scripts/screenshots.sh store   # only ids starting with "store"

The script builds web/dist, serves it with vite preview and renders every registered screen at 1920 × 1080 with headless Chrome. Set CHROME= if Chrome is not in /Applications. Then run npm run sync:images in this docs repo.

Tests ​

sh
tests/run.sh             # luac -p on every file, then every tests/test_*.lua in its own process
tests/run.sh stores      # one suite (tests/test_stores.lua); VERBOSE=1 shows the log

The harness loads the files the manifest lists, fakes oxmysql, natives, exports and events, and runs threads on a fake clock. It fails a test on any thread error, a nil SQL parameter or a payload that can't be serialised.

  • Bridge suites: test_core (es_extended + np_inventory + np_hud, with np_admin), test_qbx (qbx_core + ox_inventory), test_qb (qb-core + qb-inventory) and test_standalone. Each runs every feature's smoke test on its combination.
  • Features: test_catalogue, test_catalogue_client (scan, apply, reverse lookup, packs moving like a DLC would, an old build without the collection natives), test_stores, test_wardrobe, test_factions.
  • Client: test_client (screens, camera, look handler, natives shim).
  • Integrations: test_integrations checks every export and event np_clothing uses against the sibling repos; test_integrations_flow runs the wrappers against fake siblings.
  • Project: test_project checks locales, manifest, SQL, the vendored np_admin lib and settings, and that the documented exports, hooks and events match the code in both directions.

Needs Lua 5.4 (LUA= / LUAC= override the binaries).