# kramerforster/nion-tools architecture

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

- Interactive diagram: https://gitdiagram.com/kramerforster/nion-tools
- Repository: https://github.com/kramerforster/nion-tools

## Overview

Nion-Tools is a game-client enhancement for SA-MP, with a JavaScript interface layer and a small native integration layer. The visible startup workflow waits for the game HUD, initializes interface interception, discovers an API host, authenticates, then loads and toggles modules. Modules cover admin spectating, reports, player lists and filters, command utilities, teleport helpers, and automation. The README provides no capability details; several feature names come from the source tree. Edges reflect shown imports and calls; unsampled module behavior is not inferred.

Main entry points: [`js/src/modules/index.js`](https://github.com/kramerforster/nion-tools/blob/main/js/src/modules/index.js) (Module registry), [`js/src/core/InterfaceManager.js`](https://github.com/kramerforster/nion-tools/blob/main/js/src/core/InterfaceManager.js) (Interface manager), [`js/src/core/Loader.js`](https://github.com/kramerforster/nion-tools/blob/main/js/src/core/Loader.js) (Loader and auth), [`js/src/modules/Cmds.js`](https://github.com/kramerforster/nion-tools/blob/main/js/src/modules/Cmds.js) (Command tools)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Startup and state"]
  node_main["Startup gate<br/>[main.js]"]
  node_loader["Loader and auth<br/>[Loader.js]"]
  node_state["Shared state<br/>[state.js]"]
  node_api["API client<br/>[ApiService.js]"]
end

subgraph group_interface["Client interface"]
  node_manager["Interface manager"]
end

subgraph group_features["Admin tools"]
  node_registry["Module registry<br/>[index.js]"]
  node_cmds["Command tools<br/>[Cmds.js]"]
  node_alist["Admin list<br/>[Alist.js]"]
  node_health["Auto health<br/>[AutoHealth.js]"]
  node_autosp["Auto spectate<br/>[AutoSP.js]"]
  node_copy["Copy tools<br/>[Copy.js]"]
  node_spectate["Spectate interface<br/>[InterfaceSP.js]"]
  node_players["Player list<br/>[Players.js]"]
  node_report["Report handling<br/>[Report.js]"]
  node_spectp["Spectate teleport<br/>[SpecTP.js]"]
  node_tp["Teleport tools<br/>[Tp.js]"]
  node_filters["Player filters<br/>[filtersTab.js]"]
  node_functions["Chat helpers<br/>[functions.js]"]
end

subgraph group_native["Game integration"]
  node_samp["SA-MP bindings<br/>[sampapi_min.h]"]
  node_dll["Native entry<br/>[dllmain.cpp]"]
end

node_user(("Game user"))
node_service(("Nion API"))

node_user -->|"starts client"| node_main
node_main -->|"initializes"| node_manager
node_main -->|"starts loading"| node_loader
node_loader -->|"registers listeners"| node_manager
node_loader -->|"authenticates through"| node_api
node_loader -->|"loads modules"| node_registry
node_api -->|"sends requests"| node_service
node_loader -->|"updates"| node_state
node_api -->|"reads hosts"| node_state
node_registry -->|"registers"| node_cmds
node_registry -->|"registers"| node_alist
node_registry -->|"registers"| node_health
node_registry -->|"registers"| node_autosp
node_registry -->|"registers"| node_copy
node_registry -->|"registers"| node_spectate
node_registry -->|"registers"| node_players
node_registry -->|"registers"| node_report
node_registry -->|"registers"| node_spectp
node_registry -->|"registers"| node_tp
node_registry -->|"registers"| node_filters
node_cmds -->|"uses interface"| node_manager
node_cmds -->|"posts settings"| node_api
node_cmds -->|"uses report"| node_report
node_cmds -->|"uses helpers"| node_functions
node_filters -->|"uses interface"| node_manager
node_report -->|"registers chat hook"| node_manager
node_functions -->|"registers dialog hooks"| node_manager
node_dll -->|"uses bindings"| node_samp

click node_main "https://github.com/kramerforster/nion-tools/blob/main/js/src/main.js"
click node_loader "https://github.com/kramerforster/nion-tools/blob/main/js/src/core/Loader.js"
click node_state "https://github.com/kramerforster/nion-tools/blob/main/js/src/config/state.js"
click node_api "https://github.com/kramerforster/nion-tools/blob/main/js/src/services/ApiService.js"
click node_manager "https://github.com/kramerforster/nion-tools/blob/main/js/src/core/InterfaceManager.js"
click node_registry "https://github.com/kramerforster/nion-tools/blob/main/js/src/modules/index.js"
click node_cmds "https://github.com/kramerforster/nion-tools/blob/main/js/src/modules/Cmds.js"
click node_alist "https://github.com/kramerforster/nion-tools/blob/main/js/src/modules/Alist.js"
click node_health "https://github.com/kramerforster/nion-tools/blob/main/js/src/modules/AutoHealth.js"
click node_autosp "https://github.com/kramerforster/nion-tools/blob/main/js/src/modules/AutoSP.js"
click node_copy "https://github.com/kramerforster/nion-tools/blob/main/js/src/modules/Copy.js"
click node_spectate "https://github.com/kramerforster/nion-tools/blob/main/js/src/modules/InterfaceSP.js"
click node_players "https://github.com/kramerforster/nion-tools/blob/main/js/src/modules/Players.js"
click node_report "https://github.com/kramerforster/nion-tools/blob/main/js/src/modules/Report.js"
click node_spectp "https://github.com/kramerforster/nion-tools/blob/main/js/src/modules/SpecTP.js"
click node_tp "https://github.com/kramerforster/nion-tools/blob/main/js/src/modules/Tp.js"
click node_filters "https://github.com/kramerforster/nion-tools/blob/main/js/src/modules/filtersTab.js"
click node_functions "https://github.com/kramerforster/nion-tools/blob/main/js/src/modules/functions.js"
click node_samp "https://github.com/kramerforster/nion-tools/blob/main/asi/src/sampapi_min.h"
click node_dll "https://github.com/kramerforster/nion-tools/blob/main/asi/src/dllmain.cpp"

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_main,node_loader,node_state,node_api,node_user toneBlue
class node_manager toneAmber
class node_registry,node_cmds,node_alist,node_health,node_autosp,node_copy,node_spectate,node_players,node_report,node_spectp,node_tp,node_filters,node_functions,node_service toneMint
class node_samp,node_dll toneRose
```

## Components

### Startup and state

- [Startup gate](https://github.com/kramerforster/nion-tools/blob/main/js/src/main.js): `js/src/main.js`
- [Loader and auth](https://github.com/kramerforster/nion-tools/blob/main/js/src/core/Loader.js): `js/src/core/Loader.js`
- [Shared state](https://github.com/kramerforster/nion-tools/blob/main/js/src/config/state.js): `js/src/config/state.js`
- [API client](https://github.com/kramerforster/nion-tools/blob/main/js/src/services/ApiService.js): `js/src/services/ApiService.js`

### Client interface

- [Interface manager](https://github.com/kramerforster/nion-tools/blob/main/js/src/core/InterfaceManager.js): `js/src/core/InterfaceManager.js`

### Admin tools

- [Module registry](https://github.com/kramerforster/nion-tools/blob/main/js/src/modules/index.js): `js/src/modules/index.js`
- [Command tools](https://github.com/kramerforster/nion-tools/blob/main/js/src/modules/Cmds.js): `js/src/modules/Cmds.js`
- [Admin list](https://github.com/kramerforster/nion-tools/blob/main/js/src/modules/Alist.js): `js/src/modules/Alist.js`
- [Auto health](https://github.com/kramerforster/nion-tools/blob/main/js/src/modules/AutoHealth.js): `js/src/modules/AutoHealth.js`
- [Auto spectate](https://github.com/kramerforster/nion-tools/blob/main/js/src/modules/AutoSP.js): `js/src/modules/AutoSP.js`
- [Copy tools](https://github.com/kramerforster/nion-tools/blob/main/js/src/modules/Copy.js): `js/src/modules/Copy.js`
- [Spectate interface](https://github.com/kramerforster/nion-tools/blob/main/js/src/modules/InterfaceSP.js): `js/src/modules/InterfaceSP.js`
- [Player list](https://github.com/kramerforster/nion-tools/blob/main/js/src/modules/Players.js): `js/src/modules/Players.js`
- [Report handling](https://github.com/kramerforster/nion-tools/blob/main/js/src/modules/Report.js): `js/src/modules/Report.js`
- [Spectate teleport](https://github.com/kramerforster/nion-tools/blob/main/js/src/modules/SpecTP.js): `js/src/modules/SpecTP.js`
- [Teleport tools](https://github.com/kramerforster/nion-tools/blob/main/js/src/modules/Tp.js): `js/src/modules/Tp.js`
- [Player filters](https://github.com/kramerforster/nion-tools/blob/main/js/src/modules/filtersTab.js): `js/src/modules/filtersTab.js`
- [Chat helpers](https://github.com/kramerforster/nion-tools/blob/main/js/src/modules/functions.js): `js/src/modules/functions.js`

### Game integration

- [SA-MP bindings](https://github.com/kramerforster/nion-tools/blob/main/asi/src/sampapi_min.h): `asi/src/sampapi_min.h`
- [Native entry](https://github.com/kramerforster/nion-tools/blob/main/asi/src/dllmain.cpp): `asi/src/dllmain.cpp`

### Other components

- **Game user**
- **Nion API**

## Connections

- Game user → Startup gate: starts client
- Startup gate → Interface manager: initializes (evidence: `js/src/main.js`)
- Startup gate → Loader and auth: starts loading (evidence: `js/src/main.js`)
- Loader and auth → Interface manager: registers listeners (evidence: `js/src/core/Loader.js`)
- Loader and auth → API client: authenticates through (evidence: `js/src/core/Loader.js`)
- Loader and auth → Module registry: loads modules (evidence: `js/src/core/Loader.js`)
- API client → Nion API: sends requests (evidence: `js/src/services/ApiService.js`)
- Loader and auth → Shared state: updates (evidence: `js/src/core/Loader.js`)
- API client → Shared state: reads hosts (evidence: `js/src/services/ApiService.js`)
- Module registry → Command tools: registers (evidence: `js/src/modules/index.js`)
- Module registry → Admin list: registers (evidence: `js/src/modules/index.js`)
- Module registry → Auto health: registers (evidence: `js/src/modules/index.js`)
- Module registry → Auto spectate: registers (evidence: `js/src/modules/index.js`)
- Module registry → Copy tools: registers (evidence: `js/src/modules/index.js`)
- Module registry → Spectate interface: registers (evidence: `js/src/modules/index.js`)
- Module registry → Player list: registers (evidence: `js/src/modules/index.js`)
- Module registry → Report handling: registers (evidence: `js/src/modules/index.js`)
- Module registry → Spectate teleport: registers (evidence: `js/src/modules/index.js`)
- Module registry → Teleport tools: registers (evidence: `js/src/modules/index.js`)
- Module registry → Player filters: registers (evidence: `js/src/modules/index.js`)
- Command tools → Interface manager: uses interface (evidence: `js/src/modules/Cmds.js`)
- Command tools → API client: posts settings (evidence: `js/src/modules/Cmds.js`)
- Command tools → Report handling: uses report (evidence: `js/src/modules/Cmds.js`)
- Command tools → Chat helpers: uses helpers (evidence: `js/src/modules/Cmds.js`)
- Player filters → Interface manager: uses interface (evidence: `js/src/modules/filtersTab.js`)
- Report handling → Interface manager: registers chat hook (evidence: `js/src/modules/Report.js`)
- Chat helpers → Interface manager: registers dialog hooks (evidence: `js/src/modules/functions.js`)
- Native entry → SA-MP bindings: uses bindings (evidence: `asi/src/dllmain.cpp`)
