# Installation

This guide uses the distribution package with the interface already compiled. You do not need Node.js or to rebuild the UI to install it.

## Requirements

| Component | When you need it |
| --- | --- |
| `oxmysql` and an operational database connection | Required to save the resource data. |
| Qbox, QBCore, or ESX | If you use its economy and permissions. You can connect another economy through standalone callbacks. |
| Tattoo packs | Optional. You can install none, some, or all of them. |
| `ox_lib` | Optional for the TextUI prompt; a native alternative is available. |
| Appearance system | If your server uses one, review the [appearance bridge](https://docs.cxgstudios.com/docs/en/01-cxg-tattoos/05-integraciones.md#appearance-and-character-loading). |

Blueprints are shared through codes. You do not need to add an inventory item to use the included configuration.

## Place the resource

1. Extract the package into a resource folder on your server.
2. These guides use `cxg-tattoos` as the folder name. If your folder has a different name, use its actual name in `ensure` and `restart` commands.
3. Keep the supplied structure. Check that `config.lua`, `shared/tattoos.json`, `bridge/`, and `ui/dist/index.html` are present along with the package files.
4. Configure your database connection and make sure `oxmysql` starts correctly.

## Startup order

Example with Qbox and no external packs:

```cfg
ensure oxmysql
ensure qbx_core
ensure cxg-tattoos
```

With QBCore or ESX, replace `qbx_core` with `qb-core` or `es_extended`. Start your appearance system before the resource if you use one. For standalone, first configure the [payment and permission callbacks](https://docs.cxgstudios.com/docs/en/01-cxg-tattoos/05-integraciones.md).

If you have packs, start only the installed ones before the resource. For example:

```cfg
ensure oxmysql
ensure qbx_core
ensure xgc_TattooClasic
ensure xgc_TattooGangs
ensure cxg-tattoos
```

Do not add `ensure` lines for packs you do not have. Default sources can remain in `Config.TattooCatalog.sources`: packs that are not started are skipped.

## First startup

The resource automatically prepares its storage. You do not need to manually import a schema for a new installation.

Before testing, review these settings in `config.lua`:

- `Config.Locale`: global language.
- `Config.Purchases`: economy and payment accounts.
- `Config.Permissions`: administrative access.
- `Config.Identity`: the server's identity system and the identifier used to save and retrieve player data. See [Identity system](https://docs.cxgstudios.com/docs/en/01-cxg-tattoos/03-configuracion.md#identity-system).
- `Config.Shops`: initial shop locations.

Go to a configured shop and use its interaction. Check the catalog, a preview, and a purchase with a test character. Reload the character to confirm the tattoo is retained.

The included administrative command is configured in `Config.AdminCommand`; its initial name is `/tattooadmin`. Review [permissions and payments](https://docs.cxgstudios.com/docs/en/01-cxg-tattoos/05-integraciones.md) before using it.

## Apply changes

After modifying `config.lua` or a bridge, save the file and restart the resource:

```cfg
restart cxg-tattoos
```

Catalog sources are read again at startup and can be synchronized from the admin panel. Settings saved through that panel are retained; review [configuration](https://docs.cxgstudios.com/docs/en/01-cxg-tattoos/03-configuracion.md) and the [catalog](https://docs.cxgstudios.com/docs/en/01-cxg-tattoos/04-catalogo.md) before expecting a file value to replace them.

## Common issues

| Symptom | What to check |
| --- | --- |
| The resource does not start | That `oxmysql` is started, the connection works, and the package is complete. |
| A pack is missing from the shop | That its resource is started, `enabled` is not `false`, and the JSON path matches the pack. |
| The interface appears empty | That `ui/dist/index.html` and the referenced files in `ui/dist/assets/` were copied together. |
| The panel denies access | `Config.AdminCommand.permission`, permission bindings, and configured roles or ACE. |
| Payment is rejected | The selected framework, resource names, balance, and standalone callbacks, if applicable. |
| There are two tattoo interactions in the same place | Check whether another appearance or shop resource also has that location active. Keep a single access point for the shop you want to use. |
| A shop or level change does not apply | Check whether a setting has already been saved through the panel. Edit the effective value there. |

You can temporarily enable `Config.Debug` and `Config.Permissions.debug` to diagnose issues. Disable them when finished.

[Continue to configuration](https://docs.cxgstudios.com/docs/en/01-cxg-tattoos/03-configuracion.md).
