From 97909bec7516865f9e4257dd865aea26e66bd88d Mon Sep 17 00:00:00 2001 From: Snider Date: Mon, 9 Mar 2026 18:55:40 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20initial=20core/php-client=20=E2=80=94?= =?UTF-8?q?=20SaaS=20customer=20dashboard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extracts Core\Front\Client (authenticated dashboard, client routes, Livewire components) from core/php. Co-Authored-By: Claude Opus 4.6 --- LICENSE | 22 +++++ composer.json | 24 ++++++ .../Front/Client/Blade/dashboard.blade.php | 24 ++++++ .../Front/Client/Blade/layouts/app.blade.php | 85 +++++++++++++++++++ src/Core/Front/Client/Boot.php | 69 +++++++++++++++ src/Core/Front/Client/README.md | 52 ++++++++++++ src/Core/Front/Client/Routes/client.php | 30 +++++++ src/Core/Front/Client/View/Dashboard.php | 29 +++++++ 8 files changed, 335 insertions(+) create mode 100644 LICENSE create mode 100644 composer.json create mode 100644 src/Core/Front/Client/Blade/dashboard.blade.php create mode 100644 src/Core/Front/Client/Blade/layouts/app.blade.php create mode 100644 src/Core/Front/Client/Boot.php create mode 100644 src/Core/Front/Client/README.md create mode 100644 src/Core/Front/Client/Routes/client.php create mode 100644 src/Core/Front/Client/View/Dashboard.php diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..7d75320 --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ +European Union Public Licence +Version 1.2 + +EUPL (c) the European Union 2007, 2016 + +This European Union Public Licence (the "EUPL") applies to the Work (as +defined below) which is provided under the terms of this Licence. Any use +of the Work, other than as authorised under this Licence is prohibited (to +the extent such use is covered by a right of the copyright holder of the +Work). + +The Work is provided under the terms of this Licence when the Licensor (as +defined below) has placed the following notice immediately following the +copyright notice for the Work: + + Licensed under the EUPL + +or has expressed by any other means his willingness to license under the +EUPL. + +For the full licence text, see: +https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12 diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..06f7714 --- /dev/null +++ b/composer.json @@ -0,0 +1,24 @@ +{ + "name": "lthn/client", + "description": "SaaS customer dashboard — authenticated client frontend", + "license": "EUPL-1.2", + "require": { + "php": "^8.2", + "lthn/php": "*" + }, + "autoload": { + "psr-4": { + "Core\\Front\\Client\\": "src/Core/Front/Client/" + } + }, + "replace": { + "core/php-client": "self.version" + }, + "extra": { + "laravel": { + "dont-discover": [] + } + }, + "minimum-stability": "dev", + "prefer-stable": true +} diff --git a/src/Core/Front/Client/Blade/dashboard.blade.php b/src/Core/Front/Client/Blade/dashboard.blade.php new file mode 100644 index 0000000..9832638 --- /dev/null +++ b/src/Core/Front/Client/Blade/dashboard.blade.php @@ -0,0 +1,24 @@ +
+

Your Namespace

+

Manage your space on the internet.

+ +
+ {{-- Namespace Overview --}} +
+

Overview

+

Your namespace details will appear here.

+
+ + {{-- Quick Actions --}} +
+

Quick Actions

+

Edit your bio, view analytics, and more.

+
+ + {{-- Recent Activity --}} +
+

Recent Activity

+

Your recent activity will appear here.

+
+
+
diff --git a/src/Core/Front/Client/Blade/layouts/app.blade.php b/src/Core/Front/Client/Blade/layouts/app.blade.php new file mode 100644 index 0000000..33e5cdf --- /dev/null +++ b/src/Core/Front/Client/Blade/layouts/app.blade.php @@ -0,0 +1,85 @@ + + + + + + + {{ $title ?? 'Dashboard' }} - lt.hn + + {{-- Fonts --}} + + + + {{-- Font Awesome --}} + + + @vite(['resources/css/admin.css', 'resources/js/app.js']) + @fluxAppearance + + + {{-- Header --}} +
+
+
+ {{-- Logo + Bio link --}} +
+ lt.hn + @if(isset($bioUrl)) + / + + {{ $bioUrl }} + + @endif +
+ + {{-- Nav + User menu --}} +
+ @if(isset($bioUrl)) + + @endif + + @auth + + @endauth +
+
+
+
+ + {{-- Main content --}} +
+
+ {{ $slot }} +
+
+ + @fluxScripts + + diff --git a/src/Core/Front/Client/Boot.php b/src/Core/Front/Client/Boot.php new file mode 100644 index 0000000..b023f04 --- /dev/null +++ b/src/Core/Front/Client/Boot.php @@ -0,0 +1,69 @@ +group('client', [ + \Illuminate\Cookie\Middleware\EncryptCookies::class, + \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, + \Illuminate\Session\Middleware\StartSession::class, + \Illuminate\View\Middleware\ShareErrorsFromSession::class, + \Illuminate\Foundation\Http\Middleware\ValidateCsrfToken::class, + \Illuminate\Routing\Middleware\SubstituteBindings::class, + SecurityHeaders::class, + 'auth', + ]); + } + + public function register(): void + { + // + } + + public function boot(): void + { + // Register client:: namespace for client dashboard components + $this->loadViewsFrom(__DIR__.'/Blade', 'client'); + Blade::anonymousComponentPath(__DIR__.'/Blade', 'client'); + + // Fire ClientRoutesRegistering event for lazy-loaded modules + LifecycleEventProvider::fireClientRoutes(); + } +} diff --git a/src/Core/Front/Client/README.md b/src/Core/Front/Client/README.md new file mode 100644 index 0000000..f9cf4c4 --- /dev/null +++ b/src/Core/Front/Client/README.md @@ -0,0 +1,52 @@ +# Core/Front/Client + +SaaS customer dashboard for namespace owners. + +## Concept + +``` +Core/Front/Web → Public (anonymous, read-only) +Core/Front/Client → SaaS customer (authenticated, namespace owner) ← THIS +Core/Front/Admin → Backend admin (privileged) +Core/Hub → SaaS operator (Host.uk.com control plane) +``` + +## Namespace vs Workspace + +- **Namespace** = your identity, tied to a URI/handle (lt.hn/you, you.lthn) +- **Workspace** = management container (org/agency that can own multiple namespaces) +- **Personal workspace** = IS your namespace (1:1 for solo users) + +A user with just a personal workspace uses **Client** to manage their namespace. +An org workspace with multiple namespaces uses **Hub** for team management. + +## Use Cases + +- Bio page editor (lt.hn/you) +- Analytics dashboard (your stats) +- Domain management (custom domains, web3) +- Settings (profile, notifications) +- Boost purchases (expand namespace entitlements) + +## Not For + +- Team/org management (use Hub) +- Multi-namespace management (use Hub) +- Backend admin tasks (use Admin) +- Public viewing (use Web) + +## Middleware + +```php +Route::middleware('client')->group(function () { + // Namespace owner routes +}); +``` + +## Views + +```blade +@extends('client::layouts.app') + + +``` diff --git a/src/Core/Front/Client/Routes/client.php b/src/Core/Front/Client/Routes/client.php new file mode 100644 index 0000000..9b61a4d --- /dev/null +++ b/src/Core/Front/Client/Routes/client.php @@ -0,0 +1,30 @@ +group(function () { + // Dashboard + Route::get('/dashboard', Dashboard::class)->name('client.dashboard'); + + // Additional routes can be registered via ClientRoutesRegistering event +}); diff --git a/src/Core/Front/Client/View/Dashboard.php b/src/Core/Front/Client/View/Dashboard.php new file mode 100644 index 0000000..9e90cbc --- /dev/null +++ b/src/Core/Front/Client/View/Dashboard.php @@ -0,0 +1,29 @@ +layout('client::layouts.app'); + } +}