# berezaa/vesteria architecture

> Architecture diagram of the GitHub repository berezaa/vesteria, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/berezaa/vesteria
- Repository: https://github.com/berezaa/vesteria

## Overview

##### Project Type and Purpose
- This is a Roblox-based, full-stack game project (Vesteria MMORPG).
- It uses Rojo/VsCode for local development and synchronizes Lua scripts with Roblox’s hierarchy.
- Core purpose: provide client-server game logic, GUI, assets, shared modules, and persistent data services.

##### High-Level Architecture Components
a. Client (Player’s Device)
- StarterPlayerScripts & StarterCharacterScripts – local controllers, animations, input.
- StarterGui – UI screens (inventory, chat, quest log, etc.).
- ClientChatModules & ChatScript – client-side chat UI and command handling.
- RemoteEvents/RemoteFunctions – network layer to communicate with server.
b. Server (Roblox Servers)
- ServerScriptService
– contents/manager_* – gameplay managers (combat, quests, crafting, chat, etc.).
– analytics/GameAnalytics – external analytics integration.
– modules – reusable server modules (e.g., damage, economy, pathfinding).
- ChatServiceRunner – server side of chat system.
- DataStoreInterface – abstraction over Roblox DataStores for persistent player data.
c. Shared / Replicated Data
- ReplicatedStorage
– modules – shared libraries (utilities, events, physics, network).
– lookup tables – itemData, monsterLookup, statusEffectLookup, etc.
– temporaryEquipment, accessoryLookup, dialogue, sounds, assets.
d. External Services
- DataStores (Roblox built-in) for persistent storage.
- GameAnalytics (third-party) for telemetry.

##### Relationships & Data Flow
- Client → Server via RemoteEvents/RemoteFunctions
- Player inputs, interactions, chat messages go to server managers.
- Server → Client
- State updates (health, position, inventory), UI updates via RemoteEvents.
- Both → ReplicatedStorage
- Shared modules & lookup tables loaded locally on client & server.
- Server ↔ DataStoreInterface
- Persistent reads/writes (player progress, economy).
- Server → GameAnalytics
- Event tracking for analytics.

##### Important Architectural Patterns
- Modular Managers: each `manager_*` handles a distinct domain (e.g., manager_quest, manager_chat).
- Shared Module Library: utilities under `ReplicatedStorage/modules` to avoid duplication.
- MVC-like separation:
- Model: lookup tables & DataStore data.
- View: StarterGui, Chat UI.
- Controller: manager scripts & client scripts.
- Chat subsystem as microservice: Chat modules in `src/Chat` and `ChatServiceRunner`.

##### Including Submodules
- Under Client & Server, group related scripts and name submodules (e.g., manager_chat, manager_quest).

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Layer
    subgraph "Client (Player Device)"
        direction TB
        SPS["StarterPlayerScripts"]:::client
        SCS["StarterCharacterScripts"]:::client
        GUI["StarterGui (UI Screens)"]:::client
        CCS["ClientChatModules"]:::client
        CS["ChatScript"]:::client
    end

    %% Server Layer
    subgraph "Server (Roblox Server)"
        direction TB
        GM["Gameplay Managers\n(manager_*.lua)"]:::server
        DSI["DataStoreInterface"]:::server
        CSR["ChatServiceRunner"]:::server
        AI["Analytics Integration\n(GameAnalytics)"]:::server
    end

    %% Shared / Replicated Storage
    subgraph "ReplicatedStorage (Shared)"
        direction TB
        SM["Shared Module Library"]:::shared
        IL["Item Lookup Tables"]:::shared
        ML["Monster Lookup Tables"]:::shared
        SL["StatusEffect Lookup Tables"]:::shared
        AL["Accessory Lookup"]:::shared
        DL["Dialogue Assets"]:::shared
    end

    %% External Services
    subgraph "External Services"
        direction TB
        DS[(DataStores)]:::external
        GA((GameAnalytics API)):::external
    end

    %% Data Flows
    SPS -->|RemoteEvents/Functions| GM
    SCS -->|RemoteEvents/Functions| GM
    CCS -->|Chat RPC| CSR
    CS -->|Chat RPC| CSR
    GM -->|State Updates| GUI
    GM -->|State Updates| CS
    GM -->|Analytics Events| AI
    DSI <-->|Persistent Reads/Writes| DS
    AI -->|Telemetry| GA

    %% Shared Modules Usage
    SM --> SPS
    SM --> SCS
    SM --> CCS
    SM --> CS
    SM --> GM
    SM --> CSR
    IL --> SPS
    IL --> GM
    ML --> SPS
    ML --> GM
    SL --> SCS
    SL --> GM
    AL --> SPS
    AL --> GM
    DL --> GUI
    DL --> CS

    %% Click Events
    click SPS "https://github.com/berezaa/vesteria/tree/master/StarterPlayer/StarterPlayerScripts/"
    click SCS "https://github.com/berezaa/vesteria/tree/master/StarterPlayer/StarterCharacterScripts/"
    click GUI "https://github.com/berezaa/vesteria/tree/master/StarterGui/"
    click CCS "https://github.com/berezaa/vesteria/tree/master/src/Chat/ClientChatModules/"
    click CS "https://github.com/berezaa/vesteria/tree/master/src/Chat/ChatScript/"
    click GM "https://github.com/berezaa/vesteria/blob/master/src/ServerScriptService/contents/manager_*.lua"
    click DSI "https://github.com/berezaa/vesteria/blob/master/src/ServerScriptService/contents/datastoreInterface.lua"
    click CSR "https://github.com/berezaa/vesteria/tree/master/src/ServerScriptService/ChatServiceRunner/"
    click AI "https://github.com/berezaa/vesteria/tree/master/src/ServerScriptService/analytics/GameAnalytics/"
    click SM "https://github.com/berezaa/vesteria/tree/master/src/ReplicatedStorage/modules/"
    click IL "https://github.com/berezaa/vesteria/tree/master/src/ReplicatedStorage/itemData/"
    click ML "https://github.com/berezaa/vesteria/tree/master/src/ReplicatedStorage/monsterLookup/"
    click SL "https://github.com/berezaa/vesteria/tree/master/src/ReplicatedStorage/statusEffectLookup/"
    click AL "https://github.com/berezaa/vesteria/blob/master/src/ReplicatedStorage/accessoryLookup.lua"
    click DL "https://github.com/berezaa/vesteria/tree/master/src/ReplicatedStorage/dialogue/"

    %% Styles
    classDef client fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef server fill:#90EE90,stroke:#000,stroke-width:1px
    classDef shared fill:#FFFF99,stroke:#000,stroke-width:1px
    classDef external fill:#D3D3D3,stroke:#000,stroke-width:1px
```
