Files
huginn/resources/views/home.blade.php
T
m105 f5c9129774 Add authentication, a public landing page, and guest data preview
Hand-rolled login/register/logout on Laravel's built-in Auth facade
rather than Breeze/Jetstream, which scaffold Tailwind v3 config and
would fight our existing Tailwind v4 CSS-first setup. Login/Register
are Livewire components; logout is a plain POST route (auth-gated,
CSRF-protected).

Routing: "/" is now a public landing page describing the project;
the sites list moved from "/" to "/sites" to make room for it.

Data gating: App\Support\GuestPreview::paginate() forces page 1 and a
5-row page size for unauthenticated visitors on Sites, Discover, and
a site's Pages/Backlinks tables, while total() still reflects the
real match count — authenticated users get the existing full
pagination unchanged. A shared guest-preview-notice component shows
"N of M results, sign in to see all" and only renders when something
is actually being hidden.

Testing: pointed the test suite at a dedicated MySQL database
(huginn_testing) instead of the default in-memory SQLite, since the
existing fulltext index migration isn't SQLite-compatible — this app
is MySQL-specific by now regardless. Added AuthFlowTest (register,
login, wrong-password rejection, logout) and GuestPreviewTest (guest
capped to a preview, authenticated sees everything), all passing.

Also fixed a real bug the tests caught: request()->session() isn't
reliably attached during Livewire's in-process test action calls;
switched Login/Register to the session() helper, which resolves the
session store directly and works in both contexts.
2026-07-25 15:22:42 +03:00

28 lines
1.9 KiB
PHP

<x-layouts.app>
<div class="mx-auto max-w-3xl px-4 py-20 text-center">
<h1 class="text-4xl font-bold tracking-tight">Find out who you're really competing with</h1>
<p class="mt-4 text-lg text-neutral-600 dark:text-neutral-400">
Huginn indexes the web using Common Crawl's public archive and helps you find competitors
by product, location, and even the platform they're built on — e.g. "who sells honey with a
<span class="whitespace-nowrap">.es</span> domain," or "which of my competitors run WordPress."
</p>
<div class="mt-8 flex justify-center gap-4">
@auth
<a href="{{ route('discover') }}" class="rounded-md bg-neutral-900 px-5 py-2.5 text-sm font-medium text-white hover:bg-neutral-700 dark:bg-white dark:text-neutral-900 dark:hover:bg-neutral-200">Go to Discover</a>
<a href="{{ route('sites.index') }}" class="rounded-md border border-neutral-300 px-5 py-2.5 text-sm font-medium hover:bg-neutral-50 dark:border-neutral-700 dark:hover:bg-neutral-900">Browse sites</a>
@else
<a href="{{ route('register') }}" class="rounded-md bg-neutral-900 px-5 py-2.5 text-sm font-medium text-white hover:bg-neutral-700 dark:bg-white dark:text-neutral-900 dark:hover:bg-neutral-200">Sign up free</a>
<a href="{{ route('login') }}" class="rounded-md border border-neutral-300 px-5 py-2.5 text-sm font-medium hover:bg-neutral-50 dark:border-neutral-700 dark:hover:bg-neutral-900">Log in</a>
@endauth
</div>
@guest
<p class="mt-10 text-sm text-neutral-500">
Browsing without an account shows a limited preview of results —
<a href="{{ route('register') }}" class="text-blue-600 hover:underline dark:text-blue-400">create a free account</a> to see everything.
</p>
@endguest
</div>
</x-layouts.app>