Skip to content

xjanova/Thaiprompt-Affiliate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9,123 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 TP-Affiliate Pro - Enterprise Affiliate Marketing Ecosystem

Version Laravel PHP Tailwind Alpine.js License

ระบบ Affiliate Marketing แบบ Enterprise ที่ครบวงจรที่สุด

พัฒนาด้วย Laravel 11 + Vite | รองรับ 20+ ระบบหลัก | 389 Models | 294 Controllers | 433 Migrations

🌟 คุณสมบัติ📦 การติดตั้ง🏗️ สถาปัตยกรรม📖 เอกสาร💬 การสนับสนุน


📑 Table of Contents


🎯 Project Overview

What is TP-Affiliate Pro?

TP-Affiliate Pro เป็นระบบ Affiliate Marketing แบบ Enterprise-Level ที่พัฒนาด้วย Laravel 11 ครบวงจรที่สุดในตลาด ไม่ใช่แค่ระบบ Affiliate ธรรมดา แต่เป็น All-in-One Business Ecosystem ที่รวมระบบต่างๆ มากกว่า 20 ระบบหลัก เข้าด้วยกัน

🎯 จุดประสงค์หลัก

  1. 💼 Enterprise Affiliate Marketing Platform

    • ระบบ MLM (Multi-Level Marketing) แบบครบวงจร
    • การจัดการคอมมิชชั่นหลายระดับ (Unilevel, Binary, Matrix)
    • ระบบ Rank & Bonus อัตโนมัติ
    • ติดตามยอดขายและคอมมิชชั่นแบบ Real-time
  2. 🛒 E-Commerce & Marketplace

    • ระบบ Multivendor Marketplace สมบูรณ์
    • การจัดการสินค้าและคำสั่งซื้อ
    • ระบบ POS (Point of Sale)
    • ระบบ Inventory Management
  3. 🤖 AI-Powered Automation

    • LINE Official Account AI Bot
    • Chatbot ขับเคลื่อนด้วย AI
    • Auto-response และ Sentiment Analysis
    • NLP (Natural Language Processing)
  4. ⛓️ Blockchain & Cryptocurrency

    • TPIX Token System (ERC-20)
    • Crypto Wallet Integration
    • Staking & Farming
    • NFT Marketplace
  5. 🏨 Industry-Specific Solutions

    • Hotel Booking System
    • Food Passport & Traceability
    • Software Sales Platform
    • Accounting System

📊 Scale & Complexity

Metric Count Description
Models 389 Eloquent Models ครอบคลุมทุกฟีเจจอร์
Controllers 294 Controllers แบ่งตาม Module
Migrations 433+ Database migrations พร้อม seeder
Routes 1,000+ Web, API, Admin, User routes
Services 50+ Business logic services
API Endpoints 500+ RESTful API endpoints
Documentation 100+ MD files เอกสารครบครัน
Lines of Code 500,000+ Production-ready code

🎯 เหมาะสำหรับ

  • Enterprise Companies - ต้องการระบบ Affiliate แบบครบวงจร
  • MLM/Network Marketing - สร้างเครือข่ายการตลาดหลายระดับ
  • E-Commerce Platforms - Marketplace พร้อม Affiliate System
  • SaaS Providers - ขายซอฟต์แวร์พร้อมระบบ License
  • Blockchain Projects - รวม Crypto/Token System
  • AI/Chatbot Services - ระบบ LINE Bot และ AI
  • System Integrators - นำไปต่อยอดและปรับแต่ง

💡 จุดเด่นที่ทำให้แตกต่าง

  1. 🔥 ครบวงจรที่สุด

    • รวม 20+ ระบบหลักในแพลตฟอร์มเดียว
    • ไม่ต้องซื้อระบบต่างๆ แยก ประหยัดงบประมาณ
  2. ⚡ พร้อมใช้งานทันที

    • ติดตั้งง่ายด้วย install.sh ใช้เวลาไม่เกิน 10 นาที
    • มาพร้อม Demo Data และ Seeder สมบูรณ์
  3. 🎨 UI/UX สุดทันสมัย

    • ใช้ Tailwind CSS 3.4 + Alpine.js
    • Dark/Light Mode ทุก Component
    • Responsive Design (Mobile-first)
    • Glassmorphism & 3D Effects
  4. 🔐 ความปลอดภัยระดับ Enterprise

    • License System พร้อม IP Whitelist
    • Two-Factor Authentication (2FA)
    • Rate Limiting & CSRF Protection
    • SQL Injection & XSS Prevention
  5. 🚀 Performance สูง

    • Redis Caching
    • Queue Jobs สำหรับ Heavy Tasks
    • Database Optimization
    • CDN Ready
  6. 📈 Scalable & Extensible

    • Architecture แบบ Modular
    • Easy to extend ด้วย Service Pattern
    • API-First Design
    • Microservices Ready

✨ Core Features

🎯 1. Affiliate Marketing System

👥 Member Management

  • ✅ สมัครสมาชิกอัตโนมัติ
  • 🤖 LINE Membership Signup (AI-Powered)
    • 7 Steps Wizard
    • OTP Verification
    • Auto Referral Detection
    • Beautiful Flex Messages
  • ✅ KYC Verification (Know Your Customer)
  • ✅ Profile Management พร้อม Avatar
  • ✅ Document Upload (ID Card, Bank Book)
  • ✅ Email & SMS Verification

💰 Commission System

  • ✅ Multi-Level Commission (ไม่จำกัดระดับ)
  • ✅ Commission Types:
    • Direct Commission (ค่าแนะนำโดยตรง)
    • Level Commission (คอมเชิญตามระดับ)
    • Matching Bonus (โบนัสจับคู่)
    • Rank Achievement Bonus
  • ✅ Auto-Calculate & Auto-Pay
  • ✅ Commission History & Analytics
  • ✅ Tax Calculation & Deduction

🏆 Rank & Achievement System

  • ✅ Dynamic Rank System (กำหนดเองได้)
  • ✅ Rank Requirements:
    • Personal Sales Volume
    • Team Sales Volume
    • Direct Referrals Count
    • Active Members Ratio
  • ✅ Auto Rank Upgrade/Downgrade
  • ✅ Rank Bonus & Rewards
  • ✅ Rank History Tracking
  • ✅ Achievement Badges

🔗 Affiliate Tools

  • ✅ Unique Affiliate Link
  • ✅ QR Code Generator
  • ✅ Short URL Support
  • ✅ Click Tracking & Analytics
  • ✅ Conversion Tracking
  • ✅ Marketing Materials Library
  • ✅ Social Media Share Tools

💳 2. Wallet & Payment System

💰 Multi-Currency Wallet

  • Fiat Wallet (THB, USD, EUR, etc.)
  • TPIX Token Wallet (Blockchain)
  • Point/Credit System
  • Cashback Wallet
  • ✅ Real-time Balance Update
  • ✅ Transaction History
  • ✅ Wallet-to-Wallet Transfer
  • ✅ Auto-conversion System

💸 Withdrawal System

  • ✅ Multiple Withdrawal Methods:
    • Bank Transfer
    • PromptPay
    • Crypto Withdrawal
    • PayPal
  • ✅ Auto-approval (configurable threshold)
  • ✅ Manual approval workflow
  • ✅ Withdrawal Fee Calculation
  • ✅ Daily/Monthly Limits
  • ✅ Withdrawal Schedule

💳 Payment Gateway Integration

  • PaySolutions (Thailand)
  • PromptPay QR
  • Stripe (International)
  • Omise (Thailand)
  • 2C2P
  • Bank Transfer
  • Crypto Payment (TPIX, USDT, ETH)
  • ✅ Installment Plans
  • ✅ Auto-reconciliation

📊 Financial Reports

  • ✅ Revenue Reports
  • ✅ Commission Reports
  • ✅ Withdrawal Reports
  • ✅ Transaction Logs
  • ✅ Tax Reports
  • ✅ Export to Excel/PDF

🛒 3. E-Commerce & Marketplace

🏪 Multivendor Marketplace

  • ✅ Seller Registration & Approval
  • ✅ Seller Dashboard
  • ✅ Commission Management (Platform fee)
  • ✅ Seller Payout System
  • ✅ Seller Analytics
  • ✅ Seller Rating & Reviews

📦 Product Management

  • ✅ Unlimited Products & Categories
  • ✅ Product Variations (Size, Color, etc.)
  • ✅ Product Images & Gallery
  • ✅ Product Videos
  • ✅ Digital Products Support
  • ✅ Inventory Management
  • ✅ Stock Alerts
  • ✅ Barcode/SKU System
  • ✅ Product Import/Export

🛍️ Shopping Features

  • ✅ Advanced Product Search
  • ✅ Filters & Sorting
  • ✅ Shopping Cart
  • ✅ Wishlist
  • ✅ Product Comparison
  • ✅ Recently Viewed
  • ✅ Product Recommendations (AI)
  • ✅ Flash Sales & Deals

📋 Order Management

  • ✅ Order Processing Workflow
  • ✅ Order Status Tracking
  • ✅ Invoice Generation
  • ✅ Shipping Integration
  • ✅ Order Fulfillment
  • ✅ Return & Refund System
  • ✅ Order Analytics

🤖 4. AI & LINE Bot System

🤖 LINE Official Account Bot

  • Hybrid Bot Architecture
    • Keyword-based Responses
    • AI-powered Conversations
    • Auto-switch between modes
  • Rich Message Types
    • Text Messages
    • Flex Messages
    • Image Carousel
    • Quick Reply Buttons
    • Location Sharing
  • Rich Menu Management
    • Visual Rich Menu Builder
    • Conditional Rich Menus
    • Multi-language Support

💬 Chatbot Features

  • ✅ Auto-response System
  • ✅ Keyword Detection
  • ✅ Context Management
  • ✅ Conversation History
  • ✅ Sentiment Analysis
  • ✅ Intent Recognition
  • ✅ Multi-turn Conversations
  • ✅ Handoff to Human Agent

🎯 LINE Membership Signup ⭐

  • AI-Guided Registration
    • 7-Step Wizard
    • Progress Tracking
    • Beautiful UI/UX
  • OTP Verification
  • Auto Referral Detection
  • Welcome Bonus
  • Analytics Dashboard
    • Signup Funnel
    • Conversion Rate
    • Drop-off Analysis

🧠 AI Features

  • ✅ Natural Language Processing (NLP)
  • ✅ Message Similarity Detection
  • ✅ Auto-categorization
  • ✅ Spam Detection
  • ✅ Language Detection (14 languages)
  • ✅ Auto Translation

⛓️ 5. Blockchain & Cryptocurrency

🪙 TPIX Token System

  • ERC-20 Token on Ethereum/BSC
  • ✅ Smart Contract Integration
  • ✅ Token Wallet Management
  • ✅ Token Transfer
  • ✅ Token Swap (TPIX ↔ Other tokens)
  • ✅ Transaction History
  • ✅ Gas Fee Calculation

💎 Staking & Farming

  • ✅ TPIX Staking Pools
  • ✅ Flexible & Fixed Staking
  • ✅ APY Calculation
  • ✅ Compound Interest
  • ✅ Auto-reward Distribution
  • ✅ Staking Analytics

🔐 Crypto Wallet

  • ✅ Multi-currency Support
    • TPIX, ETH, BNB, USDT
  • ✅ Wallet Creation
  • ✅ Private Key Management
  • ✅ Transaction Signing
  • ✅ Gas Price Estimation
  • ✅ Blockchain Explorer Integration

📊 Trading Features

  • ✅ Trading Bot System
  • ✅ Order Book
  • ✅ Limit/Market Orders
  • ✅ Trading Charts
  • ✅ Price Alerts
  • ✅ Trading History

🏨 6. Industry Solutions

🏨 Hotel Booking System

  • ✅ Room Management
  • ✅ Booking Engine
  • ✅ Availability Calendar
  • ✅ Pricing Management
  • ✅ Booking Confirmation
  • ✅ Guest Management
  • ✅ Housekeeping Module

🍽️ Food Passport & Traceability

  • ✅ Product Tracking
  • ✅ QR Code Traceability
  • ✅ Supply Chain Management
  • ✅ Certificate Management
  • ✅ Quality Control
  • ✅ Carbon Footprint Tracking
  • ✅ Blockchain Verification

💼 Software Sales Platform

  • ✅ Software License Management
  • ✅ License Activation System
  • ✅ Quotation Generation
  • ✅ Customer Management
  • ✅ Renewal Management
  • ✅ Support Ticketing

📊 Accounting System

  • ✅ Chart of Accounts
  • ✅ General Ledger
  • ✅ Accounts Payable/Receivable
  • ✅ Financial Reports
  • ✅ Tax Management
  • ✅ Budget Planning

🎮 7. Gamification & Engagement

🎯 Tetris Game ⭐ NEW

  • Classic Tetris Gameplay
  • ✅ Top Score Tracking
  • ✅ Ghost Piece Preview
  • ✅ Next Piece Display
  • ✅ Level System
  • ✅ Modern Gradient UI
  • ✅ LocalStorage Persistence
  • Route: /demo/tetris

🎮 Other Games

  • ✅ Space Shooter (3D/Three.js)
  • ✅ Snake Game (with Leaderboard)
  • ✅ 3D Navigation Demo
  • ✅ Loading Animation Showcase

🎁 Reward Systems

  • Video Reward System
    • Watch video → Earn points
    • Daily quests
    • Achievement tracking
  • Point System
    • Earn points from actions
    • Redeem rewards
    • Point expiration
  • Badge System
    • Achievement badges
    • Progress tracking
    • Leaderboard

🎴 Tarot Reading System

  • ✅ 78 Tarot Cards
  • ✅ Multiple Spread Types
  • ✅ AI-powered Interpretation
  • ✅ 3D Card Animation (WebGL)
  • ✅ Reading History
  • ✅ Quota Management

🎨 8. Arrow X Theme System ⭐ NEW

⚡ Core Features

  • Real-time Customization
    • Live preview
    • Visual editor
    • Admin UI
  • 17 Components
    • Cards, Buttons, Badges
    • Forms, Inputs, Selects
    • Navigation, Tables
    • Alerts, Modals
  • RGB Animation Effects
    • 9 animation types
    • 12+ target elements
    • Customizable speed/colors

🎨 Design System

  • Modern UI
    • Glassmorphism
    • Gradient backgrounds
    • 3D shadows
    • Smooth animations
  • Performance
    • Smart caching (90%+ faster)
    • Bundle size: ~130KB
    • First compile: <500ms
    • Cached: <100ms
  • Multi-language (14 languages)
  • Dark/Light Mode

🔐 9. Security & Admin

🛡️ Security Features

  • Authentication
    • Email/Password
    • LINE Login
    • Two-Factor Authentication (2FA)
    • OTP Verification
  • Authorization
    • Role-Based Access Control (RBAC)
    • Permission System
    • IP Whitelist/Blacklist
  • Protection
    • CSRF Protection
    • XSS Prevention
    • SQL Injection Prevention
    • Rate Limiting
    • DDoS Protection

👑 Admin Dashboard

  • Dashboard Analytics
    • Real-time Statistics
    • Revenue Charts
    • User Growth
    • Sales Funnel
  • User Management
    • CRUD Users
    • Role Assignment
    • Activity Logs
    • Ban/Suspend
  • System Settings
    • General Settings
    • Email Settings
    • Payment Settings
    • API Configuration

🌍 10. Multi-language & SEO

🌐 Multi-language System

  • 14 Built-in Languages
    • Thai, English, Chinese
    • Japanese, Korean, Vietnamese
    • And 8 more...
  • Google Translate API Integration
  • RTL Support (Arabic, Hebrew)
  • Language Switcher
  • Auto-detection
  • Translation Management UI

🔍 SEO Features

  • Meta Tags Management
  • Open Graph Tags
  • Schema.org Markup
  • Sitemap Generator
  • Robots.txt Management
  • Canonical URLs
  • Image Alt Tags
  • Page Speed Optimization

🏗️ System Architecture

🎯 High-Level Architecture

┌─────────────────────────────────────────────────────────────────────┐
│                    TP-Affiliate Pro Ecosystem                        │
└─────────────────────────────────────────────────────────────────────┘

┌──────────────────┐     ┌──────────────────┐     ┌──────────────────┐
│  Frontend Layer  │────▶│  Backend Layer   │────▶│  Data Layer      │
│                  │     │                  │     │                  │
│  • Blade Views   │     │  • Laravel 11    │     │  • MySQL 8.0+    │
│  • Tailwind CSS  │     │  • 389 Models    │     │  • Redis Cache   │
│  • Alpine.js     │     │  • 294 Controllers│     │  • File Storage  │
│  • Vite          │     │  • 50+ Services  │     │  • Queue Jobs    │
└──────────────────┘     └──────────────────┘     └──────────────────┘
         │                        │                         │
         │                        │                         │
         ▼                        ▼                         ▼
┌──────────────────────────────────────────────────────────────────────┐
│                        Integration Layer                             │
├──────────────────────────────────────────────────────────────────────┤
│  • LINE Messaging API     • Google Cloud APIs    • Blockchain       │
│  • Payment Gateways       • Email Services       • SMS Providers    │
│  • Cloud Storage          • CDN Services         • Analytics        │
└──────────────────────────────────────────────────────────────────────┘

📂 Directory Structure (Detailed)

Thaiprompt-Affiliate/
├── 📁 app/                                 # Laravel Application
│   ├── 📁 Console/                        # 40+ Artisan Commands
│   │   └── Commands/
│   │       ├── License*.php              # License management
│   │       ├── Update*.php               # Version/update
│   │       ├── Crypto*.php               # Blockchain
│   │       └── Data*.php                 # Data management
│   ├── 📁 Events/                        # Event dispatching
│   ├── 📁 Exceptions/                    # Error handlers
│   ├── 📁 Helpers/                       # Helper functions
│   │   ├── SeoHelper.php
│   │   ├── IconHelper.php
│   │   └── CryptoHelper.php
│   ├── 📁 Http/
│   │   ├── 📁 Controllers/               # 294 Controllers
│   │   │   ├── 📁 Admin/                 # 40+ Admin controllers
│   │   │   │   ├── AffiliateController.php
│   │   │   │   ├── CommissionController.php
│   │   │   │   ├── DashboardController.php
│   │   │   │   ├── ECommerceController.php
│   │   │   │   ├── RankController.php
│   │   │   │   ├── WalletController.php
│   │   │   │   ├── ArrowXThemeController.php
│   │   │   │   └── ... (35+ more)
│   │   │   ├── 📁 Api/V1/                # REST API controllers
│   │   │   │   ├── AuthController.php
│   │   │   │   ├── DashboardController.php
│   │   │   │   ├── TreeController.php
│   │   │   │   └── ... (20+ more)
│   │   │   ├── 📁 Auth/                  # Authentication
│   │   │   ├── 📁 Frontend/              # Public pages
│   │   │   ├── 📁 Seller/                # E-commerce seller
│   │   │   └── 📁 User/                  # User dashboard
│   │   ├── 📁 Middleware/                # 20+ Middleware
│   │   └── 📁 Requests/                  # Form validation
│   ├── 📁 Jobs/                          # Queue jobs
│   ├── 📁 Listeners/                     # Event listeners
│   ├── 📁 Mail/                          # Email notifications
│   ├── 📁 Models/                        # 🔥 389 Eloquent Models
│   │   ├── User.php
│   │   ├── Affiliate.php
│   │   ├── Commission.php
│   │   ├── Rank.php
│   │   ├── Wallet.php
│   │   ├── WalletTransaction.php
│   │   ├── Product.php
│   │   ├── Order.php
│   │   ├── OrderItem.php
│   │   ├── AiBotProfile.php
│   │   ├── LineBotAiSetting.php
│   │   ├── TPIXStake.php
│   │   ├── CryptoWallet.php
│   │   ├── HotelBooking.php
│   │   ├── SoftwareQuotation.php
│   │   ├── TarotReading.php
│   │   └── ... (370+ more models)
│   ├── 📁 Notifications/                 # Push/Email notifications
│   ├── 📁 Observers/                     # Model observers
│   ├── 📁 Policies/                      # Authorization policies
│   ├── 📁 Providers/                     # Service providers
│   └── 📁 Services/                      # 🔥 50+ Business Logic Services
│       ├── WalletService.php            # (18,468 lines)
│       ├── RankingService.php           # (10,028 lines)
│       ├── EmailService.php             # (11,285 lines)
│       ├── NotificationService.php      # (14,104 lines)
│       ├── LicenseService.php
│       ├── AICoreService.php
│       ├── BlockchainRecordService.php
│       ├── CacheManagementService.php
│       └── ... (42+ more services)
│
├── 📁 bootstrap/                         # Framework bootstrap
├── 📁 config/                            # 🔥 30+ Configuration files
│   ├── app.php
│   ├── database.php
│   ├── license.php                      # License system config
│   ├── version.php                      # Version management
│   ├── services.php                     # Third-party APIs
│   ├── payment.php                      # Payment gateways
│   └── ... (24+ more configs)
│
├── 📁 database/
│   ├── 📁 migrations/                   # 🔥 433+ Migrations
│   │   ├── 2024_01_01_000000_create_users_table.php
│   │   ├── 2024_01_02_000000_create_affiliates_table.php
│   │   ├── 2024_01_03_000000_create_commissions_table.php
│   │   └── ... (430+ more migrations)
│   ├── 📁 seeders/                      # Database seeders
│   │   ├── DatabaseSeeder.php
│   │   ├── UserSeeder.php
│   │   ├── RankSeeder.php
│   │   ├── ProductSeeder.php
│   │   └── ... (40+ seeders)
│   └── 📁 sql/                          # Custom SQL scripts
│
├── 📁 lang/                             # Multi-language files
│   ├── 📁 en/                           # English
│   ├── 📁 th/                           # Thai
│   └── 📁 [12 more languages]
│
├── 📁 public/                           # Public assets
│   ├── 📁 build/                        # Compiled Vite assets
│   ├── 📁 images/
│   ├── 📁 icons/
│   └── index.php
│
├── 📁 resources/
│   ├── 📁 css/                          # Stylesheets
│   │   └── app.css                     # Tailwind CSS entry
│   ├── 📁 js/                           # JavaScript modules
│   │   ├── app.js                      # Main JS entry
│   │   ├── bootstrap.js
│   │   ├── theme.js                    # Arrow X Theme
│   │   └── ... (20+ JS modules)
│   └── 📁 views/                        # 🔥 100+ Blade templates
│       ├── 📁 admin/                    # Admin dashboard UI
│       │   ├── dashboard.blade.php
│       │   ├── 📁 affiliates/
│       │   ├── 📁 ecommerce/
│       │   ├── 📁 ai-bots/
│       │   ├── 📁 commissions/
│       │   ├── 📁 wallet/
│       │   └── ... (40+ admin modules)
│       ├── 📁 auth/                     # Login/Register
│       ├── 📁 frontend/                 # Public pages
│       ├── 📁 user/                     # User dashboard
│       ├── 📁 seller/                   # Seller dashboard
│       ├── 📁 layouts/                  # Master templates
│       │   ├── app.blade.php
│       │   ├── admin.blade.php         # (77KB - feature-rich)
│       │   ├── seller.blade.php
│       │   └── user.blade.php
│       ├── 📁 components/               # Reusable components
│       └── 📁 emails/                   # Email templates
│
├── 📁 routes/                           # 🔥 Route definitions
│   ├── web.php                         # (44KB) Public web routes
│   ├── admin.php                       # (164KB) Admin routes
│   ├── api.php                         # (59KB) REST API routes
│   ├── user.php                        # (24KB) User dashboard
│   ├── seller.php                      # (10KB) Seller routes
│   ├── hotel-admin.php                 # (7KB) Hotel system
│   ├── software_sales.php              # (7KB) Software sales
│   ├── bot_automation.php              # (9KB) Bot automation
│   ├── pos.php                         # (2KB) Point of sale
│   └── console.php                     # Artisan commands
│
├── 📁 scripts/                         # Utility scripts
│   ├── 📁 git-hooks/                   # Git hooks
│   │   ├── install.sh
│   │   └── pre-commit
│   ├── deploy-to-distribution.sh
│   └── verify-seeders.php
│
├── 📁 storage/                         # File storage
│   ├── 📁 app/
│   │   ├── 📁 public/                  # Publicly accessible files
│   │   ├── 📁 backups/                 # Database backups
│   │   └── installation_id.txt        # Installation UUID
│   ├── 📁 framework/                   # Framework cache
│   └── 📁 logs/                        # Application logs
│
├── 📁 tests/                           # PHPUnit tests
│   ├── 📁 Feature/
│   └── 📁 Unit/
│
├── 📁 tpix-blockchain/                 # Blockchain smart contracts
│   ├── contracts/
│   ├── migrations/
│   └── test/
│
├── 📁 .claude/                         # 🔥 Claude AI Guidelines
│   ├── instructions.md
│   ├── THAI_LANGUAGE_RULES.md
│   ├── DATABASE_GUIDELINES.md
│   ├── ROUTES_GUIDELINES.md
│   ├── V3_CODING_GUIDELINES.md        # V3 Standards
│   ├── V3_UI_DESIGN_SYSTEM.md
│   └── V3_ALPINE_BEST_PRACTICES.md
│
├── 📁 .github/                         # GitHub Actions
│   └── 📁 workflows/
│       ├── deploy-distribution.yml
│       └── tests.yml
│
├── 📁 mobile-app-samples/              # .NET MAUI mobile app
│
├── 📄 install.sh                       # 🚀 Installation script
├── 📄 deploy.sh                        # 🚀 Deployment script
├── 📄 fix-permissions.sh
├── 📄 rollback.sh
├── 📄 run-migrations.sh
│
├── 📄 .env.example                     # Environment template
├── 📄 composer.json                    # PHP dependencies
├── 📄 package.json                     # NPM dependencies
├── 📄 tailwind.config.js               # Tailwind configuration
├── 📄 vite.config.js                   # Vite configuration
│
├── 📄 VERSION                          # Current version: 3.120.0
├── 📄 CHANGELOG.md                     # Version history
│
└── 📄 [100+ Documentation .md files]   # 🔥 Comprehensive docs
    ├── README.md                       # This file
    ├── ARCHITECTURE.md                 # System architecture
    ├── CLAUDE_CONTEXT.md               # AI context
    ├── INSTALLATION.md                 # Installation guide
    ├── API-DOCS.md                     # API documentation
    ├── DEVELOPMENT.md                  # Development guide
    ├── LINE_MEMBERSHIP_SIGNUP_README.md
    ├── TPIX_TOKEN_SYSTEM.md
    ├── MLM_SYSTEM_DOCUMENTATION.md
    ├── ARROW_X_README.md
    ├── DEMO_GAMES.md
    └── ... (90+ more documentation files)

🗄️ Database Schema Overview

389 Models = 389+ Database Tables

Core System Tables (30+)

users                           -- ผู้ใช้งานหลัก
user_profiles                   -- โปรไฟล์ผู้ใช้
user_settings                   -- การตั้งค่าผู้ใช้
user_documents                  -- เอกสารผู้ใช้
roles                          -- บทบาท (RBAC)
permissions                    -- สิทธิ์การใช้งาน
role_user                      -- ความสัมพันธ์ role-user
permission_role                -- ความสัมพันธ์ permission-role
activity_logs                  -- บันทึกกิจกรรม
notifications                  -- การแจ้งเตือน
site_settings                  -- การตั้งค่าระบบ

Affiliate & MLM Tables (40+)

affiliates                     -- ข้อมูล affiliate
affiliate_links                -- ลิงก์ affiliate
affiliate_clicks               -- การคลิก
affiliate_conversions          -- การแปลง (conversion)
commissions                    -- คอมมิชชั่น
commission_tiers               -- ระดับคอมมิชชั่น
mlm_commissions                -- คอมมิชชั่น MLM
mlm_settings                   -- การตั้งค่า MLM
mlm_pv_transactions            -- PV (Point Value) transactions
ranks                          -- ยศ/แรงค์
rank_requirements              -- เงื่อนไขการขึ้นแรงค์
rank_achievements              -- ความสำเร็จแรงค์
user_rank_progress             -- ความก้าวหน้าแรงค์

Wallet & Payment Tables (30+)

wallets                        -- กระเป๋าเงิน
wallet_transactions            -- ธุรกรรม
withdrawal_requests            -- คำขอถอนเงิน
deposits                       -- การฝากเงิน
payment_methods                -- ช่องทางชำระเงิน
payment_gateways               -- Payment gateway settings
installment_plans              -- แผนผ่อนชำระ
cashbacks                      -- คืนเงิน

E-Commerce Tables (50+)

products                       -- สินค้า
product_categories             -- หมวดหมู่สินค้า
product_images                 -- รูปภาพสินค้า
product_variations             -- ตัวเลือกสินค้า
orders                         -- คำสั่งซื้อ
order_items                    -- รายการในคำสั่งซื้อ
shopping_carts                 -- ตะกร้าสินค้า
wishlists                      -- รายการโปรด
reviews                        -- รีวิว
ratings                        -- คะแนน
coupons                        -- คูปอง
flash_sales                    -- ลดราคาพิเศษ

Marketplace Tables (20+)

sellers                        -- ผู้ขาย
seller_profiles                -- โปรไฟล์ผู้ขาย
seller_payouts                 -- การจ่ายเงินผู้ขาย
marketplace_commissions        -- ค่าคอมมิชชั่น marketplace
marketplace_settings           -- การตั้งค่า marketplace
marketplace_affiliate_links    -- ลิงก์ affiliate marketplace
marketplace_sync_logs          -- Sync logs

LINE Bot & AI Tables (30+)

line_bot_ai_settings           -- การตั้งค่า LINE Bot
line_bot_messages              -- ข้อความ
line_bot_responses             -- คำตอบ
line_bot_keywords              -- คำสำคัญ
line_broadcast_messages        -- ข้อความ broadcast
line_rich_menus                -- Rich menu
line_signup_sessions           -- Session การสมัคร
line_signup_step_logs          -- Log แต่ละขั้นตอน
ai_bot_profiles                -- โปรไฟล์ AI Bot
ai_installations               -- การติดตั้ง AI
ai_conversations               -- บทสนทนา AI
ai_usage_logs                  -- Log การใช้งาน AI
message_sentiments             -- การวิเคราะห์ความรู้สึก
message_similarities           -- ความคล้ายคลึงข้อความ
conversation_contexts          -- บริบทบทสนทนา

Blockchain & Crypto Tables (25+)

crypto_wallets                 -- กระเป๋าเงิน crypto
crypto_transactions            -- ธุรกรรม crypto
crypto_exchange_transactions   -- ธุรกรรมแลกเปลี่ยน
tpix_stakes                    -- TPIX Staking
staking_positions              -- ตำแหน่ง staking
blockchain_records             -- บันทึก blockchain
nfc_cards                      -- NFC Card system
trading_trades                 -- การเทรด
trading_orders                 -- คำสั่งซื้อขาย

Hotel System Tables (15+)

hotels                         -- โรงแรม
hotel_rooms                    -- ห้องพัก
hotel_bookings                 -- การจอง
hotel_room_types               -- ประเภทห้อง
hotel_amenities                -- สิ่งอำนวยความสะดวก

Food Passport Tables (20+)

food_products                  -- สินค้าอาหาร
food_certifications            -- ใบรับรอง
food_traceability              -- การติดตาม
carbon_footprint_records       -- บันทึก carbon footprint
quality_controls               -- การควบคุมคุณภาพ

Software Sales Tables (10+)

software_products              -- ซอฟต์แวร์
software_licenses              -- ลิขสิทธิ์
software_quotations            -- ใบเสนอราคา
software_customers             -- ลูกค้า

Accounting Tables (15+)

accounting_chart_of_accounts   -- ผังบัญชี
accounting_journals            -- สมุดรายวัน
accounting_ledgers             -- บัญชีแยกประเภท
payroll_records                -- เงินเดือน
attendance_records             -- การเข้างาน

Gamification Tables (20+)

game_settings                  -- การตั้งค่าเกม
game_scores                    -- คะแนนเกม
game_leaderboards              -- ตารางผู้นำ
video_rewards                  -- รางวัลจากวิดีโอ
video_watch_sessions           -- Session การดูวิดีโอ
video_quests                   -- ภารกิจวิดีโอ
tarot_readings                 -- การอ่านไพ่ทาโรต์
tarot_cards                    -- ไพ่ทาโรต์
tarot_spread_types             -- ประเภทการจั่ว
tarot_user_limits              -- โควต้าผู้ใช้

CMS & Theme Tables (15+)

pages                          -- หน้าเว็บ
page_builder_templates         -- Template page builder
menus                          -- เมนู
menu_items                     -- รายการเมนู
sliders                        -- สไลเดอร์
smart_sliders                  -- Smart slider
theme_components               -- Component ธีม
theme_settings                 -- การตั้งค่าธีม

Support & Knowledge Base (10+)

tickets                        -- ตั๋วซัพพอร์ต
ticket_replies                 -- คำตอบตั๋ว
kb_articles                    -- บทความฐานความรู้
kb_categories                  -- หมวดหมู่ฐานความรู้
faqs                          -- คำถามที่พบบ่อย

Analytics & Tracking (10+)

analytics_events               -- เหตุการณ์
analytics_page_views           -- การดูหน้า
cookie_consents                -- ความยินยอม cookie
keyword_relationships          -- ความสัมพันธ์คำสำคัญ
trend_analyses                 -- การวิเคราะห์เทรนด์

Miscellaneous Tables (20+)

translations                   -- การแปลภาษา
language_settings              -- การตั้งค่าภาษา
email_templates                -- แม่แบบอีเมล
sms_templates                  -- แม่แบบ SMS
otp_settings                   -- การตั้งค่า OTP
app_banners                    -- แบนเนอร์แอป
pos_transactions               -- ธุรกรรม POS
pos_advertisements             -- โฆษณา POS
quizzes                        -- แบบทดสอบ
quiz_questions                 -- คำถามแบบทดสอบ

🔄 Service Layer Architecture

50+ Services จัดการ Business Logic แยกออกจาก Controller

// Service Pattern Example
app/Services/
├── WalletService.php              // 💰 18,468 lines - Wallet management
│   ├── createWallet()
│   ├── deposit()
│   ├── withdraw()
│   ├── transfer()
│   └── getBalance()
│
├── RankingService.php             // 🏆 10,028 lines - Rank calculation
│   ├── calculateRank()
│   ├── checkRequirements()
│   ├── upgradeRank()
│   ├── downgradeRank()
│   └── distributeBonus()
│
├── EmailService.php               // 📧 11,285 lines - Email sending
│   ├── sendWelcome()
│   ├── sendCommission()
│   ├── sendWithdrawal()
│   └── sendNotification()
│
├── NotificationService.php        // 🔔 14,104 lines - Notifications
│   ├── send()
│   ├── sendPush()
│   ├── sendEmail()
│   └── sendSMS()
│
├── LicenseService.php             // 🔐 License validation
├── AICoreService.php              // 🤖 AI processing
├── BlockchainRecordService.php    // ⛓️ Blockchain integration
├── CacheManagementService.php     // 🚀 Cache optimization
└── ... (42+ more services)

💻 Technology Stack

🎯 Backend Technologies

Core Framework

{
  "framework": "Laravel 11.x",
  "php": "8.1+",
  "architecture": "MVC + Service Layer",
  "patterns": [
    "Repository Pattern",
    "Service Pattern",
    "Observer Pattern",
    "Factory Pattern"
  ]
}

Database & Cache

{
  "primary_db": "MySQL 8.0+ / MariaDB 10.3+",
  "cache": "Redis",
  "queue": "Redis / Database",
  "search": "Full-text search",
  "orm": "Eloquent ORM"
}

Key PHP Packages

{
  "google/cloud-translate": "^1.15",    // Multi-language
  "google/cloud-vision": "^1.7",        // OCR & Image recognition
  "intervention/image": "^3.11",        // Image processing
  "web3p/web3.php": "^0.1.6",          // Blockchain integration
  "jenssegers/agent": "^2.6",          // User agent detection
  "guzzlehttp/guzzle": "^7.2",         // HTTP client
  "laravel/sanctum": "^4.0",           // API authentication
  "laravel/reverb": "*"                // WebSocket server
}

🎨 Frontend Technologies (V3 Stack)

Build Tool & CSS Framework

{
  "build_tool": "Vite 5.0",
  "css_framework": "Tailwind CSS 3.4",
  "css_plugins": [
    "@tailwindcss/forms ^0.5.7"
  ],
  "preprocessor": "PostCSS 8.4"
}

JavaScript Framework

{
  "primary": "Alpine.js 3.13.5",        // Lightweight reactivity
  "bundle_size": "~15KB gzipped",
  "features": [
    "x-data", "x-show", "x-if",
    "x-for", "x-model", "x-bind"
  ]
}

UI/UX Libraries

{
  "charts": "Chart.js 4.4.1",
  "3d_graphics": "Three.js 0.181.1",
  "data_viz": "D3.js 7.9.0",
  "network_viz": "vis-network 10.0.2",
  "animation": "GSAP 3.12.5",
  "drag_drop": "SortableJS 1.15+"
}

Blockchain & Web3

{
  "ethereum": "ethers 5.8.0",
  "wagmi_core": "@wagmi/core 1.4.13",
  "web3modal": "@web3modal/wagmi 3.5.7",
  "viem": "viem 1.21.4"
}

Utilities

{
  "http_client": "axios 1.6.4",
  "websocket": "laravel-echo 2.2.6",
  "realtime": "pusher-js 8.4.0",
  "qr_code": "qrcode 1.5.4",
  "barcode": "jsbarcode 3.12.1",
  "pdf": "jspdf 3.0.3",
  "screenshot": "html2canvas 1.4.1"
}

🗄️ Database Technologies

-- Primary Database
MySQL 8.0+ or MariaDB 10.3+

-- Features Used:
- JSON columns
- Full-text search
- Stored procedures
- Triggers
- Views
- Foreign key constraints
- Indexes optimization

-- Database Size:
- 433+ migrations
- 389+ tables
- 1,000+ columns
- Complex relationships

🔧 DevOps & Tools

# Version Control
git: "Latest"
github_actions: "CI/CD pipelines"

# Code Quality
laravel_pint: "PHP CodeStyle"
phpunit: "^11.0"
phpstan: "Static analysis"

# Development
composer: "2.0+"
npm: "Latest"
node: "18+"

# Server Requirements
web_server: "Nginx / Apache"
php_fpm: "8.1+"
redis_server: "6.0+"
mysql_server: "8.0+"

🌐 Third-Party Integrations

Payment Gateways

  • PaySolutions (Thailand)
  • PromptPay QR Code
  • Stripe (International)
  • Omise (Thailand)
  • 2C2P
  • ✅ Bank Transfer

Messaging & Communication

  • LINE Messaging API
  • Twilio (SMS)
  • SendGrid (Email)
  • Mailgun (Email)
  • Amazon SES

Cloud Services

  • Google Cloud Translate API
  • Google Cloud Vision API
  • AWS S3 (Storage)
  • Cloudflare (CDN)

Blockchain

  • Ethereum Network
  • BSC (Binance Smart Chain)
  • Infura (Node provider)
  • MetaMask Integration

Analytics

  • Google Analytics
  • Facebook Pixel
  • Custom Analytics Engine

📦 Quick Installation

🎯 System Requirements

Component Minimum Recommended
PHP 8.1.0 8.2+
MySQL 5.7.0 8.0+
MariaDB 10.3.0 10.6+
Redis 5.0 7.0+
Composer 2.0 2.6+
Node.js 18.0 20+
NPM 9.0 10+
Memory 512 MB 2 GB+
Disk Space 2 GB 10 GB+

Required PHP Extensions

✓ pdo
✓ pdo_mysql
✓ mbstring
✓ openssl
✓ json
✓ curl
✓ gd
✓ xml
✓ zip
✓ bcmath
✓ tokenizer
✓ fileinfo
✓ redis (optional but recommended)

🚀 Installation Methods

Method 1: Automatic Installation (Recommended)

# 1. Clone repository
git clone https://github.com/xjanova/Thaiprompt-Affiliate.git
cd Thaiprompt-Affiliate

# 2. Run auto-installer
chmod +x install.sh
./install.sh

# The installer will:
# ✓ Check system requirements
# ✓ Install Composer dependencies
# ✓ Install NPM dependencies
# ✓ Create .env file
# ✓ Generate application key
# ✓ Create database
# ✓ Run migrations
# ✓ Seed demo data
# ✓ Create Super Admin account
# ✓ Build frontend assets
# ✓ Set up file permissions
# ✓ Configure cache

# 3. Access your installation
# Frontend: http://yourdomain.com
# Admin: http://yourdomain.com/admin

Method 2: Manual Installation

# 1. Clone repository
git clone https://github.com/xjanova/Thaiprompt-Affiliate.git
cd Thaiprompt-Affiliate

# 2. Install Composer dependencies
composer install

# 3. Install NPM dependencies
npm install

# 4. Create environment file
cp .env.example .env

# 5. Generate application key
php artisan key:generate

# 6. Configure database in .env
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=thaiprompt_affiliate
DB_USERNAME=root
DB_PASSWORD=

# 7. Create database
mysql -u root -p
CREATE DATABASE thaiprompt_affiliate CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
EXIT;

# 8. Run migrations
php artisan migrate

# 9. Seed database (optional but recommended)
php artisan db:seed

# 10. Create storage symlink
php artisan storage:link

# 11. Build frontend assets
npm run build

# 12. Set permissions
chmod -R 775 storage bootstrap/cache
chown -R www-data:www-data storage bootstrap/cache

# 13. Optimize application
php artisan optimize

# 14. Start development server (for testing)
php artisan serve

🎯 Initial Configuration

1. Create Super Admin

php artisan make:admin

# Or manually via Tinker
php artisan tinker
>>> User::create([
    'name' => 'Super Admin',
    'email' => 'admin@yourdomain.com',
    'password' => bcrypt('your-secure-password'),
    'role' => 'super_admin'
]);

2. Configure Basic Settings

Via Admin Panel:

  1. Login to /admin
  2. Go to Settings → General
  3. Configure:
    • Site name
    • Site logo
    • Contact email
    • Timezone
    • Default language

3. Configure Email (SMTP)

Edit .env:

MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=your-email@gmail.com
MAIL_PASSWORD=your-app-password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=noreply@yourdomain.com
MAIL_FROM_NAME="${APP_NAME}"

4. Configure Queue Worker

# For development (simple)
php artisan queue:work

# For production (with Supervisor)
sudo nano /etc/supervisor/conf.d/thaiprompt-affiliate-worker.conf

Supervisor Configuration:

[program:thaiprompt-affiliate-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /path/to/artisan queue:work --sleep=3 --tries=3 --max-time=3600
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=www-data
numprocs=4
redirect_stderr=true
stdout_logfile=/path/to/storage/logs/worker.log
stopwaitsecs=3600

5. Configure Cron Jobs

# Add to crontab
crontab -e

# Add this line
* * * * * cd /path/to/project && php artisan schedule:run >> /dev/null 2>&1

🌐 Production Deployment

Nginx Configuration

server {
    listen 80;
    listen [::]:80;
    server_name yourdomain.com;
    root /var/www/thaiprompt-affiliate/public;

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-Content-Type-Options "nosniff";

    index index.php;

    charset utf-8;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    error_page 404 /index.php;

    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~ /\.(?!well-known).* {
        deny all;
    }
}

SSL Configuration (Let's Encrypt)

# Install Certbot
sudo apt install certbot python3-certbot-nginx

# Get SSL certificate
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com

# Auto-renewal is configured automatically

🔧 Configuration

📋 Environment Variables (.env)

# ===================================
# Application
# ===================================
APP_NAME="TP-Affiliate Pro"
APP_ENV=production
APP_KEY=base64:...
APP_DEBUG=false
APP_URL=https://yourdomain.com
APP_VERSION=3.120.0

# ===================================
# Database
# ===================================
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=thaiprompt_affiliate
DB_USERNAME=root
DB_PASSWORD=

# ===================================
# Cache & Session
# ===================================
CACHE_DRIVER=redis
SESSION_DRIVER=redis
SESSION_LIFETIME=120

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

# ===================================
# Queue
# ===================================
QUEUE_CONNECTION=redis

# ===================================
# Email
# ===================================
MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=noreply@yourdomain.com
MAIL_FROM_NAME="${APP_NAME}"

# ===================================
# License System
# ===================================
LICENSE_KEY=
LICENSE_INSTALLATION_ID=
LICENSE_API_URL=https://xman4289.com/wp-json/tp-license/v1
LICENSE_DEVELOPER_MODE=false
LICENSE_ALLOW_OFFLINE=false
LICENSE_CACHE_DURATION=604800

# ===================================
# LINE Integration
# ===================================
LINE_CHANNEL_ID=
LINE_CHANNEL_SECRET=
LINE_ACCESS_TOKEN=
LINE_BOT_BASIC_ID=
LINE_LIFF_ID=

# ===================================
# Google Cloud APIs
# ===================================
GOOGLE_CLOUD_PROJECT_ID=
GOOGLE_CLOUD_TRANSLATE_API_KEY=
GOOGLE_CLOUD_VISION_API_KEY=

# ===================================
# Payment Gateways
# ===================================
# PaySolutions
PAYSOLUTIONS_MERCHANT_ID=
PAYSOLUTIONS_SECRET_KEY=

# PromptPay
PROMPTPAY_MERCHANT_ID=
PROMPTPAY_REFERENCE_PREFIX=

# Stripe
STRIPE_KEY=
STRIPE_SECRET=
STRIPE_WEBHOOK_SECRET=

# Omise
OMISE_PUBLIC_KEY=
OMISE_SECRET_KEY=

# ===================================
# Blockchain (TPIX)
# ===================================
TPIX_CONTRACT_ADDRESS=
TPIX_RPC_URL=
TPIX_CHAIN_ID=
TPIX_PRIVATE_KEY=

# ===================================
# SMS Provider
# ===================================
TWILIO_SID=
TWILIO_TOKEN=
TWILIO_FROM=

# ===================================
# Storage
# ===================================
FILESYSTEM_DISK=local
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false

# ===================================
# Analytics
# ===================================
GOOGLE_ANALYTICS_ID=
FACEBOOK_PIXEL_ID=

# ===================================
# Social Login
# ===================================
FACEBOOK_CLIENT_ID=
FACEBOOK_CLIENT_SECRET=
FACEBOOK_REDIRECT_URL=

GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_REDIRECT_URL=

⚙️ Key Configuration Files

config/license.php - License System

return [
    'api_url' => env('LICENSE_API_URL'),
    'license_key' => env('LICENSE_KEY'),
    'installation_id' => env('LICENSE_INSTALLATION_ID'),
    'developer_mode' => env('LICENSE_DEVELOPER_MODE', false),
    'allow_offline' => env('LICENSE_ALLOW_OFFLINE', false),
    'cache_duration' => env('LICENSE_CACHE_DURATION', 604800), // 7 days
];

config/version.php - Version Management

return [
    'current' => env('APP_VERSION', file_get_contents(base_path('VERSION'))),
    'repository' => [
        'owner' => 'xjanova',
        'name' => 'TP-Affiliate',
        'api_url' => 'https://api.github.com/repos/xjanova/TP-Affiliate',
    ],
    'update_channel' => env('UPDATE_CHANNEL', 'stable'), // stable, beta
];

config/services.php - Third-Party Services

return [
    'line' => [
        'channel_id' => env('LINE_CHANNEL_ID'),
        'channel_secret' => env('LINE_CHANNEL_SECRET'),
        'access_token' => env('LINE_ACCESS_TOKEN'),
    ],
    'google_translate' => [
        'api_key' => env('GOOGLE_CLOUD_TRANSLATE_API_KEY'),
    ],
    'stripe' => [
        'key' => env('STRIPE_KEY'),
        'secret' => env('STRIPE_SECRET'),
    ],
    // ... more services
];

🎨 Major Systems

1️⃣ MLM (Multi-Level Marketing) System

เอกสาร: MLM_SYSTEM_DOCUMENTATION.md

Features

  • Unilevel Plan - ไม่จำกัดความกว้าง
  • Binary Plan - แบบ 2 ขา (Left/Right)
  • Matrix Plan - จำกัดความกว้าง (3x7, 4x7, etc.)
  • Hybrid Plan - ผสมหลายแบบ

Commission Types

1. Direct Referral Commission
   - ค่าแนะนำโดยตรง (5-20%)

2. Level Commission
   - Level 1: 10%
   - Level 2: 8%
   - Level 3: 6%
   - Level 4-10: 4-2%

3. Matching Bonus
   - จับคู่ยอดขายจาก 2 ขา
   - 10% ของคอมรวม

4. Rank Achievement Bonus
   - Bronze: 5,000 THB
   - Silver: 20,000 THB
   - Gold: 100,000 THB
   - Diamond: 500,000 THB

Genealogy Tree

  • ✅ Visual Tree (D3.js)
  • ✅ Drag & Zoom
  • ✅ Search Members
  • ✅ Filter by Rank/Status
  • ✅ Export Tree

2️⃣ LINE Bot AI System

เอกสาร:

Bot Architecture

User Message
    ↓
Webhook Handler
    ↓
Keyword Detection
    ↓
    ├─ Exact Match? → Keyword Response
    ├─ Similar Match? → Suggest Keywords
    └─ No Match? → AI Response
    ↓
Response Formatter
    ↓
LINE API
    ↓
User Receives Message

LINE Membership Signup Flow

Step 1: Welcome & Terms ✓
    ↓
Step 2: Phone Number & OTP ✓
    ↓
Step 3: Personal Info ✓
    ↓
Step 4: Address ✓
    ↓
Step 5: Bank Details ✓
    ↓
Step 6: Upline/Referrer ✓
    ↓
Step 7: Confirmation & Complete ✓
    ↓
Welcome Bonus + Email Confirmation

3️⃣ TPIX Token System

เอกสาร: TPIX_TOKEN_SYSTEM.md

Smart Contract

// TPIX Token (ERC-20)
contract TPIXToken {
    string public name = "ThaiPrompt Token";
    string public symbol = "TPIX";
    uint8 public decimals = 18;
    uint256 public totalSupply = 1000000000 * 10**18; // 1 Billion

    // Functions
    function transfer(address to, uint256 amount) external returns (bool);
    function approve(address spender, uint256 amount) external returns (bool);
    function transferFrom(address from, address to, uint256 amount) external returns (bool);

    // Staking
    function stake(uint256 amount, uint256 duration) external;
    function unstake(uint256 stakeId) external;
    function claimReward(uint256 stakeId) external;
}

Staking Pools

Pool Duration APY Min Amount
Flexible Anytime 5% 100 TPIX
30 Days 30 days 15% 500 TPIX
90 Days 90 days 25% 1,000 TPIX
180 Days 180 days 40% 5,000 TPIX
365 Days 365 days 60% 10,000 TPIX

4️⃣ Arrow X Theme System ⭐

เอกสาร:

Artisan Commands

# Compile theme
php artisan arrowx:compile

# Clear cache
php artisan arrowx:clear

# Warmup cache
php artisan arrowx:warmup

# Benchmark
php artisan arrowx:benchmark

# Show info
php artisan arrowx:info

Components Available

1. Cards (6 variants)
2. Buttons (8 variants)
3. Badges (7 variants)
4. Alerts (4 variants)
5. Forms & Inputs
6. Selects & Checkboxes
7. Navigation & Breadcrumbs
8. Tables & Pagination
9. Modals & Overlays
10. Tooltips & Popovers
... (17 components total)

5️⃣ E-Commerce System

Product Management

// Product Model
class Product extends Model {
    // Relations
    public function category() // BelongsTo
    public function images() // HasMany
    public function variations() // HasMany
    public function reviews() // HasMany
    public function seller() // BelongsTo

    // Scopes
    public function scopeActive()
    public function scopeFeatured()
    public function scopeOnSale()

    // Attributes
    public function getPriceAfterDiscountAttribute()
    public function getAverageRatingAttribute()
}

Order Processing

1. Cart → Checkout
2. Payment Selection
3. Payment Verification
4. Order Created
5. Seller Notified
6. Order Confirmed
7. Shipping
8. Delivered
9. Review (Optional)
10. Commission Paid

6️⃣ Food Passport & Traceability

เอกสาร: API Documentation - Food Passport

Traceability Chain

Farm/Producer
    ↓ (QR Code)
Processing Plant
    ↓ (QR Code)
Quality Control
    ↓ (QR Code)
Distribution Center
    ↓ (QR Code)
Retail Store
    ↓ (QR Code)
Consumer

Features

  • ✅ QR Code Generation
  • ✅ Blockchain Verification
  • ✅ Certificate Upload
  • ✅ Carbon Footprint Calculation
  • ✅ Supply Chain Tracking
  • ✅ Quality Audit Logs

7️⃣ Hotel Booking System

Booking Flow

1. Search (Dates, Rooms)
2. View Available Rooms
3. Select Room Type
4. Guest Information
5. Payment
6. Booking Confirmation
7. Email/SMS Notification
8. Check-in/Check-out

Admin Features

  • ✅ Room Management
  • ✅ Pricing Calendar
  • ✅ Booking Management
  • ✅ Housekeeping Schedule
  • ✅ Reports & Analytics

🌐 API Documentation

📡 API Overview

Base URL: https://yourdomain.com/api/v1

Authentication: Bearer Token (Laravel Sanctum)

Response Format: JSON

{
  "success": true,
  "data": {},
  "message": "Success message",
  "meta": {
    "pagination": {}
  }
}

🔐 Authentication Endpoints

Login

POST /api/v1/login
Content-Type: application/json

{
  "email": "user@example.com",
  "password": "password123"
}

Response:
{
  "success": true,
  "data": {
    "user": {
      "id": 1,
      "name": "John Doe",
      "email": "user@example.com"
    },
    "token": "1|abc123..."
  }
}

Register

POST /api/v1/register
Content-Type: application/json

{
  "name": "John Doe",
  "email": "user@example.com",
  "password": "password123",
  "password_confirmation": "password123",
  "referrer_code": "ABC123" // optional
}

Logout

POST /api/v1/logout
Authorization: Bearer {token}

👤 User Endpoints

Get Profile

GET /api/v1/user
Authorization: Bearer {token}

Update Profile

PUT /api/v1/user
Authorization: Bearer {token}

{
  "name": "John Doe",
  "phone": "0812345678",
  "address": "..."
}

💰 Wallet Endpoints

Get Balance

GET /api/v1/wallet/balance
Authorization: Bearer {token}

Response:
{
  "success": true,
  "data": {
    "fiat_balance": 15000.50,
    "tpix_balance": 5000.00,
    "point_balance": 1200
  }
}

Withdraw Request

POST /api/v1/wallet/withdraw
Authorization: Bearer {token}

{
  "amount": 1000,
  "method": "bank_transfer",
  "bank_account": "1234567890"
}

Transaction History

GET /api/v1/wallet/transactions?page=1&per_page=20
Authorization: Bearer {token}

🏆 Rank Endpoints

Get All Ranks

GET /api/v1/ranks

Response:
{
  "success": true,
  "data": [
    {
      "id": 1,
      "name": "Bronze",
      "requirements": {
        "personal_sales": 10000,
        "team_sales": 50000,
        "direct_referrals": 3
      },
      "benefits": {
        "commission_rate": 0.10,
        "bonus": 5000
      }
    }
  ]
}

🛒 Product Endpoints

Get Products

GET /api/v1/products?page=1&category=1&sort=price_asc

Get Product Details

GET /api/v1/products/{id}

📋 Order Endpoints

Create Order

POST /api/v1/orders
Authorization: Bearer {token}

{
  "items": [
    {
      "product_id": 1,
      "quantity": 2,
      "variation_id": 5
    }
  ],
  "payment_method": "stripe",
  "shipping_address": {...}
}

Get Orders

GET /api/v1/orders
Authorization: Bearer {token}

🤖 LINE Bot Endpoints

Webhook

POST /api/webhook/line
X-Line-Signature: {signature}

{
  "events": [
    {
      "type": "message",
      "message": {
        "type": "text",
        "text": "Hello"
      },
      "replyToken": "...",
      "source": {
        "userId": "..."
      }
    }
  ]
}

⛓️ Blockchain Endpoints

Get TPIX Balance

GET /api/v1/crypto/tpix/balance
Authorization: Bearer {token}

Stake TPIX

POST /api/v1/crypto/tpix/stake
Authorization: Bearer {token}

{
  "amount": 1000,
  "duration": 90
}

📖 Full API Documentation: API-DOCS.md (500+ endpoints)


📊 Database Structure

📈 Database Statistics

Total Tables: 389+
Total Columns: 5,000+
Total Relationships: 1,000+
Total Indexes: 800+
Database Size: ~500MB (with demo data)

🔗 Key Relationships

-- User → Affiliate → Commission
users
  ├─ has one → affiliates
  │   ├─ has many → affiliate_links
  │   ├─ has many → affiliate_clicks
  │   └─ has many → commissions
  ├─ has one → wallet
  │   └─ has many → wallet_transactions
  ├─ has many → orders
  │   └─ has many → order_items
  └─ belongs to → ranks
      └─ has many → rank_requirements

-- Product → Category → Review
products
  ├─ belongs to → product_categories
  ├─ has many → product_images
  ├─ has many → product_variations
  ├─ has many → reviews
  └─ belongs to → sellers
      └─ has many → seller_payouts

-- LINE Bot → Message → Response
line_bot_ai_settings
  ├─ has many → line_bot_keywords
  │   └─ has many → line_bot_responses
  ├─ has many → line_broadcast_messages
  └─ has many → ai_conversations
      └─ has many → message_sentiments

-- TPIX → Stake → Reward
crypto_wallets
  ├─ has many → crypto_transactions
  ├─ has many → tpix_stakes
  │   └─ has many → staking_rewards
  └─ belongs to → users

-- Order → Payment → Commission → Payout
orders
  ├─ has many → order_items
  ├─ has one → payment
  ├─ triggers → commission_calculation
  │   └─ creates → commissions
  │       └─ adds to → wallets
  └─ notifies → seller
      └─ triggers → seller_payout

🎯 Most Important Tables

1. users - Core User Table

CREATE TABLE users (
    id BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
    name VARCHAR(255) NOT NULL,
    email VARCHAR(255) UNIQUE NOT NULL,
    email_verified_at TIMESTAMP NULL,
    password VARCHAR(255) NOT NULL,
    phone VARCHAR(20) NULL,
    avatar VARCHAR(255) NULL,
    role ENUM('user', 'admin', 'super_admin', 'seller') DEFAULT 'user',
    status ENUM('active', 'inactive', 'suspended', 'banned') DEFAULT 'active',
    rank_id BIGINT UNSIGNED NULL,
    referrer_id BIGINT UNSIGNED NULL,
    referral_code VARCHAR(20) UNIQUE,
    two_factor_enabled BOOLEAN DEFAULT FALSE,
    last_login_at TIMESTAMP NULL,
    last_login_ip VARCHAR(45) NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    deleted_at TIMESTAMP NULL,

    FOREIGN KEY (rank_id) REFERENCES ranks(id),
    FOREIGN KEY (referrer_id) REFERENCES users(id),
    INDEX idx_email (email),
    INDEX idx_referral_code (referral_code),
    INDEX idx_status (status)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

2. commissions - Commission Management

CREATE TABLE commissions (
    id BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
    user_id BIGINT UNSIGNED NOT NULL,
    order_id BIGINT UNSIGNED NULL,
    type ENUM('direct', 'level', 'matching', 'rank_bonus') NOT NULL,
    level INT NULL,
    amount DECIMAL(15, 2) NOT NULL,
    rate DECIMAL(5, 4) NULL,
    base_amount DECIMAL(15, 2) NULL,
    status ENUM('pending', 'approved', 'paid', 'cancelled') DEFAULT 'pending',
    paid_at TIMESTAMP NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,

    FOREIGN KEY (user_id) REFERENCES users(id),
    FOREIGN KEY (order_id) REFERENCES orders(id),
    INDEX idx_user_status (user_id, status),
    INDEX idx_type (type),
    INDEX idx_created_at (created_at)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

3. wallets - Multi-Currency Wallet

CREATE TABLE wallets (
    id BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
    user_id BIGINT UNSIGNED NOT NULL UNIQUE,
    fiat_balance DECIMAL(15, 2) DEFAULT 0.00,
    tpix_balance DECIMAL(20, 8) DEFAULT 0.00000000,
    point_balance INT DEFAULT 0,
    cashback_balance DECIMAL(15, 2) DEFAULT 0.00,
    frozen_balance DECIMAL(15, 2) DEFAULT 0.00,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,

    FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,
    INDEX idx_user_id (user_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

🔍 Query Optimization

-- Optimized Indexes
CREATE INDEX idx_commissions_user_status ON commissions(user_id, status);
CREATE INDEX idx_orders_user_status ON orders(user_id, status);
CREATE INDEX idx_products_category_status ON products(category_id, status);
CREATE INDEX idx_wallet_transactions_wallet_type ON wallet_transactions(wallet_id, type);

-- Full-Text Search
CREATE FULLTEXT INDEX ft_products_search ON products(name, description);
CREATE FULLTEXT INDEX ft_articles_search ON kb_articles(title, content);

-- Composite Indexes
CREATE INDEX idx_user_referral ON users(referrer_id, status, created_at);
CREATE INDEX idx_commission_summary ON commissions(user_id, status, type, created_at);

🔐 Security Features

🛡️ Authentication & Authorization

// Multi-Factor Authentication
- Email/Password
- LINE Login (OAuth)
- Two-Factor Authentication (2FA)
- OTP Verification (SMS/Email)
- Remember Me (Secure)

// Role-Based Access Control (RBAC)
Roles:
- super_admin (All permissions)
- admin (Most permissions)
- seller (E-commerce permissions)
- user (Basic permissions)

Permissions:
- 50+ granular permissions
- Dynamic permission checking
- Role inheritance

🔒 Security Measures

// Laravel Built-in SecurityCSRF Protection (All forms)
✓ XSS Prevention (Blade escaping)
✓ SQL Injection Prevention (Query Builder/Eloquent)
✓ Mass Assignment Protection (fillable/guarded)
✓ Password Hashing (bcrypt)
✓ Encryption (AES-256-CBC)

// Custom Security
✓ Rate Limiting (Throttle middleware)
✓ IP Whitelisting/Blacklisting
✓ Failed Login Lockout
✓ Suspicious Activity Detection
✓ Auto-ban System
✓ Activity Logging
✓ File Upload Validation
✓ Request Signature Verification (Webhooks)

// Headers Security
✓ X-Frame-Options: SAMEORIGIN
✓ X-Content-Type-Options: nosniff
✓ X-XSS-Protection: 1; mode=block
✓ Strict-Transport-Security (HSTS)
✓ Content-Security-Policy (CSP)

🔐 License System

// License Validation Flow
1. Check developer mode (bypass if enabled)
2. Load license from .env
3. Check cache (7 days)
4. Validate with TpLicense API
   - License key valid?
   - Domain matches?
   - IP whitelisted?
   - Not expired?
5. Cache result
6. Allow/Deny access

// IP Whitelist System
- Admin manages IP whitelist in WordPress
- Installation checks IP before download
- Runtime validation checks IP
- IP change requires admin approval

🔍 Audit Logging

// Activity Logs
- User login/logout
- Profile changes
- Withdrawal requests
- Commission payments
- Admin actions
- API calls
- Failed attempts

// Log Retention
- 90 days for general logs
- 365 days for financial logs
- Permanent for audit trails

🚀 Deployment

📦 Deployment Scripts

1. deploy.sh - Main Deployment

./deploy.sh [branch]

# Features:
# ✓ Maintenance mode during deployment
# ✓ Automatic database backup
# ✓ Git pull latest code
# ✓ Composer install/update
# ✓ NPM build
# ✓ Database migrations
# ✓ Cache optimization
# ✓ Auto-retry on timeout (3 attempts)
# ✓ Rollback commands on failure
# ✓ Deployment logging

# Example:
./deploy.sh main

2. install.sh - Fresh Installation

./install.sh

# Interactive installer:
# 1. Check system requirements
# 2. Configure .env
# 3. Create database
# 4. Install dependencies
# 5. Run migrations
# 6. Seed data
# 7. Create admin account
# 8. Build assets
# 9. Set permissions
# 10. Complete setup

3. rollback.sh - Emergency Rollback

./rollback.sh

# Rollback features:
# ✓ Restore previous git commit
# ✓ Restore database backup
# ✓ Restore file backup
# ✓ Clear caches
# ✓ Restart services

🔄 Version Management

# Check current version
php artisan app:version
# Output: Current version: 3.120.0

# Bump version
php artisan app:bump-version patch
php artisan app:bump-version minor
php artisan app:bump-version major

# Check for updates
php artisan app:check-update

# Auto-update (with license validation)
php artisan app:update

🌐 Production Checklist

# Before deployment
☐ Run tests: php artisan test
☐ Code formatting: ./vendor/bin/pint
☐ Build assets: npm run build
☐ Update CHANGELOG.md
☐ Bump VERSION
☐ Backup database
☐ Review .env settings

# Deployment
☐ Enable maintenance mode
☐ Pull latest code
☐ Install dependencies
☐ Run migrations
☐ Clear caches
☐ Optimize application
☐ Disable maintenance mode

# After deployment
☐ Test critical features
☐ Monitor error logs
☐ Check performance
☐ Verify backups
☐ Notify team

📊 Performance Optimization

// Caching Strategy
✓ Route caching: php artisan route:cache
✓ Config caching: php artisan config:cache
✓ View caching: php artisan view:cache
✓ Query result caching (Redis)
✓ Response caching (selected routes)
✓ CDN for static assets

// Database Optimization
✓ Query optimization
✓ Eager loading relationships
✓ Index optimization
✓ Database connection pooling
✓ Read replicas (optional)

// Frontend Optimization
✓ Asset minification (Vite)
✓ Image optimization (WebP)
✓ Lazy loading
✓ Code splitting
✓ Browser caching
✓ Gzip compression

📖 Comprehensive Documentation

📚 All Documentation Files (100+)

🎯 Core Documentation

💻 Development Guides

🤖 AI & LINE Bot

⛓️ Blockchain & Crypto

🏪 MLM & E-Commerce

🎨 Theme & UI

🎮 Games & Entertainment

🏨 Industry Solutions

🔧 System & Utilities

🚀 Deployment & Operations

👑 Admin & Management


🛠️ Development Guide

🎯 Setting Up Development Environment

# 1. Clone repository
git clone https://github.com/xjanova/Thaiprompt-Affiliate.git
cd Thaiprompt-Affiliate

# 2. Install Git Hooks (CRITICAL!)
bash scripts/git-hooks/install.sh

# 3. Install dependencies
composer install
npm install

# 4. Setup environment
cp .env.example .env
php artisan key:generate

# 5. Enable developer mode (skip license check)
# Add to .env:
LICENSE_DEVELOPER_MODE=true

# 6. Setup database
php artisan migrate
php artisan db:seed

# 7. Start development servers
php artisan serve &
npm run dev

📝 Coding Standards (V3)

⚠️ VERSION 3 BREAKING CHANGES

เราอยู่ที่ Version 3 แล้ว - แนวทางการเขียนโค้ดเปลี่ยนแปลง

ด้าน V2 (เก่า) ❌ V3 (ใหม่) ✅
CSS Framework Bootstrap + Custom CSS Tailwind CSS (pure)
JavaScript jQuery + Vue.js Alpine.js (หลัก)
Drag & Drop jQuery UI Sortable SortableJS
UI Style Flat, Traditional 3D, Glassmorphism, Gradients

🚫 ห้ามทำใน V3

❌ ห้ามใช้ jQuery สำหรับ DOM manipulation
❌ ห้ามใช้ Bootstrap classes
❌ ห้ามใช้ jQuery UI Sortable
❌ ห้ามสร้าง custom CSS classes ใหม่ (ยกเว้นจำเป็จริงๆ)
❌ ห้าม inline styles

✅ ต้องทำใน V3

✅ ใช้ Tailwind CSS สำหรับทุก styling
✅ ใช้ Alpine.js สำหรับ interactivity
✅ Component-based architecture
✅ Modern UI - Glassmorphism, 3D effects
✅ Performance-first - Lazy loading, debounce
✅ Dark mode support ทุก component
✅ Mobile-first responsive

🔧 Development Workflow

# 1. Create feature branch
git checkout -b feature/your-feature-name

# 2. Make changes following V3 guidelines
# - Read .claude/V3_CODING_GUIDELINES.md
# - Use Thai language in comments
# - Implement dark/light mode
# - Make responsive design

# 3. Test locally
php artisan test
npm run build

# 4. Commit (Git hooks run automatically)
git add .
git commit -m "feat: your feature description"

# 5. Push to remote
git push -u origin feature/your-feature-name

# 6. Create pull request

🧪 Testing

# Run all tests
php artisan test

# Run specific test file
php artisan test tests/Feature/WalletTest.php

# Run with coverage
php artisan test --coverage

# Run specific test method
php artisan test --filter test_user_can_withdraw

📚 Creating New Features

Complete Checklist:

☐ Read relevant .claude/ guidelines
☐ Understand dark/light mode requirements
☐ Check existing similar features

# During Development
☐ Create migration with Schema::hasTable() check
☐ Create model with relationships
☐ Create seeder and add to DatabaseSeeder.php
☐ Create controller with validation
☐ Create routes with middleware
☐ Create views with dark/light mode
☐ Add Thai language comments
☐ Implement responsive design
☐ Add error handling

# After Development
☐ Run tests
☐ Build assets
☐ Test dark/light mode
☐ Test on mobile/tablet/desktop
☐ Commit with descriptive message
☐ Push to feature branch

❓ Troubleshooting

🔧 Common Issues

❌ Permission denied in storage/
# Fix permissions
chmod -R 775 storage bootstrap/cache
chown -R www-data:www-data storage bootstrap/cache

# Or use script
./fix-permissions.sh
❌ MySQL connection failed
  1. Check MySQL service: sudo systemctl status mysql
  2. Check credentials in .env
  3. Create database: CREATE DATABASE thaiprompt_affiliate;
  4. Grant privileges: GRANT ALL ON thaiprompt_affiliate.* TO 'user'@'localhost';
❌ Deploy failed
# View deployment logs
tail -f storage/logs/deployment.log

# Rollback
./rollback.sh

# Or manual rollback
git reset --hard COMMIT_HASH
composer install
php artisan migrate:rollback
php artisan up
❌ Assets not loading
# Rebuild assets
npm run build

# Clear cache
php artisan optimize:clear

# Check symlink
php artisan storage:link --force
❌ Queue not processing
# Check queue worker
ps aux | grep "queue:work"

# Restart queue
php artisan queue:restart

# Monitor queue
php artisan queue:monitor
❌ License validation failed
# Check license status
php artisan license:check

# Reactivate license
php artisan license:activate YOUR-LICENSE-KEY

# Check cache
php artisan cache:clear
❌ Migration failed
# Check migration status
php artisan migrate:status

# Rollback last migration
php artisan migrate:rollback

# Fresh migration (CAUTION: deletes data)
php artisan migrate:fresh

# Fresh with seeders
php artisan migrate:fresh --seed

📞 Getting Help

  1. Check Documentation - 100+ MD files
  2. Search Issues - GitHub Issues
  3. Check Logs - storage/logs/laravel.log
  4. Debug Mode - Set APP_DEBUG=true (development only)
  5. Contact Support - support@thaiprompt.com

💬 Support & Community

📧 Contact Information

📚 Resources

🤝 Contributing

We welcome contributions! Please:

  1. Fork the repository
  2. Create feature branch
  3. Follow V3 coding standards
  4. Write tests
  5. Submit pull request

Contribution Guidelines: DEVELOPMENT.md


🏆 Credits & Acknowledgments

👨‍💻 Development Team

ThaiPrompt Development Team

  • Professional Web Development
  • Enterprise Solutions
  • AI & Blockchain Integration

🛠️ Technologies Used

Backend

Frontend

Third-Party Services

🙏 Special Thanks

  • Laravel Community
  • Tailwind CSS Team
  • Alpine.js Creator
  • All Open Source Contributors

📄 License

Copyright © 2025 ThaiPrompt Team. All rights reserved.

This project is commercial software licensed under a proprietary license.

License Features

  • License System: WordPress-based license management
  • IP Whitelist: Installation restricted by IP
  • Domain Lock: Single domain per license
  • Auto-updates: Receive updates with valid license
  • Support: 1 year support included

License Validation

// License checked on:
- Installation
- Every 24 hours (runtime)
- Before updates
- Before critical features

// Bypass for development:
LICENSE_DEVELOPER_MODE=true (in .env)

For licensing inquiries: license@thaiprompt.com


🌟 Version Information

Current Version: 3.120.0

Release Date: 2025-11-22

Build: Production

Version History

Version Date Type Highlights
3.120.0 2025-11-22 Major AI Bot Profiles feature
3.119.1 2025-11-22 Patch Menu fixes
3.0.0 2025-11-15 Major V3 Release - Tailwind + Alpine.js
2.203.0 2025-11-10 Minor Arrow X Theme System
2.200.0 2025-11-01 Minor LINE Signup Enhancement
1.144.0 2025-10-15 Minor TPIX Staking
1.100.0 2025-09-01 Minor MLM System Complete
1.0.0 2025-01-12 Major Initial Release

📋 View Full Changelog


🚀 Quick Start Summary

# 🎯 Installation (Choose One Method)

# Method 1: Auto-installer (Recommended)
git clone https://github.com/xjanova/Thaiprompt-Affiliate.git
cd Thaiprompt-Affiliate
chmod +x install.sh
./install.sh

# Method 2: Manual
composer install && npm install
cp .env.example .env
php artisan key:generate
php artisan migrate --seed
npm run build

# 🌐 Access
# Frontend: http://yourdomain.com
# Admin: http://yourdomain.com/admin
# API: http://yourdomain.com/api/v1

# 🚀 Deploy Updates (Future)
./deploy.sh

# 📖 Documentation
# Read: INSTALLATION.md for detailed guide

🗺️ Roadmap

🔜 Coming Soon

  • Mobile Apps (.NET MAUI - iOS & Android)
  • WhatsApp Bot Integration
  • Telegram Bot Integration
  • Voice Assistant (AI-powered)
  • Advanced Analytics (ML-powered)
  • Multi-currency Support (100+ fiat currencies)
  • DeFi Integration (Yield farming, Liquidity pools)
  • NFT Marketplace Expansion
  • DAO Governance System
  • GraphQL API (alongside REST)

💡 Feature Requests

Have ideas? Submit them:


⭐ Star This Project!

If you find TP-Affiliate Pro useful, please give it a star on GitHub!

GitHub stars


Made with ❤️ in Thailand

🏠 Website📖 Documentation🐛 Report Bug💬 Support

© 2025 ThaiPrompt Team. All Rights Reserved.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors