Initial commit: Pireon Admin — headless admin panel and public API

Laravel 13 + Filament 5 admin panel and REST API for a non-profit developer
collective, backed by the Pireon OAuth identity server. The public site is a
separate, server-rendered application consuming /api/public/v1.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-19 17:55:27 +02:00
commit 3897113313
534 changed files with 64050 additions and 0 deletions

46
app/Jobs/ProcessMedia.php Normal file
View File

@@ -0,0 +1,46 @@
<?php
declare(strict_types=1);
namespace App\Jobs;
use App\Models\Media;
use App\Services\Media\ImageProcessor;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Queue\Queueable;
use Illuminate\Queue\Middleware\WithoutOverlapping;
/**
* Derives an image's versions off the request.
*
* Queued because resampling four widths in two formats takes seconds, and the
* person who pressed "save" should not be waiting for it. Until it runs the
* image still serves — just without the extras — so a queue that is behind
* degrades the page rather than breaking it.
*/
class ProcessMedia implements ShouldQueue
{
use Queueable;
public int $tries = 3;
/** @var array<int, int> */
public array $backoff = [10, 60];
public function __construct(public Media $media) {}
/**
* @return array<int, object>
*/
public function middleware(): array
{
// The safety-net command and an upload can easily land on the same
// file at once, and both would be writing the same derived paths.
return [(new WithoutOverlapping("media:{$this->media->id}"))->dontRelease()];
}
public function handle(ImageProcessor $processor): void
{
$processor->process($this->media);
}
}

View File

@@ -0,0 +1,63 @@
<?php
declare(strict_types=1);
namespace App\Jobs;
use App\Models\Repository;
use App\Services\Git\GitException;
use App\Services\Git\GitManager;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Queue\Queueable;
use Illuminate\Queue\Middleware\WithoutOverlapping;
use Illuminate\Support\Facades\Log;
class SyncRepository implements ShouldQueue
{
use Queueable;
public int $tries = 3;
/**
* Spread retries out: the usual cause of failure is a rate limit, and
* retrying immediately just burns the remaining allowance.
*
* @var array<int, int>
*/
public array $backoff = [60, 600];
public function __construct(public Repository $repository) {}
/**
* @return array<int, object>
*/
public function middleware(): array
{
// A manual "sync now" and the hourly schedule can easily coincide.
return [(new WithoutOverlapping((string) $this->repository->id))->dontRelease()];
}
public function handle(GitManager $git): void
{
try {
$git->sync($this->repository);
} catch (GitException $e) {
Log::warning('Repository sync failed', [
'repository' => $this->repository->full_name,
'provider' => $this->repository->provider->value,
'message' => $e->getMessage(),
]);
// A deleted or renamed repository will never succeed, so stop
// retrying. The failure is already recorded on the model and shown
// in the panel.
if (! $e->isTransient) {
$this->fail($e);
return;
}
throw $e;
}
}
}