File Structure
File Structure
The dr-bridge resource is organized into several folders and files to keep the code modular and easy to navigate. Below is an overview of the structure:
dr-bridge/
├── fxmanifest.lua
├── config.lua
├── shared/
│ └── utils.lua -- Shared utility functions (e.g., data conversion)
├── client/
│ ├── init.lua -- Framework detection and initialization on client side
│ ├── core.lua -- Client-side core API (e.g., GetPlayerData, Notify)
│ ├── ui.lua -- Functions related to Text UI (e.g., qb-core, ox_lib, helptext)
│ ├── interaction.lua -- Target systems (e.g., qb-target, ox_target)
│ └── extras.lua -- Optional functions (e.g., blips, animations)
├── server/
│ ├── init.lua -- Framework detection and initialization on server side
│ ├── core.lua -- Server-side core API (e.g., GetPlayer, AddMoney, Job API)
│ └── extras.lua -- Optional server-side functions (e.g., logging, Discord)File Breakdown:
fxmanifest.lua: This file defines the resource’s metadata, including the framework version, game compatibility, and dependencies.config.lua: Contains configuration settings, such as enabling/disabling debug messages and other global settings for the bridge.shared/: This folder contains functions that are used both on the client and server sides, such as utility functions for handling tables, debugging, and more.utils.lua: Shared helper functions likeDebugPrint,TableHasValue,Round, etc.
client/: Client-side scripts that interact with the game client, including UI, player data, and target systems.init.lua: Initializes the client and detects which framework (QBCore or ESX) is in use.core.lua: Core functions for interacting with the player (e.g., getting player data, notifications).ui.lua: Handles all text UI (e.g., notifications, help text).interaction.lua: Contains functions for working with target systems (e.g., interacting with NPCs or objects).extras.lua: Additional client-side functionality like blips, animations, and more.
server/: Server-side scripts that handle the logic of the game, including player data, economy, and other server-side operations.init.lua: Initializes the server and detects which framework is in use.core.lua: Core server-side functions for managing players (e.g., adding/removing money, items, jobs).extras.lua: Additional server-side functions like logging, Discord integration, and more.
Last updated