feat(Production): Complete production deployment infrastructure

- Add comprehensive health check system with multiple endpoints
- Add Prometheus metrics endpoint
- Add production logging configurations (5 strategies)
- Add complete deployment documentation suite:
  * QUICKSTART.md - 30-minute deployment guide
  * DEPLOYMENT_CHECKLIST.md - Printable verification checklist
  * DEPLOYMENT_WORKFLOW.md - Complete deployment lifecycle
  * PRODUCTION_DEPLOYMENT.md - Comprehensive technical reference
  * production-logging.md - Logging configuration guide
  * ANSIBLE_DEPLOYMENT.md - Infrastructure as Code automation
  * README.md - Navigation hub
  * DEPLOYMENT_SUMMARY.md - Executive summary
- Add deployment scripts and automation
- Add DEPLOYMENT_PLAN.md - Concrete plan for immediate deployment
- Update README with production-ready features

All production infrastructure is now complete and ready for deployment.
This commit is contained in:
2025-10-25 19:18:37 +02:00
parent caa85db796
commit fc3d7e6357
83016 changed files with 378904 additions and 20919 deletions

View File

@@ -8,10 +8,9 @@ use App\Framework\Database\ConnectionInterface;
use App\Framework\Database\EntityManager;
use App\Framework\Database\ValueObjects\SqlQuery;
use App\Framework\Queue\Contracts\DeadLetterQueueInterface;
use App\Framework\Queue\Contracts\QueueInterface;
use App\Framework\Queue\Queue;
use App\Framework\Queue\Entities\DeadLetterJob;
use App\Framework\Queue\ValueObjects\DeadLetterQueueName;
use App\Framework\Queue\ValueObjects\JobPayload;
use App\Framework\Queue\ValueObjects\QueueName;
use App\Framework\Queue\ValueObjects\QueuePriority;
@@ -23,8 +22,9 @@ final readonly class DatabaseDeadLetterQueue implements DeadLetterQueueInterface
public function __construct(
private ConnectionInterface $connection,
private EntityManager $entityManager,
private QueueInterface $originalQueue
) {}
private Queue $originalQueue
) {
}
public function addFailedJob(DeadLetterJob $deadLetterJob): void
{
@@ -69,7 +69,7 @@ final readonly class DatabaseDeadLetterQueue implements DeadLetterQueueInterface
try {
// Get the dead letter job
$deadLetterJob = $this->findDeadLetterJob($deadLetterJobId);
if (!$deadLetterJob) {
if (! $deadLetterJob) {
return false;
}
@@ -96,6 +96,7 @@ final readonly class DatabaseDeadLetterQueue implements DeadLetterQueueInterface
return true;
} catch (\Throwable $e) {
$this->connection->rollback();
throw $e;
}
}
@@ -122,6 +123,7 @@ final readonly class DatabaseDeadLetterQueue implements DeadLetterQueueInterface
public function clearQueue(DeadLetterQueueName $deadLetterQueueName): int
{
$sql = "DELETE FROM dead_letter_jobs WHERE dead_letter_queue = ?";
return $this->connection->execute(SqlQuery::create($sql, [$deadLetterQueueName->toString()]));
}
@@ -150,7 +152,7 @@ final readonly class DatabaseDeadLetterQueue implements DeadLetterQueueInterface
'avg_retry_count' => round((float) $stats['avg_retry_count'], 2),
'max_retry_count' => (int) $stats['max_retry_count'],
'oldest_job' => $stats['oldest_job'],
'newest_job' => $stats['newest_job']
'newest_job' => $stats['newest_job'],
];
}
@@ -177,6 +179,7 @@ final readonly class DatabaseDeadLetterQueue implements DeadLetterQueueInterface
private function deleteJobById(string $deadLetterJobId): bool
{
$sql = "DELETE FROM dead_letter_jobs WHERE id = ?";
return $this->connection->execute(SqlQuery::create($sql, [$deadLetterJobId])) > 0;
}
@@ -198,4 +201,4 @@ final readonly class DatabaseDeadLetterQueue implements DeadLetterQueueInterface
lastRetryAt: $row['last_retry_at']
);
}
}
}