# vrp-framework/vrp architecture

> Architecture diagram of the GitHub repository vrp-framework/vrp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vrp-framework/vrp
- Repository: https://github.com/vrp-framework/vrp

## Overview

vRP is a FiveM roleplay framework. Its broad user workflow is player interaction with server-provided roleplay features, surfaced through the client and in-game GUI; the README documents identity, state, economy, inventory, jobs, and world interactions. The GUI also handles prompts, menus, progress bars, radio, and audio. A separate WebRTC service relays voice packets among players. Lua feature internals and their wiring were not sampled, so those components are represented at their module paths and only documented capabilities are linked. GUI and voice-service links reflect the shown source excerpts.

Main entry points: [`vrp/vRP.lua`](https://github.com/vrp-framework/vrp/blob/master/vrp/vRP.lua) (Framework core), [`vrp/gui/main.js`](https://github.com/vrp-framework/vrp/blob/master/vrp/gui/main.js) (GUI message router), [`vrp/gui/AudioEngine.js`](https://github.com/vrp-framework/vrp/blob/master/vrp/gui/AudioEngine.js) (Audio and VoIP client), [`voip_server/main.js`](https://github.com/vrp-framework/vrp/blob/master/voip_server/main.js) (WebRTC relay)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_framework["Roleplay framework"]
  node_vrp_core["Framework core<br/>[vRP.lua]"]
  node_admin["Admin tools<br/>[admin.lua]"]
  node_identity["Identity and login<br/>[identity.lua]"]
  node_player_state["Player state<br/>[player_state.lua]"]
  node_inventory["Inventory<br/>[inventory.lua]"]
  node_money["Money and business<br/>[money.lua]"]
  node_home["Homes<br/>[home.lua]"]
  node_police["Police and survival<br/>[police.lua]"]
  node_transformer["Transformers<br/>[transformer.lua]"]
  node_shops["Shops and garage<br/>[shop.lua]"]
  node_world["Map and warp<br/>[map.lua]"]
end

subgraph group_client["Client experience"]
  node_client_runtime["Client runtime<br/>[vRP.lua]"]
end

subgraph group_voice["Voice service"]
  node_voip_server["WebRTC relay<br/>[main.js]"]
  node_voip_config["Relay configuration<br/>[config.js]"]
end

subgraph group_gui["GUI components"]
  node_gui_main["GUI message router<br/>[main.js]"]
  node_menu["Dynamic menu<br/>[Menu.js]"]
  node_progress["Progress bars<br/>[ProgressBar.js]"]
  node_prompt["Text prompt<br/>[WPrompt.js]"]
  node_requests["Request manager<br/>[RequestManager.js]"]
  node_announcements["Announcements<br/>[AnnounceManager.js]"]
  node_radio_display["Radio display<br/>[RadioDisplay.js]"]
  node_div["Dynamic div<br/>[Div.js]"]
  node_dynamic_classes["Dynamic classes<br/>[dynamic_classes.js]"]
  node_audio_engine["Audio and VoIP client<br/>[AudioEngine.js]"]
  node_opus["Opus codec runtime<br/>[libopus.wasm.js]"]
end

node_player(("Player"))

node_player -->|"uses framework"| node_vrp_core
node_vrp_core -->|"provides admin"| node_admin
node_vrp_core -->|"provides identity"| node_identity
node_vrp_core -->|"provides state"| node_player_state
node_vrp_core -->|"provides inventory"| node_inventory
node_vrp_core -->|"provides economy"| node_money
node_vrp_core -->|"provides homes"| node_home
node_vrp_core -->|"provides policing"| node_police
node_vrp_core -->|"provides processing"| node_transformer
node_vrp_core -->|"provides commerce"| node_shops
node_vrp_core -->|"provides world tools"| node_world
node_client_runtime -.->|"drives interface"| node_gui_main
node_gui_main -->|"updates"| node_menu
node_gui_main -->|"updates"| node_progress
node_gui_main -->|"opens"| node_prompt
node_gui_main -->|"queues"| node_requests
node_gui_main -->|"queues"| node_announcements
node_gui_main -->|"updates"| node_radio_display
node_gui_main -->|"updates"| node_div
node_progress -->|"registers class"| node_dynamic_classes
node_gui_main -->|"dispatches audio"| node_audio_engine
node_audio_engine -->|"initializes codec"| node_opus
node_audio_engine -.->|"exchanges voice data"| node_voip_server
node_voip_server -->|"loads settings"| node_voip_config

click node_vrp_core "https://github.com/vrp-framework/vrp/blob/master/vrp/vRP.lua"
click node_admin "https://github.com/vrp-framework/vrp/blob/master/vrp/modules/admin.lua"
click node_identity "https://github.com/vrp-framework/vrp/blob/master/vrp/modules/identity.lua"
click node_player_state "https://github.com/vrp-framework/vrp/blob/master/vrp/modules/player_state.lua"
click node_inventory "https://github.com/vrp-framework/vrp/blob/master/vrp/modules/inventory.lua"
click node_money "https://github.com/vrp-framework/vrp/blob/master/vrp/modules/money.lua"
click node_home "https://github.com/vrp-framework/vrp/blob/master/vrp/modules/home.lua"
click node_police "https://github.com/vrp-framework/vrp/blob/master/vrp/modules/police.lua"
click node_transformer "https://github.com/vrp-framework/vrp/blob/master/vrp/modules/transformer.lua"
click node_shops "https://github.com/vrp-framework/vrp/blob/master/vrp/modules/shop.lua"
click node_world "https://github.com/vrp-framework/vrp/blob/master/vrp/modules/map.lua"
click node_client_runtime "https://github.com/vrp-framework/vrp/blob/master/vrp/client/vRP.lua"
click node_gui_main "https://github.com/vrp-framework/vrp/blob/master/vrp/gui/main.js"
click node_menu "https://github.com/vrp-framework/vrp/blob/master/vrp/gui/Menu.js"
click node_progress "https://github.com/vrp-framework/vrp/blob/master/vrp/gui/ProgressBar.js"
click node_prompt "https://github.com/vrp-framework/vrp/blob/master/vrp/gui/WPrompt.js"
click node_requests "https://github.com/vrp-framework/vrp/blob/master/vrp/gui/RequestManager.js"
click node_announcements "https://github.com/vrp-framework/vrp/blob/master/vrp/gui/AnnounceManager.js"
click node_radio_display "https://github.com/vrp-framework/vrp/blob/master/vrp/gui/RadioDisplay.js"
click node_div "https://github.com/vrp-framework/vrp/blob/master/vrp/gui/Div.js"
click node_dynamic_classes "https://github.com/vrp-framework/vrp/blob/master/vrp/gui/dynamic_classes.js"
click node_audio_engine "https://github.com/vrp-framework/vrp/blob/master/vrp/gui/AudioEngine.js"
click node_opus "https://github.com/vrp-framework/vrp/blob/master/vrp/gui/lib/libopus.wasm.js"
click node_voip_server "https://github.com/vrp-framework/vrp/blob/master/voip_server/main.js"
click node_voip_config "https://github.com/vrp-framework/vrp/blob/master/voip_server/config.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_vrp_core,node_admin,node_identity,node_player_state,node_inventory,node_money,node_home,node_police,node_transformer,node_shops,node_world toneBlue
class node_client_runtime toneAmber
class node_voip_server,node_voip_config toneMint
class node_gui_main,node_menu,node_progress,node_prompt,node_requests,node_announcements,node_radio_display,node_div,node_dynamic_classes,node_audio_engine,node_opus toneRose
class node_player toneIndigo
```

## Components

### Roleplay framework

- [Framework core](https://github.com/vrp-framework/vrp/blob/master/vrp/vRP.lua): `vrp/vRP.lua`
- [Admin tools](https://github.com/vrp-framework/vrp/blob/master/vrp/modules/admin.lua): `vrp/modules/admin.lua`
- [Identity and login](https://github.com/vrp-framework/vrp/blob/master/vrp/modules/identity.lua): `vrp/modules/identity.lua`
- [Player state](https://github.com/vrp-framework/vrp/blob/master/vrp/modules/player_state.lua): `vrp/modules/player_state.lua`
- [Inventory](https://github.com/vrp-framework/vrp/blob/master/vrp/modules/inventory.lua): `vrp/modules/inventory.lua`
- [Money and business](https://github.com/vrp-framework/vrp/blob/master/vrp/modules/money.lua): `vrp/modules/money.lua`
- [Homes](https://github.com/vrp-framework/vrp/blob/master/vrp/modules/home.lua): `vrp/modules/home.lua`
- [Police and survival](https://github.com/vrp-framework/vrp/blob/master/vrp/modules/police.lua): `vrp/modules/police.lua`
- [Transformers](https://github.com/vrp-framework/vrp/blob/master/vrp/modules/transformer.lua): `vrp/modules/transformer.lua`
- [Shops and garage](https://github.com/vrp-framework/vrp/blob/master/vrp/modules/shop.lua): `vrp/modules/shop.lua`
- [Map and warp](https://github.com/vrp-framework/vrp/blob/master/vrp/modules/map.lua): `vrp/modules/map.lua`

### Client experience

- [Client runtime](https://github.com/vrp-framework/vrp/blob/master/vrp/client/vRP.lua): `vrp/client/vRP.lua`

### Voice service

- [WebRTC relay](https://github.com/vrp-framework/vrp/blob/master/voip_server/main.js): `voip_server/main.js`
- [Relay configuration](https://github.com/vrp-framework/vrp/blob/master/voip_server/config.js): `voip_server/config.js`

### GUI components

- [GUI message router](https://github.com/vrp-framework/vrp/blob/master/vrp/gui/main.js): `vrp/gui/main.js`
- [Dynamic menu](https://github.com/vrp-framework/vrp/blob/master/vrp/gui/Menu.js): `vrp/gui/Menu.js`
- [Progress bars](https://github.com/vrp-framework/vrp/blob/master/vrp/gui/ProgressBar.js): `vrp/gui/ProgressBar.js`
- [Text prompt](https://github.com/vrp-framework/vrp/blob/master/vrp/gui/WPrompt.js): `vrp/gui/WPrompt.js`
- [Request manager](https://github.com/vrp-framework/vrp/blob/master/vrp/gui/RequestManager.js): `vrp/gui/RequestManager.js`
- [Announcements](https://github.com/vrp-framework/vrp/blob/master/vrp/gui/AnnounceManager.js): `vrp/gui/AnnounceManager.js`
- [Radio display](https://github.com/vrp-framework/vrp/blob/master/vrp/gui/RadioDisplay.js): `vrp/gui/RadioDisplay.js`
- [Dynamic div](https://github.com/vrp-framework/vrp/blob/master/vrp/gui/Div.js): `vrp/gui/Div.js`
- [Dynamic classes](https://github.com/vrp-framework/vrp/blob/master/vrp/gui/dynamic_classes.js): `vrp/gui/dynamic_classes.js`
- [Audio and VoIP client](https://github.com/vrp-framework/vrp/blob/master/vrp/gui/AudioEngine.js): `vrp/gui/AudioEngine.js`
- [Opus codec runtime](https://github.com/vrp-framework/vrp/blob/master/vrp/gui/lib/libopus.wasm.js): `vrp/gui/lib/libopus.wasm.js`

### Other components

- **Player**

## Connections

- Player → Framework core: uses framework (evidence: `README.adoc`)
- Framework core → Admin tools: provides admin (evidence: `README.adoc`)
- Framework core → Identity and login: provides identity (evidence: `README.adoc`)
- Framework core → Player state: provides state (evidence: `README.adoc`)
- Framework core → Inventory: provides inventory (evidence: `README.adoc`)
- Framework core → Money and business: provides economy (evidence: `README.adoc`)
- Framework core → Homes: provides homes (evidence: `README.adoc`)
- Framework core → Police and survival: provides policing (evidence: `README.adoc`)
- Framework core → Transformers: provides processing (evidence: `README.adoc`)
- Framework core → Shops and garage: provides commerce (evidence: `README.adoc`)
- Framework core → Map and warp: provides world tools (evidence: `README.adoc`)
- Client runtime → GUI message router: drives interface
- GUI message router → Dynamic menu: updates (evidence: `vrp/gui/main.js`)
- GUI message router → Progress bars: updates (evidence: `vrp/gui/main.js`)
- GUI message router → Text prompt: opens (evidence: `vrp/gui/main.js`)
- GUI message router → Request manager: queues (evidence: `vrp/gui/main.js`)
- GUI message router → Announcements: queues (evidence: `vrp/gui/main.js`)
- GUI message router → Radio display: updates (evidence: `vrp/gui/main.js`)
- GUI message router → Dynamic div: updates (evidence: `vrp/gui/main.js`)
- Progress bars → Dynamic classes: registers class (evidence: `vrp/gui/ProgressBar.js`)
- GUI message router → Audio and VoIP client: dispatches audio (evidence: `vrp/gui/main.js`)
- Audio and VoIP client → Opus codec runtime: initializes codec (evidence: `vrp/gui/AudioEngine.js`)
- Audio and VoIP client → WebRTC relay: exchanges voice data
- WebRTC relay → Relay configuration: loads settings (evidence: `voip_server/main.js`)
