SB

Product · 2026 · 03 / 10

SB Framework.

A complete FiveM roleplay server framework built from scratch - 42 custom Lua resources, every UI a React and TypeScript app, no QBCore, no ESX, no shortcuts.

- Context

SB Framework is a full FiveM roleplay stack written end-to-end in Lua 5.4 on the server and client, with React 18 + TypeScript UIs rendered into NUI. It is not a fork of QBCore or ESX - sb_core is the shared API every other resource imports, and the 41 downstream scripts (HUD, inventory, phone, banking, police MDT, DMV, jobs center, mechanic damage model, apartments, prison, drugs, companies supply chain) all speak that one contract. MySQL via oxmysql backs persistent state, pma-voice handles radio, and the public repository ships with a full server.cfg, per-resource READMEs and commented MLO ensures so the stack can be stood up on any Cfx.re server. It is the first portfolio entry that is both a library of work and the proof that a single engineer can hold a forty-two-script surface area in their head.

- Approach

Treated the framework like a product kernel, not a mod pack. sb_core owns the nouns - player, character, money, job, gang, permission, callback, useable item, ban, vehicle - and the rest of the repository is verbs on top of those nouns. Every UI shares one toolchain (Vite, React 18, TypeScript, Tailwind, Framer Motion, Zustand) so visual drift stays near zero across forty-two resources. State lives in MySQL from day one; schemas auto-create on first run and players reconnect with inventory, vehicle mods, job grade and metadata intact. Cross-resource behaviour (dispatch, supply chain, evidence, fuel, metabolism, doorlocks) routes through shared events rather than direct coupling - the 32-component vehicle damage model in sb_mechanic_v2 feeds mechanic work, impound and the companies economy without any of those knowing about each other.

- Outcome

Released publicly under MIT on GitHub. The repository exposes the full `resources/` tree - `[custom]/sb_*` holds the forty-two handwritten resources, `[standalone]` pins the third-party deps (oxmysql, bob74_ipl), and the root README documents every script, its MLO dependency and the candid list of features still in progress. It is the substrate the standalone RedM systems (teleport admin tool, stable NPC behaviour) were written against, and the reason a single developer can ship a full RP loop - arrest to court to prison, heist to impound to mechanic, job to paycheck to apartment - without pulling a line from QBCore or ESX.

- Process

  1. 01

    Wrote the core, not a wrapper

    sb_core is the backbone every other resource imports. Player lifecycle, multi-character state, money/jobs/gangs, permission roles, server callbacks, useable items, ban/VIP with expiry, auto-save and auto-reconnect all live in one Lua API with typed shared tables for items, jobs, gangs and vehicles. Every downstream script is a thin projection of that contract, which is why forty-one other resources can coexist without glue code.

  2. 02

    Forty-two resources, one design language

    Instead of bolting third-party UIs into a roleplay stack, every in-game surface - HUD, inventory, phone, police MDT, DMV, banking, jobs center, prison dashboard - is a React 18 + TypeScript app compiled with Vite, styled in Tailwind, animated in Framer Motion, wired to Lua through NUI messages. The phone alone ships a full smartphone shell with calls, messages, contacts, bank, social and camera. Sharing the toolchain across resources kept visual drift near zero.

  3. 03

    MySQL-first state, auto-migrating schema

    oxmysql sits under every persistent system. sb_core auto-creates its tables on first run, saves characters on a 5-minute tick, and the heavier resources (sb_phone, sb_inventory, sb_banking, sb_mechanic_v2) ship their own SQL alongside the script. A player reconnecting after a resource restart comes back with inventory, money, vehicle mods and active job grade intact.

  4. 04

    Systemic economy, not disconnected minijobs

    sb_companies threads sb_mechanic_v2's 32-component damage model, sb_minigame's shared timing engine and sb_jobs' XP-gated access into one supply chain: orders, delivery, mining. sb_police, sb_alerts and sb_deaths cross-talk through the dispatch layer so an EMS call, a doorlock breach and an evidence drop all hit the same event spine.

  5. 05

    Shipped with the seams visible

    Public release includes a candid 'Known Incomplete Features' section - breathalyzer stub in sb_police, phase 4/5 pending in sb_mechanic_v2, SMG/rifle magazines still on the roadmap. The docs match the code. Every script has its own README and the server.cfg ships with commented MLO ensures so the next operator can wire their own assets in without guessing.

- Credits

Framework, scripts, UIs
Salah Eddine Boussettah

- Next

 RepoDigest

Tool · 2025

© Salah Boussettah · MMXXVIصلاحMorocco · GMT+1