# Installation

## System Requirements

| Requirement  | Minimum                    |
| ------------ | -------------------------- |
| FiveM Server | Latest artifacts           |
| Database     | MySQL 5.7+ / MariaDB 10.3+ |
| oxmysql      | v2.0+                      |

## Step-by-Step Installation

### 1. Download NOVA Core

```bash
# Clone from GitHub
git clone https://github.com/Buddhapt/nova-framework.git nova_core
```

Or download the ZIP from [Releases](https://github.com/Buddhapt/nova-framework/releases).

### 2. Database Setup

Import the SQL schema included with nova\_core:

```sql
-- File: nova_core/sql/nova.sql
-- Creates all required framework tables
```

You can import via command line:

```bash
mysql -u your_user -p your_database < nova_core/sql/nova.sql
```

Or via phpMyAdmin/HeidiSQL by importing the file.

### 3. Resource Structure

Place the resources in your server folder:

```
server-data/
├── resources/
│   ├── [nova]/
│   │   ├── nova_core/           # Required - The core framework
│   │   ├── nova_bridge/         # Optional - Compatibility with other frameworks
│   │   ├── nova_bank/           # Banking system
│   │   ├── nova_garage/         # Garage system
│   │   ├── nova_inventory/      # Inventory system
│   │   ├── nova_multichar/      # Character selection
│   │   ├── nova_hud/            # Player HUD
│   │   ├── nova_chat/           # Chat system
│   │   ├── nova_notify/         # Notifications
│   │   └── nova_shops/          # Shops (clothing, barber, tattoo)
│   ├── [dependencies]/
│   │   └── oxmysql/
```

### 4. Server Configuration

Add to your `server.cfg`:

```cfg
# Database connection
set mysql_connection_string "mysql://user:password@localhost/nova_db?charset=utf8mb4"

# Ensure dependencies first
ensure oxmysql

# NOVA Core - ALWAYS first
ensure nova_core

# Bridge (if using ESX/QB scripts)
ensure nova_bridge

# Launch scripts
ensure nova_notify
ensure nova_bank
ensure nova_garage
ensure nova_inventory
ensure nova_multichar
ensure nova_hud
ensure nova_chat
ensure nova_shops
```

::: warning IMPORTANT `nova_core` must ALWAYS be ensured before any other NOVA script. The core initializes the framework and all other scripts depend on it. :::

### 5. Verify Installation

Start your server and check the console for:

```
[NOVA] Framework v1.0 initialized
[NOVA] Modules loaded: commands, jobs, permissions, vehiclekeys
[NOVA] Locale set to: pt
```

## Installing nova\_bridge (Optional)

The bridge allows you to use existing ESX/QBCore/vRPex/Creative scripts:

```bash
git clone https://github.com/Buddhapt/nova-bridge.git nova_bridge
```

Edit `nova_bridge/config.lua` to set your compatibility mode:

```lua
Config = {}
Config.Framework = 'esx'  -- 'esx', 'qb', 'vrpex', or 'creative'
```

## Troubleshooting

### "oxmysql not found"

Ensure oxmysql is started before nova\_core in your server.cfg.

### "Table doesn't exist"

Make sure you imported `nova_core/sql/nova.sql` into your database.

### Scripts not loading

Check that nova\_core is ensured before all other nova scripts.
