feat: CLAUDE.md for every directory in CorePHP — 155 files total

Every directory containing PHP or Blade files now has agent-readable
documentation. 134 new files, 2,103 lines across:

- 78 blade component dirs (accordion through web)
- 18 admin view components
- 20 Core subsystem internals (models, services, concerns, migrations)
- 10 Bouncer/Gate subsystem dirs
- 5 root namespaces (Core, Mod, Mod/Trees, Plug, Website)
- Tests, config, lang, media, seo, cdn, search, storage, webhook dirs

Any agent landing on any CorePHP directory now understands the code
before reading a single PHP file. The CLAUDE.md IS the index.

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Snider 2026-03-29 13:41:35 +01:00
parent 1d8a202bdf
commit 98102e510d
134 changed files with 2103 additions and 0 deletions

View file

@ -0,0 +1,17 @@
# Activity/Concerns/ — Activity Logging Trait
## Traits
| Trait | Purpose |
|-------|---------|
| `LogsActivity` | Drop-in trait for models that should log changes. Wraps `spatie/laravel-activitylog` with sensible defaults: auto workspace_id tagging, dirty-only logging, empty log suppression. |
## Configuration via Model Properties
- `$activityLogAttributes` — array of attributes to log (default: all dirty)
- `$activityLogName` — custom log name
- `$activityLogEvents` — events to log (default: created, updated, deleted)
- `$activityLogWorkspace` — include workspace_id (default: true)
- `$activityLogOnlyDirty` — only log changed attributes (default: true)
Static helpers: `activityLoggingEnabled()`, `withoutActivityLogging(callable)`.

View file

@ -0,0 +1,9 @@
# Activity/Console/ — Activity Log Commands
## Commands
| Command | Signature | Purpose |
|---------|-----------|---------|
| `ActivityPruneCommand` | `activity:prune` | Prunes old activity logs. Options: `--days=N` (retention period), `--dry-run` (show count without deleting). Uses retention from config when days not specified. |
Part of the Activity subsystem's maintenance tooling. Should be scheduled in the application's console kernel for regular cleanup.

View file

@ -0,0 +1,14 @@
# Activity/Models/ — Activity Log Model
## Models
| Model | Extends | Purpose |
|-------|---------|---------|
| `Activity` | `Spatie\Activitylog\Models\Activity` | Extended activity model with workspace-aware scopes via the `ActivityScopes` trait. Adds query scopes for filtering by workspace, subject, causer, event type, date range, and search. |
Configure as the activity model in `config/activitylog.php`:
```php
'activity_model' => \Core\Activity\Models\Activity::class,
```
Requires `spatie/laravel-activitylog`.

View file

@ -0,0 +1,9 @@
# Activity/Scopes/ — Activity Query Scopes
## Traits
| Trait | Purpose |
|-------|---------|
| `ActivityScopes` | Comprehensive query scopes for activity log filtering. Includes: `forWorkspace`, `forSubject`, `forSubjectType`, `byCauser`, `byCauserId`, `ofType`, `createdEvents`, `updatedEvents`, `deletedEvents`, `betweenDates`, `today`, `lastDays`, `lastHours`, `search`, `inLog`, `withChanges`, `withExistingSubject`, `withDeletedSubject`, `newest`, `oldest`. |
Used by `Core\Activity\Models\Activity`. Workspace scoping checks both `properties->workspace_id` and subject model's `workspace_id`. Requires `spatie/laravel-activitylog`.

View file

@ -0,0 +1,11 @@
# Activity/Services/ — Activity Log Service
## Services
| Service | Purpose |
|---------|---------|
| `ActivityLogService` | Fluent interface for querying and managing activity logs. Methods: `logFor($model)`, `logBy($user)`, `forWorkspace($workspace)`, `recent()`, `search($term)`. Chainable query builder with workspace awareness. |
Provides the business logic layer over Spatie's activity log. Used by the `ActivityFeed` Livewire component and available for injection throughout the application.
Requires `spatie/laravel-activitylog`.

View file

@ -0,0 +1,9 @@
# Activity/View/Blade/admin/ — Activity Feed Blade Template
## Templates
| File | Purpose |
|------|---------|
| `activity-feed.blade.php` | Admin panel activity log display — paginated list with filters (user, model type, event type, date range), activity detail modal with full diff view, optional polling for real-time updates. |
Rendered by the `ActivityFeed` Livewire component via the `core.activity::admin.*` view namespace.

View file

@ -0,0 +1,11 @@
# Activity/View/Modal/Admin/ — Activity Feed Livewire Component
## Components
| Component | Purpose |
|-----------|---------|
| `ActivityFeed` | Livewire component for displaying activity logs in the admin panel. Paginated list with URL-bound filters (causer, subject type, event type, date range, search). Supports workspace scoping and optional polling for real-time updates. |
Usage: `<livewire:core.activity-feed />` or `<livewire:core.activity-feed :workspace-id="$workspace->id" poll="10s" />`
Requires `spatie/laravel-activitylog`.

View file

@ -0,0 +1,7 @@
# Bouncer/Database/Seeders/ — Bouncer Seeders
## Seeders
| File | Purpose |
|------|---------|
| `WebsiteRedirectSeeder.php` | Seeds 301 redirects for renamed website URLs. Uses the `RedirectService` to register old-to-new path mappings (e.g., `/services/biohost` -> `/services/bio`). Added during URL simplification (2026-01-16). |

View file

@ -0,0 +1,14 @@
# Bouncer/Gate/Attributes/ — Action Gate PHP Attributes
## Attributes
| Attribute | Target | Purpose |
|-----------|--------|---------|
| `#[Action(name, scope?)]` | Method, Class | Declares an explicit action name for permission checking, overriding auto-resolution from controller/method names. Optional `scope` for resource-specific permissions. |
Without this attribute, action names are auto-resolved: `ProductController@store` becomes `product.store`.
```php
#[Action('product.create')]
public function store(Request $request) { ... }
```

View file

@ -0,0 +1,18 @@
# Bouncer/Gate/ — Action Gate Authorisation
Whitelist-based request authorisation system. Philosophy: "If it wasn't trained, it doesn't exist."
## Files
| File | Purpose |
|------|---------|
| `Boot.php` | ServiceProvider — registers middleware, configures action gate. |
| `ActionGateMiddleware.php` | Intercepts requests, checks if the target action is permitted. Production mode blocks unknown actions (403). Training mode prompts for approval. |
| `ActionGateService.php` | Core service — resolves action names from routes/controllers, checks `ActionPermission` records. Supports `#[Action]` attribute, auto-resolution from controller names, and training mode. |
| `RouteActionMacro.php` | Adds `->action('name')` and `->bypassGate()` macros to Laravel routes for fluent action naming. |
## Integration Flow
```
Request -> ActionGateMiddleware -> ActionGateService::check() -> ActionPermission (allowed/denied) -> Controller
```

View file

@ -0,0 +1,7 @@
# Bouncer/Gate/Migrations/ — Action Gate Schema
## Migrations
| File | Purpose |
|------|---------|
| `0001_01_01_000002_create_action_permission_tables.php` | Creates `core_action_permissions` (whitelisted actions) and `core_action_requests` (audit log) tables. |

View file

@ -0,0 +1,8 @@
# Bouncer/Gate/Models/ — Action Gate Models
## Models
| Model | Table | Purpose |
|-------|-------|---------|
| `ActionPermission` | `core_action_permissions` | Whitelisted action record. Stores action identifier, scope, guard, role, allowed flag, and training metadata (who trained it, when, from which route). Source: `trained`, `seeded`, or `manual`. |
| `ActionRequest` | `core_action_requests` | Audit log entry for all action permission checks. Records HTTP method, route, action, guard, user, IP, status (allowed/denied/pending), and whether training was triggered. |

View file

@ -0,0 +1,7 @@
# Bouncer/Gate/Tests/Feature/ — Action Gate Feature Tests
## Test Files
| File | Purpose |
|------|---------|
| `ActionGateTest.php` | Integration tests for the full action gate flow — middleware interception, permission enforcement, training mode responses, route macro behaviour. |

View file

@ -0,0 +1,7 @@
# Bouncer/Gate/Tests/Unit/ — Action Gate Unit Tests
## Test Files
| File | Purpose |
|------|---------|
| `ActionGateServiceTest.php` | Unit tests for the `ActionGateService`. Tests action name resolution from routes and controllers, permission checking, training mode behaviour, and `#[Action]` attribute support. |

View file

@ -0,0 +1,9 @@
# Bouncer/Migrations/ — Bouncer Schema Migrations
## Migrations
| File | Purpose |
|------|---------|
| `0001_01_01_000001_create_bouncer_tables.php` | Creates core bouncer tables for IP/domain blocklisting, redirect rules, and rate limiting configuration. |
Uses early timestamps to run before application migrations.

View file

@ -0,0 +1,7 @@
# Bouncer/Tests/Unit/ — Bouncer Unit Tests
## Test Files
| File | Purpose |
|------|---------|
| `BlocklistServiceTest.php` | Unit tests for the IP/domain blocklist service. Tests blocking, allowing, and checking IPs and domains against the blocklist. |

83
src/Core/CLAUDE.md Normal file
View file

@ -0,0 +1,83 @@
# Core Orchestration
Root-level files in `src/Core/` that wire the entire framework together. These are the bootstrap, module discovery, lazy loading, and pro-feature detection systems.
## Files
| File | Purpose |
|------|---------|
| `Init.php` | True entry point. `Core\Init::handle()` replaces Laravel's `bootstrap/app.php`. Runs WAF input filtering via `Input::capture()`, then delegates to `Boot::app()`. Prefers `App\Boot` if it exists. |
| `Boot.php` | Configures Laravel `Application` with providers, middleware, and exceptions. Provider load order is critical: `LifecycleEventProvider` -> `Website\Boot` -> `Front\Boot` -> `Mod\Boot`. |
| `LifecycleEventProvider.php` | The orchestrator. Registers `ModuleScanner` and `ModuleRegistry` as singletons, scans configured paths, wires lazy listeners. Static `fire*()` methods are called by frontage modules to dispatch lifecycle events and process collected requests (views, livewire, routes, middleware). |
| `ModuleScanner.php` | Discovers `Boot.php` files in subdirectories of given paths. Reads static `$listens` arrays via reflection without instantiating modules. Maps paths to namespaces (`/Core` -> `Core\`, `/Mod` -> `Mod\`, `/Website` -> `Website\`, `/Plug` -> `Plug\`). |
| `ModuleRegistry.php` | Coordinates scanner output into Laravel's event system. Sorts listeners by priority (highest first), creates `LazyModuleListener` instances, supports late-registration via `addPaths()`. |
| `LazyModuleListener.php` | The lazy-loading wrapper. Instantiates module on first event fire (cached thereafter). ServiceProviders use `resolveProvider()`, plain classes use `make()`. Records audit logs and profiling data. |
| `Pro.php` | Detects Flux Pro and FontAwesome Pro installations. Auto-enables pro features, falls back gracefully to free equivalents. Throws helpful dev-mode exceptions. |
| `config.php` | Framework configuration: branding, domains, CDN, organisation, social links, contact, FontAwesome, pro fallback behaviour, icon defaults, debug settings, seeder auto-discovery. |
## Bootstrap Sequence
```
public/index.php
-> Core\Init::handle()
-> Input::capture() # WAF layer sanitises $_GET/$_POST
-> Boot::app() # Build Laravel Application
-> LifecycleEventProvider # register(): scan + wire lazy listeners
-> Website\Boot # register(): domain resolution
-> Front\Boot # boot(): fires lifecycle events
-> Mod\Boot # aggregates feature modules
```
## Module Declaration Pattern
Modules declare interest in events via static `$listens`:
```php
class Boot
{
public static array $listens = [
WebRoutesRegistering::class => 'onWebRoutes',
AdminPanelBooting::class => ['onAdmin', 10], // priority 10
];
}
```
Modules are never instantiated until their event fires.
## Lifecycle Events (fire* methods)
| Method | Event | Middleware | Processes |
|--------|-------|-----------|-----------|
| `fireWebRoutes()` | `WebRoutesRegistering` | `web` | views, livewire, routes |
| `fireAdminBooting()` | `AdminPanelBooting` | `admin` | views, translations, livewire, routes |
| `fireClientRoutes()` | `ClientRoutesRegistering` | `client` | views, livewire, routes |
| `fireApiRoutes()` | `ApiRoutesRegistering` | `api` | routes |
| `fireMcpRoutes()` | `McpRoutesRegistering` | `mcp` | routes |
| `fireMcpTools()` | `McpToolsRegistering` | -- | returns handler class names |
| `fireConsoleBooting()` | `ConsoleBooting` | -- | artisan commands |
| `fireQueueWorkerBooting()` | `QueueWorkerBooting` | -- | queue-specific init |
All route-registering fire methods call `refreshRoutes()` afterward to deduplicate names and refresh lookups.
## Default Scan Paths
- `app_path('Core')` -- application-level core modules
- `app_path('Mod')` -- feature modules
- `app_path('Website')` -- domain-scoped website modules
- `src/Core` -- framework's own modules
- `src/Mod` -- framework's own feature modules
Configurable via `config('core.module_paths')`.
## Priority System
- Default: `0`
- Higher values run first: `['onAdmin', 100]` runs before `['onAdmin', 0]`
- Negative values run last: `['onCleanup', -10]`
## Key Integration Points
- `Init::boot()` returns `App\Boot` if it exists, allowing apps to customise providers
- `Boot::basePath()` auto-detects monorepo vs vendor structure
- `LifecycleEventProvider` processes middleware aliases, view namespaces, and Livewire components collected during event dispatch
- Route deduplication prevents `route:cache` failures when the same route file serves multiple domains

View file

@ -0,0 +1,10 @@
# Cdn/Console/ — CDN Artisan Commands
## Commands
| Command | Signature | Purpose |
|---------|-----------|---------|
| `CdnPurge` | `cdn:purge` | Purge CDN cache — by URL, tag, workspace, or global. |
| `OffloadMigrateCommand` | `cdn:offload-migrate` | Migrate local files to remote storage, creating offload records. |
| `PushAssetsToCdn` | `cdn:push` | Push local assets to CDN storage zone. |
| `PushFluxToCdn` | `cdn:push-flux` | Push Flux UI framework assets to CDN. |

View file

@ -0,0 +1,9 @@
# Cdn/Facades/ — CDN Facade
## Facades
| Facade | Resolves To | Purpose |
|--------|-------------|---------|
| `Cdn` | `StorageUrlResolver` | Static proxy for CDN operations — `cdn()`, `origin()`, `private()`, `signedUrl()`, `asset()`, `pushToCdn()`, `deleteFromCdn()`, `purge()`, `storePublic()`, `storePrivate()`, `vBucketCdn()`, and more. |
Usage: `Cdn::cdn('images/logo.png')` returns the CDN URL for the asset.

View file

@ -0,0 +1,7 @@
# Cdn/Jobs/ — CDN Background Jobs
## Jobs
| Job | Purpose |
|-----|---------|
| `PushAssetToCdn` | Queued job to push a local asset file to the CDN (BunnyCDN). Handles upload, verification, and StorageOffload record creation. |

View file

@ -0,0 +1,8 @@
# Cdn/Middleware/ — CDN HTTP Middleware
## Middleware
| Class | Purpose |
|-------|---------|
| `LocalCdnMiddleware` | Adds aggressive caching headers and compression for requests on the `cdn.*` subdomain. Provides CDN-like behaviour without external services. |
| `RewriteOffloadedUrls` | Processes JSON responses and replaces local storage paths with remote equivalents when files have been offloaded to external storage. |

View file

@ -0,0 +1,7 @@
# Cdn/Models/ — CDN Storage Models
## Models
| Model | Purpose |
|-------|---------|
| `StorageOffload` | Tracks files offloaded to remote storage. Records local path, remote path, disk, SHA-256 hash, file size, MIME type, category, metadata, and offload timestamp. Used by the URL rewriting middleware. |

View file

@ -0,0 +1,13 @@
# Cdn/Services/ — CDN Service Layer
## Services
| Service | Purpose |
|---------|---------|
| `BunnyCdnService` | BunnyCDN pull zone API — cache purging (URL, tag, workspace, global), statistics retrieval, pull zone management. Uses config from `ConfigService`. |
| `BunnyStorageService` | BunnyCDN storage zone API — file upload, download, delete, list. Supports public and private storage zones. |
| `StorageOffload` (service) | Manages file offloading to remote storage — upload, track, verify. Creates `StorageOffload` model records. |
| `StorageUrlResolver` | URL builder for all asset contexts — CDN, origin, private, signed, apex. Supports virtual buckets (vBucket) per domain. Backs the `Cdn` facade. |
| `CdnUrlBuilder` | Low-level URL construction for CDN paths with cache-busting and domain resolution. |
| `AssetPipeline` | Orchestrates asset processing — push to CDN, cache headers, versioning. |
| `FluxCdnService` | Pushes Flux UI assets to CDN for faster component loading. |

View file

@ -0,0 +1,7 @@
# Cdn/Traits/ — CDN Model Traits
## Traits
| Trait | Purpose |
|-------|---------|
| `HasCdnUrls` | For models with asset paths needing CDN URL resolution. Requires `$cdnPathAttribute` (attribute with storage path) and optional `$cdnBucket` (`public` or `private`). Provides `cdnUrl()` accessor. |

View file

@ -0,0 +1,13 @@
# Config/Console/ — Config Artisan Commands
Artisan commands for managing the hierarchical configuration system.
## Commands
| Command | Signature | Purpose |
|---------|-----------|---------|
| `ConfigListCommand` | `config:list` | List config keys with resolved values. Filters by workspace, category, or configured-only. |
| `ConfigPrimeCommand` | `config:prime` | Materialise resolved config into the fast-read table. Primes system and/or specific workspace. |
| `ConfigExportCommand` | `config:export` | Export config to JSON or YAML file. Supports workspace scope and sensitive value inclusion. |
| `ConfigImportCommand` | `config:import` | Import config from JSON or YAML file. Supports dry-run mode and automatic version snapshots. |
| `ConfigVersionCommand` | `config:version` | Manage config versions — list, create snapshots, show, rollback, and compare versions. |

View file

@ -0,0 +1,9 @@
# Config/Contracts/ — Config System Interfaces
## Interfaces
| Interface | Purpose |
|-----------|---------|
| `ConfigProvider` | Virtual configuration provider. Supplies config values at runtime without database storage. Matched against key patterns (e.g., `bio.*`). Registered via `ConfigResolver::registerProvider()`. |
Providers implement `pattern()` (wildcard key matching) and `resolve()` (returns the value for a given key, workspace, and channel context). Returns `null` to fall through to database resolution.

View file

@ -0,0 +1,9 @@
# Config/Database/Seeders/ — Config Key Seeders
## Files
| File | Purpose |
|------|---------|
| `ConfigKeySeeder.php` | Seeds known configuration keys into the `config_keys` table. Defines CDN (Bunny), storage (Hetzner S3), social, analytics, and bio settings with their types, categories, and defaults. Uses `firstOrCreate` for idempotency. |
Part of the Config subsystem's M1 layer (key definitions). These keys are then assigned values via `ConfigValue` at system or workspace scope.

View file

@ -0,0 +1,12 @@
# Config/Enums/ — Config Type System
Backed enums for the configuration system's type safety and scope hierarchy.
## Enums
| Enum | Values | Purpose |
|------|--------|---------|
| `ConfigType` | STRING, BOOL, INT, FLOAT, ARRAY, JSON | Determines how config values are cast and validated. Has `cast()` and `default()` methods. |
| `ScopeType` | SYSTEM, ORG, WORKSPACE | Defines the inheritance hierarchy. Resolution order: workspace (priority 20) > org (10) > system (0). |
`ScopeType::resolutionOrder()` returns scopes from most specific to least specific for cascade resolution.

View file

@ -0,0 +1,13 @@
# Config/Events/ — Config System Events
Events dispatched by the configuration system for reactive integration.
## Events
| Event | Fired When | Key Properties |
|-------|-----------|----------------|
| `ConfigChanged` | A config value is set or updated via `ConfigService::set()` | `keyCode`, `value`, `previousValue`, `profile`, `channelId` |
| `ConfigInvalidated` | Config cache is manually cleared | `keyCode` (null = all), `workspaceId`, `channelId`. Has `isFull()` and `affectsKey()` helpers. |
| `ConfigLocked` | A config value is locked (FINAL) | `keyCode`, `profile`, `channelId` |
Modules can listen to these events via the standard `$listens` pattern in their Boot class to react to config changes (e.g., refreshing CDN clients, flushing caches).

View file

@ -0,0 +1,14 @@
# Config/Migrations/ — Config Schema Migrations
Database migrations for the hierarchical configuration system.
## Migrations
| File | Purpose |
|------|---------|
| `0001_01_01_000001_create_config_tables.php` | Creates core config tables: `config_keys`, `config_profiles`, `config_values`, `config_channels`, `config_resolved`. |
| `0001_01_01_000002_add_soft_deletes_to_config_profiles.php` | Adds soft delete support to `config_profiles`. |
| `0001_01_01_000003_add_is_sensitive_to_config_keys.php` | Adds `is_sensitive` flag for automatic encryption of values. |
| `0001_01_01_000004_create_config_versions_table.php` | Creates `config_versions` table for point-in-time snapshots and rollback. |
Uses early timestamps (`0001_01_01_*`) to run before application migrations.

View file

@ -0,0 +1,22 @@
# Config/Models/ — Config Eloquent Models
Eloquent models implementing the four-layer hierarchical configuration system.
## Models
| Model | Table | Purpose |
|-------|-------|---------|
| `ConfigKey` | `config_keys` | M1 layer — defines what keys exist. Dot-notation codes, typed (`ConfigType`), categorised. Supports sensitive flag for auto-encryption. Hierarchical parent/child grouping. |
| `ConfigProfile` | `config_profiles` | M2 layer — groups values at a scope level (system/org/workspace). Inherits from parent profiles. Soft-deletable. |
| `ConfigValue` | `config_values` | Junction table linking profiles to keys with actual values. `locked` flag implements FINAL (prevents child override). Auto-encrypts sensitive keys. Invalidates resolver hash on write. |
| `ConfigVersion` | `config_versions` | Point-in-time snapshots for version history and rollback. Immutable (no `updated_at`). Stores JSON snapshot of all values. |
| `Channel` | `config_channels` | Context dimension (web, api, mobile, instagram, etc.). Hierarchical inheritance chain with cycle detection. System or workspace-scoped. |
| `ConfigResolved` | `config_resolved` | Materialised READ table — all lookups hit this directly. No computation at read time. Populated by the `prime` operation. Composite key (workspace_id, channel_id, key_code). |
## Resolution Flow
```
ConfigService::get() → ConfigResolved (fast lookup)
→ miss: ConfigResolver computes from ConfigValue chain
→ stores result back to ConfigResolved + in-memory hash
```

View file

@ -0,0 +1,7 @@
# Config/Routes/ — Config Admin Routes
## Files
| File | Purpose |
|------|---------|
| `admin.php` | Admin route definitions for the configuration panel. Registers routes under the `admin` middleware group for the `ConfigPanel` and `WorkspaceConfig` Livewire components. |

View file

@ -0,0 +1,11 @@
# Config/Tests/Feature/ — Config Integration Tests
Pest feature tests for the hierarchical configuration system.
## Test Files
| File | Purpose |
|------|---------|
| `ConfigServiceTest.php` | Full integration tests covering ConfigKey creation, ConfigProfile inheritance, ConfigResolver scope cascading, FINAL lock enforcement, ConfigService materialised reads/writes, ConfigResolved storage, and the single-hash lazy-load pattern. |
Tests cover the complete config lifecycle: key definition, profile hierarchy (system/workspace), value resolution with inheritance, lock semantics, cache invalidation, and the prime/materialise flow.

View file

@ -0,0 +1,12 @@
# Config/View/Blade/admin/ — Config Admin Blade Templates
Blade templates for the admin configuration panel.
## Templates
| File | Purpose |
|------|---------|
| `config-panel.blade.php` | Full config management panel — browse keys by category, edit values, toggle locks, manage system vs workspace scopes. Used by `ConfigPanel` Livewire component. |
| `workspace-config.blade.php` | Workspace-specific config panel — hierarchical namespace navigation, tab grouping, value editing with system inheritance display. Used by `WorkspaceConfig` Livewire component. |
Both templates use the `hub::admin.layouts.app` layout and are rendered via the `core.config::admin.*` view namespace.

View file

@ -0,0 +1,12 @@
# Config/View/Modal/Admin/ — Config Admin Livewire Components
Livewire components for the admin configuration interface.
## Components
| Component | Purpose |
|-----------|---------|
| `ConfigPanel` | Hades-only config management. Browse/search keys by category, edit values inline, toggle FINAL locks, manage system and workspace scopes. Respects parent lock enforcement. |
| `WorkspaceConfig` | Workspace-scoped settings. Hierarchical namespace navigation (cdn/bunny/storage), tab grouping by second-level prefix, value editing with inherited value display, system lock indicators. |
Both require the Tenant module for workspace support and fall back gracefully without it. `ConfigPanel` requires Hades (super-admin) access. Values are persisted via `ConfigService`.

View file

@ -0,0 +1,15 @@
# Console/Commands/ — Core Framework Commands
Artisan commands for framework scaffolding and maintenance.
## Commands
| Command | Signature | Purpose |
|---------|-----------|---------|
| `InstallCommand` | `core:install` | Framework installation wizard — sets up sensible defaults for new projects. |
| `MakeModCommand` | `core:make-mod` | Generates a new module scaffold in the `Mod` namespace with Boot.php event-driven loading pattern. |
| `MakePlugCommand` | `core:make-plug` | Generates a new plugin scaffold in the `Plug` namespace. |
| `MakeWebsiteCommand` | `core:make-website` | Generates a new website module scaffold in the `Website` namespace. |
| `NewProjectCommand` | `core:new` | Creates a complete new project from the Core PHP template. |
| `PruneEmailShieldStatsCommand` | `emailshield:prune` | Prunes old EmailShield validation statistics. |
| `ScheduleSyncCommand` | `core:schedule-sync` | Synchronises scheduled tasks across the application. |

View file

@ -0,0 +1,27 @@
# Database/Seeders/Attributes/ — Seeder Ordering Attributes
PHP 8 attributes for controlling seeder execution order in the auto-discovery system.
## Attributes
| Attribute | Target | Purpose |
|-----------|--------|---------|
| `#[SeederAfter(...)]` | Class | This seeder must run after the specified seeders. Repeatable. |
| `#[SeederBefore(...)]` | Class | This seeder must run before the specified seeders. Repeatable. |
| `#[SeederPriority(n)]` | Class | Numeric priority (lower runs first, default 50). |
## Priority Guidelines
- 0-20: Foundation (features, configuration)
- 20-40: Core data (packages, workspaces)
- 40-60: Default (general seeders)
- 60-80: Content (pages, posts)
- 80-100: Demo/test data
## Example
```php
#[SeederAfter(FeatureSeeder::class)]
#[SeederPriority(30)]
class PackageSeeder extends Seeder { ... }
```

View file

@ -0,0 +1,9 @@
# Database/Seeders/Exceptions/ — Seeder Exception Types
## Files
| File | Purpose |
|------|---------|
| `CircularDependencyException.php` | Thrown when seeder dependency graph contains a cycle. Includes the `$cycle` array showing the loop path. Has `fromPath()` factory for building from a traversal path. |
Part of the seeder auto-discovery system. The `CoreDatabaseSeeder` uses topological sorting on `#[SeederAfter]`/`#[SeederBefore]` attributes and throws this when a cycle is detected.

View file

@ -0,0 +1,9 @@
# Events/Concerns/ — Event Version Compatibility
## Traits
| Trait | Purpose |
|-------|---------|
| `HasEventVersion` | For Boot classes to declare which event API versions they support. Methods: `getRequiredEventVersion(eventClass)`, `isCompatibleWithEventVersion(eventClass, version)`, `getEventVersionRequirements()`. |
Enables graceful handling of event API changes. Modules declare minimum versions via `$eventVersions` static property. The framework checks compatibility during bootstrap and logs warnings for version mismatches.

View file

@ -0,0 +1,38 @@
# Front/Admin/Blade/components
Anonymous Blade components for the admin panel. Used via `<admin:xyz>` tag syntax.
## Components
| Component | Purpose |
|-----------|---------|
| action-link | Styled link for table row actions |
| activity-feed | Template for ActivityFeed class component |
| activity-log | Template for ActivityLog class component |
| alert | Template for Alert class component |
| card-grid | Template for CardGrid class component |
| clear-filters | Template for ClearFilters class component |
| data-table | Template for DataTable class component |
| editable-table | Template for EditableTable class component |
| empty-state | Empty state placeholder with icon and message |
| entitlement-gate | Conditionally renders content based on workspace entitlements |
| filter / filter-bar | Template for Filter/FilterBar class components |
| flash | Session flash message display |
| header | Page header with breadcrumbs and actions |
| link-grid | Template for LinkGrid class component |
| manager-table | Template for ManagerTable class component |
| metric-card / metrics | Individual metric card and grid template |
| module | Module wrapper with loading states |
| nav-group / nav-item / nav-link / nav-menu / nav-panel | Sidebar navigation primitives |
| page-header | Page title bar with optional subtitle and actions |
| panel | Content panel with optional header/footer |
| progress-list | Template for ProgressList class component |
| search | Template for Search class component |
| service-card / service-cards | Service overview cards |
| sidebar / sidemenu | Sidebar shell and menu template |
| stat-card / stats | Individual stat card and grid template |
| status-cards | Template for StatusCards class component |
| tabs | Tab navigation wrapper using `<core:tabs>` |
| workspace-card | Workspace overview card |
Most are templates for the class-backed components in `View/Components/`. A few are standalone anonymous components (empty-state, entitlement-gate, flash, nav-*, page-header, panel, workspace-card).

View file

@ -0,0 +1,22 @@
# Front/Admin/Blade/components/tabs
Tab panel sub-component for admin tabs.
## Files
- **panel.blade.php** -- Individual tab panel that auto-detects selected state from `TabContext::$selected`. Wraps `<core:tab.panel>` with automatic selection.
- Props: `name` (string, required) -- must match the tab key
- Reads `\Core\Front\Admin\TabContext::$selected` to determine visibility
## Usage
```blade
<admin:tabs :tabs="$tabs" :selected="$currentTab">
<admin:tabs.panel name="general">
General settings content
</admin:tabs.panel>
<admin:tabs.panel name="advanced">
Advanced settings content
</admin:tabs.panel>
</admin:tabs>
```

View file

@ -0,0 +1,10 @@
# Front/Admin/Blade/layouts
Layout templates for the admin panel.
## Files
- **app.blade.php** -- Full admin HTML shell with sidebar + content area layout. Includes dark mode (localStorage + cookie sync), FontAwesome Pro CSS, Vite assets (admin.css + app.js), Flux appearance/scripts, collapsible sidebar with `sidebarExpanded` Alpine state (persisted to localStorage), and light/dark mode toggle script.
- Props: `title` (string, default 'Admin')
- Slots: `$sidebar` (sidebar component), `$header` (top header), `$slot` (main content), `$head` (extra head content), `$scripts` (extra scripts)
- Responsive: sidebar hidden on mobile, 20px collapsed / 64px expanded on desktop.

View file

@ -0,0 +1,24 @@
# Front/Admin
Admin panel frontage. Service provider that configures the `admin` middleware group, registers `<admin:xyz>` Blade tag syntax, and boots 18 class-backed view components.
## Files
- **Boot.php** -- ServiceProvider configuring the `admin` middleware stack (separate from web -- includes `auth`). Registers `admin::` Blade namespace, class component aliases (e.g., `admin-data-table`), `<admin:xyz>` tag compiler, and fires `AdminPanelBooting` lifecycle event. Binds `AdminMenuRegistry` as singleton.
- **AdminMenuRegistry.php** -- Central registry for admin sidebar navigation. Modules register `AdminMenuProvider` implementations during boot. Handles entitlement checks, permission filtering, caching (5min TTL), priority sorting, and menu structure building with groups: dashboard, agents, workspaces, services, settings, admin.
- **AdminTagCompiler.php** -- Blade precompiler for `<admin:xyz>` tags. Resolves class-backed components first (via `admin-xyz` aliases), falls back to anonymous `admin::xyz` namespace.
- **TabContext.php** -- Static context for `<admin:tabs>` to communicate selected state to child `<admin:tab.panel>` components.
## Middleware Stack
The `admin` group: EncryptCookies, AddQueuedCookiesToResponse, StartSession, ShareErrorsFromSession, ValidateCsrfToken, SubstituteBindings, SecurityHeaders, auth.
## Tag Syntax
```blade
<admin:data-table :columns="$cols" :rows="$rows" />
<admin:sidemenu />
<admin:tabs :tabs="$tabs" :selected="$current">
<admin:tabs.panel name="general">Content</admin:tabs.panel>
</admin:tabs>
```

View file

@ -0,0 +1,7 @@
# Front/Admin/Concerns
Traits for admin panel functionality.
## Files
- **HasMenuPermissions.php** -- Default implementation of `AdminMenuProvider` permission methods. Provides `menuPermissions()` (returns empty array by default), `canViewMenu()` (checks all permissions from `menuPermissions()` against the user), and `userHasPermission()` (tries Laravel Gate `can()`, then `hasPermission()`, then Spatie's `hasPermissionTo()`, falls back to allow). Include this trait in classes implementing `AdminMenuProvider` to get sensible defaults; override methods for custom logic.

View file

@ -0,0 +1,17 @@
# Front/Admin/Contracts
Interfaces for the admin menu system.
## Files
- **AdminMenuProvider.php** -- Interface for modules contributing admin sidebar items. Defines priority constants (FIRST=0 through LAST=90), `adminMenuItems()` returning registration arrays with group/priority/entitlement/permissions/item closure, `menuPermissions()` for provider-level permission requirements, and `canViewMenu()` for custom access logic. Items are lazy-evaluated -- closures only called after permission checks pass.
- **DynamicMenuProvider.php** -- Interface for providers supplying uncached, real-time menu items (e.g., notification counts, recent items). `dynamicMenuItems()` is called every request and merged after static cache retrieval. `dynamicCacheKey()` can invalidate static cache when dynamic state changes significantly.
## Menu Groups
`dashboard` | `workspaces` | `services` | `settings` | `admin`
## Priority Constants
PRIORITY_FIRST(0), PRIORITY_HIGH(10), PRIORITY_ABOVE_NORMAL(20), PRIORITY_NORMAL(50), PRIORITY_BELOW_NORMAL(70), PRIORITY_LOW(80), PRIORITY_LAST(90).

View file

@ -0,0 +1,25 @@
# Front/Admin/Support
Builder utilities for constructing admin menu items.
## Files
- **MenuItemBuilder.php** -- Fluent builder for `AdminMenuProvider::adminMenuItems()` return arrays. Chainable API: `MenuItemBuilder::make('Label')->icon('cube')->href('/path')->inGroup('services')->entitlement('core.srv.x')->build()`. Supports route-based hrefs, active state callbacks (`activeOnRoute('hub.bio.*')`), children, badges, priority shortcuts (`->first()`, `->high()`, `->last()`), service keys, and custom attributes.
- **MenuItemGroup.php** -- Static factory for structural menu elements within children arrays. Creates separators (`::separator()`), section headers (`::header('Products', 'cube')`), collapsible groups (`::collapsible('Orders', $children)`), and dividers (`::divider('More')`). Also provides type-check helpers: `isSeparator()`, `isHeader()`, `isCollapsible()`, `isDivider()`, `isStructural()`, `isLink()`.
## Usage
```php
MenuItemBuilder::make('Commerce')
->icon('shopping-cart')
->inServices()
->entitlement('core.srv.commerce')
->children([
MenuItemGroup::header('Products', 'cube'),
MenuItemBuilder::child('All Products', '/products')->icon('list'),
MenuItemGroup::separator(),
MenuItemBuilder::child('Orders', '/orders')->icon('receipt'),
])
->build();
```

View file

@ -0,0 +1,13 @@
# Front/Admin/Validation
Validation utilities for admin panel configuration.
## Files
- **IconValidator.php** -- Validates FontAwesome icon names used in admin menu items. Accepts shorthand (`home`), prefixed (`fa-home`), and full class (`fas fa-home`, `fa-solid fa-home`, `fab fa-github`) formats. Normalises all formats to base name. Contains built-in lists of ~200 solid icons and ~80 brand icons. Supports custom icons (`addCustomIcon()`), icon packs (`registerIconPack()`), and strict mode (config `core.admin_menu.strict_icon_validation`). Non-strict mode (default) allows unknown icons with optional warnings. Provides Levenshtein-based suggestions for misspelled icons (`getSuggestions()`).
## Configuration
- `core.admin_menu.strict_icon_validation` -- Reject unknown icons (default: false)
- `core.admin_menu.log_icon_warnings` -- Log warnings for unknown icons (default: true)
- `core.admin_menu.custom_icons` -- Array of additional valid icon names

View file

@ -0,0 +1,28 @@
# Front/Admin/View/Components
Class-backed Blade components for the admin panel. Registered via `<admin:xyz>` tag syntax in Boot.php.
## Components
| Component | Tag | Purpose |
|-----------|-----|---------|
| ActivityFeed | `<admin:activity-feed>` | Timeline of recent activity items with icons and timestamps |
| ActivityLog | `<admin:activity-log>` | Detailed activity log with filtering |
| Alert | `<admin:alert>` | Dismissible alert/notification banners |
| CardGrid | `<admin:card-grid>` | Responsive grid of cards |
| ClearFilters | `<admin:clear-filters>` | Button to reset active table/list filters |
| DataTable | `<admin:data-table>` | Table with columns, rows, title, empty state, and action link |
| EditableTable | `<admin:editable-table>` | Inline-editable table rows |
| Filter | `<admin:filter>` | Single filter control (select, input, etc.) |
| FilterBar | `<admin:filter-bar>` | Horizontal bar of filter controls |
| LinkGrid | `<admin:link-grid>` | Grid of navigational link cards |
| ManagerTable | `<admin:manager-table>` | CRUD management table with actions |
| Metrics | `<admin:metrics>` | Grid of metric cards (configurable columns: 2-4) |
| ProgressList | `<admin:progress-list>` | List of items with progress indicators |
| Search | `<admin:search>` | Search input with Livewire integration |
| ServiceCard | `<admin:service-card>` | Card displaying a service's status, stats, and actions |
| Sidemenu | `<admin:sidemenu>` | Sidebar navigation built from AdminMenuRegistry |
| Stats | `<admin:stats>` | Grid of stat cards (configurable columns: 2-6) |
| StatusCards | `<admin:status-cards>` | Cards showing system/service status |
All components extend `Illuminate\View\Component` and render via Blade templates in `Admin/Blade/components/`.

View file

@ -0,0 +1,16 @@
# Front/Cli
CLI/Artisan frontage. Fires `ConsoleBooting` lifecycle event and processes module registrations.
## Files
- **Boot.php** -- ServiceProvider that only runs in console context. Registers the `ScheduleServiceProvider`, fires `ConsoleBooting` event, then processes module requests collected by the event: Artisan commands, translations, middleware aliases, Gate policies, and Blade component paths. This is how modules register CLI-specific resources without coupling to the console context directly.
## Event-Driven Registration
Modules listen for `ConsoleBooting` and call methods on the event to register:
- `commandRequests()` -- Artisan command classes
- `translationRequests()` -- `[namespace, path]` pairs
- `middlewareRequests()` -- `[alias, class]` pairs
- `policyRequests()` -- `[model, policy]` pairs
- `bladeComponentRequests()` -- `[path, namespace]` pairs

View file

@ -0,0 +1,32 @@
# Front/Components
Core UI component system. Provides `<core:xyz>` Blade tag syntax and data-driven PHP component builders for programmatic UI composition.
## Files
- **Boot.php** -- ServiceProvider registering multiple Blade namespaces: `core::` (core components + `<core:xyz>` tags), `layouts::` (Livewire layout resolution), `front::` (front-end satellite components), `errors::` (error pages). Adds blade view paths for Livewire's `->layout()` resolution.
- **CoreTagCompiler.php** -- Blade precompiler for `<core:xyz>` tag syntax. Compiles to `core::` anonymous components.
- **Component.php** -- Abstract base for data-driven UI components. Fluent interface with `attr()`, `class()`, `id()`, `buildAttributes()`. Implements `Htmlable`. Used by MCP tools and agents to compose UIs without Blade templates.
- **Button.php** -- Button builder. Variants: primary, secondary, danger, ghost. Sizes: sm, md, lg. Supports link buttons (`href()`), disabled state, submit type.
- **Card.php** -- Card builder with title, description, body content, and action buttons in footer.
- **Heading.php** -- Heading builder (h1-h6) with optional description subtitle. Size classes auto-mapped from level.
- **Layout.php** -- HLCRF Layout Compositor. Data-driven layout builder where H=Header, L=Left, C=Content, R=Right, F=Footer. Variant string defines which slots exist (e.g., `'HLCF'`, `'HCF'`, `'HC'`). Supports nesting and hierarchical path tracking.
- **NavList.php** -- Navigation list builder with heading, items (label + href + icon + active), and dividers.
- **Text.php** -- Text builder. Tags: span, p, div. Variants: default, muted, success, warning, error.
## Tag Syntax
```blade
<core:icon name="star" />
<core:tabs>...</core:tabs>
```
## Programmatic Usage
```php
Layout::make('HLCF')
->h('<nav>Logo</nav>')
->l(NavList::make()->item('Dashboard', '/hub'))
->c(Card::make()->title('Settings')->body('Content'))
->f('<footer>Links</footer>');
```

View file

@ -0,0 +1,62 @@
# Components/View/Blade
Root directory for all core anonymous Blade components. Registered under the `core::` namespace and accessible via `<core:xyz>` tag syntax.
## Top-Level Components (48 files)
Each `.blade.php` file is the parent component. Sub-components live in matching subdirectories.
| Component | Description |
|-----------|-------------|
| accordion | Collapsible content sections |
| autocomplete | Typeahead search input |
| avatar | User/entity avatar display |
| badge | Status/count badge |
| button | Action button (primary, secondary, danger, ghost) |
| calendar | Calendar date display |
| callout | Notice/alert box |
| card | Content card container |
| chart | SVG chart container |
| checkbox | Checkbox input |
| command | Command palette (Cmd+K) |
| composer | Content composer/editor wrapper |
| context | Context menu |
| date-picker | Date selection input |
| description | Description list/text |
| dropdown | Dropdown menu trigger |
| editor | Rich text editor |
| error | Inline error message |
| field | Form field wrapper (label + input + error) |
| file-item | File list item display |
| file-upload | File upload input |
| heading | Section heading (h1-h6) |
| icon | FontAwesome icon renderer |
| input | Text input |
| kanban | Kanban board |
| label | Form label |
| layout | HLCRF layout container |
| main | Main content area |
| menu | Dropdown menu panel |
| modal | Modal dialog |
| navbar | Navigation bar |
| navlist | Navigation list (sidebar) |
| navmenu | Navigation menu |
| pillbox | Tag/chip multi-select input |
| popover | Popover tooltip/panel |
| radio | Radio button input |
| select | Dropdown select |
| separator | Visual divider |
| slider | Range slider input |
| subheading | Secondary heading text |
| switch | Toggle switch |
| tab | Tab trigger |
| table | Data table |
| tabs | Tab container with panels |
| text | Body text |
| textarea | Multi-line text input |
| time-picker | Time selection input |
| tooltip | Hover tooltip |
## Subdirectories
Each subdirectory contains sub-components (e.g., `table/row.blade.php` = `<core:table.row>`). See individual `CLAUDE.md` files in each subdirectory.

View file

@ -0,0 +1,20 @@
# Blade/accordion
Accordion (collapsible section) components.
## Files
- **content.blade.php** -- Collapsible content panel of an accordion item. Hidden/shown based on accordion state.
- **heading.blade.php** -- Clickable header that toggles the accordion item's content visibility.
- **item.blade.php** -- Single accordion item wrapping a heading + content pair.
## Usage
```blade
<core:accordion>
<core:accordion.item>
<core:accordion.heading>Section Title</core:accordion.heading>
<core:accordion.content>Hidden content here</core:accordion.content>
</core:accordion.item>
</core:accordion>
```

View file

@ -0,0 +1,7 @@
# Blade/autocomplete
Autocomplete sub-components.
## Files
- **item.blade.php** -- Individual autocomplete suggestion item. Rendered within an autocomplete dropdown list.

View file

@ -0,0 +1,7 @@
# Blade/button
Button sub-components.
## Files
- **group.blade.php** -- Button group container. Renders multiple buttons inline with shared styling (connected borders, uniform spacing).

View file

@ -0,0 +1,17 @@
# Blade/callout
Callout (notice/alert box) sub-components.
## Files
- **heading.blade.php** -- Callout title/heading text
- **text.blade.php** -- Callout body text/description
## Usage
```blade
<core:callout variant="info">
<core:callout.heading>Note</core:callout.heading>
<core:callout.text>Important information here.</core:callout.text>
</core:callout>
```

View file

@ -0,0 +1,33 @@
# Blade/chart
SVG chart components for data visualisation.
## Files
- **area.blade.php** -- Area chart (filled line chart)
- **axis.blade.php** -- Chart axis container
- **cursor.blade.php** -- Interactive cursor/crosshair overlay
- **legend.blade.php** -- Chart legend
- **line.blade.php** -- Line chart series
- **point.blade.php** -- Data point marker
- **summary.blade.php** -- Chart summary/stats display
- **svg.blade.php** -- SVG container wrapper
- **tooltip.blade.php** -- Hover tooltip container
- **viewport.blade.php** -- Viewable chart area with coordinate system
## Subdirectories
- **tooltip/** -- `heading.blade.php` (tooltip title), `value.blade.php` (tooltip data value)
- **axis/** -- `grid.blade.php` (grid lines), `line.blade.php` (axis line), `mark.blade.php` (axis label), `tick.blade.php` (tick mark)
## Usage
```blade
<core:chart.svg>
<core:chart.viewport>
<core:chart.line :data="$series" />
<core:chart.axis position="bottom" />
</core:chart.viewport>
<core:chart.legend :items="$items" />
</core:chart.svg>
```

View file

@ -0,0 +1,12 @@
# Blade/chart/axis
Chart axis sub-components for rendering axis elements.
## Files
- **grid.blade.php** -- Background grid lines aligned to axis ticks
- **line.blade.php** -- The axis line itself (horizontal or vertical)
- **mark.blade.php** -- Axis label/mark text (e.g., "Jan", "Feb", "100", "200")
- **tick.blade.php** -- Small tick marks along the axis
Used within `<core:chart.axis>` to compose axis rendering.

View file

@ -0,0 +1,10 @@
# Blade/chart/tooltip
Chart tooltip sub-components.
## Files
- **heading.blade.php** -- Tooltip title/heading text (e.g., date or category label)
- **value.blade.php** -- Tooltip data value display (e.g., "1,234 visitors")
Used within `<core:chart.tooltip>` to structure hover information.

View file

@ -0,0 +1,7 @@
# Blade/checkbox
Checkbox sub-components.
## Files
- **group.blade.php** -- Checkbox group container. Wraps multiple checkbox inputs with shared layout and optional label.

View file

@ -0,0 +1,23 @@
# Blade/command
Command palette (Cmd+K) sub-components.
## Files
- **empty.blade.php** -- Empty state shown when no results match the search query
- **input.blade.php** -- Search input field within the command palette
- **item.blade.php** -- Individual command/action item in the results list
- **items.blade.php** -- Results list container wrapping command items
## Usage
```blade
<core:command>
<core:command.input placeholder="Search..." />
<core:command.items>
<core:command.item>Go to Dashboard</core:command.item>
<core:command.item>Create New...</core:command.item>
</core:command.items>
<core:command.empty>No results found</core:command.empty>
</core:command>
```

View file

@ -0,0 +1,10 @@
# Blade/components/satellite
Satellite site layout components for workspace-branded pages (e.g., bio links, landing pages).
## Files
- **footer-custom.blade.php** -- Custom footer for satellite sites with workspace branding, social links, custom links, contact info, and copyright. Supports configurable footer settings (show_default_links, position, custom_content).
- **layout.blade.php** -- Full HTML shell for satellite/workspace sites. Includes dark mode, meta tags, workspace branding, configurable footer. Used for public workspace pages served on custom domains or subdomains.
These are registered under the `front::` namespace via `<x-front::satellite.layout>`.

View file

@ -0,0 +1,8 @@
# Blade/date-picker
Date picker sub-components.
## Files
- **button.blade.php** -- Trigger button that opens the date picker calendar popover.
- **input.blade.php** -- Text input field displaying the selected date value, with date picker integration.

View file

@ -0,0 +1,22 @@
# Blade/editor
Rich text editor sub-components.
## Files
- **button.blade.php** -- Toolbar action button (bold, italic, link, etc.)
- **content.blade.php** -- Editable content area (the actual rich text editing surface)
- **toolbar.blade.php** -- Editor toolbar container wrapping action buttons
## Usage
```blade
<core:editor>
<core:editor.toolbar>
<core:editor.button action="bold" icon="bold" />
<core:editor.button action="italic" icon="italic" />
<core:editor.button action="link" icon="link" />
</core:editor.toolbar>
<core:editor.content wire:model="body" />
</core:editor>
```

View file

@ -0,0 +1,11 @@
# Blade/errors
HTTP error page templates. Registered under the `errors::` namespace.
## Files
- **404.blade.php** -- Not Found error page
- **500.blade.php** -- Internal Server Error page
- **503.blade.php** -- Service Unavailable / Maintenance Mode page
These override Laravel's default error views when the `errors::` namespace is registered.

View file

@ -0,0 +1,13 @@
# Blade/examples
Example page templates demonstrating the component system.
## Files
- **blog-post.blade.php** -- Blog post page layout example
- **checkout.blade.php** -- Checkout/payment page layout example
- **guide.blade.php** -- Documentation/guide page layout example
- **help-centre.blade.php** -- Help centre page with sidebar navigation example
- **hlcrf-test.blade.php** -- Test page for the HLCRF layout compositor (Header-Left-Content-Right-Footer)
These are reference implementations showing how to compose pages using the core component library and layout system.

View file

@ -0,0 +1,7 @@
# Blade/file-item
File item sub-components for file list displays.
## Files
- **remove.blade.php** -- Remove/delete button for a file item. Typically renders an X icon button to remove a file from an upload list or file manager.

View file

@ -0,0 +1,7 @@
# Blade/file-upload
File upload sub-components.
## Files
- **dropzone.blade.php** -- Drag-and-drop file upload zone. Provides a styled drop target area with upload icon, instructions, and file type/size hints. Integrates with Livewire file upload.

View file

@ -0,0 +1,14 @@
# Blade/forms
Form element components. Provide styled, accessible form controls.
## Files
- **button.blade.php** -- Form submit/action button
- **checkbox.blade.php** -- Checkbox input with label
- **input.blade.php** -- Text input field
- **select.blade.php** -- Dropdown select field
- **textarea.blade.php** -- Multi-line text input
- **toggle.blade.php** -- Toggle switch (boolean input)
All components follow Flux Pro styling conventions and integrate with Livewire `wire:model`.

View file

@ -0,0 +1,19 @@
# Blade/icon
Inline SVG icon components. These are Heroicon-style SVG icons used as fallbacks or within specific components.
## Files
- **check.blade.php** -- Checkmark icon
- **check-circle.blade.php** -- Checkmark in circle icon
- **clipboard.blade.php** -- Clipboard icon
- **clock.blade.php** -- Clock/time icon
- **code-bracket.blade.php** -- Code brackets icon
- **code-bracket-square.blade.php** -- Code brackets in square icon
- **document-text.blade.php** -- Document with text icon
- **key.blade.php** -- Key icon
- **lock-closed.blade.php** -- Locked padlock icon
- **x-circle.blade.php** -- X in circle icon (error/close)
- **x-mark.blade.php** -- X mark icon (close/dismiss)
Note: The primary icon system uses Font Awesome Pro via `<core:icon name="...">`. These SVG components are supplementary.

View file

@ -0,0 +1,11 @@
# Blade/input
Input sub-components.
## Files
- **group.blade.php** -- Input group container for combining an input with prefix/suffix addons.
## Subdirectories
- **group/** -- Contains `prefix.blade.php` for input group prefix addon (icon, text, or custom content before the input).

View file

@ -0,0 +1,7 @@
# Blade/input/group
Input group addon components.
## Files
- **prefix.blade.php** -- Prefix addon for input groups. Renders content (icon, text, symbol) to the left of the input field within an input group container.

View file

@ -0,0 +1,26 @@
# Blade/kanban
Kanban board components.
## Files
- **card.blade.php** -- Individual kanban card (draggable item within a column)
- **column.blade.php** -- Kanban column container
## Subdirectories
- **column/** -- `cards.blade.php` (card list container), `footer.blade.php` (column footer with add action), `header.blade.php` (column title and count)
## Usage
```blade
<core:kanban>
<core:kanban.column>
<core:kanban.column.header>To Do</core:kanban.column.header>
<core:kanban.column.cards>
<core:kanban.card>Task 1</core:kanban.card>
</core:kanban.column.cards>
<core:kanban.column.footer />
</core:kanban.column>
</core:kanban>
```

View file

@ -0,0 +1,9 @@
# Blade/kanban/column
Kanban column sub-components.
## Files
- **cards.blade.php** -- Card list container within a column. Provides the droppable area for kanban cards.
- **footer.blade.php** -- Column footer, typically containing an "Add card" action button.
- **header.blade.php** -- Column header displaying the column title, item count, and optional actions.

View file

@ -0,0 +1,13 @@
# Blade/layout
Structural layout slot components for page composition.
## Files
- **content.blade.php** -- Main content area wrapper
- **footer.blade.php** -- Page footer section
- **header.blade.php** -- Page header section
- **left.blade.php** -- Left sidebar/aside section
- **right.blade.php** -- Right sidebar/aside section
These map to the HLCRF (Header-Left-Content-Right-Footer) layout system. Used as named slots within layout templates.

View file

@ -0,0 +1,27 @@
# Blade/layouts
Page layout templates registered under the `layouts::` namespace. Used by Livewire components via `->layout('layouts::app')`.
## Files
- **app.blade.php** -- Marketing/sales layout with particle animation. For landing pages, pricing, about, services.
- **content.blade.php** -- Blog posts, guides, legal pages. Centred prose layout.
- **focused.blade.php** -- Checkout, forms, onboarding. Minimal, distraction-free layout.
- **minimal.blade.php** -- Bare minimum layout with no navigation.
- **sidebar-left.blade.php** -- Help centre, FAQ, documentation. Left nav + content.
- **sidebar-right.blade.php** -- Long guides with TOC. Content + right sidebar.
- **workspace.blade.php** -- Authenticated SaaS workspace layout.
## Subdirectories
- **partials/** -- Shared layout fragments (base HTML shell, fonts, header, footer)
## Usage
```php
// In Livewire component
public function layout(): string
{
return 'layouts::app';
}
```

View file

@ -0,0 +1,12 @@
# Blade/layouts/partials
Shared layout fragments included by the layout templates.
## Files
- **base.blade.php** -- Base HTML document shell. Handles `<!DOCTYPE>`, `<html>`, `<head>`, OG meta tags, CSRF token, Vite assets, and optional particle animation canvas. All layout templates extend this.
- Props: `title`, `description`, `ogImage`, `ogType`, `particles` (bool)
- **fonts.blade.php** -- External font loading (Google Fonts link tags)
- **fonts-inline.blade.php** -- Inline font declarations (for critical rendering path)
- **footer.blade.php** -- Shared site footer with navigation links, social links, and copyright
- **header.blade.php** -- Shared site header/navigation bar with logo, menu items, and auth links

View file

@ -0,0 +1,25 @@
# Blade/menu
Dropdown menu sub-components.
## Files
- **checkbox.blade.php** -- Menu item with checkbox toggle
- **group.blade.php** -- Menu item group with optional label
- **item.blade.php** -- Standard menu item (link or action)
- **radio.blade.php** -- Menu item with radio button selection
- **separator.blade.php** -- Visual separator/divider between menu groups
- **submenu.blade.php** -- Nested submenu that opens on hover/click
## Usage
```blade
<core:menu>
<core:menu.group label="Actions">
<core:menu.item href="/edit">Edit</core:menu.item>
<core:menu.item href="/duplicate">Duplicate</core:menu.item>
</core:menu.group>
<core:menu.separator />
<core:menu.item variant="danger">Delete</core:menu.item>
</core:menu>
```

View file

@ -0,0 +1,7 @@
# Blade/navbar
Navbar sub-components for the `<core:navbar>` component.
## Files
- **item.blade.php** -- Individual navbar item. Renders as a navigation link within a navbar container.

View file

@ -0,0 +1,19 @@
# Blade/navlist
Navigation list sub-components for sidebar/panel navigation.
## Files
- **group.blade.php** -- Navigation group with optional heading label. Groups related nav items together with visual separation.
- **item.blade.php** -- Individual navigation item with label, href, icon, and active state.
## Usage
```blade
<core:navlist>
<core:navlist.group heading="Main">
<core:navlist.item href="/dashboard" icon="home" :active="true">Dashboard</core:navlist.item>
<core:navlist.item href="/settings" icon="gear">Settings</core:navlist.item>
</core:navlist.group>
</core:navlist>
```

View file

@ -0,0 +1,27 @@
# Blade/pillbox
Pillbox (tag/chip input) sub-components for multi-value selection.
## Files
- **create.blade.php** -- "Create new" action within the pillbox dropdown
- **empty.blade.php** -- Empty state when no options match the search
- **input.blade.php** -- Search/filter input within the pillbox
- **option.blade.php** -- Selectable option in the dropdown list
- **search.blade.php** -- Search container wrapping the input and results
- **trigger.blade.php** -- The pillbox trigger showing selected items as removable pills
## Usage
```blade
<core:pillbox>
<core:pillbox.trigger />
<core:pillbox.search>
<core:pillbox.input placeholder="Search tags..." />
<core:pillbox.option value="php">PHP</core:pillbox.option>
<core:pillbox.option value="go">Go</core:pillbox.option>
<core:pillbox.empty>No matches</core:pillbox.empty>
<core:pillbox.create>Add new tag</core:pillbox.create>
</core:pillbox.search>
</core:pillbox>
```

View file

@ -0,0 +1,7 @@
# Blade/radio
Radio button sub-components.
## Files
- **group.blade.php** -- Radio button group container. Wraps multiple radio inputs with shared name and layout.

View file

@ -0,0 +1,7 @@
# Blade/select
Select dropdown sub-components.
## Files
- **option.blade.php** -- Individual option within a select dropdown. Renders as a selectable item in the custom select component's option list.

View file

@ -0,0 +1,7 @@
# Blade/slider
Slider (range input) sub-components.
## Files
- **tick.blade.php** -- Tick mark along a slider track. Provides visual markers at specific values on a range slider.

View file

@ -0,0 +1,19 @@
# Blade/tab
Tab sub-components for the `<core:tabs>` system.
## Files
- **group.blade.php** -- Tab group container. Wraps tab triggers and manages selected state.
- **panel.blade.php** -- Tab content panel. Shows/hides based on which tab is selected.
## Usage
```blade
<core:tab.group>
<core:tab name="general">General</core:tab>
<core:tab name="advanced">Advanced</core:tab>
</core:tab.group>
<core:tab.panel name="general">General content</core:tab.panel>
<core:tab.panel name="advanced">Advanced content</core:tab.panel>
```

View file

@ -0,0 +1,28 @@
# Blade/table
Table sub-components for data tables.
## Files
- **cell.blade.php** -- Individual table cell (`<td>`)
- **column.blade.php** -- Column header (`<th>`) with optional sorting
- **columns.blade.php** -- Column header row container (`<thead><tr>`)
- **row.blade.php** -- Table row (`<tr>`)
- **rows.blade.php** -- Table body container (`<tbody>`)
## Usage
```blade
<core:table>
<core:table.columns>
<core:table.column>Name</core:table.column>
<core:table.column>Status</core:table.column>
</core:table.columns>
<core:table.rows>
<core:table.row>
<core:table.cell>Item 1</core:table.cell>
<core:table.cell>Active</core:table.cell>
</core:table.row>
</core:table.rows>
</core:table>
```

View file

@ -0,0 +1,11 @@
# Blade/web
Public-facing page templates for workspace websites. Registered under the `web::` namespace.
## Files
- **home.blade.php** -- Workspace homepage template
- **page.blade.php** -- Generic content page template
- **waitlist.blade.php** -- Pre-launch waitlist/signup page template
These are rendered for workspace domains resolved by `FindDomainRecord` middleware. Used via `web::home`, `web::page`, `web::waitlist` view references.

View file

@ -0,0 +1,18 @@
# Front/Services
Shared services for the Front module.
## Files
- **DeviceDetectionService.php** -- User-Agent parser for device type, OS, browser, in-app browser, and bot detection. Detects 14 social platform in-app browsers (Instagram, Facebook, TikTok, Twitter, LinkedIn, Snapchat, Threads, Pinterest, Reddit, WeChat, LINE, Telegram, Discord, WhatsApp) plus generic WebView. Identifies strict content platforms (Meta, TikTok, Twitter, Snapchat, LinkedIn) and Meta-owned platforms. Platform-specific methods: `isInstagram()`, `isFacebook()`, `isTikTok()`, etc. Full parse returns `{device_type, os_name, browser_name, in_app_browser, is_in_app}`.
## Usage
```php
$service = new DeviceDetectionService();
$info = $service->parse($request->userAgent());
if ($service->isStrictContentPlatform($ua)) {
// Hide restricted content for platform compliance
}
```

View file

@ -0,0 +1,7 @@
# Front/Stdio
Stdio frontage for terminal/pipe-based I/O.
## Files
- **Boot.php** -- ServiceProvider for stdin/stdout transport. Handles non-HTTP contexts: Artisan commands, MCP stdio transport (agents connecting via pipes), and interactive CLI tools. Currently a placeholder with empty command registration -- core CLI commands will be registered here. No HTTP middleware -- this is a different transport entirely.

View file

@ -0,0 +1,13 @@
# Front/Tests/Unit
Unit tests for the Front module.
## Files
- **DeviceDetectionServiceTest.php** -- Tests for `DeviceDetectionService`. Covers in-app browser detection (Instagram, Facebook, TikTok, Twitter, LinkedIn, Snapchat, Threads, Pinterest, Reddit, WeChat, WhatsApp), standard browser exclusion, platform-specific methods, strict content platform identification, Meta platform detection, display names, device type/OS/browser detection, bot detection, and full parse output. Uses PHPUnit DataProvider for UA string coverage.
## Running
```bash
composer test -- --filter=DeviceDetectionServiceTest
```

View file

@ -0,0 +1,21 @@
# Front/Web/Blade/components
Anonymous Blade components for the public web frontage. Used via `<web:xyz>` tag syntax.
## Components
- **nav-item.blade.php** -- Navigation list item with icon and active state highlighting.
- Props: `href` (required), `icon` (string|null), `active` (bool)
- Uses `<core:icon>` for icon rendering.
- **page.blade.php** -- Simple page wrapper for public web pages with optional title and description.
- Props: `title` (string|null), `description` (string|null)
- Provides max-width container with responsive padding.
## Usage
```blade
<web:page title="About Us">
<p>Content here</p>
</web:page>
```

View file

@ -0,0 +1,10 @@
# Front/Web/Blade/layouts
Layout templates for public web pages.
## Files
- **app.blade.php** -- Base HTML shell for public web pages. Includes dark mode support (cookie-based), CSRF meta tag, Vite assets (app.css + app.js), Flux appearance/scripts, and font loading via `layouts::partials.fonts`.
- Props: `title` (string, defaults to `core.app.name` config)
- Slots: `$head` (extra head content), `$scripts` (extra scripts before `</body>`)
- Prevents white flash with inline critical CSS for dark mode.

View file

@ -0,0 +1,21 @@
# Front/Web
Public-facing web frontage. Service provider that configures the `web` middleware group and registers `<web:xyz>` Blade tag syntax.
## Files
- **Boot.php** -- ServiceProvider that configures the `web` middleware stack (cookies, session, CSRF, security headers, domain resolution), registers the `web::` Blade namespace, fires `WebRoutesRegistering` lifecycle event, and aliases `livewire` as `admin` for Flux compatibility.
- **WebTagCompiler.php** -- Blade precompiler enabling `<web:xyz>` tag syntax (like `<flux:xyz>`). Compiles to anonymous components in the `web::` namespace.
## Middleware Stack
The `web` group includes: EncryptCookies, AddQueuedCookiesToResponse, StartSession, ResilientSession, ShareErrorsFromSession, ValidateCsrfToken, SubstituteBindings, SecurityHeaders, FindDomainRecord.
## Tag Syntax
```blade
<web:page title="Welcome">Content here</web:page>
<web:nav-item href="/about" icon="info">About</web:nav-item>
```
Resolves to anonymous components in `Web/Blade/components/` and `Components/View/Blade/web/`.

View file

@ -0,0 +1,9 @@
# Front/Web/Middleware
HTTP middleware for public web requests.
## Files
- **FindDomainRecord.php** -- Resolves the current workspace from the incoming domain. Sets `workspace_model` and `workspace` attributes on the request. Core domains (base domain, www, localhost) pass through. Checks custom domains first, then subdomain slugs. Requires `Core\Tenant` module.
- **RedirectIfAuthenticated.php** -- Redirects logged-in users away from guest-only pages (e.g., login). Redirects to `/` on the current domain instead of a global dashboard route.
- **ResilientSession.php** -- Catches session corruption (decryption errors, DB failures) and recovers gracefully by clearing cookies and retrying. Prevents 503 errors from APP_KEY changes or session table issues. Returns JSON for AJAX requests.

View file

@ -0,0 +1,7 @@
# Headers/Livewire/ — Header Configuration UI
## Components
| Component | Purpose |
|-----------|---------|
| `HeaderConfigurationManager` | Livewire component for managing security header configuration in the admin panel. Provides UI for configuring CSP directives, HSTS settings, Permissions Policy features, and other security headers. |

View file

@ -0,0 +1,10 @@
# Headers/Testing/ — Security Header Test Utilities
## Files
| File | Purpose |
|------|---------|
| `HeaderAssertions` | Trait with assertion methods for testing security headers in HTTP responses. Provides `assertHasSecurityHeaders()`, `assertCspContains()`, etc. |
| `SecurityHeaderTester` | Standalone static helper for validating security headers. Can be used without traits for flexible testing scenarios. |
Used by feature tests (`SecurityHeadersTest`) to verify CSP, HSTS, X-Frame-Options, and other security headers.

View file

@ -0,0 +1,7 @@
# Headers/Views/livewire/ — Header Configuration Blade Template
## Templates
| File | Purpose |
|------|---------|
| `header-configuration-manager.blade.php` | Blade template for the `HeaderConfigurationManager` Livewire component. Renders the security header configuration form with CSP, HSTS, and Permissions Policy controls. |

View file

@ -0,0 +1,13 @@
# Helpers/Rules/ — Custom Validation Rules
## Rules
| Rule | Purpose |
|------|---------|
| `HexRule` | Validates hexadecimal colour codes. Supports 3-digit (`#fff`) and 6-digit (`#ffffff`) formats. Hash symbol required. Constructor option `forceFull: true` rejects 3-digit codes. |
Usage:
```php
'colour' => ['required', new HexRule()]
'colour' => ['required', new HexRule(forceFull: true)]
```

View file

@ -0,0 +1,9 @@
# Input/Tests/Unit/ — Input Filtering Tests
## Test Files
| File | Purpose |
|------|---------|
| `InputFilteringTest.php` | Pest unit tests for the `Sanitiser` class. Covers clean input passthrough (ASCII, punctuation, UTF-8), XSS prevention, SQL injection stripping, null byte removal, and edge cases. |
Tests the WAF layer that `Core\Init` uses to sanitise `$_GET` and `$_POST` before Laravel processes the request.

View file

@ -0,0 +1,10 @@
# Lang/Console/Commands/ — Translation CLI Commands
## Commands
| Command | Purpose |
|---------|---------|
| `TranslationCoverageCommand` | Reports translation coverage across the codebase. Scans code for translation key usage and compares against translation files to identify missing and unused keys. |
| `TranslationMemoryCommand` | CLI interface for managing translation memory — view statistics, browse entries, import/export TMX files, fuzzy match queries. |
Part of the Lang subsystem's developer tooling.

View file

@ -0,0 +1,10 @@
# Lang/Coverage/ — Translation Coverage Analysis
## Files
| File | Purpose |
|------|---------|
| `TranslationCoverage` | Scans PHP, Blade, and JS/Vue files for translation key usage (`__()`, `trans()`, `@lang`, etc.) and compares against translation files. Reports missing keys (used but undefined) and unused keys (defined but unused). |
| `TranslationCoverageReport` | DTO containing analysis results — missing keys, unused keys, coverage statistics per locale, and usage locations. Implements `Arrayable`. |
Used by the `lang:coverage` Artisan command for translation quality assurance.

Some files were not shown because too many files have changed in this diff Show more