Prerequisites
Node.js 18+\ JavaScript runtime (or use Bun as an alternative) Convex Account\ Free tier available - create account first
Download
Clone the repository and navigate to the directory
# Download CFX-DB from GitHub
git clone https://github.com/CFX-Software/cfx-db.git
cd cfx-db
Install Dependencies
Choose your preferred package manager
npm install
Convex Setup
Initialize your Convex deployment and configure environment
# Initialize Convex project
bunx convex dev
# Follow prompts:
# 1. Create new project or use existing
# 2. Choose deployment (dev/prod)
# 3. Copy deployment URL
# Configure your .env file
CONVEX_URL=https://your-deployment.convex.cloud
CONVEX_DEPLOYMENT=dev:your-deployment-name
JWT_SECRET=your-secret-key-here
Build the Resource
Build the FiveM resource before deploying (REQUIRED)
npm run build
Deploy to FiveM
Copy the built resource to your FiveM server
# Copy the ENTIRE cfx-db folder to your resources directory
# For example: [FiveM]/resources/[database]/cfx-db
# Add to your server.cfg
ensure cfx-db
# Start your FiveM server
# CFX-DB will connect to Convex and initialize