@seip/bluebird-js 0.0.0-stage → 0.0.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.
- package/.env_example +54 -0
- package/AGENTS.md +403 -0
- package/LICENSE +21 -0
- package/README.md +284 -2
- package/app/routes/api.js +50 -0
- package/app/routes/web.js +53 -0
- package/app/views/about.html +161 -0
- package/app/views/dashboard.html +140 -0
- package/app/views/index.html +150 -0
- package/app/views/login.html +144 -0
- package/core/app.d.ts +18 -0
- package/core/app.js +644 -0
- package/core/auth.d.ts +13 -0
- package/core/auth.js +326 -0
- package/core/cache.d.ts +17 -0
- package/core/cache.js +475 -0
- package/core/cli/doctor.js +287 -0
- package/core/cli/ecosystem.js +162 -0
- package/core/cli/init.js +779 -0
- package/core/cli/migrate.js +541 -0
- package/core/cli/model.js +66 -0
- package/core/cli/nginx.js +199 -0
- package/core/cli/route.js +121 -0
- package/core/cli/swagger.js +45 -0
- package/core/cli/view.js +77 -0
- package/core/config.d.ts +3 -0
- package/core/config.js +111 -0
- package/core/csrf.d.ts +3 -0
- package/core/csrf.js +114 -0
- package/core/database.d.ts +15 -0
- package/core/database.js +636 -0
- package/core/debug.d.ts +3 -0
- package/core/debug.js +250 -0
- package/core/hash.d.ts +3 -0
- package/core/hash.js +194 -0
- package/core/index.d.ts +1071 -0
- package/core/logger.d.ts +3 -0
- package/core/logger.js +124 -0
- package/core/middleware.d.ts +3 -0
- package/core/middleware.js +28 -0
- package/core/model.d.ts +19 -0
- package/core/model.js +600 -0
- package/core/queue.d.ts +13 -0
- package/core/queue.js +172 -0
- package/core/ratelimit.d.ts +3 -0
- package/core/ratelimit.js +145 -0
- package/core/redis.d.ts +21 -0
- package/core/redis.js +230 -0
- package/core/render.d.ts +3 -0
- package/core/render.js +676 -0
- package/core/router.d.ts +3 -0
- package/core/router.js +171 -0
- package/core/seo.d.ts +3 -0
- package/core/seo.js +106 -0
- package/core/swagger.d.ts +3 -0
- package/core/swagger.js +60 -0
- package/core/upload.d.ts +13 -0
- package/core/upload.js +102 -0
- package/core/util/colors.js +82 -0
- package/core/validate.d.ts +15 -0
- package/core/validate.js +364 -0
- package/core/vite.d.ts +3 -0
- package/core/vite.js +145 -0
- package/core/ws.d.ts +13 -0
- package/core/ws.js +245 -0
- package/index.js +18 -0
- package/jsconfig.json +15 -0
- package/package.json +84 -3
- package/production.md +273 -0
- package/public/css/bluebird.min.css +2 -0
- package/public/images/favicon.ico +0 -0
- package/public/js/bluebird-client.js +1663 -0
- package/public/js/bluebird.min.js +1073 -0
|
@@ -0,0 +1,140 @@
|
|
|
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 →</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 & 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> &
|
|
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">★ GitHub</a>
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
</footer>
|
|
138
|
+
</body>
|
|
139
|
+
|
|
140
|
+
</html>
|
|
@@ -0,0 +1,150 @@
|
|
|
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 →</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 & 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> &
|
|
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">★
|
|
144
|
+
GitHub</a>
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
</footer>
|
|
148
|
+
</body>
|
|
149
|
+
|
|
150
|
+
</html>
|
|
@@ -0,0 +1,144 @@
|
|
|
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 →</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> &
|
|
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">★ 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>
|
package/core/app.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import App, {
|
|
2
|
+
AppError,
|
|
3
|
+
WebSocketManager,
|
|
4
|
+
AppOptions,
|
|
5
|
+
CorsOptions,
|
|
6
|
+
SecurityHeadersOptions,
|
|
7
|
+
AppStaticOptions,
|
|
8
|
+
} from "./index.js";
|
|
9
|
+
export default App;
|
|
10
|
+
export {
|
|
11
|
+
App,
|
|
12
|
+
AppError,
|
|
13
|
+
WebSocketManager,
|
|
14
|
+
AppOptions,
|
|
15
|
+
CorsOptions,
|
|
16
|
+
SecurityHeadersOptions,
|
|
17
|
+
AppStaticOptions,
|
|
18
|
+
};
|