# mitlight/es_extended architecture

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

- Interactive diagram: https://gitdiagram.com/mitlight/es_extended
- Repository: https://github.com/mitlight/es_extended

## Overview

es_extended is a FiveM roleplay framework whose documented player-facing capabilities include accounts, inventory, jobs, and persistent loadouts and positions. The graph separates server and client runtime, browser UI, and shared localization; it also shows the documented database dependency. Source excerpts are limited to the browser UI and message wrapper, so most gameplay relationships are documented at the capability level rather than traced through server calls.

Main entry points: [`server/classes/player.lua`](https://github.com/mitlight/es_extended/blob/master/server/classes/player.lua) (Player state), [`server`](https://github.com/mitlight/es_extended/tree/master/server) (Loadout & position), [`client/main.lua`](https://github.com/mitlight/es_extended/blob/master/client/main.lua) (Client runtime), [`server/main.lua`](https://github.com/mitlight/es_extended/blob/master/server/main.lua) (Server runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_server["Server gameplay"]
  node_player["Player state<br/>[player.lua]"]
  node_accounts["Accounts"]
  node_inventory["Inventory"]
  node_jobs["Jobs"]
  node_persistence["Loadout &amp; position"]
  node_server_entry["Server runtime<br/>[main.lua]"]
end

subgraph group_client["Client runtime"]
  node_client_entry["Client runtime<br/>[main.lua]"]
  node_client_functions["Client functions<br/>[functions.lua]"]
  node_entity_iteration["Entity iteration<br/>[entityiter.lua]"]
  node_death["Death handling<br/>[death.lua]"]
  node_scaleform["Scaleform UI<br/>[scaleform.lua]"]
  node_streaming["Asset streaming<br/>[streaming.lua]"]
end

subgraph group_ui["Browser UI"]
  node_browser_ui["HUD &amp; notifications<br/>[app.js]"]
  node_message_wrapper["Message wrapper<br/>[wrapper.js]"]
end

subgraph group_shared["Shared services"]
  node_locale["Localization lookup<br/>[locale.js]"]
  node_translations["Translation catalogs"]
  node_schema["SQL schema<br/>[es_extended.sql]"]
end

node_player_actor(("Roleplay player"))
node_fivem["FiveM runtime"]
node_database[("MySQL database")]
node_essentialmode["EssentialMode"]

node_player_actor -.->|"plays through"| node_client_entry
node_client_entry -.->|"runs in"| node_fivem
node_server_entry -->|"extends"| node_essentialmode
node_player -->|"has accounts"| node_accounts
node_player -->|"uses inventory"| node_inventory
node_player -->|"has job"| node_jobs
node_player -->|"syncs state"| node_persistence
node_persistence -->|"persists to"| node_database
node_schema -->|"defines schema"| node_database
node_browser_ui -->|"receives messages"| node_fivem
node_message_wrapper -->|"posts chunks"| node_fivem

click node_player "https://github.com/mitlight/es_extended/blob/master/server/classes/player.lua"
click node_accounts "https://github.com/mitlight/es_extended/tree/master/server"
click node_inventory "https://github.com/mitlight/es_extended/tree/master/server"
click node_jobs "https://github.com/mitlight/es_extended/tree/master/server"
click node_persistence "https://github.com/mitlight/es_extended/tree/master/server"
click node_server_entry "https://github.com/mitlight/es_extended/blob/master/server/main.lua"
click node_client_entry "https://github.com/mitlight/es_extended/blob/master/client/main.lua"
click node_client_functions "https://github.com/mitlight/es_extended/blob/master/client/functions.lua"
click node_entity_iteration "https://github.com/mitlight/es_extended/blob/master/client/entityiter.lua"
click node_death "https://github.com/mitlight/es_extended/blob/master/client/modules/death.lua"
click node_scaleform "https://github.com/mitlight/es_extended/blob/master/client/modules/scaleform.lua"
click node_streaming "https://github.com/mitlight/es_extended/blob/master/client/modules/streaming.lua"
click node_browser_ui "https://github.com/mitlight/es_extended/blob/master/html/js/app.js"
click node_message_wrapper "https://github.com/mitlight/es_extended/blob/master/html/js/wrapper.js"
click node_locale "https://github.com/mitlight/es_extended/blob/master/locale.js"
click node_translations "https://github.com/mitlight/es_extended/tree/master/locales"
click node_schema "https://github.com/mitlight/es_extended/blob/master/es_extended.sql"

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_player,node_accounts,node_inventory,node_jobs,node_persistence,node_server_entry toneBlue
class node_client_entry,node_client_functions,node_entity_iteration,node_death,node_scaleform,node_streaming,node_database toneAmber
class node_browser_ui,node_message_wrapper toneMint
class node_locale,node_translations,node_schema toneRose
class node_player_actor,node_fivem,node_essentialmode toneIndigo
```

## Components

### Server gameplay

- [Player state](https://github.com/mitlight/es_extended/blob/master/server/classes/player.lua): `server/classes/player.lua`
- [Accounts](https://github.com/mitlight/es_extended/tree/master/server): `server`
- [Inventory](https://github.com/mitlight/es_extended/tree/master/server): `server`
- [Jobs](https://github.com/mitlight/es_extended/tree/master/server): `server`
- [Loadout & position](https://github.com/mitlight/es_extended/tree/master/server): `server`
- [Server runtime](https://github.com/mitlight/es_extended/blob/master/server/main.lua): `server/main.lua`

### Client runtime

- [Client runtime](https://github.com/mitlight/es_extended/blob/master/client/main.lua): `client/main.lua`
- [Client functions](https://github.com/mitlight/es_extended/blob/master/client/functions.lua): `client/functions.lua`
- [Entity iteration](https://github.com/mitlight/es_extended/blob/master/client/entityiter.lua): `client/entityiter.lua`
- [Death handling](https://github.com/mitlight/es_extended/blob/master/client/modules/death.lua): `client/modules/death.lua`
- [Scaleform UI](https://github.com/mitlight/es_extended/blob/master/client/modules/scaleform.lua): `client/modules/scaleform.lua`
- [Asset streaming](https://github.com/mitlight/es_extended/blob/master/client/modules/streaming.lua): `client/modules/streaming.lua`

### Browser UI

- [HUD & notifications](https://github.com/mitlight/es_extended/blob/master/html/js/app.js): `html/js/app.js`
- [Message wrapper](https://github.com/mitlight/es_extended/blob/master/html/js/wrapper.js): `html/js/wrapper.js`

### Shared services

- [Localization lookup](https://github.com/mitlight/es_extended/blob/master/locale.js): `locale.js`
- [Translation catalogs](https://github.com/mitlight/es_extended/tree/master/locales): `locales`
- [SQL schema](https://github.com/mitlight/es_extended/blob/master/es_extended.sql): `es_extended.sql`

### Other components

- **Roleplay player**
- **FiveM runtime**
- **MySQL database**
- **EssentialMode**

## Connections

- Roleplay player → Client runtime: plays through
- Client runtime → FiveM runtime: runs in
- Server runtime → EssentialMode: extends (evidence: `README.md`)
- Player state → Accounts: has accounts (evidence: `README.md`)
- Player state → Inventory: uses inventory (evidence: `README.md`)
- Player state → Jobs: has job (evidence: `README.md`)
- Player state → Loadout & position: syncs state (evidence: `README.md`)
- Loadout & position → MySQL database: persists to (evidence: `README.md`)
- SQL schema → MySQL database: defines schema (evidence: `README.md`)
- HUD & notifications → FiveM runtime: receives messages (evidence: `html/js/app.js`)
- Message wrapper → FiveM runtime: posts chunks (evidence: `html/js/wrapper.js`)
