Features
Fans (fx-fansapp)
The bundled creator subscription app, how it installs into the phone and its main settings.
#What it is
fx-fansapp is a creator and subscription app. Creators post content; other players subscribe, tip and unlock posts. Everything is paid from the in-game bank account.
- Profile and creator mode. The app has its own login with a handle and password, independent of the framework login. A session is kept on the phone for
Config.SessionHours. Avatar, banner, bio and category; one tap to become a creator. - Posts. Free, subscribers only, or pay-per-view. Text with an image or video. Like, comment, bookmark, share, hide.
- Subscriptions. Monthly, plus 3, 6 and 12 month bundles with creator-set discounts. Free trial, promo codes, auto-renew and cancel at any time.
- Tips and pay-per-view. Tip on a post or profile. Locked posts are paid once.
- Direct messages. Free, subscribers-only or paid.
- Ranked feed. Scored on the server; the weights are in
config.lua. - Creator studio. Withdrawable balance, lifetime earnings, a per-credit ledger, subscriber list and pricing.
- Moderation. Staff become moderators when they open the app: delete or hide posts, ban, manage profiles, work the report queue and read the audit log. Each action can be switched off per permission.
- Notifications. An in-app inbox plus phone notifications.
#Requirements
| Resource | Required |
|---|---|
fx-phone |
Yes (the app also installs into lb-phone or cylex_phone) |
oxmysql |
Yes |
qb-core, qbx_core or es_extended |
One of them, detected automatically |
ox_lib |
On Qbox only |
| A banking resource | Optional, for paying the platform commission into a society account |
fx-companyapp |
Optional, mirrors the commission into a company ledger |
#Installation
cfgensure fx-phone
ensure fx-fansapp
The framework, oxmysql and the phone must be ensured before it.
- Database. Nothing to import. On every start the resource creates missing
fans_*tables and columns. The database user needsCREATErights; without them, importsetup/sql/install.sqlby hand. - Password salt. Set
ConfigServer.PasswordSaltinconfig_server.luato your own random string before the first player registers. Changing it later invalidates every stored app password. - Staff. Set who is staff in
ConfigServer.Admin, by framework permission group or by identifier list.
#How it registers into the phone
With Config.Phone.Resource = "auto" the app installs into the running phone. Its FX Phone adapter (client/phone/fxphone.lua) registers it with exports['fx-phone']:AddCustomApp, using Config.AppIdentifier (default fans), Config.AppName, Config.AppDeveloper, Config.DefaultApp and Config.AppPrice.
On the server, notifications go through exports['fx-phone']:SendNotification, and payments are written to the phone's bank history with AddTransaction when Config.Phone.BankHistory = true.
To keep the app from starting at all, set ['fx-fansapp'] = false in Config.BundledApps. See Apps.
#Config highlights
config.lua is downloaded by every client. Do not put secrets in it.
| Setting | Meaning |
|---|---|
Config.AppIdentifier, Config.AppName, Config.DefaultApp, Config.AppPrice |
How the app appears on the phone |
Config.Locale |
tr or en. Missing keys fall back to English |
Config.Framework |
Leave auto unless detection picks the wrong one |
Config.Theme |
Starting theme |
Config.Account, Config.Currency |
Account fans pay from and creators are paid into, and the currency symbol |
Config.PlatformFee |
Platform cut on every credit, 0.00 to 0.50 |
Config.FeeSociety |
nil removes the fee from the economy; a string names a society account |
Config.Banking |
Which banking resource pays the society account |
Config.SessionHours, handle and password length limits, Config.AllowForgotPassword |
Account rules |
Config.Pricing |
The minimum and maximum prices creators must stay inside |
Config.Bundles |
Bundle lengths and discount caps |
Config.MonthDurationDays |
Real days in one subscription month |
Config.AutoRenew, Config.RenewIntervalMinutes |
Auto-renewal and how often the renewer runs |
Config.Media |
Allowed media extensions and limits |
Config.Feed, Config.Affinity |
Feed scoring weights |
Config.Notify |
Which events send a phone notification |
Config.Categories |
Tags a creator can pick |
Config.FeaturedPrice, Config.FeaturedDays, Config.CreatorPrice |
Spotlight and creator fees |
config_server.lua is server only:
| Setting | Purpose |
|---|---|
ConfigServer.PasswordSalt |
Salt for app passwords. Set your own value |
ConfigServer.Admin |
Who is staff (groups, identifiers), ban behaviour (BanBlocksApp, BanScope) and per-action permissions |
ConfigServer.Webhooks |
Discord log channels per category (admin, economy, account, content, report). With no address the system is silent |
#Security model
From the resource's README:
- Money, permissions and prices are decided on the server. An amount, price or target id from the client is never used directly, and every price is clamped to the
Config.Pricingcaps. - Rate limits apply to login, registration, password reset, posting, comments, messages, search and reports.
- Locked media is never sent to a client that should not have it.
- Bans are tied to the player's identity, so a banned player cannot become a creator again from a new account.
#Database tables
fans_profiles, fans_posts, fans_post_likes, fans_bookmarks, fans_post_hides, fans_comments, fans_subs, fans_tips, fans_ppv_unlocks, fans_dms, fans_notifications, fans_earnings, fans_post_seen, fans_affinity, fans_bans, fans_reports, fans_admin_log. No framework table is modified.
#Exports
| Export | Side | Purpose |
|---|---|---|
GetVersionStatus() |
Server | Result of the update check: { state, current, latest, behind } |
The app has no other exports.