-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforge-admin-console.html
More file actions
763 lines (738 loc) · 39 KB
/
Copy pathforge-admin-console.html
File metadata and controls
763 lines (738 loc) · 39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
<!doctype html>
<html lang="en" class="scroll-smooth">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Forge Kernel - ForgeAdminConsole</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-core.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/autoloader/prism-autoloader.min.js"></script>
<link
href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-tomorrow.min.css"
rel="stylesheet"
/>
<link
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"
rel="stylesheet"
/>
<link rel="stylesheet" href="assets/css/docs.css" />
</head>
<body class="bg-gray-50 text-gray-900">
<!-- Navigation -->
<nav class="bg-white shadow-sm border-b">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16">
<div class="flex items-center">
<div class="flex-shrink-0">
<h1 class="text-xl font-bold text-gray-900">
Forge Kernel
</h1>
</div>
<div class="hidden sm:ml-6 sm:flex sm:space-x-8">
<a
href="index.html"
class="text-gray-900 inline-flex items-center px-1 pt-1 text-sm font-medium hover:text-blue-600"
>
Home
</a>
<a
href="getting-started.html"
class="text-gray-900 inline-flex items-center px-1 pt-1 text-sm font-medium hover:text-blue-600"
>
Getting Started
</a>
<a
href="core-concepts.html"
class="text-gray-900 inline-flex items-center px-1 pt-1 text-sm font-medium hover:text-blue-600"
>
Core Concepts
</a>
<a
href="capabilities.html"
class="text-gray-900 inline-flex items-center px-1 pt-1 text-sm font-medium hover:text-blue-600"
>
Capabilities
</a>
<a
href="api-reference.html"
class="text-gray-900 inline-flex items-center px-1 pt-1 text-sm font-medium hover:text-blue-600"
>
API Reference
</a>
<a
href="tutorial.html"
class="text-gray-900 inline-flex items-center px-1 pt-1 text-sm font-medium hover:text-blue-600"
>
Tutorials
</a>
</div>
</div>
<div class="flex items-center sm:hidden">
<button
id="mobile-menu-button"
class="text-gray-700 hover:text-blue-600 p-2"
>
<i class="fas fa-bars text-xl"></i>
</button>
</div>
</div>
</div>
<div
id="mobile-menu"
class="sm:hidden hidden bg-white border-t border-gray-200"
>
<div class="px-2 pt-2 pb-3 space-y-1">
<a
href="index.html"
class="block px-3 py-2 text-gray-900 hover:text-blue-600"
>Home</a
>
<a
href="getting-started.html"
class="block px-3 py-2 text-gray-900 hover:text-blue-600"
>Getting Started</a
>
<a
href="core-concepts.html"
class="block px-3 py-2 text-gray-900 hover:text-blue-600"
>Core Concepts</a
>
<a
href="capabilities.html"
class="block px-3 py-2 text-gray-900 hover:text-blue-600"
>Capabilities</a
>
<a
href="api-reference.html"
class="block px-3 py-2 text-gray-900 hover:text-blue-600"
>API Reference</a
>
<a
href="tutorial.html"
class="block px-3 py-2 text-gray-900 hover:text-blue-600"
>Tutorials</a
>
</div>
</div>
</nav>
<!-- Main Content -->
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<div class="flex flex-col lg:flex-row gap-8">
<!-- Sidebar Navigation -->
<div id="sidebar-nav" class="lg:w-1/4">
<div class="bg-white rounded-lg shadow-sm p-6 sticky top-8">
<h3 class="text-lg font-semibold text-gray-900 mb-4">
ForgeAdminConsole
</h3>
<nav class="space-y-2">
<a
href="#overview"
class="nav-link block px-3 py-2 text-sm text-gray-700 rounded-md hover:text-blue-600"
>Overview</a
>
<a
href="#the-auth-puzzle"
class="nav-link block px-3 py-2 text-sm text-gray-700 rounded-md hover:text-blue-600"
>The Auth Puzzle</a
>
<a
href="#installation"
class="nav-link block px-3 py-2 text-sm text-gray-700 rounded-md hover:text-blue-600"
>Installation</a
>
<a
href="#the-console"
class="nav-link block px-3 py-2 text-sm text-gray-700 rounded-md hover:text-blue-600"
>The Console</a
>
<a
href="#protected-routes"
class="nav-link block px-3 py-2 text-sm text-gray-700 rounded-md hover:text-blue-600"
>Protected Routes</a
>
<a
href="#user-management"
class="nav-link block px-3 py-2 text-sm text-gray-700 rounded-md hover:text-blue-600"
>User Management</a
>
<a
href="#the-layout-and-ui"
class="nav-link block px-3 py-2 text-sm text-gray-700 rounded-md hover:text-blue-600"
>The Layout & UI</a
>
<a
href="#extending"
class="nav-link block px-3 py-2 text-sm text-gray-700 rounded-md hover:text-blue-600"
>Extending</a
>
<a
href="#configuration"
class="nav-link block px-3 py-2 text-sm text-gray-700 rounded-md hover:text-blue-600"
>Configuration</a
>
</nav>
<div class="mt-6 pt-6 border-t border-gray-200">
<h4 class="font-semibold text-sm mb-3 text-blue-600">
Related
</h4>
<nav class="space-y-2">
<a
href="forge-auth.html"
class="block text-gray-600 hover:text-blue-600 py-1 text-sm"
>ForgeAuth — the auth engine →</a
>
<a
href="forge-hub.html"
class="block text-gray-600 hover:text-blue-600 py-1 text-sm"
>ForgeHub — administration hub →</a
>
<a
href="forge-notification.html"
class="block text-gray-600 hover:text-blue-600 py-1 text-sm"
>ForgeNotification — async messages →</a
>
<a
href="capabilities.html"
class="block text-gray-600 hover:text-blue-600 py-1 text-sm"
>All capabilities →</a
>
</nav>
</div>
</div>
</div>
<!-- Main Content -->
<div class="lg:w-3/4">
<div class="bg-white rounded-lg shadow-sm p-8">
<h1 class="text-4xl font-bold text-gray-900 mb-6">
ForgeAdminConsole
</h1>
<p class="text-xl text-gray-600 mb-4">
A protected admin console that <strong>your app</strong>
can drop in to get a working dashboard, account and
profile pages, and user management — the final piece
of a complete, local auth experience. Combined with
ForgeAuth and ForgeAppAuth, it turns the auth
primitives into a secure, ready-to-use admin area.
</p>
<!-- Overview -->
<section id="overview" class="section-anchor mb-12">
<h2 class="text-2xl font-bold text-gray-900 mb-4">
Overview
</h2>
<p class="text-gray-600 mb-4">
ForgeAdminConsole ships a set of already-wired,
authenticated pages under <code>/admin</code> —
a dashboard, account settings, a profile editor,
and a paginated users list with detail views. It's
built on the auth capability and the app-level
auth flow, so by the time it's installed you have a
real, secure place for a logged-in user to land.
</p>
<div
class="bg-blue-50 border border-blue-200 rounded-lg p-6"
>
<h3 class="font-semibold text-lg mb-4">
What arrives out of the box
</h3>
<div
class="grid md:grid-cols-2 gap-4 text-sm text-gray-700"
>
<ul
class="space-y-2 list-disc list-inside"
>
<li>A dashboard with stats, activity, and quick actions</li>
<li>Account and profile edit pages</li>
</ul>
<ul
class="space-y-2 list-disc list-inside"
>
<li>A paginated users table and user detail</li>
<li>Every page behind the auth gate</li>
</ul>
</div>
</div>
</section>
<!-- The Auth Puzzle -->
<section
id="the-auth-puzzle"
class="section-anchor mb-12"
>
<h2 class="text-2xl font-bold text-gray-900 mb-4">
The Auth Puzzle
</h2>
<p class="text-gray-600 mb-4">
Getting a real, secure admin area takes three
cooperating pieces. ForgeAdminConsole is the last
of them, and only feels complete because the other
two exist:
</p>
<div class="space-y-4 mb-6">
<div
class="bg-gray-50 border border-gray-200 rounded-lg p-5"
>
<h3 class="font-semibold mb-1">
1. ForgeAuth — the engine
</h3>
<p class="text-sm text-gray-700">
The primitives: the
<code>UserProvider</code> and
<code>UserContext</code> contracts, roles
and permissions, JWT and API-key support,
and the auth middlewares. It defines
<em>how</em> auth works but doesn't decide
where your users live.
</p>
</div>
<div
class="bg-gray-50 border border-gray-200 rounded-lg p-5"
>
<h3 class="font-semibold mb-1">
2. ForgeAppAuth — the local auth flow
</h3>
<p class="text-sm text-gray-700">
The business layer that makes the engine
usable: it <strong>provides</strong> the
concrete <code>UserProvider</code> (your
user repository) and
<code>UserContext</code>, plus the real
<code>/auth</code> routes — register,
login, logout, forgot-password, and
reset-password — with forms, validation,
and sessions.
</p>
</div>
<div
class="bg-gray-50 border border-gray-200 rounded-lg p-5"
>
<h3 class="font-semibold mb-1">
3. ForgeAdminConsole — the protected UI
</h3>
<p class="text-sm text-gray-700">
The window into it all: pages gated by the
auth route that read the current user and
list the user store. It's the easy starting
point — a functional admin area with no
wiring left to do.
</p>
</div>
</div>
<p class="text-gray-600">
Install all three and the loop closes: a visitor
registers and logs in through ForgeAppAuth's
<code>/auth</code> flow, lands in the protected
console, and you have a secure home for
authenticated management.
</p>
</section>
<!-- Installation -->
<section
id="installation"
class="section-anchor mb-12"
>
<h2 class="text-2xl font-bold text-gray-900 mb-4">
Installation
</h2>
<div
class="code-block p-6 text-white rounded-lg mb-6"
>
<pre><code class="language-bash">php forge.php package:install-module --module=ForgeAdminConsole</code></pre>
</div>
<p class="text-gray-600 mb-4">
The module requires the pieces it builds on —
<code>forge-router</code>, <code>forge-view</code>,
<code>forge-components</code>, and
<code>forge-auth</code> — and links its
stylesheet into your public directory on install.
</p>
<p class="text-gray-600">
For the complete flow, also install
<code>ForgeAppAuth</code> alongside it; that's the
module that provides the user store and the
<code>/auth</code> login flow the console depends
on for both authentication and signing out.
</p>
</section>
<!-- The Console -->
<section
id="the-console"
class="section-anchor mb-12"
>
<h2 class="text-2xl font-bold text-gray-900 mb-4">
The Console
</h2>
<p class="text-gray-600 mb-4">
The console is a handful of controllers, all under
the <code>/admin</code> prefix:
</p>
<div class="overflow-x-auto mb-6">
<table
class="w-full text-sm text-left text-gray-700 bg-gray-50 border border-gray-200 rounded-lg"
>
<thead class="bg-gray-200">
<tr>
<th class="px-4 py-2">Route</th>
<th class="px-4 py-2">Purpose</th>
</tr>
</thead>
<tbody
class="divide-y divide-gray-200"
>
<tr>
<td class="px-4 py-2"><code>/admin</code></td>
<td class="px-4 py-2">Dashboard — stats, recent activity, quick actions</td>
</tr>
<tr>
<td class="px-4 py-2"><code>/admin/account</code></td>
<td class="px-4 py-2">Account settings (email), GET + POST save</td>
</tr>
<tr>
<td class="px-4 py-2"><code>/admin/profile</code></td>
<td class="px-4 py-2">Public profile (identifier, bio), GET + POST save</td>
</tr>
<tr>
<td class="px-4 py-2"><code>/admin/users</code></td>
<td class="px-4 py-2">Paginated users table</td>
</tr>
<tr>
<td class="px-4 py-2"><code>/admin/users/{id}</code></td>
<td class="px-4 py-2">A single user's detail</td>
</tr>
</tbody>
</table>
</div>
<p class="text-gray-600">
Dashboard data is composed in the controller —
stats cards, a recent-activity feed, and quick
actions — with the authenticated user's
identifier and email in the header. The account and
profile pages <code>sanitize</code> submitted data
and report success or failure through flash
messages before redirecting back to their own
page.
</p>
</section>
<!-- Protected Routes -->
<section
id="protected-routes"
class="section-anchor mb-12"
>
<h2 class="text-2xl font-bold text-gray-900 mb-4">
Protected Routes
</h2>
<p class="text-gray-600 mb-4">
Every console controller is declared with
<code>#[UseMiddleware(['web', 'auth'])]</code>.
The <code>auth</code> middleware — provided by the
app-auth flow — checks for a current user:
</p>
<div
class="code-block p-6 text-white rounded-lg mb-6"
>
<pre><code class="language-php">use Modules\ForgeAuth\Contracts\UserContextInterface;
use Modules\ForgeRouter\Attributes\Layout;
use Modules\ForgeRouter\Attributes\Routable;
use Modules\ForgeRouter\Http\Attributes\UseMiddleware;
use Modules\ForgeRouter\Http\Response;
use Modules\ForgeRouter\Routing\Endpoint;
use Modules\ForgeRouter\Traits\ResponseHelper;
use Modules\ForgeView\Traits\ViewHelper;
#[Routable(prefix: '/admin')]
#[UseMiddleware(['web', 'auth'])]
#[Layout("ForgeComponents:wrappers/admin-default")]
final class Account
{
use ResponseHelper;
use ViewHelper;
public function __construct(
private readonly UserContextInterface $userContext,
) {}
#[Endpoint("/account")]
public function editAccount(): Response
{
$user = $this->userContext->current();
return $this->view(view: "admin/account", data: [
'currentUser' => $user,
]);
}
}</code></pre>
</div>
<p class="text-gray-600 mb-4">
A guest hitting any admin URL is saved an intended
URL and redirected to
<code>/auth/login</code> — after signing in they
return to where they were headed. Signing out
works through the same flow: the console's user
dropdown posts a <code>logout</code> action to
<code>/auth/logout</code>, closing the loop.
</p>
<p class="text-gray-600">
The current user is read through
<code>UserContextInterface</code>, so whatever your
app-auth implementation exposes as the
authenticated user flows straight into the
console header.
</p>
</section>
<!-- User Management -->
<section
id="user-management"
class="section-anchor mb-12"
>
<h2 class="text-2xl font-bold text-gray-900 mb-4">
User Management
</h2>
<p class="text-gray-600 mb-4">
The users list and detail pages read through a
small <code>UserProvider</code> helper that wraps
the auth capability's
<code>UserProviderInterface</code> — the same seam
your app-auth module supplies. It paginates the
user store and reshapes rows into table columns:
</p>
<div
class="code-block p-6 text-white rounded-lg mb-6"
>
<pre><code class="language-php">use Modules\ForgeAuth\Contracts\UserProviderInterface;
final class UserProvider
{
public function __construct(
private readonly UserProviderInterface $userProvider,
) {}
public function getUsersTableData(int $page = 1, int $perPage = 10): array
{
$users = $this->userProvider->paginate($page, $perPage);
return [
'columns' => [
['key' => 'id', 'label' => 'ID'],
['key' => 'identifier', 'label' => 'Identifier'],
['key' => 'email', 'label' => 'Email'],
],
'rows' => array_map([$this, 'userToRow'], $users->items()),
];
}
public function getUserDetails(int $id): ?array
{
$user = $this->userProvider->findById($id);
return $user === null ? null : $this->userToArray($user);
}
}</code></pre>
</div>
<p class="text-gray-600">
A missing user redirects back to the list with a
"User not found" flash message rather than erroring.
Because everything flows through the
<code>UserProviderInterface</code> contract, the
console works against whichever user store your
app provides — no changes to the console itself.
</p>
</section>
<!-- The Layout & UI -->
<section
id="the-layout-and-ui"
class="section-anchor mb-12"
>
<h2 class="text-2xl font-bold text-gray-900 mb-4">
The Layout & UI
</h2>
<p class="text-gray-600 mb-4">
All console pages render inside the same admin
layout — <code>ForgeComponents:wrappers/admin-default</code> —
and drive it through the component system. Each
view sets its sidebar, breadcrumbs, and the user
dropdown in the standard way:
</p>
<div
class="code-block p-6 text-white rounded-lg mb-6"
>
<pre><code class="language-php">use Modules\ForgeComponents\Definitions\Admin\SidebarDefinition;
use Modules\ForgeComponents\Definitions\Admin\NavGroupDefinition;
use Modules\ForgeComponents\Definitions\Admin\NavItemDefinition;
use Modules\ForgeComponents\Definitions\Admin\IconDefinition;
use Modules\ForgeComponents\Definitions\Admin\UserDropdownDefinition;
use Modules\ForgeComponents\Definitions\Admin\DropdownItemDefinition;
$layoutProps = array_merge($layoutProps ?? [], [
'sidebar' => new SidebarDefinition(
brand: 'Admin',
brandHref: '/admin',
groups: [
new NavGroupDefinition(items: [
new NavItemDefinition(label: 'Dashboard', href: '/admin', icon: new IconDefinition(name: 'home'), active: is_link_active('/admin')),
new NavItemDefinition(label: 'Users', href: '/admin/users', icon: new IconDefinition(name: 'users'), active: is_link_active('/admin/users')),
]),
],
),
'userDropdown' => new UserDropdownDefinition(
name: $currentUser?->getIdentifier() ?? 'User',
email: $currentUser?->getEmail() ?? '',
items: [
new DropdownItemDefinition(label: 'Profile', icon: new IconDefinition(name: 'user'), href: '/admin/profile'),
new DropdownItemDefinition(divider: true),
new DropdownItemDefinition(label: 'Logout', icon: new IconDefinition(name: 'arrow-right-on-rectangle'), href: '/auth/logout', method: 'POST'),
],
),
]);</code></pre>
</div>
<p class="text-gray-600 mb-4">
The active nav item is derived from the current URL
via <code>is_link_active()</code>, so highlighting
stays correct as you move between pages. Dashboard,
account, and users pages reuse the shared admin
components — stats cards, data cards, an activity
list, quick-actions tiles, and a table — so the
console looks consistent without bespoke markup.
</p>
<p class="text-gray-600">
The console's own stylesheet intersects with the
component design system (CSS variables, spacing
scales), and the brand shown in the sidebar is
configurable.
</p>
</section>
<!-- Extending -->
<section
id="extending"
class="section-anchor mb-12"
>
<h2 class="text-2xl font-bold text-gray-900 mb-4">
Extending
</h2>
<p class="text-gray-600 mb-4">
The shipped pages are a starting point, not a
straitjacket. You can:
</p>
<ul
class="space-y-2 list-disc list-inside text-gray-700 mb-4"
>
<li>
Add more protected endpoints under
<code>/admin</code> — same
<code>UseMiddleware(['web', 'auth'])</code>
declaration, same layout.
</li>
<li>
Gate finer-grained actions with the auth
capability's roles and permissions
(<code>RequiresPermission</code> / roles), which
layer on top of the base authentication.
</li>
<li>
Read <code>UserContextInterface::current()</code>
anywhere in your own controllers for
authenticated, user-scoped behavior.
</li>
<li>
Customize the sidebar, breadcrumbs, and user
dropdown the same way the shipped views do.
</li>
</ul>
<p class="text-gray-600">
Because the console is plain controllers using the
component system, extending it follows the same
conventions as building any other page in your
app.
</p>
</section>
<!-- Configuration -->
<section
id="configuration"
class="section-anchor mb-12"
>
<h2 class="text-2xl font-bold text-gray-900 mb-4">
Configuration
</h2>
<p class="text-gray-600 mb-6">
Two small settings live under
<code>forge_admin_console</code>:
</p>
<div class="overflow-x-auto mb-6">
<table
class="w-full text-sm text-left text-gray-700 bg-gray-50 border border-gray-200 rounded-lg"
>
<thead class="bg-gray-200">
<tr>
<th class="px-4 py-2">Config</th>
<th class="px-4 py-2">Default</th>
<th class="px-4 py-2">Purpose</th>
</tr>
</thead>
<tbody
class="divide-y divide-gray-200"
>
<tr>
<td class="px-4 py-2">brand</td>
<td class="px-4 py-2">Admin</td>
<td class="px-4 py-2">Sidebar brand label/href</td>
</tr>
<tr>
<td class="px-4 py-2">items_per_page</td>
<td class="px-4 py-2">10</td>
<td class="px-4 py-2">Users per table page</td>
</tr>
</tbody>
</table>
</div>
<p class="text-gray-600">
There's nothing else to set up — the real work is
done by the auth capability and the app-auth flow
it builds on, and the console simply sits on top
of them.
</p>
</section>
</div>
</div>
</div>
</div>
<!-- Footer -->
<footer class="bg-gray-900 text-white py-8 mt-16">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center">
<div class="mb-4">
<span class="text-lg font-bold">Forge Kernel</span>
</div>
<p class="text-gray-400">
A toolbox for builders who like to do things their way.
</p>
</div>
</footer>
<script>
document.querySelectorAll('a[href^="#"]').forEach((anchor) => {
anchor.addEventListener("click", function (e) {
e.preventDefault();
const target = document.querySelector(
this.getAttribute("href"),
);
if (target) {
target.scrollIntoView({
behavior: "smooth",
block: "start",
});
}
});
});
const mobileMenuButton =
document.getElementById("mobile-menu-button");
const mobileMenu = document.getElementById("mobile-menu");
if (mobileMenuButton && mobileMenu) {
mobileMenuButton.addEventListener("click", function () {
mobileMenu.classList.toggle("hidden");
});
}
window.addEventListener("scroll", function () {
const sections = document.querySelectorAll(".section-anchor");
const navLinks = document.querySelectorAll(".nav-link");
let current = "";
sections.forEach((section) => {
const sectionTop = section.offsetTop - 100;
if (window.pageYOffset >= sectionTop) {
current = section.getAttribute("id");
}
});
navLinks.forEach((link) => {
link.classList.remove("active");
if (link.getAttribute("href") === "#" + current) {
link.classList.add("active");
}
});
});
</script>
</body>
</html>