CREATE DATABASE sub4sub CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;Then run the migration:
php install/migrate.phpcp .env.example .envEdit .env with your settings:
# Required - Database
DB_HOST=localhost
DB_NAME=sub4sub
DB_USER=root
DB_PASS=your_password
# Required - Admin Access
ADMIN_USERNAME=admin
ADMIN_PASSWORD=ChangeThisPassword123!
# Optional - Email (Leave empty to disable)
SMTP_HOST=smtp.gmail.com
SMTP_USER=your-email@gmail.com
SMTP_PASS=your-app-password
# Optional - Payments (Leave empty for demo mode)
STRIPE_SECRET_KEY=sk_live_your_stripe_key
PAYPAL_CLIENT_ID=your_paypal_client_id- Website: http://yourdomain.com
- Admin Panel: http://yourdomain.com/Admin/login.php
- Default Admin: admin / admin123 (Change in .env!)
Sub4Sub-Web-Application/
βββ Admin/ # Admin Panel
β βββ login.php # Admin authentication
β βββ dashboard.php # Statistics & overview
β βββ users.php # User management
β βββ payments.php # Payment history
β βββ settings.php # Global settings
β βββ content-management.php # Content hub
β βββ ...
β
βββ api/ # RESTful API
βββ assets/ # CSS, JS, Images
βββ classes/ # OOP Architecture
β βββ Database.php # PDO singleton
β βββ User.php # User model
β βββ Security.php # Security utilities
β βββ EmailService.php # Email (optional)
β βββ Logger.php # Logging system
β
βββ config/ # Configuration
βββ includes/ # Header/Footer templates
βββ install/ # Database migration
β
βββ index.php # Landing page
βββ account.php # User dashboard
βββ exchange.php # Subscription exchange
βββ purchase.php # Premium checkout
βββ .env.example # Environment template
βββ README.md # This file
- Works immediately without any setup
- Creates test transactions
- Perfect for development
- Get API keys from https://dashboard.stripe.com/apikeys
- Add to
.env:STRIPE_SECRET_KEY=sk_live_xxxxx - Users can pay with credit cards
- Create app at https://developer.paypal.com
- Add to
.env:PAYPAL_CLIENT_ID=xxxxx - PayPal checkout enabled
The app works perfectly without email configuration.
Leave SMTP settings empty in .env to disable:
SMTP_HOST=
SMTP_USER=
SMTP_PASS=To enable Gmail:
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASS=your-app-passwordβ
CSRF Protection
β
Password Hashing (bcrypt)
β
SQL Injection Prevention
β
XSS Protection
β
Rate Limiting
β
Session Security
β
API Authentication
β
Activity Logging
β
AES-256 Encryption
- Responsive Design
- Real-time Statistics
- AJAX Operations
- Premium Subscriptions
- Analytics Dashboard
- Notification System
- Modern Dashboard
- User Management
- Payment Tracking
- Content Management
- Activity Logs
- Settings Panel
- Free: 10 subscriptions/day, basic features
- Monthly ($9.99): Unlimited subscriptions, advanced analytics
- Quarterly ($24.99): Save 17%, extended features
- Yearly ($99.99): Save 17%, all features
- Change
ADMIN_PASSWORDin.env - Set
APP_ENV=production - Set
APP_DEBUG=false - Configure payment gateways
- Set up HTTPS/SSL
- Configure backups
// Enable OPcache in php.ini
opcache.enable=1
opcache.memory_consumption=128Database Error: Check .env DB credentials
Admin Can't Login: Default is admin/admin123
Email Not Sending: This is normal - email is optional
Payment Not Working: Demo mode is automatic
Styling Broken: Clear browser cache
POST /api/auth/login
POST /api/auth/register
GET /api/users/me
GET /api/subscriptions
POST /api/subscriptions
GET /api/notifications
Authentication: Bearer token in Authorization header
8 Tables:
- users
- subscriptions
- payments
- notifications
- activity_logs
- settings
- points
- api_tokens
β
Complete codebase overhaul
β
Modern OOP architecture
β
Professional file naming
β
Working payment gateways
β
Optional email system
β
Modern admin panel
β
Responsive design
β
Comprehensive security
β
RESTful API
β
Production-ready
- Always backup before updates
- Use strong passwords in production
- Enable HTTPS for payments
- Monitor logs regularly
- Test payments in sandbox mode first
- Keep PHP and MySQL updated
Built with PHP 8.0+, MySQL 5.7+, Bootstrap 5
Ready to launch! π