Skip to content

Development ​

Layout ​

fxmanifest.lua
shared/lib/                 NpTat namespace and utils, locale loader, ink maths (zones, stacks, sanitising, wire shapes)
shared/config.lua           Config.*
shared/catalogue/           00_vanilla 10_prison 20_temporary 30_crew
shared/locales/             en / de
data/                       JSON catalogue packs (example_pack.json)
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
bridge/inventory/server/    0_common 1_ox 2_qb 3_esx 9_none
client/                     00_state 01_nui 02_rpc 03_ink 04_camera 05_preview 06_shops 07_healing 08_items
                            09_marks 10_admin 11_api
server/                     00_server 01_db 02_rpc 03_catalogue 04_ink 05_shop 06_healing 07_removal 08_crew
                            09_prison 10_temporary 11_moderation 12_marks 13_exports 14_logs 15_commands
sql/np_tattoos.sql          schema (also run at start with Config.AutoCreateTables)
web/                        NUI (React 18 + Vite 5 + TS strict + zustand), web/dist committed
design/                     Nimbus UI tokens and components (imported unchanged)
docs/                       ARCHITECTURE.md (contract)
tests/                      plain-Lua harness + run.sh

Files are numbered so the glob order in fxmanifest.lua is deterministic. Code resolves NpTat.X when it's called, never at file load. All SQL lives in server/01_db.lua, so the tests can swap it for an in-memory store.

NUI ​

sh
cd web
npm install
npm run dev            # http://localhost:5177, browser mock mode
npm run build          # tsc --noEmit && vite build → web/dist
npx vite build --mode mock --outDir dist-mock && npx vite preview --outDir dist-mock   # mock build on :4320

web/dist is committed, so rebuild and commit it after changing the web UI.

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 about 33 shop designs across all zones (colour variants, mirrored pairs, locked Ballas / Vagos pieces, a buyable Families piece, New badges, a female-only design that stays hidden), 9 temporary and 8 prison designs, and 8 owned pieces covering every ink state: healing with ointment, healed, faded, a flagged crew piece, a removal at 1 / 3 on cooldown, temporary, covered, and crude prison ink. The review panel has pending, approved and rejected submissions, custom designs (one disabled) and an audit log. A GTA capture is painted behind the UI, and a small dev bar at the top 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 parlour (default), prison, temp (henna kit), admin, toasts (no UI, toasts only)
tab flash, temp, cover, removal, submit (with screen=parlour)
material liquid
locale any; strings come from boot.strings
brand e.g. %233d74ff (theme ramp)
shot 1: no dev bar, no animations (for screenshots)

Screenshots ​

sh
cd web
npm run screenshots              # = scripts/screenshots.sh, renders every screen
scripts/screenshots.sh parlour   # only screenshots whose name contains "parlour"
SCALE=3 scripts/screenshots.sh admin   # 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 4320, and renders 10 screens at 1920 × 1080 with headless Chrome into web/screenshots/ (parlour-flash, parlour-temp, parlour-cover, parlour-removal, parlour-submit, prison, temp, admin, toasts, liquid). Set CHROME= if Chrome is not in /Applications. Then run npm run sync:images in this docs repo.

Tests ​

sh
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, events and the framework. Needs Lua 5.4 (LUA= / LUAC= override the binaries).

  • Server: boot (bridges, RPCs, exports, commands, catalogue and pack merge), table creation, ink maths and sanitising, opening a shop (distance, tabs, filtering, crew locks), checkout (price, money, healing, events, all-or-nothing, zone limits, gender hashes, mirror sides, colour variants, society payout), the session closing when the player walks away, laser removal, cover-ups, healing, ointment, swimming, crew flag / grace / forced cover, prison ink, temporary expiry, moderation (submit, review, toggle, audit, webhook), marks and the np_identification provider, the exports, character switches, RPC schema rejection and rate limits, and cleanup on drop.
  • Client: stack counts, applying ink with preview and hidden pieces, the gender hash choice, the healing overlay set and restore, every NUI callback answering exactly once, camera presets, opening and closing the parlour (undress, freeze, focus), the checkout refresh, the swim watcher, the review panel, marks, the NUI queue and resource stop.

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 NUI protocol, the server RPCs, the feature rules, the config and the exports. When code and that file disagree, the code is fixed; deliberate changes are listed in its §11. See the NUI contract for a summary.