Skip to content

AKhancoder/onlyfans-clone-laravel-flutter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MoonFansPro Logo

MoonFansPro β€” Creator Monetization Platform

A full-featured OnlyFans clone Β· Content subscriptions Β· PPV messaging Β· Live tipping Β· Shop Β· PWA

Live Demo [PHP [Laravel [MySQL [Bootstrap [AWS [Stripe


πŸ“‹ Table of Contents


🌟 Overview

MoonFansPro is a production-ready, white-label creator monetization platform β€” a fully functional OnlyFans-style clone built on the Laravel + MySQL stack. It allows content creators to monetize their work through subscriptions, pay-per-view posts, tips, and a digital shop, while giving fans an immersive browsing and messaging experience.

It ships as a Progressive Web App (PWA), supports multi-language (English, Spanish, Persian), and integrates with Stripe for payment processing and AWS S3 for scalable media storage.

🎯 Perfect for launching your own creator economy platform β€” fully customizable, self-hosted, and white-label ready.


πŸ”— Live Demo

URL Description
moonfanspro.goodcoderz.com Full live platform demo
/creators Browse creator profiles
/shop Digital product shop
/signup Register as a creator or fan

✨ Features

πŸ‘€ Creator Features

  • Creator profiles with custom bios, cover images, and avatar
  • Subscription tiers β€” set a monthly subscription price or offer free access
  • Post types β€” photos, videos, text posts, and audio
  • Pay-Per-View (PPV) β€” lock individual posts behind a one-time payment
  • Stories β€” ephemeral content visible to subscribers
  • Digital Shop β€” sell physical or digital products directly from your profile
  • Live earnings dashboard β€” real-time revenue tracking and payout management
  • Earnings simulator β€” estimate monthly income based on follower count and subscription price
  • Referral system β€” earn commissions by referring new creators

πŸ’¬ Fan Features

  • Subscription management β€” subscribe/unsubscribe from creators
  • Direct messaging β€” chat with creators including PPV message unlocks
  • Tipping β€” send tips to creators on posts and in messages
  • Bookmarks & likes β€” save and interact with content
  • Discovery β€” browse creators by category (Animation, Art, Design, Developer, and more)
  • Two-factor authentication (2FA) β€” email-based OTP on login

βš™οΈ Platform / Admin Features

  • Admin dashboard β€” manage users, creators, payouts, and reported content
  • Platform fee β€” configurable percentage cut (default 5%) on all transactions
  • Multi-language support β€” English, EspaΓ±ol, Persian (RTL ready)
  • Blog system β€” built-in CMS for platform news and articles
  • Static pages β€” Terms, Privacy, About, How It Works, Cookies Policy
  • Cookie consent β€” GDPR-compliant cookie banner
  • PWA β€” installable web app with offline caching
  • SEO-ready β€” clean URLs, meta tags, sitemap support

πŸ› οΈ Tech Stack

Layer Technology Purpose
Backend PHP 8.x Core language
Framework Laravel 10.x MVC framework, routing, ORM, queues
Database MySQL 8.0 Relational data store
ORM Eloquent (Laravel) Model relationships, migrations
Frontend Bootstrap 5.x Responsive UI grid and components
JS Layer jQuery 3.x DOM manipulation, AJAX calls
Templating Blade (Laravel) Server-side view rendering
Payments Stripe (Checkout + Connect) Subscriptions, PPV, tips, payouts
Media Storage AWS S3 Scalable image and video storage
Auth Laravel Breeze / Sanctum Session auth, 2FA via email OTP
Queue / Jobs Laravel Queues Async notifications, email dispatch
PWA Web App Manifest + Service Worker Installable mobile-first experience
Email SMTP / Mailgun Transactional email delivery
Server Nginx / Apache Web server
OS Ubuntu 22.04 LTS Recommended deployment OS

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        Client Layer                          β”‚
β”‚         Browser / PWA  ←→  Bootstrap 5 + jQuery 3          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚ HTTP / HTTPS
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Web Server (Nginx)                        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Laravel Application (PHP 8.x)                   β”‚
β”‚                                                             β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  Routes   β”‚  β”‚Controllersβ”‚  β”‚  Models  β”‚  β”‚   Blade   β”‚  β”‚
β”‚  β”‚ web.php   β”‚β†’ β”‚ Creator  β”‚β†’ β”‚Eloquent  β”‚  β”‚  Views    β”‚  β”‚
β”‚  β”‚ api.php   β”‚  β”‚ Post     β”‚  β”‚ ORM      β”‚  β”‚Templates  β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚ Payment  β”‚  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                β”‚ Auth     β”‚       β”‚                         β”‚
β”‚                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β”‚                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                    β”‚
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚                         β”‚                       β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”
β”‚   MySQL 8.0    β”‚       β”‚    AWS S3        β”‚    β”‚  Stripe API      β”‚
β”‚  Relational DB β”‚       β”‚  Media Storage   β”‚    β”‚  Payments &      β”‚
β”‚  (Users, Posts β”‚       β”‚  (Images, Videos β”‚    β”‚  Connect Payouts β”‚
β”‚  Subs, Orders) β”‚       β”‚   Audio files)   β”‚    β”‚                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“ Project Structure

moonfanspro/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ Http/
β”‚   β”‚   β”œβ”€β”€ Controllers/
β”‚   β”‚   β”‚   β”œβ”€β”€ Auth/                   # Login, register, 2FA, password reset
β”‚   β”‚   β”‚   β”œβ”€β”€ CreatorController.php   # Creator profile, settings, earnings
β”‚   β”‚   β”‚   β”œβ”€β”€ PostController.php      # Post CRUD, PPV locking, media upload
β”‚   β”‚   β”‚   β”œβ”€β”€ SubscriptionController.php # Subscribe/unsubscribe, billing
β”‚   β”‚   β”‚   β”œβ”€β”€ MessageController.php   # DM threads, PPV message unlock
β”‚   β”‚   β”‚   β”œβ”€β”€ PaymentController.php   # Stripe webhooks, tip processing
β”‚   β”‚   β”‚   β”œβ”€β”€ ShopController.php      # Product listings, orders
β”‚   β”‚   β”‚   β”œβ”€β”€ AdminController.php     # Admin panel, user management
β”‚   β”‚   β”‚   └── PageController.php      # Static pages, blog
β”‚   β”‚   └── Middleware/
β”‚   β”‚       β”œβ”€β”€ CreatorMiddleware.php   # Restrict routes to creators
β”‚   β”‚       └── AdminMiddleware.php     # Restrict routes to admins
β”‚   β”œβ”€β”€ Models/
β”‚   β”‚   β”œβ”€β”€ User.php                    # Users (fans & creators)
β”‚   β”‚   β”œβ”€β”€ Post.php                    # Posts (photo/video/text/audio)
β”‚   β”‚   β”œβ”€β”€ Subscription.php            # Fan β†’ Creator subscriptions
β”‚   β”‚   β”œβ”€β”€ Message.php                 # DM messages
β”‚   β”‚   β”œβ”€β”€ Tip.php                     # Tips on posts and in DMs
β”‚   β”‚   β”œβ”€β”€ Order.php                   # Shop orders
β”‚   β”‚   β”œβ”€β”€ Product.php                 # Shop products
β”‚   β”‚   β”œβ”€β”€ Story.php                   # 24h ephemeral stories
β”‚   β”‚   β”œβ”€β”€ Payout.php                  # Creator payout records
β”‚   β”‚   └── Bookmark.php                # Fan bookmarks
β”‚   └── Services/
β”‚       β”œβ”€β”€ StripeService.php           # Stripe API abstraction
β”‚       β”œβ”€β”€ MediaService.php            # S3 upload/delete helpers
β”‚       └── EarningsService.php         # Revenue calculation logic
β”‚
β”œβ”€β”€ database/
β”‚   β”œβ”€β”€ migrations/                     # All table migrations
β”‚   └── seeders/                        # Demo data seeders
β”‚
β”œβ”€β”€ resources/
β”‚   β”œβ”€β”€ views/
β”‚   β”‚   β”œβ”€β”€ layouts/                    # app.blade.php, admin.blade.php
β”‚   β”‚   β”œβ”€β”€ auth/                       # Login, register, 2FA views
β”‚   β”‚   β”œβ”€β”€ creator/                    # Profile, dashboard, settings
β”‚   β”‚   β”œβ”€β”€ post/                       # Feed, single post, create post
β”‚   β”‚   β”œβ”€β”€ messages/                   # DM inbox and thread views
β”‚   β”‚   β”œβ”€β”€ shop/                       # Product list and checkout
β”‚   β”‚   β”œβ”€β”€ admin/                      # Admin panel views
β”‚   β”‚   └── pages/                      # Terms, Privacy, Blog, etc.
β”‚   β”œβ”€β”€ lang/
β”‚   β”‚   β”œβ”€β”€ en/                         # English strings
β”‚   β”‚   β”œβ”€β”€ es/                         # Spanish strings
β”‚   β”‚   └── pe/                         # Persian strings (RTL)
β”‚   └── js/
β”‚       β”œβ”€β”€ app.js                      # Main JS entrypoint
β”‚       └── service-worker.js           # PWA offline caching
β”‚
β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ img/                            # Logo, home illustrations
β”‚   β”œβ”€β”€ uploads/                        # Local upload fallback
β”‚   β”œβ”€β”€ manifest.json                   # PWA manifest
β”‚   └── index.php
β”‚
β”œβ”€β”€ routes/
β”‚   β”œβ”€β”€ web.php                         # Web routes (authenticated + public)
β”‚   └── api.php                         # API routes (future mobile app)
β”‚
β”œβ”€β”€ config/
β”‚   β”œβ”€β”€ filesystems.php                 # S3 disk configuration
β”‚   β”œβ”€β”€ services.php                    # Stripe keys configuration
β”‚   └── app.php                         # App locale, timezone
β”‚
β”œβ”€β”€ .env.example                        # Environment variable template
β”œβ”€β”€ composer.json
β”œβ”€β”€ package.json
└── README.md

πŸ—„οΈ Database Schema

Core Tables

-- Users table (fans and creators share this table)
CREATE TABLE users (
  id            BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  name          VARCHAR(255)        NOT NULL,
  username      VARCHAR(100) UNIQUE NOT NULL,
  email         VARCHAR(255) UNIQUE NOT NULL,
  password      VARCHAR(255)        NOT NULL,
  role          ENUM('user','creator','admin') DEFAULT 'user',
  bio           TEXT,
  avatar        VARCHAR(500),
  cover_image   VARCHAR(500),
  subscription_price DECIMAL(8,2)  DEFAULT 0.00,
  is_verified   BOOLEAN            DEFAULT FALSE,
  two_fa_enabled BOOLEAN           DEFAULT FALSE,
  stripe_account_id VARCHAR(255),
  created_at    TIMESTAMP,
  updated_at    TIMESTAMP
);
 
-- Posts table
CREATE TABLE posts (
  id            BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  user_id       BIGINT UNSIGNED     NOT NULL REFERENCES users(id),
  type          ENUM('photo','video','text','audio') NOT NULL,
  body          TEXT,
  media_url     VARCHAR(500),
  is_ppv        BOOLEAN            DEFAULT FALSE,
  ppv_price     DECIMAL(8,2)       DEFAULT 0.00,
  likes_count   INT                DEFAULT 0,
  created_at    TIMESTAMP,
  updated_at    TIMESTAMP
);
 
-- Subscriptions table
CREATE TABLE subscriptions (
  id            BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  fan_id        BIGINT UNSIGNED     NOT NULL REFERENCES users(id),
  creator_id    BIGINT UNSIGNED     NOT NULL REFERENCES users(id),
  stripe_sub_id VARCHAR(255),
  status        ENUM('active','cancelled','past_due') DEFAULT 'active',
  current_period_end TIMESTAMP,
  created_at    TIMESTAMP,
  updated_at    TIMESTAMP
);
 
-- Messages table
CREATE TABLE messages (
  id            BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  sender_id     BIGINT UNSIGNED     NOT NULL REFERENCES users(id),
  receiver_id   BIGINT UNSIGNED     NOT NULL REFERENCES users(id),
  body          TEXT,
  media_url     VARCHAR(500),
  is_ppv        BOOLEAN            DEFAULT FALSE,
  ppv_price     DECIMAL(8,2)       DEFAULT 0.00,
  is_read       BOOLEAN            DEFAULT FALSE,
  created_at    TIMESTAMP
);
 
-- Tips table
CREATE TABLE tips (
  id            BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  fan_id        BIGINT UNSIGNED     NOT NULL REFERENCES users(id),
  creator_id    BIGINT UNSIGNED     NOT NULL REFERENCES users(id),
  post_id       BIGINT UNSIGNED     REFERENCES posts(id),
  message_id    BIGINT UNSIGNED     REFERENCES messages(id),
  amount        DECIMAL(8,2)        NOT NULL,
  stripe_charge_id VARCHAR(255),
  created_at    TIMESTAMP
);
 
-- Products (Shop) table
CREATE TABLE products (
  id            BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  creator_id    BIGINT UNSIGNED     NOT NULL REFERENCES users(id),
  name          VARCHAR(255)        NOT NULL,
  description   TEXT,
  price         DECIMAL(8,2)        NOT NULL,
  media_url     VARCHAR(500),
  stock         INT                DEFAULT NULL,
  created_at    TIMESTAMP,
  updated_at    TIMESTAMP
);

πŸš€ Installation

Prerequisites

  • PHP >= 8.1
  • Composer
  • Node.js >= 18 & npm
  • MySQL 8.0
  • An AWS account (S3 bucket)
  • A Stripe account

Steps

# 1. Clone the repository
git clone https://github.com/your-username/moonfanspro.git
cd moonfanspro
 
# 2. Install PHP dependencies
composer install
 
# 3. Install JS dependencies
npm install && npm run build
 
# 4. Copy and configure environment
cp .env.example .env
php artisan key:generate
 
# 5. Set up the database
php artisan migrate --seed
 
# 6. Create storage symlink
php artisan storage:link
 
# 7. Start the development server
php artisan serve

Visit http://localhost:8000 in your browser.


βš™οΈ Environment Configuration

APP_NAME=MoonFansPro
APP_ENV=production
APP_URL=https://yourdomain.com
APP_LOCALE=en
 
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=moonfanspro
DB_USERNAME=your_db_user
DB_PASSWORD=your_db_password
 
# AWS S3 β€” Media storage
AWS_ACCESS_KEY_ID=your_access_key
AWS_SECRET_ACCESS_KEY=your_secret_key
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=your-bucket-name
 
# Stripe β€” Payments
STRIPE_KEY=pk_live_...
STRIPE_SECRET=sk_live_...
STRIPE_WEBHOOK_SECRET=whsec_...
 
# Platform fee (percentage taken from creator earnings)
PLATFORM_FEE_PERCENT=5
 
# Mail
MAIL_MAILER=smtp
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=587
MAIL_USERNAME=your_mail_user
MAIL_PASSWORD=your_mail_password
MAIL_FROM_ADDRESS=hello@yourdomain.com
MAIL_FROM_NAME="MoonFansPro"

πŸ’³ Payment Integration

MoonFansPro uses Stripe for all monetary flows:

Flow Stripe Feature Used
Monthly subscriptions Stripe Billing (Subscriptions API)
Pay-per-view posts Stripe Checkout / Payment Intents
Tips on posts & DMs Stripe Payment Intents
Shop purchases Stripe Checkout
Creator payouts Stripe Connect (Express accounts)

Stripe Webhook Events Handled

customer.subscription.created
customer.subscription.updated
customer.subscription.deleted
invoice.payment_succeeded
invoice.payment_failed
payment_intent.succeeded
account.updated                  ← Creator Connect onboarding

Configure your webhook endpoint in Stripe Dashboard to point to:

https://yourdomain.com/webhook/stripe

☁️ Media Storage

All user-uploaded content (profile avatars, cover images, post photos/videos, product images) is stored on AWS S3.

The MediaService handles:

  • Streaming uploads directly to S3
  • Generating signed URLs for private/PPV content
  • Deleting media when posts or accounts are removed

Configure your S3 bucket with the following CORS policy:

[
  {
    "AllowedHeaders": ["*"],
    "AllowedMethods": ["GET", "PUT", "POST", "DELETE"],
    "AllowedOrigins": ["https://yourdomain.com"],
    "ExposeHeaders": ["ETag"]
  }
]

πŸ“± PWA Support

MoonFansPro ships as a Progressive Web App. Users on Chrome/Safari will be prompted to install it to their home screen.

Key files:

  • public/manifest.json β€” App name, icons, theme color, display mode
  • public/js/service-worker.js β€” Offline caching strategy (cache-first for static assets, network-first for API)

🌍 Localization

The platform supports 3 languages out of the box, switchable from any page via the footer language picker:

Code Language
en English (default)
es EspaΓ±ol
pe Persian (RTL layout)

Translation strings live in resources/lang/{code}/. To add a new language, create a new folder matching the ISO code and translate the string files.


πŸ’° Creator Earnings Model

Fan pays $10/month subscription
    └─ Stripe fee:        ~$0.59  (2.9% + $0.30)
    └─ Platform fee:       $0.47  (5% of net)
    └─ Creator receives:  ~$8.94

The earnings simulator on the homepage lets prospective creators estimate income:

Estimated monthly earnings = (followers Γ— 0.05 Γ— subscription_price) Γ— (1 - platform_fee)

πŸ“Έ Screenshots

Page Preview

| Homepage | moonfanspro.goodcoderz.comHomepage

| Creator Discovery | /creators |Creator Discovery

| Shop | /shop |Shop


🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create your feature branch: git checkout -b feature/your-feature-name
  3. Commit your changes: git commit -m 'Add: your feature description'
  4. Push to the branch: git push origin feature/your-feature-name
  5. Open a Pull Request

Please make sure your code follows PSR-12 coding standards and includes relevant tests where applicable.


Built with ❀️ · Live Demo · Report an Issue

About

Production-ready OnlyFans clone built with Laravel 10 + MySQL + Stripe + AWS S3. Subscriptions, PPV posts, tipping, DMs, digital shop, creator dashboard, admin panel, PWA & multi-language

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors