Development ​
Layout ​
fxmanifest.lua
shared/lib/ NpChar namespace and utils, locale loader, appearance schema (sanitize, look codes)
shared/config.lua Config.*
shared/config/ spawns, starter (+ ID card, outfits, tattoos), blacklist, names
shared/locales/ en / de
bridge/framework/client/ 0_common 1_qbx 2_qb 3_esx 9_standalone
bridge/framework/server/ 0_common 1_qbx 2_qb 3_esx 9_standalone
client/ 00_state 01_nui 02_rpc 03_camera 04_appearance 05_scene 06_select 07_creator
08_spawn 09_arrival 10_session 11_api 12_admin 13_settings
server/ 00_server 01_db 02_rpc 03_characters 04_appearance 05_slots 06_spawns 07_looks
08_admin 09_exports 10_logs 11_session
sql/np_character.sql schema (also run at start with Config.AutoCreateTables)
web/ NUI (React 18 + Vite 5 + TS strict + zustand)
design/ Nimbus UI tokens and components (imported unchanged)
docs/ ARCHITECTURE.md (contract), IDEAS.md, mockups/
tests/ plain-Lua harness + run.sh
Files are numbered so the glob order in fxmanifest.lua is deterministic. Code resolves NpChar.X when it's called,
never at file load.
NUI ​
cd web
npm install
npm run dev # http://localhost:5176, browser mock mode
npm run build # tsc --noEmit && vite build → web/dist (build before starting the resource)
npx vite build --mode mock --outDir dist-mock && npx vite preview --outDir dist-mock # mock build on :4319
Outside FiveM, src/dev installs a fake Lua backend that answers every web → Lua callback and drives the UI through the
same path SendNUIMessage uses. The sample data has three characters (Marcus Hale, LSPD; Lena Kraus, EMS; Tony Russo,
unemployed), five slots with slot 5 locked, a deleted character for the staff panel, a spawn list and plausible creator
options. A cleaned GTA capture is painted behind the UI. A small dev bar at the bottom switches screens.
The mock and the background image are only loaded under vite dev or a --mode mock build (a compile-time guard in
main.tsx), so the production web/dist contains neither.
| URL parameter | Values |
|---|---|
screen |
select (default), manage (options popover + delete dialog), creator, store, spawn, admin |
step |
identity, heritage, face, hair, clothing, summary (creator / store) |
store |
barber, clothing, surgeon (default), with screen=store |
material |
liquid |
locale |
de |
brand |
e.g. %233d74ff (theme ramp) |
shot |
1: no dev bar, no animations (for screenshots) |
Mock behaviours worth knowing: admin, test and staff are rejected as names; look codes must look like
NPC-XXXX-XXXX; Marcus wears the barefoot drawable, so the summary shows the "No shoes" warning.
Screenshots ​
cd web
npm run screenshots # = scripts/screenshots.sh, renders every screen
scripts/screenshots.sh face # only screenshots whose name contains "face"
SCALE=3 scripts/screenshots.sh select # high-DPI render for edge checks
The script builds web/dist and a mock build into web/dist-mock, serves it with vite preview on port 4319, and
renders 13 screens at 1920 × 1080 with headless Chrome into web/screenshots/ (select, manage, the six creator
steps, spawn, admin, store, liquid, de). Set CHROME= if Chrome is not in /Applications. Then run
npm run sync:images in this docs repo.
Tests ​
tests/run.sh # VERBOSE=1 shows resource log lines and stubbed natives
It runs luac -p on every Lua file, then the server and client scenario suites (tests/test_server.lua,
tests/test_client.lua). tests/harness.lua stubs FiveM natives, oxmysql (an in-memory table store), exports and
events. Needs Lua 5.4 (LUA= / LUAC= override the binaries).
- Server: create with valid, invalid and duplicate names, slot limits, delete with the wrong and the right confirm
name, soft delete, restore, purge after the grace period, reorder and default, look code round trip, spawn id
validation (including a forged id), rate limits and the state machine, sanitize clamps, and fuzzing every RPC with
junk payloads (no Lua errors, always
{ ok = false }). - Client: appearance apply → get round trip, camera preset math, every NUI callback registered, the select → creator → spawn → loaded flow, store mode, arms auto-match, headshots.
- Seam checks (read from the sources): every web
post('<name>')has a Lua callback, every LuaNpChar.send('<action>')is a web action, every clientNpChar.rpc('<name>')is a serverregisterRpc, and every serverTriggerClientEvent('np_character:…')has a client handler.
The web build (npm run build, TypeScript strict) must pass as well.
Contract ​
docs/ARCHITECTURE.md is the single
source of truth for the core objects, the appearance format, the NUI protocol, the server RPCs, the bridge contract,
the config and the database. When code and that file disagree, the code is fixed. See the
NUI contract for a summary.