Skip to content

Development ​

Layout ​

fxmanifest.lua
shared/config.lua           server + shared Config
shared/config/client.lua    Config.Client (keys, noclip, tags, spectate, presets)
shared/lib/                 Admin namespace, locale, settings field validation, permission resolver (perms.lua)
shared/locales/             en
lib/np_admin.lua            the integration lib other resources vendor (never loaded by np_admin itself)
bridge/framework/           client + server: qbx, qb, esx, standalone (job, money, items, revive)
server/core/                server, db, players, perms, duty, logs, rpc, actions, settings, discord, exports
server/modules/             session, players, bans, reports, perms, logs, player / tool / world actions,
                            commands, console, own settings, ready
client/core/                locale, state, rpc, nui, np_menu wrapper, notify, keybinds
client/modules/             quick menu, noclip, spectate, freecam, tags, fx, self, vehicle, world, devtools, reports
web/                        NUI: React + Vite + TypeScript + zustand (panel, palette, overlays)
sql/np_admin.sql            schema (also created on start)
tests/                      plain-Lua harness and suites

np_admin's own code uses the global Admin. Other resources only see the exports and the vendored lib.

Build ​

sh
cd web
npm ci
npm run build    # → web/dist (not committed)

Tests ​

sh
bash tests/run.sh

run.sh runs luac -p on every Lua file, then four suites:

Suite
server Permissions, settings, bans, reports, actions and RPCs against a fake database and natives
lib The vendored lib with and without np_admin running, including the fallback convars
client Client modules with stubbed natives
contract Every RPC method, action, net event, NUI callback, overlay and push topic used by the NUI and client exists on the other side

VERBOSE=1 prints log lines and stubbed natives.

Browser dev mode ​

sh
cd web && npm run dev

Every screen runs in a browser with a mock backend and fixtures. URL parameters:

Parameter
?view=dashboard|players|reports|bans|logs|world|settings|perms|discord Open the panel on a view
&target=17, &dialog=ban|warn|kick, &report=214, &resource=np_hud, &key=Minimap.zoom Select a player, dialog, report or setting
&palette=1 / &palette=panel, &q=bring%2017 Standalone palette or Ctrl K inside the panel, with a query
&overlay=tags,spectate,noclip,dev,toasts In-game overlays (without view the panel stays closed)
&dirty=1 Settings with two unsaved changes
&shot=1 No dev bar and no animations (screenshots)

Screenshots ​

sh
bash web/scripts/screenshots.sh            # all
bash web/scripts/screenshots.sh settings   # names containing "settings"

The script builds web/dist, serves it with vite preview and renders web/screenshots/*.png at 1920×1080 with headless Chrome (CHROME= to point at another binary). The docs copy them with npm run sync:images.