# Admin Studio Overview

# Admin Studio Overview

Server-authoritative administration for items, providers, diagnostics and vehicles.

**Applies to:** `Nord Inventory v2.0.0`
# Admin Studio System

Admin Studio is server-authoritative. Hiding a button in NUI is only UX; every mutation is checked again on the server.

## Roles

Default ACE objects:

```cfg
add_ace group.dev nord_inventory.dev allow
add_ace group.admin nord_inventory.admin allow
add_ace group.owner nord_inventory.owner allow
```

Default capability levels:

- **Developer**: view Admin Studio, integrations, health diagnostics and item testing.
- **Admin**: Developer access plus item/category management, imports, vehicle storage, backup creation/deletion and audit log.
- **Owner**: Admin access plus backup restore.

The exact ACE names and optional license-based roles are configured in the server-only `config/admin.lua`.

## Integrations page

Shows resources that register through Nord APIs, including:

- provider resource and display name
- online/offline state
- provider version/author when supplied
- items associated with the provider
- custom action and image counts
- dependency state
- registration failures/conflicts

The **Recommended Scripts** catalog opens in a read-only modal from the Integrations page. It is maintained only by Nord Lab developers in protected server source; no Admin Studio role, command, event or public export can edit its contents. Server owners can only hide/show the read-only button with `Config.Ecosystem.ShowRecommendedScripts` in `config/core.lua`.

Recommendations are curated by **Nord Lab**. Server owners, administrators and developers can never add, edit or remove catalog entries. The only public option is visibility: `Config.Ecosystem.ShowRecommendedScripts = true/false` in `config/core.lua`.

The catalog data lives in the protected server core and is updated by Nord Lab as part of inventory releases.

## System Health

Health Check reports problems such as:

- item image missing from `web/images/items`
- unknown category
- durability item not unique/non-stackable
- malformed external export
- export/provider/dependency offline
- runtime item without a tracked provider
- provider registration conflict
- orphan item action
- invalid/offline action export
- orphan/offline metadata schema provider

The report is diagnostic only; it does not silently rewrite definitions.

## Backups and restore

A backup contains Nord-managed configuration:

- database-authoritative custom item definitions
- disabled reference-item markers
- custom categories
- vehicle storage categories
- vehicle model overrides

Before restore, Nord automatically creates a **pre-restore safety backup**. Runtime items supplied by external resources are not persisted as authoritative database definitions; active providers are reapplied after the registry reload.

Restore is Owner-only by default.

## Audit log

The server records administrative changes such as item/category/vehicle mutations, imports and backup operations. Audit data is only sent to roles with the `audit` permission.

## Migration Center

The import UI supports:

- ox_inventory
- QB/QBCore
- ESX
- Quasar
- CodeM
- Nord JSON

Files are read by the NUI as text/data; imported Lua is not executed by Nord. Always review the conversion preview and warnings before applying a large migration.

Database-authoritative conflicts can be skipped or explicitly overwritten when the user's role allows imports. Reference/source items remain protected from direct source-file rewriting.

## Item Templates

Admin Studio includes templates for common definitions such as food, drink, medical, reusable tool, document, container, durability repair item and external usable item.

Templates are starting points only; review the resulting definition before production use.

## Testing Mode

Authorized developers/admins can select an item and exercise controlled testing flows from System Health. Testing uses the real server-authoritative inventory path, so it is suitable for verifying use handlers, metadata and durability behavior before rollout.

## Source-aware item management

Nord distinguishes the source of each item:

- **Reference (`shared/items.lua` / `shared/weapons.lua`)**: deleting from Admin Studio disables the reference instead of rewriting the Lua file.
- **Reference + DB override**: delete removes the database override and leaves the reference disabled.
- **Database-only**: delete removes the custom database row.
- **Runtime provider item**: protected from Admin Studio deletion; its provider owns unregister/cleanup.

Restoring a disabled reference returns to the original Lua definition.
