Database Schema¶
The Preads Platform utilizes a highly relational and performance-optimized schema designed to handle high-concurrency traffic and complex monetization workflows. The system is built on MySQL 8.0+ and follows Laravel's Eloquent naming conventions.
🏗️ Core Architecture (ERD)¶
The following diagram illustrates the primary relationship between the Platform, the Publishers, and the Monetization assets.
erDiagram
ADMIN ||--o{ SETTINGS : manages
PUBLISHER ||--o{ PUBLISHER_APP : owns
PUBLISHER_APP ||--o{ OFFERS : displays
PUBLISHER_APP ||--o{ CLICKS : generates
CLICKS ||--o{ CONVERSIONS : leads_to
OFFERS ||--o{ CONVERSIONS : results_in
CONVERSIONS ||--o{ TRANSACTIONS : creates
📑 Core Tables Reference¶
Identity & Authentication¶
| Table | Description | Key Columns |
|---|---|---|
admins |
Platform administrators. | email, password, role |
publishers |
Network partners (Affiliates). | email, balance, status |
login_logs |
Security auditing for all users. | ip_address, user_agent |
Network & Inventory¶
| Table | Description | Relationships |
|---|---|---|
publisher_apps |
Containers for offerwalls/tools. | belongsTo: publisher |
offers |
Monetization inventory. | belongsTo: external_networks |
external_networks |
3rd party API/Postback sources. | hasMany: offers |
Tracking & Finances¶
| Table | Description | Key Columns |
|---|---|---|
clicks |
Raw traffic redirection data. | click_id, sub_id, ip_address |
conversions |
Verified earnings from postbacks. | payout, status, txid |
transactions |
Ledger entries for all balance changes. | amount, type (credit/debit) |
withdrawals |
Payout requests from publishers. | amount, payment_method_id |
🧩 Addon Modules (Modular Schema)¶
Addons extend the core database with specialized tables. This modular approach ensures that core migrations remain clean.
Content & Link Lockers¶
content_lockers: Configuration for file/page lockers.link_lockers: Configuration for short-link monetization.locker_sessions: Tracks user progress through multi-step lockers.
Ad Systems (CPC/CPV)¶
cpc_campaigns: Pay-per-click advertiser inventory.cpv_campaigns: Pay-per-view (Video) advertiser inventory.cpv_views: Verified playback logs for video campaigns.
🛡️ Infrastructure & Security¶
Anti-Cheat Assets¶
ip_intelligence: Cached reputation data for IPs (Proxy, VPN, Fraud Score).device_fingerprints: Unique identifiers for cross-account detection.fraud_scores: Real-time analysis results for suspicious traffic.
System Configuration¶
settings: Key-value pairs for global platform state.settings_history: Audit trail of configuration changes.email_templates: Blade-based templates with variable injection.
📏 Database Conventions¶
- Primary Keys: All tables use auto-incrementing
idorbigint. - Foreign Keys: Follow the
{table_singular}_idconvention (e.g.,publisher_id). - Booleans: Stored as
tinyint(1)(0/1). - JSON Fields: Used for unstructured data like
fingerprint_dataoremail_variables. - Dates: All tables include standard Laravel
created_atandupdated_attimestamps.