Files
redl-gamepanel/README.md
T
Claude Opus 5andClaude Opus 5 71856b15e9 The server itself: repo now mirrors the machine it runs on, plus install.sh
The repository carried two different servers side by side - the early
`justrp` prototype with its Python auth API, and a snapshot of the real
one under `server-code/`. Only the second one is a server anyone should
start from, so the prototype is gone and the real one moved to the root.

Taken from the live box, so the UI is the finished version (the tokens,
the county-records sheets and the variable fonts landed after the last
snapshot was pushed):

  resources/[rp]/   rp_db, rp_core, rp_session, rp_loading, rp_ui,
                    rp_selftest, rp_dbtest
  bin/              supervise.sh (keep-alive + console FIFO), rcon, init script
  etc/schema.sql    accounts, characters, transactions, inventory, vehicles
  assets/fonts/     the bundled subsets
  docs/SERVER.md    how it is put together, resource by resource

install.sh turns a clean Ubuntu/Debian box into this server in one
command: recommended FXServer build, MariaDB with the schema, resources,
server.cfg + a generated database password, boot entry (systemd or
init.d), then it waits for the Cfx registration. --name/--port/--db-name
let a second server live on the same machine. Tested end to end on a
spare install root: build 25770 fetched, schema applied, boot entry
written, FXServer started and stopped exactly where a wrong licence key
should stop it.

No secrets travel with it: the licence key and the database password live
in data/secrets.cfg on the machine, and .gitignore now names it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-12 23:23:33 +00:00

12 KiB
Raw Blame History

redl-fivem-rp

An open-source FiveM roleplay base written completely from scratch — no ESX, no QBCore, no scripts downloaded from a forum. Every line here was written by an AI agent on a live server, on camera, and it is free for anyone to take and build on.

🇷🇺 Русская версия — ниже / Russian version below.

This repository is the server itself, exactly as it runs: the resources, the schema, the supervisor, the config. sh install.sh puts it on a clean Ubuntu box.

Why another base?

Most FiveM projects start by dropping in a 200 MB framework, of which you use maybe 5%. You inherit somebody else's bugs, somebody else's dependencies, and you end up with the same server as a thousand other people — and you're afraid to touch any of it, because you don't know what breaks.

This is the opposite. It's small, it's readable, and it only contains what was actually asked for. If you don't understand a file, you can ask for it to be rewritten.

What's in it

  • Own MySQL driver (rp_db) — the wire protocol spoken directly over a TCP socket: handshake, mysql_native_password, text result sets, a connection pool, transactions. No npm packages, no third-party database resource.
  • Accounts and characters (rp_core, rp_session): registration, login, scrypt password hashing, the connection gate (bans, capacity), character creation and spawn. Every decision is made server-side; the client can only ask.
  • NUI screens with real design work (rp_ui, rp_loading), not a template: a loading screen with a procedural night-city flyover and synthesised ambience, sign-in / register with live validation, character creation with an orbiting camera and a live ped, and a spawn picker.
  • A self-test (rp_selftest) that proves the account/character data path survived the last restart, and a driver test suite (rp_dbtest).
  • cfx-server-data is not used at all — the player cap, chat, spawning and session handling are ours.

Screens

The whole UI follows one theme the agent picked itself — Los Santos County records: your login is a residency file, character creation is an identity-record intake, spawn selection is a county survey map.

Auth — RESIDENT INTAKE Character — identity record Spawn — county survey grid
Auth Character Spawn

Install

Ubuntu 22.04 / 24.04 (or Debian 12), 4 vCPU / 8 GB RAM recommended, and a free server key from keymaster.fivem.net.

git clone https://github.com/RedlHosting/redl-fivem-rp.git
cd redl-fivem-rp
sudo sh install.sh --licence cfxk_your_key_here

The installer fetches the recommended FXServer build, installs MariaDB and applies the schema, copies the resources into /opt/fivem, writes server.cfg and a secrets.cfg with a generated database password, sets the server to start on boot, and waits until it has registered with Cfx. Then connect to <your ip>:30120.

Useful options: --dir, --hostname, --port, --name (run several servers on one box), --db-name, --db-user, --no-start. Run sh install.sh --help for the list.

Day to day:

service fivem start|stop|restart|status     # systemd boxes: systemctl ...
rcon status                                 # send a command to the live console
tail -f /opt/fivem/logs/server.log

Layout

resources/[rp]/     the server: rp_db, rp_core, rp_session, rp_loading, rp_ui, rp_selftest, rp_dbtest
etc/schema.sql      database schema (accounts, characters, transactions, inventory, vehicles)
bin/                supervise.sh (keep-alive + console FIFO), rcon, the init script
assets/fonts/       the bundled font subsets — a NUI page has no guaranteed internet
server.cfg.example  main config
etc/secrets.cfg.example
docs/SERVER.md      how it is put together, resource by resource

docs/SERVER.md is the design document: what each resource does, why the interface looks the way it does, how the database is protected.

What's not built yet

The pre-spawn experience and the framework underneath it are done. Gameplay on top of it — chat, HUD, inventory, jobs, vehicles, policing, medical — is not. characters, transactions, inventory and vehicles already have their tables, and the money API in rp_core/server/player.lua is journalled and ready.

  • Part 1 — the foundation: database, registration, login, character creation ← we are here
  • Part 2 — money, jobs, the bank
  • Part 3 — inventory and phone
  • Part 4 — garages and vehicles
  • Part 5 — an admin panel and the project website on the same machine

Issues and pull requests are welcome — this is meant to be used, not admired.

How it was made

Everything is built on a REDL VDS, where an AI agent lives on the server itself with root access. The task is given in plain words, the agent writes the code, fixes its own mistakes and restarts the service. The whole process is recorded — including the parts where it broke.

Licence

MIT — take it, change it, ship it. Credit is nice but not required.


redl-fivem-rp (RU)

Открытая ролевая база для FiveM, написанная полностью с нуля — без ESX, без QBCore, без скачанных с форума скриптов. Каждая строчка здесь написана ИИ-агентом на живом сервере, в кадре, и выложена бесплатно для всех.

В репозитории лежит сам сервер, ровно в том виде, в каком он работает: ресурсы, схема базы, супервизор, конфиг. sh install.sh ставит его на чистую Ubuntu.

Зачем ещё одна база?

Обычно проект начинается с того, что ставится сборка на 200 мегабайт, из которой реально используется процентов пять. Вместе с ней приезжают чужие баги, чужие зависимости, и в итоге у тебя такой же сервер, как ещё у тысячи человек, — и трогать его страшно, потому что непонятно, что отвалится.

Здесь наоборот. Мало кода, он читаемый, и в нём есть только то, что мы попросили. Не понял файл — попросил переписать.

Что внутри

  • Свой драйвер MySQL (rp_db) — протокол реализован прямо поверх TCP-сокета: рукопожатие, mysql_native_password, разбор результатов, пул соединений, транзакции. Ни одного npm-пакета и ни одного чужого ресурса для базы.
  • Аккаунты и персонажи (rp_core, rp_session): регистрация, вход, хеширование паролей scrypt, шлюз подключения (баны, вместимость), создание персонажа и спавн. Все решения принимает сервер, клиент может только попросить.
  • Экраны NUI с настоящей дизайн-проработкой (rp_ui, rp_loading), а не шаблон: загрузочный экран с процедурным облётом ночного города и синтезированной атмосферой, вход/регистрация с живой валидацией, создание персонажа с облётом камеры и живой моделью, выбор точки спавна.
  • Самотест (rp_selftest), который на каждом запуске доказывает, что данные аккаунтов и персонажей пережили перезапуск, и набор тестов драйвера (rp_dbtest).
  • cfx-server-data не используется вообще — лимит игроков, чат, спавн и сессии свои.

Экраны

Весь интерфейс сделан в одной теме, которую агент выбрал сам, — архив округа Лос-Сантос: вход это дело о проживании, создание персонажа — анкета учёта личности, выбор спавна — топографическая карта округа.

Установка

Ubuntu 22.04 / 24.04 (или Debian 12), рекомендую 4 vCPU / 8 ГБ RAM, и бесплатный ключ сервера с keymaster.fivem.net.

git clone https://github.com/RedlHosting/redl-fivem-rp.git
cd redl-fivem-rp
sudo sh install.sh --licence cfxk_ваш_ключ

Установщик сам скачает рекомендованную сборку FXServer, поставит MariaDB и накатит схему, разложит ресурсы в /opt/fivem, напишет server.cfg и secrets.cfg со сгенерированным паролем базы, поставит сервер в автозапуск и дождётся регистрации в Cfx. Дальше — connect <ваш ip>:30120.

Полезные параметры: --dir, --hostname, --port, --name (несколько серверов на одной машине), --db-name, --db-user, --no-start. Список — sh install.sh --help.

Повседневное:

service fivem start|stop|restart|status     # на машинах с systemd — systemctl ...
rcon status                                 # команда в живую консоль сервера
tail -f /opt/fivem/logs/server.log

Что где лежит

resources/[rp]/     сам сервер: rp_db, rp_core, rp_session, rp_loading, rp_ui, rp_selftest, rp_dbtest
etc/schema.sql      схема базы (accounts, characters, transactions, inventory, vehicles)
bin/                supervise.sh (перезапуск + FIFO консоли), rcon, init-скрипт
assets/fonts/       вшитые подмножества шрифтов — у страницы NUI нет гарантированного интернета
server.cfg.example  основной конфиг
etc/secrets.cfg.example
docs/SERVER.md      как всё устроено, ресурс за ресурсом

Чего ещё нет

Всё до спавна и фундамент под этим — готово. Геймплей сверху — чат, HUD, инвентарь, работы, транспорт, полиция, медицина — нет. Таблицы characters, transactions, inventory, vehicles уже заведены, денежный API в rp_core/server/player.lua журналируемый и готов.

  • Часть 1 — фундамент: база, регистрация, авторизация, создание персонажа ← мы здесь
  • Часть 2 — деньги, работы, банк
  • Часть 3 — инвентарь и телефон
  • Часть 4 — гаражи и транспорт
  • Часть 5 — админка + сайт проекта на этой же машине

Issues и pull request'ы приветствуются — это сделано, чтобы этим пользовались.

Как это сделано

Всё собирается на VDS REDL, где ИИ-агент живёт прямо на сервере с root-доступом. Задача ставится обычными словами, агент пишет код, чинит свои же ошибки и перезапускает сервис. Весь процесс записан — включая те моменты, где всё ломалось.

Лицензия

MIT — берите, меняйте, используйте. Упоминание приятно, но не обязательно.