Skip to content

Building, tests & screenshots ​

Layout ​

fxmanifest.lua                 globs only: a feature module adds files and never edits the manifest
shared/lib/                    00 NpFishing global, bridge selection, bus · 01 util · 02 geometry · 03 locale
                               04 conditions (pure) · 05 data (Species / Zones / Gear)
shared/config/                 00_core, conditions, species, zones, gear + one file per module
bridge/np_admin.lua            np_admin lib, vendored byte-identical (after the config)
shared/np_admin_settings.lua   np_admin Resource settings
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 optional np_* sibling, both sides, with a built-in fallback
                               (np_npchandler / np_prophandler: called directly, no adapter)
server/core/NN_*.lua           init · schema · rpc · events · hooks · timers · services · world · pressure · rating ·
                               catches · players · items · sync · notify · api
server/modules/                loop/, progression/, economy*.lua, social*.lua
server/boot.lua                last: schema, onBoot hooks, ready
client/core/NN_*.lua           state · nui · rpc · sync · keys · helpers · api
client/modules/                loop/, progression.lua, economy.lua, social.lua
web/                           React + Vite NUI (index.html) and the Angler app (phone.html), one package
web/design/                    Nimbus UI tokens and CSS, never edited
sql/install.sql                identical to server/core/01_schema.lua (tested)
tests/                         plain-Lua harness, one process per tests/test_*.lua

The core carries four gameplay modules: loop (cast to reveal), progression (gear, rigs, XP, journal), economy (market, shops, orders) and social (Angler app, tournaments, licences, photos). A module only adds files and talks to the others through service seams (NpFishing.Services.*) with safe defaults and an internal bus, so each one works alone and with the others.

Build ​

sh
cd web
npm ci
npm run build          # fish SVGs + FiveM guard check + tsc --noEmit + vite build → web/dist/
npm test               # fish SVGs + contract check + vitest
npm run dev            # browser mock: http://localhost:5187
npm run screenshots    # headless Chrome → web/screenshots/*.png

npm run build 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. npm run gen:fish writes the fish images to web/public/fish/<species>.svg, which Vite copies to web/dist/fish/.

Browser mock ​

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

Parameter Values
screen loop, loop.reveal, loop.toast, progression.tackle, progression.journal, economy, economy.shop, social.staff (?screens=list lists them all with their variants)
variant e.g. fight, bite, snap for loop; legendary for loop.reveal; skills for progression.journal; counter for economy.shop
locale de
shot 1: no dev panel, for screenshots

Example: http://localhost:5187/?screen=loop&variant=fight&locale=de. The Angler app runs at phone.html with tab (forecast, spots, events, market, records), variant and locale.

npm run screenshots renders every screen and variant at 1920 × 1080 and every tab of the Angler app at 500 × 1000 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 flow loop   # selected suites

The harness loads the real files in manifest order with fake natives, a scheduler, an in-memory oxmysql and fakes of every framework, inventory and np_* sibling. Suites:

  • boot smoke tests per stack: esx + np_inventory (primary), qbx + ox, qb + qb, standalone + none;
  • the conditions model, the data, the client, the integrations (every declared export exists in the sibling repositories next to np_fishing), project hygiene (locales, error texts in Lua and the NUI, manifest, SQL parity, the vendored np_admin lib, item blocks, house rules);
  • per module: loop, progression, economy and social, each also alone and on other stacks;
  • end to end: shop → tackle box → rod → cast → land → keep → sell → phone → tournament prize on esx + np_inventory with every sibling, standalone, and qbx + ox.

Web: npm test checks the contract and runs vitest (silver line, tokens only, no gold, fish art parity, en / de parity, icons).

Conventions ​

  • One global NpFishing (plus Config, Locales and the vendored npAdmin). Lua 5.4.
  • Net events np_fishing:<name>, public server events np_fishing:server:<name>, tables np_fishing_*, RPC methods <module>.<verb>, permission nodes np_fishing.<node>.
  • Handlers return a value or nil, 'error_code'; every code has a text in en and de (the tests check it).
  • No ACE anywhere: every staff check is npAdmin.can(src, node).