Modules

Orchid Bridge is built as a fully modular framework, where both the core framework integration and modules (target, text UI, context, notify, etc.) are self-contained.

Key Points

  • Modular Structure: Each module is independent and can be added, replaced, or extended without affecting other parts of the system.

  • Fast Extensibility: Quickly adapt or expand the bridge to fit your server’s needs by creating new modules or modifying existing ones.

  • Dynamic Loading: Modules are loaded based on configuration, supporting client and server separation.

  • Easy Integration: Designed for seamless integration with existing frameworks (esx, qb, ox, or custom).

This approach allows developers to rapidly customize and scale Orchid Bridge while keeping the core clean and lightweight.


Scalability

Modules can be extended per both contexts (server/client) or only for client context.

  • Separate files module

    modules/<moduleName>/server/<type>.lua
    modules/<moduleName>/client/<type>.lua
    • Server file loads only on the server.

    • Client file loads only on the client.

  • One file module

    modules/<moduleName>/<type>.lua
    • Loaded automatically only on the client.

1

Adding new module

Add new module to the modules folder with <moduleName> referring to the paragraph above.

2

Defining new module in bridge

Go to the data/config.lua and add new filed <moduleName> with value <type>

return {
    ...
    <moduleName> = <type>
    ...
}    

Config Requirements

  • The folder name must match the module key in data.config.

  • The config value must match the file name (<type>.lua).

    • Example:

      -- data/config.lua
      return {
          target = 'ox', -- loads modules/target/client/ox.lua and/or modules/target/server/ox.lua
          textUI = 'custom', -- loads modules/textUI/client/custom.lua
      }

This allows any module type (not just ox.lua) and ensures clean scaling without modifying the core bridge.

Last updated