feat: Add comprehensive documentation suite and reorganize project structure

- Created complete documentation in docs/ directory
- Added PROJECT_OVERVIEW.md with feature highlights and getting started guide
- Added ARCHITECTURE.md with system design and technical details
- Added SECURITY.md with comprehensive security implementation guide
- Added DEVELOPMENT.md with development workflows and best practices
- Added DEPLOYMENT.md with production deployment instructions
- Added API.md with complete REST API documentation
- Added CONTRIBUTING.md with contribution guidelines
- Added CHANGELOG.md with version history and migration notes
- Reorganized all documentation files into docs/ directory for better organization
- Updated README.md with proper documentation links and quick navigation
- Enhanced project structure with professional documentation standards
This commit is contained in:
SamiAhmed7777
2025-10-21 00:39:45 -07:00
commit 0b7e2d0a5b
6080 changed files with 1332936 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
<?php
define('_ISVALID', true);
include_once '../../../f_core/config.core.php';
require_once __DIR__ . '/../config/config.php';
use Donations\DonationHandler;
// Get streamer information
$streamer_id = $_GET['streamer_id'] ?? 0;
$sql = "SELECT username, display_name FROM users WHERE user_id = ?";
$streamer = db()->getRow($sql, [$streamer_id]);
if (!$streamer) {
handle_error('Invalid streamer', 404);
}
// Initialize donation handler
$donation_handler = new DonationHandler();
// Load view
view('donation_form', [
'streamer' => $streamer,
'config' => $square_config
]);

View File

@@ -0,0 +1,69 @@
<?php
/*******************************************************************************************************************
| Software Name : EasyStream
| Software Description : High End YouTube Clone Script with Videos, Shorts, Streams, Images, Audio, Documents, Blogs
| Software Author : (c) Sami Ahmed
|*******************************************************************************************************************
|
|*******************************************************************************************************************
| This source file is subject to the EasyStream Proprietary License Agreement.
|
| By using this software, you acknowledge having read this Agreement and agree to be bound thereby.
|*******************************************************************************************************************
| Copyright (c) 2025 Sami Ahmed. All rights reserved.
|*******************************************************************************************************************/
define('_ISVALID', true);
include_once '../../../f_core/config.core.php';
$usr_key = $class_filter->clr_str($_GET['u']);
header('Content-Type: text/html; charset=UTF-8');
?><!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Donations Overlay</title>
<style>
html,body{margin:0;height:100%;background:transparent;overflow:hidden}
.ov-wrap{position:relative;width:100%;height:100%;font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;color:#fff}
.event{position:absolute;left:16px;bottom:16px;background:rgba(0,0,0,.55);padding:12px 14px;border-radius:8px;backdrop-filter:saturate(150%) blur(6px);box-shadow:0 6px 18px rgba(0,0,0,.3)}
.event .name{font-weight:600}
.event .amount{color:#6cf;margin-left:8px}
.goal{position:absolute;right:16px;top:16px;background:rgba(0,0,0,.55);padding:10px 12px;border-radius:8px}
.bar{width:220px;height:8px;background:rgba(255,255,255,.2);border-radius:6px;margin-top:8px;overflow:hidden}
.fill{height:100%;background:#6cf;width:0%}
</style>
<script>const uKey = <?php echo json_encode($usr_key); ?>;</script>
</head>
<body>
<div class="ov-wrap">
<div class="goal">
<div id="goal-title">Goal</div>
<div class="bar"><div id="goal-fill" class="fill"></div></div>
</div>
<div id="event" class="event" style="display:none"></div>
</div>
<script>
async function tick(){
try{
const res = await fetch('../api/overlay_status.php?u='+encodeURIComponent(uKey), {cache:'no-store'});
const j = await res.json();
const ev = document.getElementById('event');
if (j && j.recent && j.recent[0]){
const r = j.recent[0];
ev.innerHTML = `<span class="name">${r.name || 'Someone'}</span> <span class="amount">$${Number(r.amount||0).toFixed(2)}</span><div>${r.message?r.message:''}</div>`;
ev.style.display='block';
}
const pct = Math.max(0, Math.min(100, j.goal && j.goal.target>0 ? (j.goal.raised/j.goal.target*100) : 0));
document.getElementById('goal-fill').style.width = pct+'%';
document.getElementById('goal-title').textContent = j.goal && j.goal.title ? j.goal.title : 'Goal';
}catch(e){/* noop */}
}
tick(); setInterval(tick, 5000);
</script>
</body>
/html>

View File

@@ -0,0 +1,35 @@
<?php
define('_ISVALID', true);
include_once '../../../f_core/config.core.php';
require_once __DIR__ . '/../config/config.php';
use Donations\DonationHandler;
// Get POST data
$data = json_decode(file_get_contents('php://input'), true);
if (!$data) {
json_response([
'success' => false,
'message' => 'Invalid request data'
], 400);
}
// Validate required fields
if (!isset($data['streamer_id']) || !isset($data['amount'])) {
json_response([
'success' => false,
'message' => 'Missing required fields'
], 400);
}
// Process donation
$handler = new DonationHandler();
$result = $handler->createDonation(
$data['streamer_id'],
$data['amount'],
$data['donor_name'] ?? '',
$data['message'] ?? ''
);
json_response($result);

View File

@@ -0,0 +1,50 @@
<?php
define('_ISVALID', true);
include_once '../../../f_core/config.core.php';
require_once __DIR__ . '/../config/config.php';
use Donations\DonationHandler;
// Get JSON input
$input = json_decode(file_get_contents('php://input'), true);
if (!$input) {
handle_error('Invalid request data', 400);
}
// Validate required fields
$required_fields = ['nonce', 'amount', 'streamer_id'];
foreach ($required_fields as $field) {
if (!isset($input[$field]) || empty($input[$field])) {
handle_error("Missing required field: {$field}", 400);
}
}
// Initialize donation handler
$donation_handler = new DonationHandler();
try {
// Process the donation
$result = $donation_handler->createDonation(
$input['streamer_id'],
$input['amount'],
$input['nonce'],
$input['message'] ?? null
);
// Return success response
echo json_encode([
'success' => true,
'message' => 'Donation processed successfully',
'donation_id' => $result['donation_id']
]);
} catch (Exception $e) {
// Log error
error_log("Donation processing error: " . $e->getMessage());
// Return error response
echo json_encode([
'success' => false,
'error' => $e->getMessage()
]);
}

View File

@@ -0,0 +1,9 @@
<?php
define('_ISVALID', true);
include_once '../../../f_core/config.core.php';
require_once __DIR__ . '/../config/config.php';
use Donations\WebhookHandler;
$handler = new WebhookHandler();
$handler->handle();