> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rktscripts.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Complete guide to install RKT Skins on your server

## Requirements

Before installing, make sure you have the following resources:

<CardGroup cols={2}>
  <Card title="ox_lib" icon="box" href="https://github.com/overextended/ox_lib">
    Interface and utilities
  </Card>

  <Card title="oxmysql" icon="database" href="https://github.com/overextended/oxmysql">
    Database connection
  </Card>
</CardGroup>

<Note>
  You will also need an account on [Fivemerr](https://fivemerr.com) or [Fivemanage](https://fivemanage.com) for image hosting.
</Note>

## Step 1: Download and Extract

Download the latest version and extract the `rkt_skins` folder to your server's `resources` directory.

```
resources/
├── [standalone]/
├── [core]/
└── rkt_skins/        <-- Extract here
    ├── bridge/
    ├── modules/
    ├── web/
    └── ...
```

## Step 2: Framework Configuration

Open the `bridge/config.lua` file and set your framework:

<CodeGroup>
  ```lua QBCore theme={null}
  BridgeConfig.Framework = "qbcore"
  ```

  ```lua Qbox theme={null}
  BridgeConfig.Framework = "qbx"
  ```

  ```lua Custom theme={null}
  BridgeConfig.Framework = "custom"
  ```
</CodeGroup>

## Step 3: Database

Execute the `database.sql` file in your database to create the necessary tables.

<Tabs>
  <Tab title="HeidiSQL">
    1. Connect to your database
    2. Open the `database.sql` file
    3. Click **Execute**
  </Tab>

  <Tab title="phpMyAdmin">
    1. Access your phpMyAdmin
    2. Select the server database
    3. Go to **Import** and select the `database.sql` file
  </Tab>
</Tabs>

<Info>
  If you use the **Admin Panel** to create skins, the tables will be populated automatically.
</Info>

### Table Structure

| Table                 | Description                   |
| --------------------- | ----------------------------- |
| `rkt_skins`           | Player skins                  |
| `rkt_skins_config`    | Available skins configuration |
| `rkt_market_listings` | Marketplace listings          |
| `rkt_market_offers`   | Listing offers                |
| `rkt_transactions`    | Transaction history           |
| `rkt_daily_shop`      | Daily Shop offers             |
| `rkt_night_market`    | Night Market offers           |

## Step 4: Server Configuration

Add to your `server.cfg`:

```cfg theme={null}
# Dependencies
ensure ox_lib
ensure oxmysql

# RKT Skins
ensure rkt_skins
```

<Warning>
  Make sure `ox_lib` and `oxmysql` are **before** `rkt_skins` in the file.
</Warning>

## Update (Migration)

If you're updating from a previous version, check the `.sql` migration files in the root folder (e.g., `migration_add_daily_shop.sql`) and execute them if necessary to create new tables without losing data.

## Step 5: Configure Image API

Configure the image provider API in `modules/screenshot/config.lua`:

<CodeGroup>
  ```lua Fivemerr theme={null}
  ScreenshotConfig.Provider = 'fivemerr'
  ScreenshotConfig.Fivemerr = {
      Token = "YOUR_API_KEY_HERE"
  }
  ```

  ```lua Fivemanage theme={null}
  ScreenshotConfig.Provider = 'fivemanage'
  ScreenshotConfig.Fivemanage = {
      Token = "YOUR_TOKEN_HERE"
  }
  ```
</CodeGroup>

## Verification

After starting the server, check the console to confirm:

```
[Bridge] QBCore detected and loaded
[Bridge Client] QBCore detected and loaded
```

<Check>
  If you see these messages, the resource was installed successfully!
</Check>
