@seip/bluebird-js 0.1.6 → 0.2.0
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/.vscode/extensions.json +7 -7
- package/.vscode/settings.json +10 -10
- package/AGENTS.md +266 -116
- package/README.md +258 -245
- package/app/models/user.js +19 -0
- package/app/resources/html/home.html +137 -0
- package/app/resources/html/layouts/main.html +54 -0
- package/app/resources/html/notFound.html +14 -0
- package/app/resources/html/terms.html +46 -0
- package/app/resources/index.html +27 -0
- package/app/resources/layouts/AppLayout.jsx +89 -0
- package/app/resources/main.jsx +18 -0
- package/app/resources/pages/Dashboard.jsx +98 -0
- package/app/resources/pages/Home.jsx +140 -0
- package/app/resources/pages/Login.jsx +35 -0
- package/app/resources/pages/NotFound.jsx +16 -0
- package/app/resources/pages/Register.jsx +55 -0
- package/app/resources/routes.jsx +54 -0
- package/app/resources/spa.js +67 -0
- package/app/resources/styles.css +9 -0
- package/app/routes/api.js +85 -50
- package/app/routes/auth.js +209 -0
- package/app/routes/web.js +49 -37
- package/core/ai.d.ts +151 -151
- package/core/ai.js +1071 -1051
- package/core/app.d.ts +2 -18
- package/core/app.js +978 -792
- package/core/auth.d.ts +2 -13
- package/core/auth.js +444 -326
- package/core/cli/backup.js +167 -167
- package/core/cli/build.js +37 -0
- package/core/cli/dev.js +155 -0
- package/core/cli/doctor.js +37 -2
- package/core/cli/export.js +191 -0
- package/core/cli/init.js +101 -332
- package/core/cli/nginx.js +1 -1
- package/core/cli/templates.js +139 -0
- package/core/cli/view.js +73 -136
- package/core/config.js +44 -2
- package/core/csrf.js +156 -24
- package/core/database.js +737 -684
- package/core/debug.js +1 -1
- package/core/html.js +8 -1
- package/core/index.d.ts +1286 -1431
- package/core/paths.js +55 -0
- package/core/ratelimit.js +10 -1
- package/core/react/client/api.js +237 -0
- package/core/react/client/auth.js +236 -0
- package/core/react/client/components.js +1321 -0
- package/core/react/client/i18n.js +338 -0
- package/core/react/client/index.d.ts +249 -0
- package/core/react/client/index.js +49 -0
- package/core/react/client/router.js +26 -0
- package/core/react/client/theme.css +512 -0
- package/core/render-cache.js +250 -212
- package/core/render.d.ts +25 -21
- package/core/render.js +613 -603
- package/core/router.d.ts +2 -3
- package/core/router.js +171 -171
- package/core/seo.js +10 -0
- package/core/spa.js +599 -0
- package/core/view-loader.js +81 -455
- package/core/vite-plugin.d.ts +18 -0
- package/core/vite-plugin.js +162 -0
- package/core/vite.js +250 -145
- package/index.js +22 -18
- package/jsconfig.json +5 -3
- package/package.json +114 -92
- package/production.md +8 -3
- package/public/js/bluebird.js +1160 -0
- package/templates/_auth/app/database.js +19 -0
- package/templates/_auth/app/models/user.js +22 -0
- package/templates/_auth/app/routes/auth-router.js +304 -0
- package/templates/_base/app/resources/html/layouts/main.html +55 -0
- package/templates/_base/app/resources/html/notFound.html +14 -0
- package/templates/_base/app/resources/index.html +27 -0
- package/templates/_base/app/resources/styles.css +9 -0
- package/templates/api/app/models/note.js +18 -0
- package/templates/api/app/routes/api.js +82 -0
- package/templates/api/app/routes/auth.js +11 -0
- package/templates/api/index.js +19 -0
- package/templates/api/template.json +13 -0
- package/templates/auth/app/mail.js +11 -0
- package/templates/auth/app/models/password_reset.js +18 -0
- package/templates/auth/app/resources/html/home.html +21 -0
- package/templates/auth/app/resources/html/partials/nav.html +2 -0
- package/templates/auth/app/resources/layouts/AppLayout.jsx +60 -0
- package/templates/auth/app/resources/main.jsx +18 -0
- package/templates/auth/app/resources/pages/Dashboard.jsx +51 -0
- package/templates/auth/app/resources/pages/ForgotPassword.jsx +34 -0
- package/templates/auth/app/resources/pages/Login.jsx +36 -0
- package/templates/auth/app/resources/pages/NotFound.jsx +16 -0
- package/templates/auth/app/resources/pages/Profile.jsx +99 -0
- package/templates/auth/app/resources/pages/Register.jsx +50 -0
- package/templates/auth/app/resources/pages/ResetPassword.jsx +50 -0
- package/templates/auth/app/resources/routes.jsx +54 -0
- package/templates/auth/app/resources/spa.js +29 -0
- package/templates/auth/app/routes/api.js +17 -0
- package/templates/auth/app/routes/auth.js +13 -0
- package/templates/auth/app/routes/web.js +21 -0
- package/templates/auth/index.js +19 -0
- package/templates/auth/template.json +15 -0
- package/templates/blank/app/models/.gitkeep +0 -0
- package/templates/blank/app/resources/html/home.html +27 -0
- package/templates/blank/app/resources/html/partials/nav.html +1 -0
- package/templates/blank/app/resources/main.jsx +16 -0
- package/templates/blank/app/resources/pages/Home.jsx +42 -0
- package/templates/blank/app/resources/pages/NotFound.jsx +27 -0
- package/templates/blank/app/resources/routes.jsx +15 -0
- package/templates/blank/app/resources/spa.js +24 -0
- package/templates/blank/app/routes/api.js +11 -0
- package/templates/blank/app/routes/web.js +21 -0
- package/templates/blank/index.js +13 -0
- package/templates/blank/template.json +12 -0
- package/templates/blog/app/lib/blog.js +149 -0
- package/templates/blog/app/models/post.js +22 -0
- package/templates/blog/app/resources/html/home.html +28 -0
- package/templates/blog/app/resources/html/not-found.html +5 -0
- package/templates/blog/app/resources/html/partials/nav.html +2 -0
- package/templates/blog/app/resources/html/partials/post-card.html +9 -0
- package/templates/blog/app/resources/html/post.html +8 -0
- package/templates/blog/app/resources/layouts/AdminLayout.jsx +54 -0
- package/templates/blog/app/resources/main.jsx +18 -0
- package/templates/blog/app/resources/pages/Login.jsx +31 -0
- package/templates/blog/app/resources/pages/NotFound.jsx +16 -0
- package/templates/blog/app/resources/pages/PostEditor.jsx +51 -0
- package/templates/blog/app/resources/pages/Posts.jsx +83 -0
- package/templates/blog/app/resources/pages/Register.jsx +43 -0
- package/templates/blog/app/resources/routes.jsx +51 -0
- package/templates/blog/app/resources/spa.js +25 -0
- package/templates/blog/app/resources/styles.css +40 -0
- package/templates/blog/app/routes/api.js +77 -0
- package/templates/blog/app/routes/auth.js +10 -0
- package/templates/blog/app/routes/web.js +114 -0
- package/templates/blog/index.js +21 -0
- package/templates/blog/template.json +14 -0
- package/vite.config.js +11 -0
- package/app/views/about.jsx +0 -98
- package/app/views/components/Header.jsx +0 -42
- package/app/views/components/LiveCounter.jsx +0 -66
- package/app/views/dashboard.jsx +0 -300
- package/app/views/index.jsx +0 -123
- package/app/views/layouts/main/view.jsx +0 -201
- package/app/views/legal/terms.html +0 -29
- package/app/views/login.jsx +0 -141
- package/core/actions.d.ts +0 -4
- package/core/actions.js +0 -329
- package/core/jsx.d.ts +0 -38
- package/core/jsx.js +0 -1432
- package/core/vite.d.ts +0 -3
- package/public/js/bluebird-client.js +0 -3161
- package/public/js/tailwind.js +0 -8
package/app/views/dashboard.jsx
DELETED
|
@@ -1,300 +0,0 @@
|
|
|
1
|
-
import Auth from "@seip/bluebird-js/core/auth.js";
|
|
2
|
-
import Actions from "@seip/bluebird-js/core/actions.js";
|
|
3
|
-
import { script } from "@seip/bluebird-js/core/html.js";
|
|
4
|
-
import { Client } from "@seip/bluebird-js/core/jsx.js";
|
|
5
|
-
import Header from "./components/Header.jsx";
|
|
6
|
-
import LiveCounter from "./components/LiveCounter.jsx";
|
|
7
|
-
|
|
8
|
-
export const route = "/dashboard";
|
|
9
|
-
export const layout = "main";
|
|
10
|
-
export const middlewares = [Auth.protect({ redirect: "/login" })];
|
|
11
|
-
export const seo = false;
|
|
12
|
-
|
|
13
|
-
export const actions = {
|
|
14
|
-
syncCount: Actions.define(
|
|
15
|
-
{
|
|
16
|
-
schema: { count: { required: true, number: true } },
|
|
17
|
-
maxBytes: "16kb",
|
|
18
|
-
},
|
|
19
|
-
async ({ body, user }) => {
|
|
20
|
-
return {
|
|
21
|
-
synced: true,
|
|
22
|
-
count: Number(body.count),
|
|
23
|
-
message: `Counter (${body.count}) verified on server for ${user?.name || "Member"} with CSRF & payload guard!`,
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
),
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export const head = (data) => ({
|
|
30
|
-
title: `Dashboard — ${data.user?.name || "Member"}`,
|
|
31
|
-
description: "Protected member dashboard for Blue Bird framework.",
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Dashboard page React JSX view module.
|
|
36
|
-
* @param {Object} props
|
|
37
|
-
* @param {Object} [props.user={}]
|
|
38
|
-
*/
|
|
39
|
-
export default function DashboardView({ user = {} }) {
|
|
40
|
-
const initialCount = 7;
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<>
|
|
44
|
-
<Header title="Protected Dashboard" user={user} count={initialCount} />
|
|
45
|
-
|
|
46
|
-
<div className="space-y-6">
|
|
47
|
-
<div className="rounded-xl border border-emerald-500/30 bg-emerald-950/20 p-4 text-emerald-200 flex items-start gap-3">
|
|
48
|
-
<span className="inline-flex items-center justify-center w-6 h-6 rounded-full bg-emerald-500/20 text-emerald-400 text-xs font-bold shrink-0 mt-0.5">
|
|
49
|
-
✓
|
|
50
|
-
</span>
|
|
51
|
-
<div>
|
|
52
|
-
<strong className="font-semibold block text-emerald-100">
|
|
53
|
-
Active Protected Session (React JSX SSR)
|
|
54
|
-
</strong>
|
|
55
|
-
<p className="text-sm text-emerald-300/80 mt-0.5 leading-relaxed">
|
|
56
|
-
This route is declaratively configured via{" "}
|
|
57
|
-
<code className="px-1.5 py-0.5 rounded bg-emerald-900/40 text-emerald-200 text-xs">
|
|
58
|
-
export const middlewares = [Auth.protect({'{'} redirect: "/login" {'}'})]
|
|
59
|
-
</code>{" "}
|
|
60
|
-
inside <code>app/views/dashboard.jsx</code>.
|
|
61
|
-
</p>
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
|
|
65
|
-
<article className="rounded-2xl border border-slate-800 bg-slate-900/60 p-6 shadow-sm">
|
|
66
|
-
<header className="flex items-center justify-between pb-4 border-b border-slate-800/80">
|
|
67
|
-
<div>
|
|
68
|
-
<h3 className="text-lg font-bold text-slate-100">User Profile</h3>
|
|
69
|
-
<p className="text-xs text-slate-400 mt-0.5">
|
|
70
|
-
Decoded JWT payload stored in <code className="text-sky-400">req.user</code>.
|
|
71
|
-
</p>
|
|
72
|
-
</div>
|
|
73
|
-
<span className="inline-flex items-center px-2.5 py-1 rounded-full text-xs font-semibold bg-emerald-500/10 text-emerald-400 border border-emerald-500/20">
|
|
74
|
-
Active Session
|
|
75
|
-
</span>
|
|
76
|
-
</header>
|
|
77
|
-
|
|
78
|
-
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mt-5">
|
|
79
|
-
<div className="rounded-xl border border-slate-800/80 bg-slate-950/60 p-4">
|
|
80
|
-
<span className="text-[11px] uppercase font-bold tracking-wider text-slate-400 block">
|
|
81
|
-
User Name
|
|
82
|
-
</span>
|
|
83
|
-
<div className="font-bold text-base text-slate-100 mt-1">
|
|
84
|
-
{user.name || "Anonymous"}
|
|
85
|
-
</div>
|
|
86
|
-
</div>
|
|
87
|
-
<div className="rounded-xl border border-slate-800/80 bg-slate-950/60 p-4">
|
|
88
|
-
<span className="text-[11px] uppercase font-bold tracking-wider text-slate-400 block">
|
|
89
|
-
Email Address
|
|
90
|
-
</span>
|
|
91
|
-
<div className="font-bold text-base text-slate-100 mt-1">
|
|
92
|
-
{user.email || "user@example.com"}
|
|
93
|
-
</div>
|
|
94
|
-
</div>
|
|
95
|
-
<div className="rounded-xl border border-slate-800/80 bg-slate-950/60 p-4">
|
|
96
|
-
<span className="text-[11px] uppercase font-bold tracking-wider text-slate-400 block">
|
|
97
|
-
Account Role
|
|
98
|
-
</span>
|
|
99
|
-
<div className="mt-1">
|
|
100
|
-
<span className="inline-block px-2.5 py-0.5 rounded-md text-xs font-semibold bg-sky-500/15 text-sky-400 border border-sky-500/30">
|
|
101
|
-
{user.role || "user"}
|
|
102
|
-
</span>
|
|
103
|
-
</div>
|
|
104
|
-
</div>
|
|
105
|
-
<div className="rounded-xl border border-slate-800/80 bg-slate-950/60 p-4">
|
|
106
|
-
<span className="text-[11px] uppercase font-bold tracking-wider text-slate-400 block">
|
|
107
|
-
Session Identifier
|
|
108
|
-
</span>
|
|
109
|
-
<div className="mt-1 font-mono text-xs text-slate-300 truncate">
|
|
110
|
-
{user._sessionId || "sess_active"}
|
|
111
|
-
</div>
|
|
112
|
-
</div>
|
|
113
|
-
</div>
|
|
114
|
-
|
|
115
|
-
<footer className="flex flex-wrap items-center justify-between gap-3 pt-5 mt-5 border-t border-slate-800/80">
|
|
116
|
-
<a
|
|
117
|
-
href="/logout"
|
|
118
|
-
data-no-prefetch="true"
|
|
119
|
-
className="px-4 py-2 rounded-lg text-sm font-semibold text-red-400 bg-red-500/10 border border-red-500/20 hover:bg-red-500/20 transition-colors"
|
|
120
|
-
>
|
|
121
|
-
Sign Out →
|
|
122
|
-
</a>
|
|
123
|
-
<div className="flex items-center gap-2">
|
|
124
|
-
<a
|
|
125
|
-
href="/about"
|
|
126
|
-
className="px-3.5 py-2 rounded-lg text-sm font-medium text-slate-300 bg-slate-800/80 border border-slate-700 hover:text-white hover:bg-slate-700 transition-colors"
|
|
127
|
-
>
|
|
128
|
-
Test Transition to /about
|
|
129
|
-
</a>
|
|
130
|
-
<a
|
|
131
|
-
href="/"
|
|
132
|
-
className="px-3.5 py-2 rounded-lg text-sm font-medium text-slate-300 bg-slate-800/80 border border-slate-700 hover:text-white hover:bg-slate-700 transition-colors"
|
|
133
|
-
>
|
|
134
|
-
Test Transition to /
|
|
135
|
-
</a>
|
|
136
|
-
</div>
|
|
137
|
-
</footer>
|
|
138
|
-
</article>
|
|
139
|
-
|
|
140
|
-
<article className="rounded-2xl border border-slate-800 bg-slate-900/60 p-6 shadow-sm">
|
|
141
|
-
<header className="flex items-center justify-between pb-4 border-b border-slate-800/80">
|
|
142
|
-
<div>
|
|
143
|
-
<h3 className="text-lg font-bold text-slate-100">Interactive Client Controls</h3>
|
|
144
|
-
<p className="text-xs text-slate-400 mt-0.5">
|
|
145
|
-
Native inline client script and <code><Client /></code> skeleton boundary with zero layout shift.
|
|
146
|
-
</p>
|
|
147
|
-
</div>
|
|
148
|
-
<span className="inline-flex items-center px-2.5 py-1 rounded-full text-xs font-semibold bg-sky-500/10 text-sky-400 border border-sky-500/20">
|
|
149
|
-
Live Interactive
|
|
150
|
-
</span>
|
|
151
|
-
</header>
|
|
152
|
-
|
|
153
|
-
<div className="mt-5 space-y-5">
|
|
154
|
-
<p className="text-sm text-slate-300">
|
|
155
|
-
Click the buttons below to interact without page reloads:
|
|
156
|
-
</p>
|
|
157
|
-
|
|
158
|
-
<div className="flex items-center gap-3">
|
|
159
|
-
<button
|
|
160
|
-
id="btnDec"
|
|
161
|
-
type="button"
|
|
162
|
-
className="px-3.5 py-2 rounded-lg border border-slate-700 bg-slate-800 hover:bg-slate-700 text-slate-100 font-semibold text-sm transition-colors"
|
|
163
|
-
>
|
|
164
|
-
− Decrement
|
|
165
|
-
</button>
|
|
166
|
-
<span
|
|
167
|
-
id="counterVal"
|
|
168
|
-
className="font-mono text-2xl font-bold px-4 py-1.5 bg-slate-950 border border-slate-800 text-sky-400 rounded-lg min-w-14 text-center"
|
|
169
|
-
>
|
|
170
|
-
{initialCount}
|
|
171
|
-
</span>
|
|
172
|
-
<button
|
|
173
|
-
id="btnInc"
|
|
174
|
-
type="button"
|
|
175
|
-
className="px-3.5 py-2 rounded-lg border border-slate-700 bg-slate-800 hover:bg-slate-700 text-slate-100 font-semibold text-sm transition-colors"
|
|
176
|
-
>
|
|
177
|
-
+ Increment
|
|
178
|
-
</button>
|
|
179
|
-
<button
|
|
180
|
-
id="btnReset"
|
|
181
|
-
type="button"
|
|
182
|
-
className="px-3.5 py-2 rounded-lg border border-red-500/30 bg-red-500/10 hover:bg-red-500/20 text-red-300 font-semibold text-sm transition-colors"
|
|
183
|
-
>
|
|
184
|
-
Reset
|
|
185
|
-
</button>
|
|
186
|
-
</div>
|
|
187
|
-
|
|
188
|
-
<div className="pt-4 border-t border-slate-800/60">
|
|
189
|
-
<label
|
|
190
|
-
htmlFor="filterQuery"
|
|
191
|
-
className="text-xs font-semibold uppercase tracking-wider text-slate-400 block mb-2"
|
|
192
|
-
>
|
|
193
|
-
Live Input Event Listener:
|
|
194
|
-
</label>
|
|
195
|
-
<input
|
|
196
|
-
type="text"
|
|
197
|
-
id="filterQuery"
|
|
198
|
-
placeholder="Type here to test live event handling..."
|
|
199
|
-
className="w-full max-w-lg rounded-lg border border-slate-700 bg-slate-950 px-3.5 py-2.5 text-sm text-slate-100 placeholder-slate-500 focus:border-sky-500 focus:outline-none focus:ring-2 focus:ring-sky-500/20 transition-all"
|
|
200
|
-
/>
|
|
201
|
-
<p id="summaryText" className="text-xs text-slate-400 mt-2">
|
|
202
|
-
Type in the field above to test live event listening.
|
|
203
|
-
</p>
|
|
204
|
-
</div>
|
|
205
|
-
|
|
206
|
-
<div className="pt-4 border-t border-slate-800/60">
|
|
207
|
-
<span className="text-xs font-semibold uppercase tracking-wider text-slate-400 block mb-2">
|
|
208
|
-
Imported Client Component (<code><Client component={LiveCounter} persistent /></code>) + Server Action:
|
|
209
|
-
</span>
|
|
210
|
-
<Client
|
|
211
|
-
component={LiveCounter}
|
|
212
|
-
props={{ initial: initialCount, label: "Client Counter" }}
|
|
213
|
-
persistent={true}
|
|
214
|
-
minHeight={56}
|
|
215
|
-
skeleton={
|
|
216
|
-
<div className="h-14 rounded-xl border border-slate-800 bg-slate-950/70 px-4 flex items-center justify-between text-xs text-slate-400 animate-pulse">
|
|
217
|
-
<span>Loading Client Component...</span>
|
|
218
|
-
<span className="px-2 py-0.5 rounded bg-slate-800 text-sky-400 font-mono">
|
|
219
|
-
minHeight: 56px
|
|
220
|
-
</span>
|
|
221
|
-
</div>
|
|
222
|
-
}
|
|
223
|
-
/>
|
|
224
|
-
</div>
|
|
225
|
-
</div>
|
|
226
|
-
</article>
|
|
227
|
-
|
|
228
|
-
{script(
|
|
229
|
-
(state) => {
|
|
230
|
-
let count = state.initialCount;
|
|
231
|
-
const valEl = document.getElementById("counterVal");
|
|
232
|
-
const headerBadge = document.getElementById("header-counter-badge");
|
|
233
|
-
const incBtn = document.getElementById("btnInc");
|
|
234
|
-
const decBtn = document.getElementById("btnDec");
|
|
235
|
-
const resetBtn = document.getElementById("btnReset");
|
|
236
|
-
const queryInput = document.getElementById("filterQuery");
|
|
237
|
-
const summaryEl = document.getElementById("summaryText");
|
|
238
|
-
|
|
239
|
-
const update = () => {
|
|
240
|
-
if (valEl) valEl.textContent = String(count);
|
|
241
|
-
if (headerBadge) headerBadge.textContent = String(count);
|
|
242
|
-
};
|
|
243
|
-
|
|
244
|
-
incBtn?.addEventListener("click", () => {
|
|
245
|
-
count++;
|
|
246
|
-
update();
|
|
247
|
-
});
|
|
248
|
-
decBtn?.addEventListener("click", () => {
|
|
249
|
-
if (count > 0) count--;
|
|
250
|
-
update();
|
|
251
|
-
});
|
|
252
|
-
resetBtn?.addEventListener("click", () => {
|
|
253
|
-
count = 0;
|
|
254
|
-
update();
|
|
255
|
-
});
|
|
256
|
-
|
|
257
|
-
queryInput?.addEventListener("input", (e) => {
|
|
258
|
-
if (summaryEl) {
|
|
259
|
-
summaryEl.textContent = e.target.value
|
|
260
|
-
? `Active query: ${e.target.value}`
|
|
261
|
-
: "Type in the field above to test live event listening.";
|
|
262
|
-
}
|
|
263
|
-
});
|
|
264
|
-
},
|
|
265
|
-
{ initialCount },
|
|
266
|
-
{ onLoad: true }
|
|
267
|
-
)}
|
|
268
|
-
|
|
269
|
-
<article className="rounded-2xl border border-slate-800 bg-slate-900/60 p-6 shadow-sm">
|
|
270
|
-
<header className="pb-3 border-b border-slate-800/80">
|
|
271
|
-
<h4 className="text-base font-bold text-slate-100">
|
|
272
|
-
Transition & Middleware Diagnostics
|
|
273
|
-
</h4>
|
|
274
|
-
</header>
|
|
275
|
-
<div className="grid grid-cols-1 md:grid-cols-3 gap-4 mt-4">
|
|
276
|
-
<div className="rounded-xl border border-slate-800 bg-slate-950/60 p-4">
|
|
277
|
-
<h5 className="font-semibold text-sm text-slate-200 mb-1">Stateful Navigation</h5>
|
|
278
|
-
<p className="text-xs text-slate-400 leading-relaxed">
|
|
279
|
-
Click links between Home, About, and Dashboard. Notice how the View Transitions API animates without page refreshes while preserving session cookies.
|
|
280
|
-
</p>
|
|
281
|
-
</div>
|
|
282
|
-
<div className="rounded-xl border border-slate-800 bg-slate-950/60 p-4">
|
|
283
|
-
<h5 className="font-semibold text-sm text-slate-200 mb-1">Zero Cache On Dashboard</h5>
|
|
284
|
-
<p className="text-xs text-slate-400 leading-relaxed">
|
|
285
|
-
Response header <code className="text-sky-400">X-Bluebird-Cache: MISS</code> is returned, verifying that user-sensitive data is never statically cached.
|
|
286
|
-
</p>
|
|
287
|
-
</div>
|
|
288
|
-
<div className="rounded-xl border border-slate-800 bg-slate-950/60 p-4">
|
|
289
|
-
<h5 className="font-semibold text-sm text-slate-200 mb-1">Automatic Revocation</h5>
|
|
290
|
-
<p className="text-xs text-slate-400 leading-relaxed">
|
|
291
|
-
Clicking "Sign Out" revokes the session in memory/Redis and clears the HttpOnly cookie, blocking subsequent dashboard visits.
|
|
292
|
-
</p>
|
|
293
|
-
</div>
|
|
294
|
-
</div>
|
|
295
|
-
</article>
|
|
296
|
-
</div>
|
|
297
|
-
</>
|
|
298
|
-
);
|
|
299
|
-
}
|
|
300
|
-
|
package/app/views/index.jsx
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
export const route = "/";
|
|
2
|
-
export const cache = 300;
|
|
3
|
-
export const layout = "main";
|
|
4
|
-
export const seo = true;
|
|
5
|
-
|
|
6
|
-
export const head = () => ({
|
|
7
|
-
title: "Blue Bird Framework — High Performance Web Framework",
|
|
8
|
-
description: "Fast, structured, and opinionated Express.js framework with React JSX SSR and multi-tier caching.",
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Home page React JSX view module.
|
|
13
|
-
*/
|
|
14
|
-
export default function IndexView() {
|
|
15
|
-
return (
|
|
16
|
-
<>
|
|
17
|
-
<section className="py-10 md:py-14 border-b border-slate-800/80">
|
|
18
|
-
<h1 className="mt-3 text-3xl md:text-5xl font-extrabold tracking-tight bg-gradient-to-r from-sky-400 via-blue-500 to-indigo-400 bg-clip-text text-transparent">
|
|
19
|
-
Hello, Developer!
|
|
20
|
-
</h1>
|
|
21
|
-
<p className="mt-4 text-base md:text-lg text-slate-300 max-w-2xl leading-relaxed">
|
|
22
|
-
Blue Bird is a fast, structured, and opinionated Express.js framework for developers who want
|
|
23
|
-
visual elegance and performance with native React JSX SSR, Partial Rendering, and modern JavaScript.
|
|
24
|
-
</p>
|
|
25
|
-
<div className="flex items-center gap-4 mt-6">
|
|
26
|
-
<a
|
|
27
|
-
href="/about"
|
|
28
|
-
className="px-4 py-2.5 rounded-xl bg-sky-500 hover:bg-sky-400 text-slate-950 font-semibold text-sm transition-colors shadow-lg shadow-sky-500/20"
|
|
29
|
-
>
|
|
30
|
-
About Us →
|
|
31
|
-
</a>
|
|
32
|
-
<a
|
|
33
|
-
href="https://github.com/seip25/bluebird-js"
|
|
34
|
-
target="_blank"
|
|
35
|
-
className="px-4 py-2.5 rounded-xl border border-slate-700 bg-slate-900/60 hover:bg-slate-800 text-slate-200 text-sm font-semibold transition-colors"
|
|
36
|
-
>
|
|
37
|
-
GitHub
|
|
38
|
-
</a>
|
|
39
|
-
</div>
|
|
40
|
-
</section>
|
|
41
|
-
|
|
42
|
-
<div className="mt-8">
|
|
43
|
-
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5">
|
|
44
|
-
<article className="rounded-2xl border border-slate-800 bg-slate-900/60 p-6 hover:border-sky-500/40 hover:shadow-lg hover:shadow-sky-500/5 transition-all">
|
|
45
|
-
<header>
|
|
46
|
-
<span className="inline-block px-2.5 py-1 rounded-md bg-sky-500/15 text-sky-400 border border-sky-500/30 text-xs font-semibold uppercase tracking-wider mb-3">
|
|
47
|
-
Rendering
|
|
48
|
-
</span>
|
|
49
|
-
<h3 className="text-lg font-bold text-slate-100">Zero-Build React JSX SSR</h3>
|
|
50
|
-
</header>
|
|
51
|
-
<p className="text-sm text-slate-400 mt-2 leading-relaxed">
|
|
52
|
-
Native <code>.jsx</code> views compiled in memory with automatic XSS escaping, shared layouts,{" "}
|
|
53
|
-
<code><Client /></code> islands with anti-CLS skeletons, and partial SPA transitions.
|
|
54
|
-
</p>
|
|
55
|
-
</article>
|
|
56
|
-
|
|
57
|
-
<article className="rounded-2xl border border-slate-800 bg-slate-900/60 p-6 hover:border-sky-500/40 hover:shadow-lg hover:shadow-sky-500/5 transition-all">
|
|
58
|
-
<header>
|
|
59
|
-
<span className="inline-block px-2.5 py-1 rounded-md bg-sky-500/15 text-sky-400 border border-sky-500/30 text-xs font-semibold uppercase tracking-wider mb-3">
|
|
60
|
-
Performance
|
|
61
|
-
</span>
|
|
62
|
-
<h3 className="text-lg font-bold text-slate-100">Declarative Auto-Routes & Cache</h3>
|
|
63
|
-
</header>
|
|
64
|
-
<p className="text-sm text-slate-400 mt-2 leading-relaxed">
|
|
65
|
-
Export <code>const cache = 300</code> and <code>const middlewares = [...]</code> directly from your{" "}
|
|
66
|
-
<code>app/views/*.jsx</code> files for instant route mounting and L1 RAM / Redis caching.
|
|
67
|
-
</p>
|
|
68
|
-
</article>
|
|
69
|
-
|
|
70
|
-
<article className="rounded-2xl border border-slate-800 bg-slate-900/60 p-6 hover:border-sky-500/40 hover:shadow-lg hover:shadow-sky-500/5 transition-all">
|
|
71
|
-
<header>
|
|
72
|
-
<span className="inline-block px-2.5 py-1 rounded-md bg-sky-500/15 text-sky-400 border border-sky-500/30 text-xs font-semibold uppercase tracking-wider mb-3">
|
|
73
|
-
Security
|
|
74
|
-
</span>
|
|
75
|
-
<h3 className="text-lg font-bold text-slate-100">JWT & Route Security</h3>
|
|
76
|
-
</header>
|
|
77
|
-
<p className="text-sm text-slate-400 mt-2 leading-relaxed">
|
|
78
|
-
Secure cookie management, GCM-encrypted JWT tokens, custom security headers, and route rate limiting built-in.
|
|
79
|
-
</p>
|
|
80
|
-
</article>
|
|
81
|
-
|
|
82
|
-
<article className="rounded-2xl border border-slate-800 bg-slate-900/60 p-6 hover:border-sky-500/40 hover:shadow-lg hover:shadow-sky-500/5 transition-all">
|
|
83
|
-
<header>
|
|
84
|
-
<span className="inline-block px-2.5 py-1 rounded-md bg-sky-500/15 text-sky-400 border border-sky-500/30 text-xs font-semibold uppercase tracking-wider mb-3">
|
|
85
|
-
Database
|
|
86
|
-
</span>
|
|
87
|
-
<h3 className="text-lg font-bold text-slate-100">Unified DB Layer</h3>
|
|
88
|
-
</header>
|
|
89
|
-
<p className="text-sm text-slate-400 mt-2 leading-relaxed">
|
|
90
|
-
Built-in support for SQLite (native node:sqlite with WAL), MySQL, and PostgreSQL with connection pooling and caching.
|
|
91
|
-
</p>
|
|
92
|
-
</article>
|
|
93
|
-
|
|
94
|
-
<article className="rounded-2xl border border-slate-800 bg-slate-900/60 p-6 hover:border-sky-500/40 hover:shadow-lg hover:shadow-sky-500/5 transition-all">
|
|
95
|
-
<header>
|
|
96
|
-
<span className="inline-block px-2.5 py-1 rounded-md bg-sky-500/15 text-sky-400 border border-sky-500/30 text-xs font-semibold uppercase tracking-wider mb-3">
|
|
97
|
-
DevOps
|
|
98
|
-
</span>
|
|
99
|
-
<h3 className="text-lg font-bold text-slate-100">Production Ready</h3>
|
|
100
|
-
</header>
|
|
101
|
-
<p className="text-sm text-slate-400 mt-2 leading-relaxed">
|
|
102
|
-
Production cluster orchestration with PM2, native health checks, and smooth View Transitions SPA navigation.
|
|
103
|
-
</p>
|
|
104
|
-
</article>
|
|
105
|
-
|
|
106
|
-
<article className="rounded-2xl border border-slate-800 bg-slate-900/60 p-6 hover:border-sky-500/40 hover:shadow-lg hover:shadow-sky-500/5 transition-all">
|
|
107
|
-
<header>
|
|
108
|
-
<span className="inline-block px-2.5 py-1 rounded-md bg-sky-500/15 text-sky-400 border border-sky-500/30 text-xs font-semibold uppercase tracking-wider mb-3">
|
|
109
|
-
Design
|
|
110
|
-
</span>
|
|
111
|
-
<h3 className="text-lg font-bold text-slate-100">Tailwind CSS Built-In</h3>
|
|
112
|
-
</header>
|
|
113
|
-
<p className="text-sm text-slate-400 mt-2 leading-relaxed">
|
|
114
|
-
Modern utility classes styled by <strong>Tailwind CSS v4</strong> (
|
|
115
|
-
<code className="text-sky-400 font-mono text-xs">/js/tailwind.js</code>) and Google Fonts Inter with zero build steps.
|
|
116
|
-
</p>
|
|
117
|
-
</article>
|
|
118
|
-
</div>
|
|
119
|
-
</div>
|
|
120
|
-
</>
|
|
121
|
-
);
|
|
122
|
-
}
|
|
123
|
-
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared application layout for Bluebird.js written in React JSX.
|
|
3
|
-
* Provides the global HTML shell, header navigation, aside menu, and footer.
|
|
4
|
-
*
|
|
5
|
-
* @param {Object} context
|
|
6
|
-
* @param {any} context.body - Main content rendered by the view.
|
|
7
|
-
* @param {Object} [context.head={}] - Head metadata (title, description, canonical, etc.).
|
|
8
|
-
* @param {Object} [context.ctx={}] - Request context ({ req, res, user, locals }).
|
|
9
|
-
*/
|
|
10
|
-
export default function MainLayout({ body, head = {}, ctx = {} }) {
|
|
11
|
-
const currentPath = ctx.req?.path || "/";
|
|
12
|
-
const user = ctx.user || ctx.req?.user;
|
|
13
|
-
|
|
14
|
-
const isActive = (path) =>
|
|
15
|
-
currentPath === path
|
|
16
|
-
? "bg-sky-500/15 text-sky-400 border border-sky-500/30 font-semibold"
|
|
17
|
-
: "text-slate-400 hover:text-slate-100 hover:bg-slate-800/60";
|
|
18
|
-
|
|
19
|
-
const tailwindThemeCss = `
|
|
20
|
-
@custom-variant dark (&:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *));
|
|
21
|
-
@theme {
|
|
22
|
-
--font-sans: 'Inter', system-ui, -apple-system, sans-serif;
|
|
23
|
-
}
|
|
24
|
-
`;
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<html lang="en" className="dark" data-theme="dark">
|
|
28
|
-
<head>
|
|
29
|
-
<meta charSet="UTF-8" />
|
|
30
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
31
|
-
<title>{head.title || "Blue Bird Framework"}</title>
|
|
32
|
-
<link rel="canonical" href={head.canonical || "https://seip25.github.io/bluebird-js/"} />
|
|
33
|
-
<meta
|
|
34
|
-
name="description"
|
|
35
|
-
content={
|
|
36
|
-
head.description ||
|
|
37
|
-
"Blue Bird is a fast, structured, and opinionated Express.js framework for developers who want visual elegance and performance with React SSR and modern JavaScript."
|
|
38
|
-
}
|
|
39
|
-
/>
|
|
40
|
-
<meta
|
|
41
|
-
name="keywords"
|
|
42
|
-
content={
|
|
43
|
-
head.keywords ||
|
|
44
|
-
"Blue Bird, Express.js, Node.js, React SSR, Partial Rendering, Performance, Nginx, Redis"
|
|
45
|
-
}
|
|
46
|
-
/>
|
|
47
|
-
<meta name="author" content="Seip25" />
|
|
48
|
-
<link rel="icon" href="/images/favicon.ico" />
|
|
49
|
-
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
50
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />
|
|
51
|
-
<link
|
|
52
|
-
href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap"
|
|
53
|
-
rel="stylesheet"
|
|
54
|
-
/>
|
|
55
|
-
<script src="/js/tailwind.js"></script>
|
|
56
|
-
<style type="text/tailwindcss">{tailwindThemeCss}</style>
|
|
57
|
-
<script src="/js/bluebird-client.js" defer></script>
|
|
58
|
-
</head>
|
|
59
|
-
<body
|
|
60
|
-
data-layout="main"
|
|
61
|
-
className="min-h-screen flex flex-col bg-slate-950 text-slate-100 font-sans antialiased selection:bg-sky-500/30"
|
|
62
|
-
>
|
|
63
|
-
<header className="border-b border-slate-800/80 bg-slate-950/80 backdrop-blur-md sticky top-0 z-30 px-6 py-4">
|
|
64
|
-
<nav className="flex items-center justify-between max-w-7xl mx-auto">
|
|
65
|
-
<a
|
|
66
|
-
href="/"
|
|
67
|
-
className="flex items-center gap-2.5 text-slate-100 hover:text-sky-400 transition-colors"
|
|
68
|
-
>
|
|
69
|
-
<svg
|
|
70
|
-
width="28"
|
|
71
|
-
height="28"
|
|
72
|
-
viewBox="0 0 24 24"
|
|
73
|
-
fill="none"
|
|
74
|
-
stroke="currentColor"
|
|
75
|
-
strokeWidth="2"
|
|
76
|
-
strokeLinecap="round"
|
|
77
|
-
strokeLinejoin="round"
|
|
78
|
-
className="text-sky-400"
|
|
79
|
-
>
|
|
80
|
-
<path d="M12 19l9 2-9-18-9 18 9-2zm0 0v-8" />
|
|
81
|
-
</svg>
|
|
82
|
-
<strong className="text-xl font-bold bg-gradient-to-r from-sky-400 via-blue-500 to-indigo-400 bg-clip-text text-transparent">
|
|
83
|
-
Blue Bird
|
|
84
|
-
</strong>
|
|
85
|
-
</a>
|
|
86
|
-
<div className="flex items-center gap-3">
|
|
87
|
-
<a
|
|
88
|
-
href="https://github.com/seip25/bluebird-js"
|
|
89
|
-
target="_blank"
|
|
90
|
-
className="px-3 py-1.5 rounded-lg border border-slate-700/80 bg-slate-900/60 text-xs font-medium text-slate-300 hover:text-white hover:bg-slate-800 transition-all flex items-center gap-1.5"
|
|
91
|
-
>
|
|
92
|
-
<span>★</span> GitHub
|
|
93
|
-
</a>
|
|
94
|
-
</div>
|
|
95
|
-
</nav>
|
|
96
|
-
</header>
|
|
97
|
-
|
|
98
|
-
<main
|
|
99
|
-
data-bb-outlet="true"
|
|
100
|
-
className="flex-1 max-w-7xl w-full mx-auto px-4 md:px-6 py-8 flex flex-col md:flex-row gap-8"
|
|
101
|
-
>
|
|
102
|
-
<aside className="w-full md:w-60 shrink-0 flex flex-col gap-1.5 p-4 rounded-2xl border border-slate-800/80 bg-slate-900/40 h-fit">
|
|
103
|
-
<h4 className="px-3 py-1 text-xs font-bold uppercase tracking-wider text-slate-400 mb-1">
|
|
104
|
-
Menu
|
|
105
|
-
</h4>
|
|
106
|
-
<a href="/" className={`px-3 py-2 rounded-lg text-sm transition-colors ${isActive("/")}`}>
|
|
107
|
-
Home
|
|
108
|
-
</a>
|
|
109
|
-
<a
|
|
110
|
-
href="/about"
|
|
111
|
-
className={`px-3 py-2 rounded-lg text-sm transition-colors ${isActive("/about")}`}
|
|
112
|
-
>
|
|
113
|
-
About
|
|
114
|
-
</a>
|
|
115
|
-
<a
|
|
116
|
-
href="/login"
|
|
117
|
-
className={`px-3 py-2 rounded-lg text-sm transition-colors ${isActive("/login")}`}
|
|
118
|
-
>
|
|
119
|
-
Login
|
|
120
|
-
</a>
|
|
121
|
-
<a
|
|
122
|
-
href="/dashboard"
|
|
123
|
-
className={`px-3 py-2 rounded-lg text-sm transition-colors ${isActive("/dashboard")}`}
|
|
124
|
-
>
|
|
125
|
-
Dashboard
|
|
126
|
-
</a>
|
|
127
|
-
<div className="my-2 border-t border-slate-800/80"></div>
|
|
128
|
-
<a
|
|
129
|
-
href="https://seip25.github.io/bluebird-js"
|
|
130
|
-
target="_blank"
|
|
131
|
-
className="px-3 py-2 rounded-lg text-sm text-slate-400 hover:text-slate-100 hover:bg-slate-800/60 transition-colors"
|
|
132
|
-
>
|
|
133
|
-
Documentation
|
|
134
|
-
</a>
|
|
135
|
-
<a
|
|
136
|
-
href="https://github.com/seip25/bluebird-js"
|
|
137
|
-
target="_blank"
|
|
138
|
-
className="px-3 py-2 rounded-lg text-sm text-slate-400 hover:text-slate-100 hover:bg-slate-800/60 transition-colors"
|
|
139
|
-
>
|
|
140
|
-
GitHub Repository
|
|
141
|
-
</a>
|
|
142
|
-
{user ? (
|
|
143
|
-
<a
|
|
144
|
-
href="/logout"
|
|
145
|
-
data-no-prefetch="true"
|
|
146
|
-
role="button"
|
|
147
|
-
className="mt-3 px-3 py-2 text-center rounded-lg text-xs font-semibold bg-red-500/15 text-red-400 border border-red-500/30 hover:bg-red-500/25 transition-colors"
|
|
148
|
-
>
|
|
149
|
-
Sign Out
|
|
150
|
-
</a>
|
|
151
|
-
) : (
|
|
152
|
-
<a
|
|
153
|
-
href="https://github.com/seip25/bluebird-js"
|
|
154
|
-
target="_blank"
|
|
155
|
-
role="button"
|
|
156
|
-
className="mt-3 px-3 py-2 text-center rounded-lg text-xs font-semibold bg-slate-800 text-slate-200 border border-slate-700 hover:bg-slate-700 hover:text-white transition-colors"
|
|
157
|
-
>
|
|
158
|
-
Star on GitHub
|
|
159
|
-
</a>
|
|
160
|
-
)}
|
|
161
|
-
</aside>
|
|
162
|
-
|
|
163
|
-
<div className="page-content flex-1 min-w-0">{body}</div>
|
|
164
|
-
</main>
|
|
165
|
-
|
|
166
|
-
<footer className="border-t border-slate-800/80 bg-slate-950 py-8 px-6 mt-auto">
|
|
167
|
-
<div className="max-w-7xl mx-auto flex flex-col md:flex-row items-center justify-between gap-4 text-xs text-slate-400">
|
|
168
|
-
<p>
|
|
169
|
-
Powered by{" "}
|
|
170
|
-
<strong className="bg-gradient-to-r from-sky-400 to-indigo-400 bg-clip-text text-transparent font-semibold">
|
|
171
|
-
Blue Bird Framework
|
|
172
|
-
</strong>
|
|
173
|
-
</p>
|
|
174
|
-
<div className="flex items-center gap-4">
|
|
175
|
-
<a href="/" className="hover:text-slate-200 transition-colors">
|
|
176
|
-
Home
|
|
177
|
-
</a>
|
|
178
|
-
<a href="/about" className="hover:text-slate-200 transition-colors">
|
|
179
|
-
About
|
|
180
|
-
</a>
|
|
181
|
-
<a href="/login" className="hover:text-slate-200 transition-colors">
|
|
182
|
-
Login
|
|
183
|
-
</a>
|
|
184
|
-
<a href="/dashboard" className="hover:text-slate-200 transition-colors">
|
|
185
|
-
Dashboard
|
|
186
|
-
</a>
|
|
187
|
-
<a
|
|
188
|
-
href="https://github.com/seip25/bluebird-js"
|
|
189
|
-
target="_blank"
|
|
190
|
-
className="hover:text-sky-400 transition-colors"
|
|
191
|
-
>
|
|
192
|
-
★ GitHub
|
|
193
|
-
</a>
|
|
194
|
-
</div>
|
|
195
|
-
</div>
|
|
196
|
-
</footer>
|
|
197
|
-
</body>
|
|
198
|
-
</html>
|
|
199
|
-
);
|
|
200
|
-
}
|
|
201
|
-
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en" class="dark" data-theme="dark">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
<title>Terms of Service — Blue Bird</title>
|
|
7
|
-
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
8
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
9
|
-
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
|
10
|
-
<script src="/js/tailwind.js"></script>
|
|
11
|
-
<style type="text/tailwindcss">
|
|
12
|
-
@custom-variant dark (&:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *));
|
|
13
|
-
@theme {
|
|
14
|
-
--font-sans: 'Inter', system-ui, -apple-system, sans-serif;
|
|
15
|
-
}
|
|
16
|
-
</style>
|
|
17
|
-
</head>
|
|
18
|
-
<body class="min-h-screen bg-slate-950 text-slate-100 font-sans p-8 max-w-4xl mx-auto">
|
|
19
|
-
<article class="rounded-2xl border border-slate-800 bg-slate-900/60 p-8 shadow-xl">
|
|
20
|
-
<header class="border-b border-slate-800 pb-4 mb-6">
|
|
21
|
-
<h1 class="text-3xl font-extrabold bg-gradient-to-r from-sky-400 to-indigo-400 bg-clip-text text-transparent">Terms of Service</h1>
|
|
22
|
-
<p class="text-sm text-slate-400 mt-1">Served directly as raw, unparsed HTML via Render.html().</p>
|
|
23
|
-
</header>
|
|
24
|
-
<div>
|
|
25
|
-
<p class="text-slate-300 leading-relaxed">This static document demonstrates zero-overhead static HTML serving without template interpolation or server computation.</p>
|
|
26
|
-
</div>
|
|
27
|
-
</article>
|
|
28
|
-
</body>
|
|
29
|
-
</html>
|