Skip to content

This is a fully open-source advanced Sub4Sub Web Application made with PHP and MySQL database by Hiranmay Roy and Sameer Pathak.

Notifications You must be signed in to change notification settings

cold-cofffeee/Sub4Sub-Web-Application

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

38 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SUB4SUB v2.0 - Professional Production Setup Guide

πŸš€ Quick Start (5 Minutes)

1. Database Setup

CREATE DATABASE sub4sub CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

Then run the migration:

php install/migrate.php

2. Environment Configuration

cp .env.example .env

Edit .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

3. Access Your Site


πŸ“ Professional File Structure

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

πŸ’³ Payment Gateway Integration

Demo Mode (Default - No Configuration Needed)

  • Works immediately without any setup
  • Creates test transactions
  • Perfect for development

Stripe Integration

  1. Get API keys from https://dashboard.stripe.com/apikeys
  2. Add to .env: STRIPE_SECRET_KEY=sk_live_xxxxx
  3. Users can pay with credit cards

PayPal Integration

  1. Create app at https://developer.paypal.com
  2. Add to .env: PAYPAL_CLIENT_ID=xxxxx
  3. PayPal checkout enabled

πŸ“§ Email Configuration (100% Optional)

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

πŸ”’ Security Features

βœ… CSRF Protection
βœ… Password Hashing (bcrypt)
βœ… SQL Injection Prevention
βœ… XSS Protection
βœ… Rate Limiting
βœ… Session Security
βœ… API Authentication
βœ… Activity Logging
βœ… AES-256 Encryption


🎨 Modern Features

User Features

  • Responsive Design
  • Real-time Statistics
  • AJAX Operations
  • Premium Subscriptions
  • Analytics Dashboard
  • Notification System

Admin Features

  • Modern Dashboard
  • User Management
  • Payment Tracking
  • Content Management
  • Activity Logs
  • Settings Panel

🎯 Pricing Plans

  • 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

🌐 Production Deployment

Security Checklist

  • Change ADMIN_PASSWORD in .env
  • Set APP_ENV=production
  • Set APP_DEBUG=false
  • Configure payment gateways
  • Set up HTTPS/SSL
  • Configure backups

Performance

// Enable OPcache in php.ini
opcache.enable=1
opcache.memory_consumption=128

πŸ†˜ Troubleshooting

Database 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


πŸ”Œ API Endpoints

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


πŸ“Š Database Schema

8 Tables:

  • users
  • subscriptions
  • payments
  • notifications
  • activity_logs
  • settings
  • points
  • api_tokens

πŸ“ Version 2.0.0 Features

βœ… 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


⭐ Pro Tips

  1. Always backup before updates
  2. Use strong passwords in production
  3. Enable HTTPS for payments
  4. Monitor logs regularly
  5. Test payments in sandbox mode first
  6. Keep PHP and MySQL updated

Built with PHP 8.0+, MySQL 5.7+, Bootstrap 5

Ready to launch! πŸš€

About

This is a fully open-source advanced Sub4Sub Web Application made with PHP and MySQL database by Hiranmay Roy and Sameer Pathak.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published