# arius-scripts/ars_hunting architecture

> Architecture diagram of the GitHub repository arius-scripts/ars_hunting, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/arius-scripts/ars_hunting
- Repository: https://github.com/arius-scripts/ars_hunting

## Overview

##### Project type and purpose
- This is a FiveM “Ars Advanced Hunting” script package for GTA V, designed as a plugin for the ESX and QBCore frameworks.
- Its purpose is to add hunting zones, animal behavior, tracking, missions, shops, a campfire system, and integration with in-game frameworks and ox_lib.

##### File structure
- Top-level entries:
- INSTALLATION/        – scripts for installing item definitions (ox_items.lua, qb_items.lua)
- client/              – client-side Lua modules (aimblock, campfire, hunting, missions, shops)
- server/              – server-side logic and framework bridge modules (ESX, QBCore)
- shared/              – shared configuration (config.lua)
- locales/             – language files (en.json)
- fxmanifest.lua       – FiveM manifest defining resource metadata
- _icons, .editorconfig, LICENSE, README.md
- Patterns:
- Modular feature directories under client/
- A single server.lua entry point plus bridge/* for framework abstraction
- Shared config and localization loaded by both client and server

##### README for additional insights
- Frameworks supported: ESX, QBCore
- Dependency: ox_lib
- Features list describes core components (zones, animals, shops, missions, campfire)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Layers
    subgraph "FiveM Runtime" 
        FIVEM["FiveM Runtime"]:::external
        FX["fxmanifest.lua"]:::external
    end

    subgraph "Client-Side Scripts"
        direction TB
        AIM["AimBlock Module<br/>(client/aimblock.lua)"]:::client
        CAMP["Campfire Module<br/>(client/campfire.lua)"]:::client
        HUNT["Hunting Module<br/>(client/hunting.lua)"]:::client
        MISS["Missions Module<br/>(client/missions.lua)"]:::client
        SHOP["Shops Module<br/>(client/shops.lua)"]:::client
        UTILS["Utilities Module<br/>(client/modules/utils.lua)"]:::client
    end

    subgraph "Server-Side Logic"
        direction TB
        SERVER["Main Server Controller<br/>(server/server.lua)"]:::server
        subgraph "Bridge Layer"
            ESX["ESX Bridge<br/>(server/bridge/esx.lua)"]:::server
            QBCORE["QBCore Bridge<br/>(server/bridge/qb.lua)"]:::server
        end
    end

    subgraph "Shared Resources"
        direction TB
        CONFIG["Configuration<br/>(shared/config.lua)"]:::shared
        LOCALE["Localization<br/>(locales/en.json)"]:::shared
    end

    subgraph "Installation Scripts"
        direction TB
        OXLIB["ox_lib Item Definitions<br/>(INSTALLATION/ox_items.lua)"]:::install
        QBDEF["QBCore Item Definitions<br/>(INSTALLATION/qb_items.lua)"]:::install
    end

    subgraph "External Dependencies"
        ESXFW["ESX Framework"]:::external
        QBFW["QBCore Framework"]:::external
        OXLIBEXT["ox_lib"]:::external
    end

    %% Relationships
    FIVEM -->|loads| FX
    FX -->|initializes| CONFIG
    FX -->|initializes| LOCALE
    FX -->|starts| AIM
    FX -->|starts| CAMP
    FX -->|starts| HUNT
    FX -->|starts| MISS
    FX -->|starts| SHOP
    FX -->|starts| UTILS
    FX -->|starts| SERVER

    AIM -->|TriggerServerEvent: startHunt| SERVER
    CAMP -->|TriggerServerEvent: startCamp| SERVER
    HUNT -->|TriggerServerEvent: trackAnimal| SERVER
    MISS -->|TriggerServerEvent: startMission| SERVER
    SHOP -->|TriggerServerEvent: openShop| SERVER
    UTILS -->|uses| CONFIG

    SERVER -->|routes| ESX
    SERVER -->|routes| QBCORE

    ESX -->|calls API| ESXFW
    QBCORE -->|calls API| QBFW
    SERVER -->|uses| OXLIBEXT

    SERVER -->|TriggerClientEvent: animalSpawned| HUNT
    SERVER -->|TriggerClientEvent: missionUpdate| MISS
    SERVER -->|TriggerClientEvent: openShopUI| SHOP

    CONFIG -->|consumed by| AIM
    CONFIG -->|consumed by| CAMP
    CONFIG -->|consumed by| HUNT
    CONFIG -->|consumed by| MISS
    CONFIG -->|consumed by| SHOP

    OXLIB -->|registers items| ESXFW
    QBDEF -->|registers items| QBFW

    %% Click Events
    click FX "https://github.com/arius-scripts/ars_hunting/blob/main/fxmanifest.lua"
    click AIM "https://github.com/arius-scripts/ars_hunting/blob/main/client/aimblock.lua"
    click CAMP "https://github.com/arius-scripts/ars_hunting/blob/main/client/campfire.lua"
    click HUNT "https://github.com/arius-scripts/ars_hunting/blob/main/client/hunting.lua"
    click MISS "https://github.com/arius-scripts/ars_hunting/blob/main/client/missions.lua"
    click SHOP "https://github.com/arius-scripts/ars_hunting/blob/main/client/shops.lua"
    click UTILS "https://github.com/arius-scripts/ars_hunting/blob/main/client/modules/utils.lua"
    click SERVER "https://github.com/arius-scripts/ars_hunting/blob/main/server/server.lua"
    click ESX "https://github.com/arius-scripts/ars_hunting/blob/main/server/bridge/esx.lua"
    click QBCORE "https://github.com/arius-scripts/ars_hunting/blob/main/server/bridge/qb.lua"
    click CONFIG "https://github.com/arius-scripts/ars_hunting/blob/main/shared/config.lua"
    click LOCALE "https://github.com/arius-scripts/ars_hunting/blob/main/locales/en.json"
    click OXLIB "https://github.com/arius-scripts/ars_hunting/blob/main/INSTALLATION/ox_items.lua"
    click QBDEF "https://github.com/arius-scripts/ars_hunting/blob/main/INSTALLATION/qb_items.lua"

    %% Styles
    classDef client fill:#cce5ff,stroke:#005cbf,color:#004085
    classDef server fill:#d4edda,stroke:#28a745,color:#155724
    classDef shared fill:#f8f9fa,stroke:#6c757d,color:#343a40
    classDef external fill:#fff3cd,stroke:#ffc107,color:#856404
    classDef install fill:#e2e3e5,stroke:#6c757d,color:#1b1e21
```
