@seip/bluebird-js 0.0.1 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/.env_example +53 -53
  2. package/AGENTS.md +426 -403
  3. package/LICENSE +1 -1
  4. package/README.md +292 -285
  5. package/app/routes/api.js +50 -50
  6. package/app/routes/web.js +55 -53
  7. package/app/views/about.js +63 -0
  8. package/app/views/dashboard.js +147 -0
  9. package/app/views/index.js +80 -0
  10. package/app/views/layouts/main/view.js +81 -0
  11. package/app/views/legal/terms.html +19 -0
  12. package/app/views/login.js +80 -0
  13. package/core/app.d.ts +18 -18
  14. package/core/app.js +684 -644
  15. package/core/auth.d.ts +13 -13
  16. package/core/auth.js +326 -326
  17. package/core/cache.d.ts +17 -17
  18. package/core/cache.js +475 -475
  19. package/core/cli/doctor.js +287 -287
  20. package/core/cli/ecosystem.js +162 -162
  21. package/core/cli/init.js +779 -779
  22. package/core/cli/migrate.js +541 -541
  23. package/core/cli/model.js +66 -66
  24. package/core/cli/nginx.js +199 -199
  25. package/core/cli/route.js +120 -120
  26. package/core/cli/view.js +55 -36
  27. package/core/config.d.ts +3 -3
  28. package/core/config.js +111 -111
  29. package/core/csrf.d.ts +3 -3
  30. package/core/csrf.js +114 -114
  31. package/core/database.d.ts +15 -15
  32. package/core/database.js +636 -636
  33. package/core/debug.d.ts +3 -3
  34. package/core/debug.js +249 -249
  35. package/core/hash.d.ts +3 -3
  36. package/core/hash.js +194 -194
  37. package/core/html.d.ts +42 -0
  38. package/core/html.js +217 -0
  39. package/core/index.d.ts +1176 -1071
  40. package/core/logger.d.ts +3 -3
  41. package/core/logger.js +127 -124
  42. package/core/middleware.d.ts +3 -3
  43. package/core/middleware.js +28 -28
  44. package/core/model.d.ts +19 -19
  45. package/core/model.js +600 -600
  46. package/core/queue.d.ts +13 -13
  47. package/core/queue.js +172 -172
  48. package/core/ratelimit.d.ts +3 -3
  49. package/core/ratelimit.js +145 -145
  50. package/core/redis.d.ts +21 -21
  51. package/core/redis.js +230 -230
  52. package/core/render-cache.js +212 -0
  53. package/core/render.d.ts +3 -3
  54. package/core/render.js +199 -555
  55. package/core/router.d.ts +3 -3
  56. package/core/router.js +171 -171
  57. package/core/seo.d.ts +3 -3
  58. package/core/seo.js +106 -106
  59. package/core/swagger.d.ts +3 -3
  60. package/core/swagger.js +60 -60
  61. package/core/upload.d.ts +13 -13
  62. package/core/upload.js +102 -102
  63. package/core/util/colors.js +82 -82
  64. package/core/validate.d.ts +15 -15
  65. package/core/validate.js +364 -364
  66. package/core/view-loader.js +162 -0
  67. package/core/vite.d.ts +3 -3
  68. package/core/vite.js +145 -145
  69. package/core/ws.d.ts +13 -13
  70. package/core/ws.js +245 -245
  71. package/index.js +18 -18
  72. package/jsconfig.json +15 -15
  73. package/package.json +85 -86
  74. package/production.md +273 -273
  75. package/public/css/bluebird.min.css +1 -1
  76. package/public/js/bluebird-client.js +1780 -1662
  77. package/public/js/bluebird.min.js +1072 -1072
  78. package/app/views/about.html +0 -161
  79. package/app/views/dashboard.html +0 -140
  80. package/app/views/index.html +0 -150
  81. package/app/views/login.html +0 -144
@@ -1,161 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en" data-theme="dark">
3
-
4
- <head>
5
- <meta charset="UTF-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>Blue Bird - About</title>
8
- <link rel="canonical" href="https://seip25.github.io/Blue-bird/" />
9
- <meta name="description"
10
- content="Blue Bird is a fast, structured, and opinionated Express.js framework for developers who want visual elegance and performance with raw HTML and CSS.">
11
- <meta name="keywords" content="Blue Bird, Express.js, About, Semantic CSS, Architecture">
12
- <meta name="author" content="Seip25">
13
- <link rel="icon" href="/images/favicon.ico" />
14
- <link rel="stylesheet" href="/css/bluebird.min.css" />
15
-
16
- <script src="/js/bluebird-client.js" defer></script>
17
- </head>
18
-
19
- <body>
20
- <header>
21
- <nav>
22
- <a href="/" class="flex items-center gap-2">
23
- <svg width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
24
- stroke-linecap="round" stroke-linejoin="round" class="text-blue">
25
- <path d="M12 19l9 2-9-18-9 18 9-2zm0 0v-8" />
26
- </svg>
27
- <strong class="text-xl text-gradient">Blue Bird</strong>
28
- </a>
29
- </nav>
30
- </header>
31
-
32
- <main>
33
- <aside>
34
- <h4>Menu</h4>
35
- <a href="/">Home</a>
36
- <a href="/about" class="active badge badge-glow px-3 py-3">About</a>
37
- <a href="/login">Login</a>
38
- <a href="/dashboard">Dashboard</a>
39
- <a href="https://seip25.github.io/Blue-bird" target="_blank">Blue bird</a>
40
- <a href="https://seip25.github.io/Blue-bird-css/" target="_blank">Blue Bird CSS</a>
41
- <a href="https://github.com/seip25/Blue-bird" target="_blank" role="button"
42
- class="btn-sm outline">GitHub</a>
43
- </aside>
44
-
45
- <div>
46
- <section class="hero ">
47
- <h1 class="mt-3 text-gradient font-bold">About Blue Bird</h1>
48
- <p class="lead">Built for performance, simplicity, and raw speed.</p>
49
- </section>
50
-
51
- <article class="mt-6 ">
52
- <header>
53
- <h2 class="text-gradient-blue font-semibold">Our Philosophy</h2>
54
- </header>
55
- <p>
56
- Blue Bird was born out of a desire for a clean, performance-first approach to web development. We
57
- believe in harnessing the raw power of Express.js and Nginx, stripping away unnecessary bloat, and
58
- providing developers with a robust foundation that just works.
59
- </p>
60
- <p>
61
- By separating the static frontend delivery (handled blazingly fast by Nginx) from the dynamic API
62
- layer (powered by Express and Redis), Blue Bird achieves unparalleled performance out of the box.
63
- </p>
64
- </article>
65
-
66
- <div class="px-4 py-4 mb-4">
67
- <h2 class="text-gradient-blue font-semibold">Why Blue Bird?</h2>
68
-
69
- <div class="grid cols-2 gap-4">
70
- <div>
71
- <details open>
72
- <summary>Production Ready</summary>
73
- <p>Go from development to production seamlessly with PM2 clustering, systemd, and high performance multi-level caching for SQLite, MySQL, and PostgreSQL.</p>
74
- </details>
75
- <details open>
76
- <summary>Military Grade Security</summary>
77
- <p>Built-in AES-256-GCM JWT encryption, secure HttpOnly cookie
78
- sessions, helmet headers, and
79
- route rate limiting.</p>
80
- </details>
81
- </div>
82
- <div>
83
- <details open>
84
- <summary>High Performance Layer</summary>
85
- <p>Redis caching for the data layer and Nginx static delivery with
86
- 1-month browser asset
87
- caching.</p>
88
- </details>
89
- <details open>
90
- <summary>Pure Semantic HTML &amp; CSS</summary>
91
- <p>No bloated frontend frameworks or heavy node compile steps. Write
92
- clean, accessible code
93
- close to the metal.</p>
94
- </details>
95
- </div>
96
- </div>
97
-
98
- <article class="">
99
- <header>
100
- <h2 class="text-gradient-blue font-semibold">Core Architecture Summary</h2>
101
- </header>
102
- <table class="table table-hover">
103
- <thead>
104
- <tr>
105
- <th>Layer</th>
106
- <th>Technology</th>
107
- <th>Role</th>
108
- </tr>
109
- </thead>
110
- <tbody>
111
- <tr>
112
- <td><strong>Frontend</strong></td>
113
- <td>Pure Semantic HTML5 + <a href="https://seip25.github.io/Blue-bird-css/"
114
- target="_blank">Blue Bird CSS</a></td>
115
- <td>Static rendering served directly via Nginx</td>
116
- </tr>
117
- <tr>
118
- <td><strong>Backend</strong></td>
119
- <td>Node.js + Express + PM2</td>
120
- <td>High-performance REST API services</td>
121
- </tr>
122
- <tr>
123
- <td><strong>Cache</strong></td>
124
- <td>Redis / In-Memory RAM</td>
125
- <td>Sub-millisecond route &amp; query caching</td>
126
- </tr>
127
- <tr>
128
- <td><strong>Database</strong></td>
129
- <td>SQLite (WAL) / PostgreSQL / MySQL</td>
130
- <td>Unified driver with connection pooling</td>
131
- </tr>
132
- </tbody>
133
- </table>
134
- </article>
135
-
136
-
137
- </div>
138
- </div>
139
- </main>
140
-
141
- <footer>
142
- <div class="footer-content">
143
- <p>Powered by <strong class="text-gradient">Blue Bird Framework</strong> &amp;
144
- <strong class="text-gradient-blue">
145
- <a href="https://seip25.github.io/Blue-bird-css/" target="_blank">Blue Bird
146
- CSS</a>
147
- </strong>.
148
- </p>
149
- <div class="lang-switcher">
150
- <a href="/" class="lang-link">Home</a>
151
- <a href="/about" class="lang-link">About</a>
152
- <a href="/login" class="lang-link">Login</a>
153
- <a href="/dashboard" class="lang-link">Dashboard</a>
154
- <a href="https://github.com/seip25/Blue-bird" target="_blank" class="github-star mt-2">&#9733;
155
- GitHub</a>
156
- </div>
157
- </div>
158
- </footer>
159
- </body>
160
-
161
- </html>
@@ -1,140 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en" data-theme="dark">
3
-
4
- <head>
5
- <meta charset="UTF-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>Blue Bird - Dashboard</title>
8
- <link rel="canonical" href="https://seip25.github.io/Blue-bird/" />
9
- <meta name="description"
10
- content="Protected member dashboard for Blue Bird framework. Demonstrating JWT session authentication and smooth View Transitions.">
11
- <meta name="keywords" content="Blue Bird, Dashboard, Authentication, Protected Route">
12
- <meta name="author" content="Seip25">
13
- <link rel="icon" href="/images/favicon.ico" />
14
- <link rel="stylesheet" href="/css/bluebird.min.css" />
15
-
16
- <script src="/js/bluebird-client.js" defer></script>
17
- </head>
18
-
19
- <body>
20
- <header>
21
- <nav>
22
- <a href="/" class="flex items-center gap-2">
23
- <svg width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
24
- stroke-linecap="round" stroke-linejoin="round" class="text-blue">
25
- <path d="M12 19l9 2-9-18-9 18 9-2zm0 0v-8" />
26
- </svg>
27
- <strong class="text-xl text-gradient">Blue Bird</strong>
28
- </a>
29
- </nav>
30
- </header>
31
-
32
- <main>
33
- <aside>
34
- <h4>Menu</h4>
35
- <a href="/">Home</a>
36
- <a href="/about">About</a>
37
- <a href="/login">Login</a>
38
- <a href="/dashboard" class="active badge badge-glow px-3 py-3">Dashboard</a>
39
- <a href="https://seip25.github.io/Blue-bird" target="_blank">Blue bird</a>
40
- <a href="https://seip25.github.io/Blue-bird-css/" target="_blank">Blue Bird CSS</a>
41
- <a href="/logout" data-no-prefetch="true" role="button" class="btn-sm destructive mt-4">Sign Out</a>
42
- </aside>
43
-
44
- <div>
45
- <section class="hero">
46
- <h1 class="mt-3 text-gradient font-bold">Protected Dashboard</h1>
47
- <p class="lead">You are securely authenticated via <strong>Auth.protect()</strong> middleware.</p>
48
- </section>
49
-
50
- <div class="mt-6">
51
- <div class="alert alert-success mb-6">
52
- <div>
53
- <strong class="alert-title">Active Protected Session</strong>
54
- <p class="alert-description">
55
- This route was rendered on-demand with fresh session data via <code>Render.send(res, "dashboard", ...)</code>, bypassing view caching completely.
56
- </p>
57
- </div>
58
- </div>
59
-
60
- <article class="card">
61
- <header class="card-header">
62
- <div class="flex items-center justify-between">
63
- <div>
64
- <h3 class="card-title">User Profile</h3>
65
- <p class="card-description">Decoded JWT payload stored in <code>req.user</code>.</p>
66
- </div>
67
- <span class="badge badge-success badge-glow">Active Session</span>
68
- </div>
69
- </header>
70
-
71
- <div class="grid cols-2 gap-4 mt-4">
72
- <div class="card bg-secondary">
73
- <small class="text-muted uppercase font-bold tracking-wider">User Name</small>
74
- <h4 class="font-bold text-lg mt-1">{{ user.name }}</h4>
75
- </div>
76
- <div class="card bg-secondary">
77
- <small class="text-muted uppercase font-bold tracking-wider">Email Address</small>
78
- <h4 class="font-bold text-lg mt-1">{{ user.email }}</h4>
79
- </div>
80
- <div class="card bg-secondary">
81
- <small class="text-muted uppercase font-bold tracking-wider">Account Role</small>
82
- <p class="mt-1"><span class="badge badge-primary">{{ user.role }}</span></p>
83
- </div>
84
- <div class="card bg-secondary">
85
- <small class="text-muted uppercase font-bold tracking-wider">Session Identifier</small>
86
- <p class="mt-1 font-mono text-xs"><code>{{ user._sessionId }}</code></p>
87
- </div>
88
- </div>
89
-
90
- <footer class="card-footer mt-6">
91
- <a href="/logout" data-no-prefetch="true" role="button" class="destructive">Sign Out &rarr;</a>
92
- <div class="flex items-center gap-2">
93
- <a href="/about" role="button" class="outline">Test Transition to /about</a>
94
- <a href="/" role="button" class="outline">Test Transition to /</a>
95
- </div>
96
- </footer>
97
- </article>
98
-
99
- <article class="mt-6">
100
- <header>
101
- <h4 class="font-bold">Transition &amp; Middleware Diagnostics</h4>
102
- </header>
103
- <div class="grid cols-3 gap-4 mt-4">
104
- <div class="card">
105
- <h5 class="font-bold mb-1">Stateful Navigation</h5>
106
- <p class="text-sm">Click links between Home, About, and Dashboard. Notice how the View Transitions API animates without page refreshes while preserving session cookies.</p>
107
- </div>
108
- <div class="card">
109
- <h5 class="font-bold mb-1">Zero Cache On Dashboard</h5>
110
- <p class="text-sm">Response header <code>X-Bluebird-Cache: MISS</code> is returned, verifying that user-sensitive data is never statically cached.</p>
111
- </div>
112
- <div class="card">
113
- <h5 class="font-bold mb-1">Automatic Revocation</h5>
114
- <p class="text-sm">Clicking "Sign Out" revokes the session in memory/Redis and clears the HttpOnly cookie, blocking subsequent dashboard visits.</p>
115
- </div>
116
- </div>
117
- </article>
118
- </div>
119
- </div>
120
- </main>
121
-
122
- <footer>
123
- <div class="footer-content">
124
- <p>Powered by <strong class="text-gradient">Blue Bird Framework</strong> &amp;
125
- <strong class="text-gradient-blue">
126
- <a href="https://seip25.github.io/Blue-bird-css/" target="_blank">Blue Bird CSS</a>
127
- </strong>.
128
- </p>
129
- <div class="lang-switcher">
130
- <a href="/" class="lang-link">Home</a>
131
- <a href="/about" class="lang-link">About</a>
132
- <a href="/login" class="lang-link">Login</a>
133
- <a href="/dashboard" class="lang-link">Dashboard</a>
134
- <a href="https://github.com/seip25/Blue-bird" target="_blank" class="github-star mt-2">&#9733; GitHub</a>
135
- </div>
136
- </div>
137
- </footer>
138
- </body>
139
-
140
- </html>
@@ -1,150 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en" data-theme="dark">
3
-
4
- <head>
5
- <meta charset="UTF-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>Blue Bird Framework</title>
8
- <link rel="canonical" href="https://seip25.github.io/Blue-bird/" />
9
- <meta name="description"
10
- content="Blue Bird is a fast, structured, and opinionated Express.js framework for developers who want visual elegance and performance with raw HTML and CSS.">
11
- <meta name="keywords" content="Blue Bird, Express.js, Node.js, Semantic CSS, Performance, Nginx, Redis">
12
- <meta name="author" content="Seip25">
13
- <link rel="icon" href="/images/favicon.ico" />
14
- <link rel="stylesheet" href="/css/bluebird.min.css" />
15
-
16
- <script src="/js/bluebird-client.js" defer></script>
17
- </head>
18
-
19
- <body>
20
- <header>
21
- <nav>
22
- <a href="/" class="flex items-center gap-2">
23
- <svg width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
24
- stroke-linecap="round" stroke-linejoin="round" class="text-blue">
25
- <path d="M12 19l9 2-9-18-9 18 9-2zm0 0v-8" />
26
- </svg>
27
- <strong class="text-xl text-gradient">Blue Bird</strong>
28
- </a>
29
- </nav>
30
- </header>
31
-
32
- <main>
33
- <aside>
34
- <h4>Menu</h4>
35
- <a href="/" class="active badge badge-glow px-3 py-3">Home</a>
36
- <a href="/about">About</a>
37
- <a href="/login">Login</a>
38
- <a href="/dashboard">Dashboard</a>
39
- <a href="https://seip25.github.io/Blue-bird" target="_blank">Blue bird</a>
40
- <a href="https://seip25.github.io/Blue-bird-css/" target="_blank">Blue Bird CSS</a>
41
- <a href="https://github.com/seip25/Blue-bird" target="_blank" role="button"
42
- class="btn-sm outline">GitHub</a>
43
- </aside>
44
-
45
- <div>
46
- <section class="hero ">
47
- <h1 class="mt-3 text-gradient font-bold">Hello, Developer!</h1>
48
- <p class="lead">
49
- Blue Bird is a fast, structured, and opinionated Express.js framework for developers who want
50
- visual elegance and performance with raw HTML and CSS.
51
- </p>
52
- <div class="hero-actions">
53
- <a href="/about" role="button">About Us &rarr;</a>
54
- <a href="https://seip25.github.io/Blue-bird-css/" target="_blank" role="button" class="outline">Blue
55
- Bird CSS Docs</a>
56
- <a href="https://github.com/seip25/Blue-bird" target="_blank" role="button"
57
- class="outline">GitHub</a>
58
- </div>
59
- </section>
60
-
61
- <div class="mt-8">
62
- <div class="grid cols-3 gap-4">
63
- <article class="hover-glow ">
64
- <header>
65
- <span class="badge badge-primary mb-2">Rendering</span>
66
- <h3 class="text-gradient-blue">Ultra-Fast HTML Render</h3>
67
- </header>
68
- <p>Direct static HTML rendering using high-speed string placeholder
69
- replacement, bypassing heavy
70
- parsing engines completely.</p>
71
- </article>
72
-
73
- <article class="hover-glow ">
74
- <header>
75
- <span class="badge badge-primary mb-2">Performance</span>
76
- <h3 class="text-gradient-blue">In-Memory Caching</h3>
77
- </header>
78
- <p>Configurable time-to-live caching. Rendered pages are stored in RAM for
79
- instant,
80
- sub-millisecond
81
- delivery in production.</p>
82
- </article>
83
-
84
- <article class="hover-glow ">
85
- <header>
86
- <span class="badge badge-primary mb-2">Security</span>
87
- <h3 class="text-gradient-blue">JWT &amp; Route Security</h3>
88
- </header>
89
- <p>Secure cookie management, GCM-encrypted JWT tokens, custom helmet
90
- configurations, and route
91
- rate
92
- limiting built-in.</p>
93
- </article>
94
-
95
- <article class="hover-glow ">
96
- <header>
97
- <span class="badge badge-primary mb-2">Database</span>
98
- <h3 class="text-gradient-blue">Unified DB Layer</h3>
99
- </header>
100
- <p>Built-in support for SQLite (WAL mode), MySQL, and PostgreSQL with
101
- connection pooling,
102
- retries,
103
- and Redis query caching.</p>
104
- </article>
105
-
106
- <article class="hover-glow ">
107
- <header>
108
- <span class="badge badge-primary mb-2">DevOps</span>
109
- <h3 class="text-gradient-blue">Production Ready</h3>
110
- </header>
111
- <p>Production cluster orchestration with PM2, native health checks,
112
- systemd, and flexible caching out of the box.</p>
113
- </article>
114
-
115
- <article class="hover-glow ">
116
- <header>
117
- <span class="badge badge-primary mb-2">Design</span>
118
- <h3 class="text-gradient-blue">Pure Semantic CSS</h3>
119
- </header>
120
- <p>Clean semantic markup styled by <a href="https://seip25.github.io/Blue-bird-css/"
121
- target="_blank">Blue Bird CSS</a> with
122
- zero JavaScript framework bloat or compile steps.
123
- </p>
124
- </article>
125
- </div>
126
- </div>
127
- </div>
128
- </main>
129
-
130
- <footer>
131
- <div class="footer-content">
132
- <p>Powered by <strong class="text-gradient">Blue Bird Framework</strong> &amp;
133
- <strong class="text-gradient-blue">
134
- <a href="https://seip25.github.io/Blue-bird-css/" target="_blank">Blue Bird
135
- CSS</a>
136
- </strong>.
137
- </p>
138
- <div class="lang-switcher">
139
- <a href="/" class="lang-link">Home</a>
140
- <a href="/about" class="lang-link">About</a>
141
- <a href="/login" class="lang-link">Login</a>
142
- <a href="/dashboard" class="lang-link">Dashboard</a>
143
- <a href="https://github.com/seip25/Blue-bird" target="_blank" class="github-star mt-2">&#9733;
144
- GitHub</a>
145
- </div>
146
- </div>
147
- </footer>
148
- </body>
149
-
150
- </html>
@@ -1,144 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en" data-theme="dark">
3
-
4
- <head>
5
- <meta charset="UTF-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>Blue Bird - Login</title>
8
- <link rel="canonical" href="https://seip25.github.io/Blue-bird/" />
9
- <meta name="description"
10
- content="Sign in to your Blue Bird protected dashboard to test authentication and middleware transitions.">
11
- <meta name="keywords" content="Blue Bird, Express.js, Authentication, Login, Security, JWT">
12
- <meta name="author" content="Seip25">
13
- <link rel="icon" href="/images/favicon.ico" />
14
- <link rel="stylesheet" href="/css/bluebird.min.css" />
15
-
16
- <script src="/js/bluebird-client.js" defer></script>
17
- </head>
18
-
19
- <body>
20
- <header>
21
- <nav>
22
- <a href="/" class="flex items-center gap-2">
23
- <svg width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
24
- stroke-linecap="round" stroke-linejoin="round" class="text-blue">
25
- <path d="M12 19l9 2-9-18-9 18 9-2zm0 0v-8" />
26
- </svg>
27
- <strong class="text-xl text-gradient">Blue Bird</strong>
28
- </a>
29
- </nav>
30
- </header>
31
-
32
- <main>
33
- <aside>
34
- <h4>Menu</h4>
35
- <a href="/">Home</a>
36
- <a href="/about">About</a>
37
- <a href="/login" class="active badge badge-glow px-3 py-3">Login</a>
38
- <a href="/dashboard">Dashboard</a>
39
- <a href="https://seip25.github.io/Blue-bird" target="_blank">Blue bird</a>
40
- <a href="https://seip25.github.io/Blue-bird-css/" target="_blank">Blue Bird CSS</a>
41
- <a href="https://github.com/seip25/Blue-bird" target="_blank" role="button"
42
- class="btn-sm outline">GitHub</a>
43
- </aside>
44
-
45
- <div>
46
- <section class="hero">
47
- <h1 class="mt-3 text-gradient font-bold">Authentication Demo</h1>
48
- <p class="lead">Test native AES-256-GCM JWT auth cookies, Auth.protect middleware, and seamless View Transitions.</p>
49
- </section>
50
-
51
- <div class="mt-6">
52
- <div class="alert alert-info mb-6">
53
- <div>
54
- <strong class="alert-title">Interactive Auth Testing</strong>
55
- <p class="alert-description">
56
- Submit any email and password below to generate an encrypted JWT session cookie with <code>Auth.login(res, user)</code>.
57
- Try visiting <strong>/dashboard</strong> directly before and after logging in to verify the <code>Auth.protect({ redirect: "/login" })</code> middleware!
58
- </p>
59
- </div>
60
- </div>
61
-
62
- <article class="card">
63
- <header class="card-header">
64
- <h3 class="card-title">Sign In</h3>
65
- <p class="card-description">Enter your test credentials below to start a secure session.</p>
66
- </header>
67
-
68
- <form action="/login" method="POST" id="loginForm">
69
- <label for="email">Email Address</label>
70
- <input type="email" id="email" name="email" value="alex@example.com" placeholder="alex@example.com" required />
71
-
72
- <label for="password">Password</label>
73
- <input type="password" id="password" name="password" value="password123" placeholder="••••••••" required />
74
-
75
- <div class="flex items-center justify-between gap-4 mt-6">
76
- <button type="submit" class="glow-blue">Sign In &rarr;</button>
77
- <a href="/dashboard" role="button" class="outline">Try /dashboard (Protected)</a>
78
- </div>
79
- </form>
80
- </article>
81
-
82
- <article class="mt-6">
83
- <header>
84
- <h4 class="font-bold">What is being tested here?</h4>
85
- </header>
86
- <div class="grid cols-2 gap-4 mt-4">
87
- <div class="card">
88
- <h5 class="font-bold mb-2">1. Auth.protect Middleware</h5>
89
- <p class="text-sm">When an unauthenticated client requests <code>/dashboard</code>, the server issues a 302 redirect to <code>/login</code>. The client router automatically follows the transition smoothly.</p>
90
- </div>
91
- <div class="card">
92
- <h5 class="font-bold mb-2">2. Uncached SSR Delivery</h5>
93
- <p class="text-sm">The dashboard view is rendered on-demand with fresh user data via <code>Render.send()</code>, bypassing the static view cache.</p>
94
- </div>
95
- </div>
96
- </article>
97
- </div>
98
- </div>
99
- </main>
100
-
101
- <footer>
102
- <div class="footer-content">
103
- <p>Powered by <strong class="text-gradient">Blue Bird Framework</strong> &amp;
104
- <strong class="text-gradient-blue">
105
- <a href="https://seip25.github.io/Blue-bird-css/" target="_blank">Blue Bird CSS</a>
106
- </strong>.
107
- </p>
108
- <div class="lang-switcher">
109
- <a href="/" class="lang-link">Home</a>
110
- <a href="/about" class="lang-link">About</a>
111
- <a href="/login" class="lang-link">Login</a>
112
- <a href="/dashboard" class="lang-link">Dashboard</a>
113
- <a href="https://github.com/seip25/Blue-bird" target="_blank" class="github-star mt-2">&#9733; GitHub</a>
114
- </div>
115
- </div>
116
- </footer>
117
-
118
- <script>
119
- document.getElementById("loginForm")?.addEventListener("submit", async (e) => {
120
- e.preventDefault();
121
- const form = e.target;
122
- const formData = new FormData(form);
123
- const body = new URLSearchParams(formData);
124
-
125
- try {
126
- await fetch("/login", {
127
- method: "POST",
128
- body,
129
- headers: { "X-Bluebird-Client-Router": "1" }
130
- });
131
-
132
- if (window.Bluebird && typeof window.Bluebird.navigate === "function") {
133
- window.Bluebird.navigate("/dashboard");
134
- } else {
135
- window.location.href = "/dashboard";
136
- }
137
- } catch (err) {
138
- form.submit();
139
- }
140
- });
141
- </script>
142
- </body>
143
-
144
- </html>