How qbcore-framework/qb-core works
Project's Main Purpose and Type
• The README and file structure clearly indicate this is the QBCore Framework—a core system for a FiveM roleplay server.
• It is a full-stack solution in the sense that it has a “client” side (with scripts like drawtext.lua, events.lua, etc.), a “server” side (with commands, events, and exports), and a “shared” component (handling jobs, gangs, and weapons), along with an HTML-based UI component.
• The configuration files (config.lua and fxmanifest.lua) and integration files (qbcore.sql) also highlight the need to manage both in-game logic and external resources like databases or web interfaces.
File Structure
• Top-level directories:
• .github: Contains CI/CD workflows, issue templates, and contributor guidelines.
• client: Contains Lua scripts that manage client-side actions and interface elements.
• server: Contains Lua scripts responsible for handling game server commands, events, and player data.
• shared: Places common logic and definitions that are used by both client and server (e.g., jobs, gangs, vehicles, weapons).
• html: Contains static web assets (HTML, CSS, JS) likely used for an in-game UI or external web dashboards.
• locale: Stores multiple language support files in Lua to offer internationalization.
• Key configuration files:
• fxmanifest.lua: Defines resource metadata for FiveM.
• config.lua: Likely governs core settings for the framework.
• qbcore.sql: Represents the database schema or sample SQL useful for backend database integration.
• The structure reinforces separation of concerns: client-side presentation and event-handling, server-side command processing and data handling, and shared modules to maintain consistency and reusability.
• From Client to Server: Mark events, remote calls, and data updates.
• From Server to Database: Mark data storage and retrieval operations.
• From Shared to both Client and Server: Indicate loading of common logic (jobs, gangs, vehicles, etc.).
• Use consistent labeling:
• Annotations:
• Notations explaining that fxmanifest.lua drives integration with the FiveM server environment.
• Comments on how locale files enable the internationalization support.