13.09.2025 02:23

Enterprise-Level Upgrade: Our Biggest System Overhaul Yet

⏱️ 4 min czytania
Udostępnij:

🚀 Enterprise-Level Upgrade: Our Biggest System Overhaul Yet

Over the past weeks, we’ve been working relentlessly on bringing our fan-support and subscription platform to a new level.
What started as a small bug fix in the Support tab turned into a full-scale enterprise-grade system – ready to compete with Patreon (and even surpass it in certain areas).

Here’s a complete breakdown of what has been shipped.


🎯 Support System Fixes

  • Fixed "Failed to load tab: support" error by removing duplicate routes.
  • Added debug logging for better diagnostics.
  • Created a test tier (100 coins) for comics.
  • Fixed redirects from /comics/1/fanpage/fanpage/comic/1.

💰 Billing & Subscription System

🔄 Triple-Billing Options

  • Monthly Cycle (Patreon-style) – pay once per month, full access to past content.
  • Anniversary Billing – pay every 30 days from subscription date.
  • User Choice – creators decide if fans can pick their billing type.

Creators now have full control in the Admin panel, while users get dynamic billing options in the Support tab.

📅 Smart Date Handling

  • New BillingDateService handles edge cases (Feb, leap years, 31→30).
  • Implements a “last day of month” strategy.
  • Built-in 12-month billing schedule support.

💳 Automated Payments

  • ProcessSubscriptionPayments command with dry-run mode.
  • Cron job running daily at 6:00 AM.
  • Grace periods: 3 days (coins), 7 days (Stripe).
  • Full transaction logging in subscription-payments.log.

🪙 Currency & Coins

💱 Multi-Currency Support

  • 4 supported currencies: USD, EUR, PLN, GBP.
  • Full conversion logic via CurrencyConversionService.
  • Helper functions like currency_to_coins() and format_coins().
  • Anti-arbitrage: 1 coin = $0.10 across all currencies.

🚨 Fundamental Change: FLOAT Coins

  • Migrated from INT to DECIMAL(16,4) precision.
  • Updated all tables, services, and calculations to handle floats.
  • Formatting rules remove trailing zeros (e.g. 10.0000 → 10).

🛡️ Anti-Fraud Protection

📊 New Database Models

  • chargebacks for dispute tracking.
  • fraud_warnings with 90-day history.
  • suspicious_transactions for flagged payments.
  • Extended users table with fraud_warnings_count & is_fraud_banned.

⚙️ Fraud Logic

  • AntiFraudService handles full chargeback workflow.
  • Spending trace shows exactly where coins were used.
  • Author recovery reclaims coins from fraudulent users.
  • Warning system:
    • Coins → 2 warnings
    • Subscriptions → 3 warnings
  • Automatic bans once thresholds are exceeded.

🔗 Stripe Webhooks

  • StripeWebhookController for dispute events.
  • Automated handling of charge.dispute.created & charge.dispute.closed.

📱 Admin Panel

  • New Fraud Analytics dashboard: /admin/analytics/fraud.
  • Fraudster list with filters (banned, warned, high-risk).

📱 Subscription Management

👤 User Dashboard

  • UI text updated: “Discover Comics”“Manage Subscriptions”.
  • Full subscription control in SubscriptionController.
  • Pages:
    • /subscriptions/manage – dashboard
    • /subscriptions/show – subscription details
  • Cancel/reactivate functionality included.

📊 Analytics

  • User analytics – upcoming payments, spend tracking.
  • Author analytics – MRR, churn, tier breakdown.
  • Admin analytics – platform-wide metrics.

⭐ Premium Access System

📝 Project Configuration

  • Added premium_access_days and enable_scheduled_publishing.
  • Presets available: 1, 3, 7, 14, 21 days.
  • JavaScript helper setPremiumDays() with instant feedback.

📚 Content Control

  • Chapters, books, and music tracks can toggle premium individually.
  • use_premium_access, premium_access_until, and per-track configs.

🔒 Access Control

  • Access validation in Chapter and BookChapter controllers.
  • Premium lock screen with subscription plans.
  • “⭐ PREMIUM” visual badges in listings.

⏰ Scheduled Publishing

  • ProcessScheduledPublishing command for timed releases.
  • Cron job runs every 15 minutes.
  • Supports chapters, book chapters, and music tracks.

🔧 Critical Fixes

  • Coin Transfers: 95% of coins auto-transferred to authors via cron jobs.
  • Default Coins: no more coins_enabled flag – coins always available.
  • Premium in Tiers: new provides_premium_access option.
  • Fee System: configurable transaction_fee_rate and payout_fee_rate with live previews in UI.

🔔 Notifications

  • Payment success/failure notifications (email + database).
  • Fraud warnings and bans integrated into the notification system.

📚 Documentation

  • Complete Billing & Subscription System README (96 sections).
  • Updated main README with links.
  • Environment variable docs updated with currency configs.
  • Clear warning for developers about FLOAT coin migration.

🧪 QA & Testing

  • Verified all cron jobs, routes, and endpoints.
  • Database migrations tested and confirmed safe.
  • Linter cleanup across the project.
  • Full error handling: graceful fallbacks everywhere.

🏆 The Result

88 new features and fixes delivered, including:

  • Triple-billing system
  • Bitcoin-like FLOAT coin precision
  • Premium early access for subscribers
  • Enterprise-grade anti-fraud protection
  • Advanced analytics for users, authors, and admins
  • Full automation with cron jobs, webhooks, and notifications

👉 This is not just a patch.
It’s a complete enterprise-ready system – capable of competing with Patreon and pushing beyond it in terms of flexibility, analytics, and fraud prevention.

🚀 The platform is now stronger, smarter, and ready for scale.

📚 Powiązane posty

01.09.2025 17:49

Advanced underpages system - monetized subpages for all Moonlight content types

Advanced underpages system - bringing structured content to every corner of Moonlight We've just launched one of our most versatile content creation f...
Czytaj dalej →
01.09.2025 17:28

Universal Team Management System

Universal team management system launched We've just shipped the most significant UX improvement in Moonlight's history - a completely unified team ma...
Czytaj dalej →
01.09.2025 17:19

Moonlight permissions system

Big news for Moonlight developers and creators! We've just completed a massive infrastructure overhaul that brings unified permissions and team manage...
Czytaj dalej →

📧 Bądź na bieżąco!

Zapisz się na listę oczekujących, aby otrzymywać powiadomienia o nowych postach na Dev Blog oraz informacje o starcie platformy Moonlight.