# leafysmoke/rv-framework architecture

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

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

## Overview

Red Valley is a standalone FiveM roleplay framework. Players interact with persistent character and gameplay systems through the server; staff also use moderation and administration tools. The README describes major systems, while the only sampled implementation is the NUI web app, which receives host messages and posts user responses to NUI callbacks. Other subsystem paths are supported by the tree, but their internal calls and database wiring were not sampled, so those connections are omitted.

Main entry points: [`resources/[rvrp]/rvrp_ui/web/app.js`](https://github.com/leafysmoke/rv-framework/blob/main/resources/%5Brvrp%5D/rvrp_ui/web/app.js) (NUI web library), [`resources/[rvrp]/rvrp_core`](https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_core) (Player framework), [`resources/[rvrp]/rvrp_admin`](https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_admin) (Administration console)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_foundation["Framework foundation"]
  node_core["Player framework"]
  node_identity["Characters and identity"]
  node_database[("Persistence schema<br/>[schema.sql]")]
  node_economy["Accounts and inventory"]
end

subgraph group_player["Player systems"]
  node_status["Needs and status"]
  node_medical["EMS and treatment"]
  node_phone["Mobile phone"]
  node_documents["Physical documents"]
  node_interactions["World interactions"]
  node_target["Target framework"]
end

subgraph group_civic["Civic services"]
  node_civic_jobs["Civilian work"]
  node_civic_services["City hall services"]
  node_properties["Homes and storage"]
  node_vehicles["Vehicles and garages"]
  node_crafting["Crafting and repairs"]
  node_police["Police services"]
end

subgraph group_crime["Crime systems"]
  node_crime["Criminal progression"]
  node_underworld["Gangs and heists"]
  node_heistcreator["Heist authoring"]
end

subgraph group_operations["Staff and interface"]
  node_admin["Administration console"]
  node_ui_client["NUI client bridge<br/>[client.lua]"]
  node_ui_web["NUI web library<br/>[app.js]"]
end

node_player_actor(("Player"))
node_staff_actor(("Staff"))
node_fivem["FiveM host"]

node_player_actor -.->|"plays through"| node_core
node_staff_actor -.->|"uses"| node_admin
node_fivem -->|"sends UI messages"| node_ui_web
node_ui_web -->|"posts callbacks"| node_fivem

click node_core "https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_core"
click node_identity "https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_identity"
click node_database "https://github.com/leafysmoke/rv-framework/blob/main/database/schema.sql"
click node_economy "https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_economy"
click node_status "https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_status"
click node_medical "https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_medical"
click node_phone "https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_phone"
click node_documents "https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_documents"
click node_interactions "https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_interactions"
click node_target "https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_target"
click node_civic_jobs "https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_civ"
click node_civic_services "https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_civic"
click node_properties "https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_properties"
click node_vehicles "https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_vehicles"
click node_crafting "https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_crafting"
click node_police "https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_police"
click node_crime "https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_crime"
click node_underworld "https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_underworld"
click node_heistcreator "https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_heistcreator"
click node_admin "https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_admin"
click node_ui_client "https://github.com/leafysmoke/rv-framework/blob/main/resources/%5Brvrp%5D/rvrp_ui/client.lua"
click node_ui_web "https://github.com/leafysmoke/rv-framework/blob/main/resources/%5Brvrp%5D/rvrp_ui/web/app.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_core,node_identity,node_database,node_economy toneBlue
class node_status,node_medical,node_phone,node_documents,node_interactions,node_target toneAmber
class node_civic_jobs,node_civic_services,node_properties,node_vehicles,node_crafting,node_police toneMint
class node_crime,node_underworld,node_heistcreator toneRose
class node_admin,node_ui_client,node_ui_web,node_player_actor,node_staff_actor,node_fivem toneIndigo
```

## Components

### Framework foundation

- [Player framework](https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_core): `resources/[rvrp]/rvrp_core`
- [Characters and identity](https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_identity): `resources/[rvrp]/rvrp_identity`
- [Persistence schema](https://github.com/leafysmoke/rv-framework/blob/main/database/schema.sql): `database/schema.sql`
- [Accounts and inventory](https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_economy): `resources/[rvrp]/rvrp_economy`

### Player systems

- [Needs and status](https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_status): `resources/[rvrp]/rvrp_status`
- [EMS and treatment](https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_medical): `resources/[rvrp]/rvrp_medical`
- [Mobile phone](https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_phone): `resources/[rvrp]/rvrp_phone`
- [Physical documents](https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_documents): `resources/[rvrp]/rvrp_documents`
- [World interactions](https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_interactions): `resources/[rvrp]/rvrp_interactions`
- [Target framework](https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_target): `resources/[rvrp]/rvrp_target`

### Civic services

- [Civilian work](https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_civ): `resources/[rvrp]/rvrp_civ`
- [City hall services](https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_civic): `resources/[rvrp]/rvrp_civic`
- [Homes and storage](https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_properties): `resources/[rvrp]/rvrp_properties`
- [Vehicles and garages](https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_vehicles): `resources/[rvrp]/rvrp_vehicles`
- [Crafting and repairs](https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_crafting): `resources/[rvrp]/rvrp_crafting`
- [Police services](https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_police): `resources/[rvrp]/rvrp_police`

### Crime systems

- [Criminal progression](https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_crime): `resources/[rvrp]/rvrp_crime`
- [Gangs and heists](https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_underworld): `resources/[rvrp]/rvrp_underworld`
- [Heist authoring](https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_heistcreator): `resources/[rvrp]/rvrp_heistcreator`

### Staff and interface

- [Administration console](https://github.com/leafysmoke/rv-framework/tree/main/resources/%5Brvrp%5D/rvrp_admin): `resources/[rvrp]/rvrp_admin`
- [NUI client bridge](https://github.com/leafysmoke/rv-framework/blob/main/resources/%5Brvrp%5D/rvrp_ui/client.lua): `resources/[rvrp]/rvrp_ui/client.lua`
- [NUI web library](https://github.com/leafysmoke/rv-framework/blob/main/resources/%5Brvrp%5D/rvrp_ui/web/app.js): `resources/[rvrp]/rvrp_ui/web/app.js`

### Other components

- **Player**
- **Staff**
- **FiveM host**

## Connections

- Player → Player framework: plays through (evidence: `README.md`)
- Staff → Administration console: uses (evidence: `README.md`)
- FiveM host → NUI web library: sends UI messages (evidence: `resources/[rvrp]/rvrp_ui/web/app.js`)
- NUI web library → FiveM host: posts callbacks (evidence: `resources/[rvrp]/rvrp_ui/web/app.js`)
