Development ​
Layout ​
fxmanifest.lua
shared/config.lua Config.VehicleManufacturing
shared/catalog.lua fixture templates and parts
bridge/server/ framework, inventory and notify bridges (loaded before server/core)
server/core/ 00_util … 99_main: auth, state + persistence, catalog, vehicle checks, sessions, RPC
dispatcher, bay, projects, attachments, pricing, builds, slot pool, review, jobs, fleet,
brand, wear, onboarding, exports, events, go-live helpers, bake
server/data/ flatfile state (state-a.json / state-b.json)
client/ capture, camera, attachment, texture and slot runtime, job runtime, wear, photo mode,
anchor gizmo, console (main.lua), NUI bridge
sql/np_manufacturing.sql oxmysql schema
bake/ bake exports (written by Admin → Bake, git-ignored)
tools/np_mf_slot_poc/ standalone slot pool test resource (not loaded by the manifest)
packages/contracts/ TypeScript contract shared by the NUI (and mirrored by Lua)
ui/ NUI source (React 18 + Vite 5 + TypeScript + zustand)
web/ built NUI, checked in (ui_page)
design/ Nimbus UI tokens and components
tests/ static checks + Lua server tests
docs/screenshots/ rendered screens
Server core files are numbered so the order in fxmanifest.lua is deterministic.
NUI ​
The repository is a Bun workspace (ui and packages/*). From the resource root:
bun install
bun run dev # http://localhost:5177, browser mode with the mock backend
bun run build # tsc --noEmit && vite build → web/
bun run typecheck
The build writes to web/ with relative asset paths, and web/ is committed, so servers run the resource without a
build step. Rebuild and commit web/ when you change the UI.
Browser dev mode ​
Outside FiveM (no GetParentResourceName), the NUI installs a mock backend that answers every callback and RPC with
sample data, paints a fake garage behind the console, and shows a small dev bar to open the console or the HUD scene.
URL parameters pick the scene:
| Parameter | Effect |
|---|---|
?screen=bay|livery|equipment|release|fleet|queue|admin|hud |
Start screen (hud = the in-world job HUD) |
&role=designer|approver|admin |
Permissions of the mock player |
&state=empty|ready|pending|approved|applied |
Scenario: empty bay, ready bay, or the build's review state |
&admin=catalog|onboarding|bake|brand |
Administration tab (&admin=bake&demo=1 also runs an export) |
&mode=<application mode> |
Preselect the application mode on the Release screen (e.g. runtime_slot) |
&live=0 |
Mock player without np_manufacturing.runtime_livery |
&locale=de |
German |
&bg=0 |
No fake garage background |
&shot=1 |
No dev bar, instant bay checks, sticky toasts (for screenshots) |
Examples: http://localhost:5177/?screen=release&role=approver&state=pending,
http://localhost:5177/?screen=admin&role=admin&admin=onboarding.
A separate harness renders just the livery and equipment screens with fixtures:
cd ui
bunx vite --config src/studio-dev/vite.config.ts # http://localhost:5178/studio-dev.html?screen=livery
It takes screen=livery|equipment|gallery, view=<editor view>, select=<layer id>, previewing=off and
runtime=on.
Screenshots ​
ui/scripts/screenshots.sh # build, then render every screen at 1920×1080
ui/scripts/screenshots.sh --no-build # reuse web/
ui/scripts/screenshots.sh release # only names containing "release"
The script serves web/ with python3 -m http.server, renders each scene with headless Chrome
(CHROME= overrides the binary, PORT= the port) and writes docs/screenshots/<name>.png: bay, bay-empty,
release, release-draft, release-approved, fleet, queue, admin, admin-onboarding, admin-bake, admin-brand, hud,
livery, equipment, bay-de and release-de. Then run npm run sync:images in this docs repo.
Tests ​
bun test tests # static checks + the Lua server tests
lua tests/server/run.lua # server tests only (Lua 5.4+)
Static checks (tests/static.test.ts): every file referenced by fxmanifest.lua exists, lua54 and the OneSync
dependency are declared, bridges load before server/core and the core modules are in numeric order, every .lua
file passes luac -p, every net event starts with np_manufacturing: and every command with np_manufacturing_
(except the legacy alias).
Server tests (tests/server/): harness.lua stubs the FiveM server natives the resource uses (state bags,
entities, players, a fake np_admin export, resource files, exports, events) with an in-memory world and loads the real shared and server
scripts in manifest order. run.lua covers every RPC name, pricing and bills, variable resolution, brand-only
rejection, locked layers, the wear formula, bay check order, the RPC dispatcher (unknown RPC, invalid session, rate
limits), the review flow, production jobs (order, minimum duration, materials, apply on inspect, recovery, cancel,
timeout), rollouts, v1 state migration and write rollback, thumbnails, onboarding, attachment slots, permissions and
weight, exports, photo saving, billing (payer, no double charge, refunds, prepaid) and untrusted client data.
Nothing here starts FiveM.
Contract ​
packages/contracts/src/index.ts is the source of truth for every payload; docs/PROTOCOL.md in the resource
describes the transport and the server rules. See the NUI contract for a summary.