Add Fortify auth, Flux dark mode, demo seed, and Docker hot reload.

Protect recordings per user, seed a demo login on container start, and bind-mount the app with Vite HMR for local Compose development.
This commit is contained in:
ben
2026-08-12 18:38:53 +02:00
parent accb721811
commit bfcfc12f58
78 changed files with 3942 additions and 186 deletions
+18 -2
View File
@@ -5,6 +5,7 @@ namespace Tests\Feature;
use App\Events\RecordingTranscriptionUpdated;
use App\Jobs\TranscribeRecording;
use App\Models\Recording;
use App\Models\User;
use App\Services\TranscriptionService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Event;
@@ -16,11 +17,22 @@ class TranscriptionBroadcastTest extends TestCase
{
use RefreshDatabase;
protected User $user;
protected function setUp(): void
{
parent::setUp();
$this->user = User::factory()->create();
$this->actingAs($this->user);
}
public function test_report_progress_broadcasts_transcription_updated(): void
{
Event::fake([RecordingTranscriptionUpdated::class]);
$recording = Recording::query()->create([
'user_id' => $this->user->id,
'title' => 'Broadcast progress',
'original_filename' => 'progress.mp3',
'file_path' => 'recordings/progress.mp3',
@@ -48,6 +60,7 @@ class TranscriptionBroadcastTest extends TestCase
Transcription::fake(['Hello from the recorder.']);
$recording = Recording::query()->create([
'user_id' => $this->user->id,
'title' => 'Sample',
'original_filename' => 'sample.mp3',
'file_path' => 'recordings/sample.mp3',
@@ -81,6 +94,7 @@ class TranscriptionBroadcastTest extends TestCase
});
$recording = Recording::query()->create([
'user_id' => $this->user->id,
'title' => 'Bad',
'original_filename' => 'bad.mp3',
'file_path' => 'recordings/bad.mp3',
@@ -111,6 +125,7 @@ class TranscriptionBroadcastTest extends TestCase
Event::fake([RecordingTranscriptionUpdated::class]);
$recording = Recording::query()->create([
'user_id' => $this->user->id,
'title' => 'Cancel me',
'original_filename' => 'cancel.mp3',
'file_path' => 'recordings/cancel.mp3',
@@ -128,9 +143,10 @@ class TranscriptionBroadcastTest extends TestCase
});
}
public function test_broadcast_event_uses_public_recordings_channel(): void
public function test_broadcast_event_uses_private_recording_channel(): void
{
$recording = Recording::query()->create([
'user_id' => $this->user->id,
'title' => 'Channel',
'original_filename' => 'channel.mp3',
'file_path' => 'recordings/channel.mp3',
@@ -141,6 +157,6 @@ class TranscriptionBroadcastTest extends TestCase
$event = new RecordingTranscriptionUpdated($recording);
$this->assertSame('RecordingTranscriptionUpdated', $event->broadcastAs());
$this->assertSame('recordings', $event->broadcastOn()[0]->name);
$this->assertSame('private-recording.'.$recording->id, $event->broadcastOn()[0]->name);
}
}