Open Source / Archived
ESX Framework
Core contributor to one of the most widely used roleplay frameworks in the FiveM ecosystem, used by a large global community
Jan 2019 — Aug 2021
Overview
Long before I was building production web applications and cloud infrastructure, a significant part of my programming career started somewhere slightly less conventional: Grand Theft Auto V.
More specifically, the FiveM multiplayer ecosystem and the ESX Framework.
ESX provides the foundations developers need to build persistent roleplay servers on FiveM. Instead of every server independently recreating concepts such as player accounts, inventories, jobs, organisations, vehicles, money, and character data, ESX provides a common framework that other resources can build upon.
What began for me as experimenting with Lua scripts gradually grew into contributing to the framework itself, building reusable community resources, operating one of the largest Polish-speaking FiveM roleplay communities, and eventually helping develop a major v2 redesign of ESX.
It became one of my earliest experiences working on software that other developers depended on.
I left the project in 2021, but ESX continued as an open-source project under community stewardship. Today, the current ESX project describes itself as the leading FiveM framework and says it is trusted by more than 12,000 communities worldwide.
For something that began as writing scripts for a video game, it became an unexpectedly important foundation for the way I approach software engineering today.
The problem
FiveM gives developers an enormous amount of freedom, but relatively little structure for building a persistent roleplay game.
A serious roleplay server needs far more than the underlying GTA world.
Players need persistent characters, money, inventories, jobs, organisations, vehicles, properties, licences, shops, banking, policing, medical systems, and countless other gameplay mechanics.
More importantly, all of those systems need to interact.
A police resource needs to understand the same player and inventory state as a vehicle system. A society account may need to interact with jobs, billing, and banking. Third-party developers need predictable APIs and conventions so that a new resource can integrate without understanding every implementation detail of the framework.
This meant ESX wasn't simply a collection of game scripts.
It was becoming an application framework.
As adoption increased, early architectural decisions also became increasingly difficult to maintain. Code written for smaller communities was now being used as the foundation for significantly larger and more customised servers.
There were questions around performance, maintainability, API design, database access, shared state, backwards compatibility, and how independently developed resources should interact with the framework.
Running my own roleplay environment introduced another scale problem entirely.
Rather than operating a single isolated server, I worked on infrastructure that could distribute players between multiple FiveM servers while maintaining a consistent experience, synchronising relevant information between them and coordinating player access through a central queue.
At that point, something that began as game scripting had turned into a combination of framework development, distributed systems, production operations, and community management.
The solution
My work gradually moved from building individual resources to designing reusable systems that could support the wider ESX ecosystem.
Many of my earlier public projects explored gameplay mechanics and quality-of-life improvements.
For example, daily_QoL consolidated and modernised a collection of commonly required FiveM functionality, including player commands, NPC behaviour, AFK handling, interaction controls, server restart alerts, and other improvements behind a single ESX-compatible resource.
Other projects explored more self-contained systems. daily_lockpick integrated an interactive lock-picking mechanic into ESX, combining FiveM scripting with a browser-based UI and configurable inventory requirements. rid_blackmarket implemented a persistent weapon marketplace with configurable stock, scheduled replenishment, random inventory selection, and integrations with multiple inventory systems.
Those projects helped establish the design patterns that became increasingly important as I began contributing deeper into ESX itself: configuration over hard-coding, reusable APIs, predictable resource boundaries, and extensibility for other developers.
I later became a core contributor to ESX and helped lead work on a significant v2 refactor.
The intention was not simply to add more features, but to rethink how the framework itself was structured: improving maintainability, separating responsibilities more clearly, making systems easier to extend, and creating stronger foundations for increasingly complex servers.
Some systems I originally developed independently were subsequently incorporated into the wider framework as standard functionality.
At the same time, I was applying those ideas in a real production environment through the roleplay community I operated.
Managing the server meant thinking beyond code. Releases had to work for active players, administrators needed tooling, volunteer staff required processes, and changes across dozens of interconnected resources had to be introduced without destabilising the entire environment.
It was one of my earliest opportunities to experience the distinction between writing software and operating software that people actively depend on.
Architecture & technical approach
A typical ESX environment is highly modular.
At its centre sits es_extended, the framework core responsible for common concepts such as players, accounts, jobs, inventory data, callbacks, and shared APIs.
Around that core sit independent FiveM resources, primarily written in Lua.
A resource might implement a police department, vehicle dealership, property system, inventory, job, user interface, or an individual gameplay mechanic. Rather than building its own concept of a player or economy, that resource communicates with ESX and other supporting resources.
The architecture can therefore be thought of as:
FiveM Runtime → ESX Core → Shared Services → Gameplay Resources → Player
Persistent information is stored in a relational database, while client and server Lua scripts communicate through FiveM's event-driven networking model.
Many resources also contain a NUI layer, allowing HTML, CSS, and JavaScript interfaces to run inside the game. This meant individual systems could span client-side Lua, server-side Lua, browser UI code, and SQL persistence within the same resource.
My archived DailyRP environment demonstrates how large this composition could become. A single deployment included the ESX core alongside systems for jobs, societies, billing, vehicles, properties, licences, character status, inventories, shops, policing, administration, Discord integration, UI, and numerous custom gameplay systems.
At a larger scale, I also designed infrastructure around multiple FiveM server instances.
Rather than treating every game server as an isolated environment, the architecture used shared services to coordinate information between instances and a centralised queue to manage how players entered the wider platform.
That introduced problems normally associated with distributed applications: shared state, cross-server communication, consistency, service availability, and coordinating users across independently running processes.
The combination of framework work and production operation gave me exposure to several layers of engineering very early in my career:
Framework → Resources → Database → Game Servers → Shared Infrastructure → Players
Although the technology and environment were unconventional, many of the problems were the same ones I would later encounter in professional software engineering.
Key features
- Core development and major refactoring of the ESX Framework
- Reusable gameplay systems adopted across the wider FiveM ecosystem
- Modular Lua resources supporting jobs, inventories, economies, UI, and persistent gameplay
- Large-scale production roleplay environment with a substantial active community
- Multi-server infrastructure with cross-server synchronisation and a centralised player queue
- Open-source resources designed for configuration, extension, and community integration
- Management of both technical infrastructure and a volunteer administration team
Technical highlights
- Extensive Lua development across FiveM client and server environments
- Event-driven communication between clients, servers, and framework resources
- JavaScript / HTML / CSS NUI interfaces integrated directly into gameplay systems
- SQL-backed persistent player and application state
- Framework API and abstraction design for third-party developers
- Refactoring and modernisation of legacy systems for greater maintainability and scalability
- Multi-server architecture and cross-instance state synchronisation
- Production operation of a large, highly modular application composed of dozens of independently developed resources