Toolvana: production-ready media tools platform (CodeIgniter 4)
- 134-tool registry with programmatic SEO (unique titles/H1/descriptions, JSON-LD graphs, sitemap index, canonical 301 enforcement via required filter) - DB-backed job queue (SKIP LOCKED) with drivers: Ffmpeg, Images (GD), Pdf (qpdf/gs/poppler), Youtube (thumbnails), Qr (server-side PNG) - Security: SSRF guard, MIME validation, rate limits, API-key auth, bcrypt admin login, security headers - Admin panel: dashboard, tools/categories/guides CRUD, SEO audit, analytics, job inspector with retry, system health, feature flags - Docker deployment (nginx + web/api FPM pools + scalable workers), PHPUnit suite (19 tests / 1139 assertions), PWA manifest + service worker
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
|
||||
/**
|
||||
* Anonymous product analytics: tool_view, tool_start, tool_success,
|
||||
* tool_failure, download, upload, search, error. No cookies, no PII —
|
||||
* session/ip values are one-way hashes with no lookup table.
|
||||
*/
|
||||
final class CreateAnalyticsEvents extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
$this->forge->addField([
|
||||
'id' => ['type' => 'BIGINT', 'unsigned' => true, 'auto_increment' => true],
|
||||
'name' => ['type' => 'VARCHAR', 'constraint' => 32],
|
||||
'tool_slug' => ['type' => 'VARCHAR', 'constraint' => 120, 'null' => true],
|
||||
'format' => ['type' => 'VARCHAR', 'constraint' => 16, 'null' => true],
|
||||
'value' => ['type' => 'BIGINT', 'unsigned' => true, 'default' => 0],
|
||||
'session_id' => ['type' => 'VARCHAR', 'constraint' => 64, 'null' => true],
|
||||
'country' => ['type' => 'CHAR', 'constraint' => 2, 'null' => true],
|
||||
'meta' => ['type' => 'JSON', 'null' => true],
|
||||
'created_at' => ['type' => 'DATETIME', 'null' => true],
|
||||
]);
|
||||
$this->forge->addPrimaryKey('id');
|
||||
$this->forge->addKey('name');
|
||||
$this->forge->addKey('created_at');
|
||||
$this->forge->addKey('tool_slug');
|
||||
$this->forge->createTable('analytics_events', true);
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
$this->forge->dropTable('analytics_events', true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user