# ragemp-pro/redage_v3 architecture

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

- Interactive diagram: https://gitdiagram.com/ragemp-pro/redage_v3
- Repository: https://github.com/ragemp-pro/redage_v3

## Overview

#### Purpose and Runtime

RedAge/NeptuneEvo is a full RAGE:MP GTA V role-play gamemode. It runs as a packaged RAGE:MP server with a .NET Core 3.1 authoritative game resource, JavaScript client scripts, and an embedded Chromium (CEF) Svelte UI. Server launch/runtime artifacts include `ragemp-server.exe`, `conf.json`, `dotnet/settings.xml`, and `dotnet/resources/NeptuneEvo/meta.xml`.

#### Entry Points and Composition

The game server loads the NeptuneEvo resource, whose C# entry point is `dotnet/resources/NeptuneEvo/Main.cs`, built through `dotnet/resources/NeptuneEvo/NeptuneEvo.csproj` within `dotnet/resources/NeptuneEvo.sln`. Client-side RAGE:MP scripts enter through `src_client/index.js` / `src_client/main.js`; deployed client package wiring is `client_packages/index.js` and `client_packages/main.js`. The browser UI starts at `src_cef/src/main.js` and `src_cef/src/App.svelte`, compiled into `client_packages/interface/build/bundle.js`.

#### Server Authority and Lifecycle

The C# resource owns game state, player lifecycle, validation, and persistence. Connection/session flow is centered on `dotnet/resources/NeptuneEvo/Players/Connect/Events.cs`, `dotnet/resources/NeptuneEvo/Players/Session/Repository.cs`, and account/character flows under `dotnet/resources/NeptuneEvo/Accounts/Autorization/Events.cs` and `dotnet/resources/NeptuneEvo/Character/Load/Events.cs`. Gameplay modules expose RAGE:MP events/repositories; clients and CEF are presentation/input layers rather than authorities.

#### Domain Systems

Major stateful domains are organized by bounded folders:
- Economy, donations, banking, casino: `dotnet/resources/NeptuneEvo/MoneySystem/Bank.cs`, `dotnet/resources/NeptuneEvo/MoneySystem/Donations.cs`, `dotnet/resources/NeptuneEvo/NewCasino/Roulette/Roullete.cs`.
- Social/property organizations: `dotnet/resources/NeptuneEvo/Businesses/Repository.cs`, `dotnet/resources/NeptuneEvo/Houses/HouseManager.cs`, `dotnet/resources/NeptuneEvo/Fractions/Manager.cs`.
- Player-owned state and interaction: `dotnet/resources/NeptuneEvo/Chars/Repository.cs`, `dotnet/resources/NeptuneEvo/Inventory/Drop/Repository.cs`, `dotnet/resources/NeptuneEvo/Players/Phone/Repository.cs`.
- Jobs, quests, and timed/world events: `dotnet/resources/NeptuneEvo/Jobs/WorkManager.cs`, `dotnet/resources/NeptuneEvo/Quests/qMain.cs`, `dotnet/resources/NeptuneEvo/Events/AirDrop/Events.cs`.

#### Client and CEF Boundary

`src_client` translates engine events into local GTA behavior—camera, vehicles, sync, world rendering—and invokes CEF/UI and server events. Key integration points are `src_client/utils/cef.js`, `src_client/synchronization/index.js`, and `src_client/player/auth.js`. The Svelte CEF app routes views and maintains browser-side state via `src_cef/src/router/index.js`, `src_cef/src/store/server.js`, and the RAGE bridge `src_cef/src/api/rage.js`. UI encompasses auth/character creation, HUD/phone, inventory/menu, businesses, factions, and casino; e.g. `src_cef/src/views/player/newauthentication/index.svelte`, `src_cef/src/views/player/hudevo/index.svelte`.

#### Persistence, Settings, and Services

MySQL-backed models/configuration reside in `dotnet/resources/NeptuneEvo/Database/ConnectionInfo.cs` and `dotnet/resources/NeptuneEvo/Database/Models/Repository.cs`; initial schemas are `database/main.sql`, `database/mainconfig.sql`, and `database/mainlogs.sql`. Runtime economy/server settings are file-driven under `settings/`, notably `settings/serverSettings.json` and `settings/moneySettings.json`. Redis supports transient workflows such as email confirmation (`dotnet/resources/NeptuneEvo/Utils/Redis/Repository.cs`), while Google Analytics integration exists in `dotnet/resources/NeptuneEvo/Utils/Analytics/GoogleAnalyticsHelper.cs`.

#### Assets and Deployment Shape

GTA client resources are shipped in `client_packages/game_resources/`; the compiled UI is under `client_packages/interface/`. Source UI and client code are separate from deployed package outputs, so changes generally require rebuilding and copying/bundling into `client_packages`. Shared gameplay data is duplicated or mirrored as JSON for server/client/UI consumption, including `json/itemsInfo.js`, `src_cef/src/json/itemsInfo.js`, and `dotnet/vehicleData.json`.

Main entry points: [`dotnet/resources/NeptuneEvo/Main.cs`](https://github.com/ragemp-pro/redage_v3/blob/main/dotnet/resources/NeptuneEvo/Main.cs) (NeptuneEvo Resource), [`dotnet/resources/NeptuneEvo/Accounts/Autorization/Events.cs`](https://github.com/ragemp-pro/redage_v3/blob/main/dotnet/resources/NeptuneEvo/Accounts/Autorization/Events.cs) (Account & Character), [`src_client/index.js`](https://github.com/ragemp-pro/redage_v3/blob/main/src_client/index.js) (Client Entry), [`src_cef/src/main.js`](https://github.com/ragemp-pro/redage_v3/blob/main/src_cef/src/main.js) (Svelte UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["RAGE:MP Runtime"]
  node_rage_server{{"RAGE:MP Server<br/>server runtime<br/>[ragemp-server.exe]"}}
end

subgraph group_server["Authoritative Server"]
  node_server_resource{{"NeptuneEvo Resource<br/>C&#35; resource entry<br/>[Main.cs]"}}
  node_connection_flow["Connection &amp; Session<br/>player lifecycle<br/>[Events.cs]"]
  node_account_character["Account &amp; Character<br/>identity flow<br/>[Events.cs]"]
  node_gameplay_domains["Gameplay Domains<br/>game modules<br/>[Bank.cs]"]
  node_mysql_repository[("MySQL Models<br/>persistence layer<br/>[Repository.cs]")]
  node_redis_workflows[("Redis Workflows<br/>transient store<br/>[Repository.cs]")]
end

subgraph group_client["Client Scripts"]
  node_client_entry{{"Client Entry<br/>RAGE:MP JavaScript<br/>[index.js]"}}
  node_client_sync["Local Sync &amp; World<br/>client integration<br/>[index.js]"]
  node_client_auth["Client Auth<br/>client flow<br/>[auth.js]"]
  node_cef_bridge["CEF Bridge<br/>client-to-browser bridge<br/>[cef.js]"]
end

subgraph group_cef["CEF Svelte UI"]
  node_ui_entry{{"Svelte UI<br/>browser app entry<br/>[main.js]"}}
  node_ui_router["Views &amp; Router<br/>UI navigation<br/>[index.js]"]
  node_ui_store["UI Server State<br/>browser state<br/>[server.js]"]
  node_ui_rage_api["RAGE Browser API<br/>CEF bridge<br/>[rage.js]"]
end

subgraph group_data["Data &amp; Deployment"]
  node_deployed_client["Deployed Client Package<br/>package entry<br/>[index.js]"]
  node_compiled_ui["Compiled UI Bundle<br/>CEF artifact<br/>[bundle.js]"]
  node_settings["Server Settings<br/>runtime settings"]
  node_mysql_schema[("MySQL Schema<br/>database schema<br/>[main.sql]")]
  node_game_assets["Game Resources<br/>GTA assets"]
end

node_rage_server -->|"loads"| node_server_resource
node_server_resource -->|"handles lifecycle"| node_connection_flow
node_connection_flow -->|"starts login"| node_account_character
node_account_character -->|"loads player state"| node_gameplay_domains
node_server_resource -->|"authoritative events"| node_gameplay_domains
node_connection_flow -->|"persists sessions"| node_mysql_repository
node_account_character -->|"reads accounts and characters"| node_mysql_repository
node_gameplay_domains -->|"persists game state"| node_mysql_repository
node_account_character -->|"uses transient workflows"| node_redis_workflows
node_mysql_schema -.->|"defines storage"| node_mysql_repository
node_settings -.->|"configures"| node_server_resource
node_client_entry -->|"initializes"| node_client_sync
node_client_entry -->|"initializes"| node_client_auth
node_client_sync -->|"opens and updates UI"| node_cef_bridge
node_client_auth -->|"drives auth UI"| node_cef_bridge
node_cef_bridge -->|"loads and messages"| node_ui_entry
node_ui_entry -->|"renders routes"| node_ui_router
node_ui_entry -->|"maintains state"| node_ui_store
node_ui_router -->|"submits UI actions"| node_ui_rage_api
node_ui_rage_api -->|"browser events"| node_cef_bridge
node_client_entry -->|"RAGE:MP events"| node_server_resource
node_deployed_client -.->|"packages source runtime"| node_client_entry
node_deployed_client -->|"loads"| node_compiled_ui
node_compiled_ui -.->|"built from"| node_ui_entry
node_game_assets -.->|"ships alongside"| node_deployed_client

click node_rage_server "https://github.com/ragemp-pro/redage_v3/blob/main/ragemp-server.exe"
click node_server_resource "https://github.com/ragemp-pro/redage_v3/blob/main/dotnet/resources/NeptuneEvo/Main.cs"
click node_connection_flow "https://github.com/ragemp-pro/redage_v3/blob/main/dotnet/resources/NeptuneEvo/Players/Connect/Events.cs"
click node_account_character "https://github.com/ragemp-pro/redage_v3/blob/main/dotnet/resources/NeptuneEvo/Accounts/Autorization/Events.cs"
click node_gameplay_domains "https://github.com/ragemp-pro/redage_v3/blob/main/dotnet/resources/NeptuneEvo/MoneySystem/Bank.cs"
click node_mysql_repository "https://github.com/ragemp-pro/redage_v3/blob/main/dotnet/resources/NeptuneEvo/Database/Models/Repository.cs"
click node_redis_workflows "https://github.com/ragemp-pro/redage_v3/blob/main/dotnet/resources/NeptuneEvo/Utils/Redis/Repository.cs"
click node_client_entry "https://github.com/ragemp-pro/redage_v3/blob/main/src_client/index.js"
click node_client_sync "https://github.com/ragemp-pro/redage_v3/blob/main/src_client/synchronization/index.js"
click node_client_auth "https://github.com/ragemp-pro/redage_v3/blob/main/src_client/player/auth.js"
click node_cef_bridge "https://github.com/ragemp-pro/redage_v3/blob/main/src_client/utils/cef.js"
click node_ui_entry "https://github.com/ragemp-pro/redage_v3/blob/main/src_cef/src/main.js"
click node_ui_router "https://github.com/ragemp-pro/redage_v3/blob/main/src_cef/src/router/index.js"
click node_ui_store "https://github.com/ragemp-pro/redage_v3/blob/main/src_cef/src/store/server.js"
click node_ui_rage_api "https://github.com/ragemp-pro/redage_v3/blob/main/src_cef/src/api/rage.js"
click node_deployed_client "https://github.com/ragemp-pro/redage_v3/blob/main/client_packages/index.js"
click node_compiled_ui "https://github.com/ragemp-pro/redage_v3/blob/main/client_packages/interface/build/bundle.js"
click node_settings "https://github.com/ragemp-pro/redage_v3/blob/main/settings/serverSettings.json"
click node_mysql_schema "https://github.com/ragemp-pro/redage_v3/blob/main/database/main.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_rage_server toneBlue
class node_server_resource,node_connection_flow,node_account_character,node_gameplay_domains,node_mysql_repository,node_redis_workflows toneAmber
class node_client_entry,node_client_sync,node_client_auth,node_cef_bridge toneMint
class node_ui_entry,node_ui_router,node_ui_store,node_ui_rage_api toneRose
class node_deployed_client,node_compiled_ui,node_settings,node_mysql_schema,node_game_assets toneIndigo
```

## Components

### RAGE:MP Runtime

- [RAGE:MP Server](https://github.com/ragemp-pro/redage_v3/blob/main/ragemp-server.exe): server runtime · Hosts the packaged NeptuneEvo resource. · `ragemp-server.exe`

### Authoritative Server

- [NeptuneEvo Resource](https://github.com/ragemp-pro/redage_v3/blob/main/dotnet/resources/NeptuneEvo/Main.cs): C# resource entry · Authoritative game composition and lifecycle entry point. · `dotnet/resources/NeptuneEvo/Main.cs`
- [Connection & Session](https://github.com/ragemp-pro/redage_v3/blob/main/dotnet/resources/NeptuneEvo/Players/Connect/Events.cs): player lifecycle · Establishes connections and player sessions. · `dotnet/resources/NeptuneEvo/Players/Connect/Events.cs`
- [Account & Character](https://github.com/ragemp-pro/redage_v3/blob/main/dotnet/resources/NeptuneEvo/Accounts/Autorization/Events.cs): identity flow · Authenticates accounts and loads characters. · `dotnet/resources/NeptuneEvo/Accounts/Autorization/Events.cs`
- [Gameplay Domains](https://github.com/ragemp-pro/redage_v3/blob/main/dotnet/resources/NeptuneEvo/MoneySystem/Bank.cs): game modules · Economy, property, factions, inventory, phone, jobs, quests, and world events. · `dotnet/resources/NeptuneEvo/MoneySystem/Bank.cs`
- [MySQL Models](https://github.com/ragemp-pro/redage_v3/blob/main/dotnet/resources/NeptuneEvo/Database/Models/Repository.cs): persistence layer · Database connection and model repositories. · `dotnet/resources/NeptuneEvo/Database/Models/Repository.cs`
- [Redis Workflows](https://github.com/ragemp-pro/redage_v3/blob/main/dotnet/resources/NeptuneEvo/Utils/Redis/Repository.cs): transient store · Supports transient flows such as email confirmation. · `dotnet/resources/NeptuneEvo/Utils/Redis/Repository.cs`

### Client Scripts

- [Client Entry](https://github.com/ragemp-pro/redage_v3/blob/main/src_client/index.js): RAGE:MP JavaScript · Receives engine events and initializes local client behavior. · `src_client/index.js`
- [Local Sync & World](https://github.com/ragemp-pro/redage_v3/blob/main/src_client/synchronization/index.js): client integration · Handles synchronization, local GTA behavior, and rendering. · `src_client/synchronization/index.js`
- [Client Auth](https://github.com/ragemp-pro/redage_v3/blob/main/src_client/player/auth.js): client flow · Coordinates player authentication presentation. · `src_client/player/auth.js`
- [CEF Bridge](https://github.com/ragemp-pro/redage_v3/blob/main/src_client/utils/cef.js): client-to-browser bridge · Invokes browser UI and bridges CEF events. · `src_client/utils/cef.js`

### CEF Svelte UI

- [Svelte UI](https://github.com/ragemp-pro/redage_v3/blob/main/src_cef/src/main.js): browser app entry · Browser-side UI application root. · `src_cef/src/main.js`
- [Views & Router](https://github.com/ragemp-pro/redage_v3/blob/main/src_cef/src/router/index.js): UI navigation · Routes auth, HUD, phone, inventory, organization, and casino views. · `src_cef/src/router/index.js`
- [UI Server State](https://github.com/ragemp-pro/redage_v3/blob/main/src_cef/src/store/server.js): browser state · Maintains browser-side state received from the game. · `src_cef/src/store/server.js`
- [RAGE Browser API](https://github.com/ragemp-pro/redage_v3/blob/main/src_cef/src/api/rage.js): CEF bridge · Sends UI actions through the RAGE bridge. · `src_cef/src/api/rage.js`

### Data & Deployment

- [Deployed Client Package](https://github.com/ragemp-pro/redage_v3/blob/main/client_packages/index.js): package entry · Runtime wiring for deployed JavaScript client scripts. · `client_packages/index.js`
- [Compiled UI Bundle](https://github.com/ragemp-pro/redage_v3/blob/main/client_packages/interface/build/bundle.js): CEF artifact · Built Svelte UI loaded by the deployed client package. · `client_packages/interface/build/bundle.js`
- [Server Settings](https://github.com/ragemp-pro/redage_v3/blob/main/settings/serverSettings.json): runtime settings · File-driven economy and server settings. · `settings/serverSettings.json`
- [MySQL Schema](https://github.com/ragemp-pro/redage_v3/blob/main/database/main.sql): database schema · Initial game database schema. · `database/main.sql`
- **Game Resources**: GTA assets · Shipped GTA client resources.

## Connections

- RAGE:MP Server → NeptuneEvo Resource: loads
- NeptuneEvo Resource → Connection & Session: handles lifecycle
- Connection & Session → Account & Character: starts login
- Account & Character → Gameplay Domains: loads player state
- NeptuneEvo Resource → Gameplay Domains: authoritative events
- Connection & Session → MySQL Models: persists sessions
- Account & Character → MySQL Models: reads accounts and characters
- Gameplay Domains → MySQL Models: persists game state
- Account & Character → Redis Workflows: uses transient workflows
- MySQL Schema → MySQL Models: defines storage
- Server Settings → NeptuneEvo Resource: configures
- Client Entry → Local Sync & World: initializes
- Client Entry → Client Auth: initializes
- Local Sync & World → CEF Bridge: opens and updates UI
- Client Auth → CEF Bridge: drives auth UI
- CEF Bridge → Svelte UI: loads and messages
- Svelte UI → Views & Router: renders routes
- Svelte UI → UI Server State: maintains state
- Views & Router → RAGE Browser API: submits UI actions
- RAGE Browser API → CEF Bridge: browser events
- Client Entry → NeptuneEvo Resource: RAGE:MP events · Clients are presentation and input layers; server validates actions.
- Deployed Client Package → Client Entry: packages source runtime
- Deployed Client Package → Compiled UI Bundle: loads
- Compiled UI Bundle → Svelte UI: built from
- Game Resources → Deployed Client Package: ships alongside
