Skip to content

Building, tests & screenshots ​

Layout ​

fxmanifest.lua                 globs only: a feature module adds files and never edits the manifest
shared/lib/                    00 NpVending global, bridge selection, bus · 01 util + validation · 02 geometry
                               03 spacing (the ONE rule engine, client and server) · 04 locale
shared/config/NN_*.lua         Config: core, models, items, spacing, zones, world, economy, crime, ui, shops
bridge/np_admin.lua            np_admin lib, vendored byte-identical (after the config)
shared/np_admin_settings.lua   np_admin Resource settings (also the schema np_admin reads while np_vending is stopped)
shared/locales/{en,de}/
bridge/framework/{client,server}/   esx | qbx | qb | standalone   (esx first)
bridge/inventory/server/            np | ox | qb | none           (np first)
integrations/*.lua             one adapter per np_* sibling, both sides, with a built-in fallback
server/core/NN_*.lua           init (staff) · schema + data · rpc · events · hooks · timers · ledger · operators + keys ·
                               machines + slots · rules + zones · money + accounts · notify + inbox · sync · views · api · props (np_prophandler)
server/modules/<m>.lua         purchase, world, placement, service, owner, market, rent, routes (+ jobs), crime, admin
server/boot.lua                last: schema, stores, ready
client/core/NN_*.lua           state · nui · rpc · sync · helpers (fallback toasts / prompts / progress) · props ·
                               interact (target + prompts) · api + commands
client/modules/<m>.lua         machine, placement (ghost + rings), service, dashboard, crime, admin
web/                           React + Vite NUI (index.html) and the phone app (phone.html), one package
web/design/                    Nimbus UI tokens and CSS, never edited
sql/install.sql
tests/                         plain-Lua harness, one process per tests/test_*.lua

shared/lib/03_spacing.lua is pure Lua without natives: the client runs it every few frames to draw the rings and the checklist, and the server runs exactly the same code again before it places, moves or sells a machine.

Build ​

sh
cd web
npm ci
npm run build          # FiveM guard check + tsc --noEmit + vite build → web/dist/index.html, web/dist/phone.html
npm test               # contract check (types.ts against the RPC list and the Lua registrations) + vitest
npm run dev            # browser mock
npm run screenshots    # headless Chrome → web/screenshots/*.png
node scripts/check-contract.mjs --strict

npm run build first runs scripts/check-fivem-guard.mjs: in FiveM a blurred surface renders as a black box over the game, so the HTML sets html.nb-fivem before the first paint and the CSS turns backdrop-filter off under it. The guard fails the build when that rule or the code that sets the class is missing.

Browser mock ​

npm run dev runs the UI without FiveM, with mock data and a dev panel that links every screen and variant. URL parameters pick a screen:

Parameter Values
screen machine, peek, service, placement, dashboard, admin, noise, and variants like machine@tray, service@slot, dashboard@routes, admin@zones (?screens=list lists them all)
locale de
brand, strength, material A server theme, e.g. brand=%233D74FF&strength=tiles&material=liquid
shot 1: no dev panel and no animations, for screenshots

The phone app runs at phone.html with view (machines, route, market, sales), detail=<machine id>, gallery=1 and locale=de.

npm run screenshots renders every registered screen and variant at 1920 × 1080, the German and themed samples and the phone views into web/screenshots/. The screenshots on these pages come from there.

Tests ​

sh
bash tests/run.sh             # luac -p on every Lua file, then every tests/test_*.lua in its own process
bash tests/run.sh spacing     # one suite
VERBOSE=1 bash tests/run.sh   # with resource log lines

The harness fakes oxmysql, the frameworks, the inventories and the siblings. The suites cover spacing, purchase, world machines, placement, service, owner, market, rent, crime, admin, the client, the integrations (every declared export exists in the siblings' source, read from the repositories next to np_vending), project hygiene, and bridge smoke tests on esx + np, qbx + ox, qb + qb and standalone + none.

Conventions ​

  • One global NpVending (plus Config, Locales). Lua 5.4; every file parses with plain lua 5.4.
  • Handlers return value or nil, 'error_code'; every code has a text in en and de (the tests check it).
  • Money is whole dollars, timestamps unix seconds, coordinates { x, y, z, w? }.
  • No ACE anywhere: every staff check is npAdmin.can(src, node).