# vorpcore/vorp_core architecture

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

- Interactive diagram: https://gitdiagram.com/vorpcore/vorp_core
- Repository: https://github.com/vorpcore/vorp_core

## Overview

VORP Core is a Lua framework for RedM servers. Its principal workflow is server/player management, alongside gameplay administration and a client HUD that displays player state. The README documents configuration, commands, whitelist and ban management, respawn, and Discord presence; the tree identifies corresponding server and client subsystems. Only the HUD source was excerpted, so its message-driven behavior is directly supported, while most server-side relationships are not shown and are left unconnected rather than inferred.

Main entry points: [`server/services/dbupdater/dbupdater.lua`](https://github.com/vorpcore/vorp_core/blob/main/server/services/dbupdater/dbupdater.lua) (Database updates), [`server/commands.lua`](https://github.com/vorpcore/vorp_core/blob/main/server/commands.lua) (Admin commands), [`config/commands.lua`](https://github.com/vorpcore/vorp_core/blob/main/config/commands.lua) (Command settings), [`config/config.lua`](https://github.com/vorpcore/vorp_core/blob/main/config/config.lua) (Server settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_server["Server and players"]
  node_server_init["Core startup<br/>[init.lua]"]
  node_user_character["Users and characters"]
  node_character_loading["Character loading<br/>[loadcharacter.lua]"]
  node_user_loading["User loading<br/>[loadusers.lua]"]
  node_user_saving["User saving<br/>[saveusers.lua]"]
  node_database_updates["Database updates<br/>[dbupdater.lua]"]
  node_whitelist_bans["Access and bans<br/>[whitelist.lua]"]
end

subgraph group_gameplay["Gameplay features"]
  node_server_api["Server API<br/>[apicontroller.lua]"]
  node_client_api["Client API<br/>[clientapi.lua]"]
  node_respawn["Respawn system<br/>[respawnsystem.lua]"]
  node_instance["Player instances<br/>[instance.lua]"]
end

subgraph group_admin["Administration"]
  node_admin_commands["Admin commands<br/>[commands.lua]"]
  node_command_config["Command settings<br/>[commands.lua]"]
  node_server_config["Server settings<br/>[config.lua]"]
  node_logging["Player logging<br/>[logs.lua]"]
end

subgraph group_client["Client experience"]
  node_client_hud["Client HUD<br/>[uicore.lua]"]
  node_hud_ui["HUD message view<br/>[app.js]"]
  node_discord_presence["Discord presence<br/>[richpresence.lua]"]
end

node_redm(("RedM server"))
node_nui_host(("NUI host"))
node_admin_actor(("Server administrator"))

node_nui_host -->|"sends messages"| node_hud_ui
node_admin_actor -->|"runs commands"| node_admin_commands
node_admin_actor -->|"configures permissions"| node_command_config
node_redm -->|"uses settings"| node_server_config
node_redm -->|"requires database"| node_database_updates

click node_server_init "https://github.com/vorpcore/vorp_core/blob/main/server/init.lua"
click node_user_character "https://github.com/vorpcore/vorp_core/tree/main/server/class"
click node_character_loading "https://github.com/vorpcore/vorp_core/blob/main/server/loadcharacter.lua"
click node_user_loading "https://github.com/vorpcore/vorp_core/blob/main/server/loadusers.lua"
click node_user_saving "https://github.com/vorpcore/vorp_core/blob/main/server/saveusers.lua"
click node_database_updates "https://github.com/vorpcore/vorp_core/blob/main/server/services/dbupdater/dbupdater.lua"
click node_whitelist_bans "https://github.com/vorpcore/vorp_core/blob/main/server/whitelist.lua"
click node_server_api "https://github.com/vorpcore/vorp_core/blob/main/server/apicontroller.lua"
click node_client_api "https://github.com/vorpcore/vorp_core/blob/main/client/clientapi.lua"
click node_respawn "https://github.com/vorpcore/vorp_core/blob/main/client/respawnsystem.lua"
click node_instance "https://github.com/vorpcore/vorp_core/blob/main/server/instance.lua"
click node_admin_commands "https://github.com/vorpcore/vorp_core/blob/main/server/commands.lua"
click node_command_config "https://github.com/vorpcore/vorp_core/blob/main/config/commands.lua"
click node_server_config "https://github.com/vorpcore/vorp_core/blob/main/config/config.lua"
click node_logging "https://github.com/vorpcore/vorp_core/blob/main/server/logs.lua"
click node_client_hud "https://github.com/vorpcore/vorp_core/blob/main/client/uicore.lua"
click node_hud_ui "https://github.com/vorpcore/vorp_core/blob/main/ui/app.js"
click node_discord_presence "https://github.com/vorpcore/vorp_core/blob/main/server/richpresence.lua"

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_server_init,node_user_character,node_character_loading,node_user_loading,node_user_saving,node_database_updates,node_whitelist_bans,node_nui_host toneBlue
class node_server_api,node_client_api,node_respawn,node_instance toneAmber
class node_admin_commands,node_command_config,node_server_config,node_logging,node_redm,node_admin_actor toneMint
class node_client_hud,node_hud_ui,node_discord_presence toneRose
```

## Components

### Server and players

- [Core startup](https://github.com/vorpcore/vorp_core/blob/main/server/init.lua): `server/init.lua`
- [Users and characters](https://github.com/vorpcore/vorp_core/tree/main/server/class): `server/class`
- [Character loading](https://github.com/vorpcore/vorp_core/blob/main/server/loadcharacter.lua): `server/loadcharacter.lua`
- [User loading](https://github.com/vorpcore/vorp_core/blob/main/server/loadusers.lua): `server/loadusers.lua`
- [User saving](https://github.com/vorpcore/vorp_core/blob/main/server/saveusers.lua): `server/saveusers.lua`
- [Database updates](https://github.com/vorpcore/vorp_core/blob/main/server/services/dbupdater/dbupdater.lua): `server/services/dbupdater/dbupdater.lua`
- [Access and bans](https://github.com/vorpcore/vorp_core/blob/main/server/whitelist.lua): `server/whitelist.lua`

### Gameplay features

- [Server API](https://github.com/vorpcore/vorp_core/blob/main/server/apicontroller.lua): `server/apicontroller.lua`
- [Client API](https://github.com/vorpcore/vorp_core/blob/main/client/clientapi.lua): `client/clientapi.lua`
- [Respawn system](https://github.com/vorpcore/vorp_core/blob/main/client/respawnsystem.lua): `client/respawnsystem.lua`
- [Player instances](https://github.com/vorpcore/vorp_core/blob/main/server/instance.lua): `server/instance.lua`

### Administration

- [Admin commands](https://github.com/vorpcore/vorp_core/blob/main/server/commands.lua): `server/commands.lua`
- [Command settings](https://github.com/vorpcore/vorp_core/blob/main/config/commands.lua): `config/commands.lua`
- [Server settings](https://github.com/vorpcore/vorp_core/blob/main/config/config.lua): `config/config.lua`
- [Player logging](https://github.com/vorpcore/vorp_core/blob/main/server/logs.lua): `server/logs.lua`

### Client experience

- [Client HUD](https://github.com/vorpcore/vorp_core/blob/main/client/uicore.lua): `client/uicore.lua`
- [HUD message view](https://github.com/vorpcore/vorp_core/blob/main/ui/app.js): `ui/app.js`
- [Discord presence](https://github.com/vorpcore/vorp_core/blob/main/server/richpresence.lua): `server/richpresence.lua`

### Other components

- **RedM server**
- **NUI host**
- **Server administrator**

## Connections

- NUI host → HUD message view: sends messages (evidence: `ui/app.js`)
- Server administrator → Admin commands: runs commands (evidence: `README.md`)
- Server administrator → Command settings: configures permissions (evidence: `README.md`)
- RedM server → Server settings: uses settings (evidence: `README.md`)
- RedM server → Database updates: requires database (evidence: `README.md`)
