@seip/bluebird-js 0.1.7 → 0.2.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/AGENTS.md +727 -620
- package/README.md +670 -607
- package/app/models/user.js +19 -0
- package/app/resources/html/home.html +137 -0
- package/app/resources/html/layouts/main.html +55 -0
- package/app/resources/html/notFound.html +14 -0
- package/app/resources/html/table.html +15 -0
- package/app/resources/html/terms.html +46 -0
- package/app/resources/index.html +27 -0
- package/app/resources/layouts/AppLayout.jsx +92 -0
- package/app/resources/main.jsx +18 -0
- package/app/resources/pages/Dashboard.jsx +93 -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/pages/TableDemo.jsx +85 -0
- package/app/resources/routes.jsx +59 -0
- package/app/resources/spa.js +73 -0
- package/app/resources/styles.css +9 -0
- package/app/routes/api.js +129 -50
- package/app/routes/auth.js +209 -0
- package/app/routes/web.js +89 -47
- package/core/ai.js +30 -10
- package/core/app.d.ts +2 -18
- package/core/app.js +987 -801
- package/core/auth.d.ts +2 -13
- package/core/auth.js +444 -326
- 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 +91 -322
- package/core/cli/nginx.js +1 -1
- package/core/cli/templates.js +139 -0
- package/core/cli/view.js +98 -161
- package/core/config.js +44 -2
- package/core/csrf.js +156 -24
- package/core/database.js +1184 -1131
- package/core/debug.js +1 -1
- package/core/html.js +8 -1
- package/core/index.d.ts +126 -310
- package/core/paths.js +55 -0
- package/core/ratelimit.js +10 -1
- package/core/react/client/api.js +239 -0
- package/core/react/client/auth.js +236 -0
- package/core/react/client/components.js +1321 -0
- package/core/react/client/datatable.js +595 -0
- package/core/react/client/i18n.js +440 -0
- package/core/react/client/index.d.ts +314 -0
- package/core/react/client/index.js +50 -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 +738 -736
- 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 +155 -613
- 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 +1886 -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/components/Header.jsx +0 -42
- package/app/views/components/LiveCounter.jsx +0 -67
- package/app/views/layouts/main/view.jsx +0 -201
- package/app/views/legal/terms.html +0 -29
- package/app/views/pages/about.jsx +0 -98
- package/app/views/pages/dashboard.jsx +0 -278
- package/app/views/pages/index.jsx +0 -123
- package/app/views/pages/login.jsx +0 -141
- package/core/actions.d.ts +0 -4
- package/core/actions.js +0 -355
- package/core/jsx.d.ts +0 -38
- package/core/jsx.js +0 -1597
- package/core/vite.d.ts +0 -3
- package/public/js/bluebird-client.js +0 -3265
- package/public/js/tailwind.js +0 -8
package/README.md
CHANGED
|
@@ -1,607 +1,670 @@
|
|
|
1
|
-
# Bluebird.js Framework
|
|
2
|
-
|
|
3
|
-
**Performance-first Node.js
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/@seip/bluebird-js)
|
|
6
|
-
[](https://opensource.org/licenses/MIT)
|
|
7
|
-
[](https://nodejs.org)
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
## Introduction
|
|
12
|
-
|
|
13
|
-
Bluebird.js (`@seip/bluebird-js`) is a high-performance web and API framework built on Express (Node.js 22.18+).
|
|
14
|
-
|
|
15
|
-
### Key Highlights
|
|
16
|
-
|
|
17
|
-
- **
|
|
18
|
-
-
|
|
19
|
-
- **
|
|
20
|
-
- **
|
|
21
|
-
- **
|
|
22
|
-
- **
|
|
23
|
-
- **Smart Automatic Migrations:** CLI detects schema changes across `app/models/`, resolves foreign key dependencies topologically, generates consolidated `CREATE TABLE` / `ALTER TABLE ADD COLUMN` SQL files, and executes them with interactive terminal prompts.
|
|
24
|
-
- **Lightweight BaseModel:** Static facade providing readable schemas, CRUD shortcuts, query operators (`IN`, `$gt`, `$like`), `count()`, `exists()`, `firstOrCreate()`, `updateOrCreate()`, smart relations without N+1 queries, soft deletes, and automatic query cache invalidation.
|
|
25
|
-
- **Native SQLite & Desktop Mode (Electron/Tauri):** Uses Node's built-in `node:sqlite` driver
|
|
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
|
-
- Project
|
|
51
|
-
- Database engine: `sqlite` (default,
|
|
52
|
-
- Connection credentials and database paths
|
|
53
|
-
- Automatic generation of `index.js`, `.env`, `jsconfig.json`, `app/`, and `public/`
|
|
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
|
-
|
|
1
|
+
# Bluebird.js Framework
|
|
2
|
+
|
|
3
|
+
**Performance-first Node.js framework: Express + HTML `{{ }}` SSR templates + React Router SPA with Vite, Tailwind CSS v4, JWT auth with roles, BaseModel, smart migrations, and multi-level caching.**
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@seip/bluebird-js)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://nodejs.org)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Introduction
|
|
12
|
+
|
|
13
|
+
Bluebird.js (`@seip/bluebird-js`) is a high-performance web and API framework built on Express (Node.js 22.18+). Public landings and SEO pages render cleanly on the server with **HTML `{{ }}` templates** (`app/resources/html/`), while interactive dashboards and web applications run as **client-rendered React 19 + React Router SPAs** mounted via `router.spa()`, bundled with Vite and styled with Tailwind CSS v4 (dark and light themes). It ships with JWT authentication (with optional role checks and `/api/auth/*` routes), vanilla HTML UI helpers (`public/js/bluebird.js`), Tailwind React components, multi-driver caching (in-memory LRU, filesystem, and Redis), BaseModel with smart migrations, CSRF protection, background queues, and PM2 production clustering.
|
|
14
|
+
|
|
15
|
+
### Key Highlights
|
|
16
|
+
|
|
17
|
+
- **HTML `{{ }}` SSR Engine:** Fast `.html` views, layouts (`{{{ body }}}`), partials (`{{> name }}`), `{{if}}`/`{{else}}`, `{{each}}`, raw `{{{ html }}}`, and `{{ vite "app/resources/styles.css" }}`, and `\{{ literal }}` escapes.
|
|
18
|
+
- **React Router SPA (`router.spa()`):** Serves the React shell `app/resources/index.html` with per-URL SEO metadata (`title`, `description`, `keywords`, `canonical`, Open Graph, `robots`, `jsonld`), custom scripts/styles, and a full-width anti-CLS skeleton inside `<div id="root">`.
|
|
19
|
+
- **One React Codebase, Web + Desktop + Mobile:** Zero server-injected props in the SPA — React talks directly to `/api/*` via `api()`. `npx bluebird-js export` turns the same code into a 100% static HTML/JS/CSS build for Electron (`loadFile`), Capacitor, or any static host, with bearer-token auth against your Bluebird API.
|
|
20
|
+
- **Vite & Tailwind CSS v4:** Vite middleware HMR on the same port as Express in development; client bundle + manifest in `public/build/` via `npx bluebird-js build`. Built-in dark and light theme synchronization.
|
|
21
|
+
- **AuthProvider & Role Guards:** Client `AuthProvider`, `useAuth()`, `RequireAuth` (with optional `roles`), `GuestOnly`, plus default `/api/auth/login`, `/logout`, `/me`, and optional `/register`.
|
|
22
|
+
- **UI Kits for Both Worlds:** React UI components (`Link`, `Button`, `Form`, `Input`, `Select`, `Textarea`, `Card`, `Badge`, `Carousel`, `Modal`, `Drawer`, `Skeleton`, `ThemeToggle`, `Toaster` / `toast`) and dependency-free vanilla `public/js/bluebird.js` (`data-carousel`, `data-toast`, `data-modal`, `data-dropdown`, `data-tabs`, `data-theme-toggle`, `data-form`).
|
|
23
|
+
- **Smart Automatic Migrations:** CLI detects schema changes across `app/models/`, resolves foreign key dependencies topologically, generates consolidated `CREATE TABLE` / `ALTER TABLE ADD COLUMN` SQL files, and executes them with interactive terminal prompts.
|
|
24
|
+
- **Lightweight BaseModel:** Static facade providing readable schemas, CRUD shortcuts, query operators (`IN`, `$gt`, `$like`), `count()`, `exists()`, `firstOrCreate()`, `updateOrCreate()`, smart relations without N+1 queries, soft deletes, and automatic query cache invalidation.
|
|
25
|
+
- **Native SQLite & Desktop Mode (Electron/Tauri):** Uses Node's built-in `node:sqlite` driver (no native compilation), plus first-class `desktop: true` mode (`app.runDesktop()`) for read-only `.asar` bundles.
|
|
26
|
+
- **Decoupled Caching:** High-speed in-memory LRU cache by default, persistent filesystem fallback, and modular Redis support via `core/redis.js`.
|
|
27
|
+
- **Unified AI Client (`core/ai.js`):** Built-in client (no provider SDKs) with DeepSeek default (`deepseek-flash`), Gemini 3.5/3.8, and OpenAI, featuring reversible PII data masking, 0ms prompt caching, sliding window rate limits ("Anti-Quiebra"), and JSON schema validation.
|
|
28
|
+
- **Atomic Database Backups & Verification:** WAL-safe, non-blocking online SQLite snapshots using `VACUUM INTO` and gzip compression, with automated retention rotation (`--keep 10`, ordered by filename timestamp so same-millisecond backups never drop the newest one) and integrity-verified restore.
|
|
29
|
+
- **CSRF, Rate Limiting & Security:** Native HMAC-SHA256 signed CSRF protection (timing-safe, rotated on login/logout, never leaked through cached pages), built-in Rate Limiter (`rateLimit` in `App`, `App.rateLimit()`), secure-by-default CORS, CSP nonces (`'nonce-{nonce}'`) applied to every inline script/style, automatic `/sitemap.xml` & `/robots.txt` generation, and secure HTTP headers.
|
|
30
|
+
- **Production Ready:** Built-in PM2 clustering CLI (`npx bluebird-js make:ecosystem`), optimized Nginx generator (`npx bluebird-js nginx:conf`), and native runner (`npm start`).
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Quick Start
|
|
35
|
+
|
|
36
|
+
### 1. Requirements
|
|
37
|
+
|
|
38
|
+
- Node.js 22.18.0 or higher
|
|
39
|
+
- npm 10+
|
|
40
|
+
|
|
41
|
+
### 2. Installation and Initialization
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm install @seip/bluebird-js
|
|
45
|
+
npx bluebird-js
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The interactive CLI configures:
|
|
49
|
+
- Project title and port settings
|
|
50
|
+
- Project template (see below), `blank` by default
|
|
51
|
+
- Database engine: `sqlite` (default, built into Node.js), `mysql`, `postgres`, or `none`
|
|
52
|
+
- Connection credentials and database paths
|
|
53
|
+
- Automatic generation of `index.js`, `vite.config.js`, `.env`, `jsconfig.json`, `app/`, and `public/`
|
|
54
|
+
|
|
55
|
+
#### Project Templates
|
|
56
|
+
|
|
57
|
+
Pick a starting point with a flag (or answer the prompt). Every template starts clean, so there is nothing to delete before building your own app:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npx bluebird-js # asks for the template (default: blank)
|
|
61
|
+
npx bluebird-js --blank # HTML {{ }} page on / + one-page React SPA on /app/*
|
|
62
|
+
npx bluebird-js --auth # + login, register, forgot/reset password, dashboard, profile
|
|
63
|
+
npx bluebird-js --blog # SEO blog (HTML list, posts, RSS, sitemap) + React admin on /app
|
|
64
|
+
npx bluebird-js --api # headless REST API: JWT auth (cookie or bearer) + CRUD example
|
|
65
|
+
npx bluebird-js --demo # full showcase used to develop the framework
|
|
66
|
+
npx bluebird-js --auth --yes --title "My App" # non-interactive
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
| Template | Server | React (`/app`) | Database |
|
|
70
|
+
|---|---|---|---|
|
|
71
|
+
| `blank` | `/` HTML page, `/api/hello` | `Home.jsx` only | optional |
|
|
72
|
+
| `auth` | `/` landing, `/api/auth/*` (me, login, logout, register, forgot/reset password, profile, password), `/api/dashboard` | Login, Register, ForgotPassword, ResetPassword, Dashboard, Profile | required (tables created on first run) |
|
|
73
|
+
| `blog` | `/`, `/blog/:slug` (cached, JSON-LD), `/feed.xml`, posts in `/sitemap.xml`, `/api/posts` (admin) | Login, one-time admin Register, Posts, PostEditor | required |
|
|
74
|
+
| `api` | `/api/auth/*`, `/api/notes` (paginated, owner-scoped CRUD), no Vite | none | required |
|
|
75
|
+
|
|
76
|
+
- In `auth` and `api`, every new account gets the `user` role; promote admins yourself, e.g. in a seed: `await User.update(id, { role: "admin" })`. In `blog`, only the first account can register: it becomes the `admin` and registration closes.
|
|
77
|
+
- Sessions are checked against the database on every protected request (`Auth.configure({ resolveUser })`): changing or resetting the password signs out every other device (the current one gets a fresh token), `POST /api/auth/logout-all` signs out everywhere, deleted accounts lose access, and role changes apply immediately. Changing the sign-in email requires `current_password`.
|
|
78
|
+
- Password reset links are printed in the server console by `app/mail.js` until you plug in a mail provider there.
|
|
79
|
+
- Tables are created with `CREATE TABLE IF NOT EXISTS` at startup (`app/database.js`); use `make:migration` / `migrate` for later schema changes.
|
|
80
|
+
- Existing files are never overwritten, so the command is safe to run inside an existing folder.
|
|
81
|
+
|
|
82
|
+
Dependencies: `express`, `react`, `react-dom`, `react-router`, `vite`, `@vitejs/plugin-react`, `tailwindcss` and `@tailwindcss/vite` are installed with the framework; database drivers, Redis, uploads, WebSockets, Swagger and Helmet are optional (`npx bluebird-js add <module>`).
|
|
83
|
+
|
|
84
|
+
### 3. Development Server
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
npm run dev
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
`npm run dev` runs `bluebird-js dev`: Express and Vite share one port, with React Fast Refresh and Tailwind CSS HMR for `app/resources/` (HTML `{{ }}` pages included). The server restarts when any server file under `app/` changes (routes, models, jobs, `app/lib/`...), or `index.js`, `.env`, `app/resources/spa.js`; client files in `app/resources/` hot-reload through Vite instead, and writes to `logs/`, `node_modules/`, or build output never restart it. Watch extra folders with `bluebird-js dev index.js --watch app/services`.
|
|
91
|
+
|
|
92
|
+
### 4. Production Build
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
npx bluebird-js build # Builds client SPA & Tailwind CSS bundle into public/build/
|
|
96
|
+
npm start
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### 5. Static Export (Electron, Capacitor, static hosting)
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
npx bluebird-js export --api https://api.example.com # dist/client/index.html + assets/
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## Project Structure
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
project/
|
|
111
|
+
├── index.js # Main application entrypoint
|
|
112
|
+
├── vite.config.js # Optional Vite config (React, Tailwind, Bluebird plugins)
|
|
113
|
+
├── app/
|
|
114
|
+
│ ├── resources/ # Everything client-side
|
|
115
|
+
│ │ ├── index.html # React SPA shell (router.spa() + npx bluebird-js export)
|
|
116
|
+
│ │ ├── spa.js # SPA config: mount, title, description, per-URL meta tree
|
|
117
|
+
│ │ ├── styles.css # Tailwind CSS v4 entry (shared by HTML SSR + React SPA)
|
|
118
|
+
│ │ ├── main.jsx # createRoot + AuthProvider + RouterProvider
|
|
119
|
+
│ │ ├── routes.jsx # createRouter + lazy routes
|
|
120
|
+
│ │ ├── layouts/AppLayout.jsx
|
|
121
|
+
│ │ ├── pages/ # Home.jsx, Login.jsx, Register.jsx, Dashboard.jsx, NotFound.jsx
|
|
122
|
+
│ │ └── html/ # HTML {{ }} SSR templates
|
|
123
|
+
│ │ ├── layouts/main.html
|
|
124
|
+
│ │ ├── partials/
|
|
125
|
+
│ │ ├── home.html
|
|
126
|
+
│ │ ├── terms.html
|
|
127
|
+
│ │ └── notFound.html (404 page for unknown routes)
|
|
128
|
+
│ ├── models/ # BaseModel definitions (user.js)
|
|
129
|
+
│ ├── routes/ # Express routes (web.js, auth.js, api.js)
|
|
130
|
+
│ └── jobs/ # Background worker job handlers
|
|
131
|
+
├── public/ # Static assets (js/bluebird.js, images/, build/)
|
|
132
|
+
├── core/ # Bluebird.js framework core
|
|
133
|
+
├── database/ # SQLite storage and SQL migrations
|
|
134
|
+
├── .env
|
|
135
|
+
└── package.json
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## Core Features & Usage Examples
|
|
141
|
+
|
|
142
|
+
### 1. Application Entrypoint (`index.js`)
|
|
143
|
+
|
|
144
|
+
```javascript
|
|
145
|
+
import App from "@seip/bluebird-js/core/app.js";
|
|
146
|
+
import routerApi from "./app/routes/api.js";
|
|
147
|
+
import routerWeb from "./app/routes/web.js";
|
|
148
|
+
|
|
149
|
+
const app = new App({
|
|
150
|
+
routes: [routerWeb, routerApi],
|
|
151
|
+
port: process.env.PORT || 3000,
|
|
152
|
+
rateLimit: { max: 120, windowMs: 60000 },
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
app.run();
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
For **Electron / Desktop** applications:
|
|
159
|
+
|
|
160
|
+
```javascript
|
|
161
|
+
const app = new App({
|
|
162
|
+
desktop: true,
|
|
163
|
+
userDataPath: electronApp.getPath("userData"),
|
|
164
|
+
routes: [routerWeb, routerApi],
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
const { url, lanUrl } = await app.runDesktop({ allowLan: true });
|
|
168
|
+
mainWindow.loadURL(url);
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
### 2. BaseModel & Smart Automatic Migrations (`app/models/`)
|
|
174
|
+
|
|
175
|
+
#### Defining a Model (`app/models/user.js`)
|
|
176
|
+
|
|
177
|
+
```javascript
|
|
178
|
+
import Model from "@seip/bluebird-js/core/model.js";
|
|
179
|
+
|
|
180
|
+
export default class User extends Model {
|
|
181
|
+
static table = "users";
|
|
182
|
+
static primaryKey = "id";
|
|
183
|
+
static timestamps = true;
|
|
184
|
+
static softDelete = true;
|
|
185
|
+
|
|
186
|
+
static schema = {
|
|
187
|
+
id: { type: "int", primary: true, auto: true },
|
|
188
|
+
name: { type: "string", length: 150, required: true },
|
|
189
|
+
email: { type: "string", length: 150, unique: true, required: true, email: true },
|
|
190
|
+
password: { type: "string", length: 255, required: true, min: 8, hidden: true, hash: true },
|
|
191
|
+
role: { type: "string", length: 20, default: "user", in: ["user", "admin"] },
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
#### Foreign Key References (`app/models/post.js`)
|
|
197
|
+
|
|
198
|
+
```javascript
|
|
199
|
+
import Model from "@seip/bluebird-js/core/model.js";
|
|
200
|
+
|
|
201
|
+
export default class Post extends Model {
|
|
202
|
+
static table = "posts";
|
|
203
|
+
static schema = {
|
|
204
|
+
id: { type: "int", primary: true, auto: true },
|
|
205
|
+
title: { type: "string", length: 200, required: true },
|
|
206
|
+
content: { type: "text" },
|
|
207
|
+
author_id: { type: "int", references: "users.id", onDelete: "cascade" },
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
#### Powerful Query Methods
|
|
213
|
+
|
|
214
|
+
```javascript
|
|
215
|
+
const totalUsers = await User.count({ role: "user" });
|
|
216
|
+
const userExists = await User.exists({ email: "alice@example.com" });
|
|
217
|
+
|
|
218
|
+
const activeUsers = await User.all({
|
|
219
|
+
where: {
|
|
220
|
+
id: [1, 2, 3],
|
|
221
|
+
role: { $ne: "banned" },
|
|
222
|
+
views: { $gt: 100 },
|
|
223
|
+
},
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
const user = await User.firstOrCreate(
|
|
227
|
+
{ email: "john@example.com" },
|
|
228
|
+
{ name: "John Doe", role: "user" }
|
|
229
|
+
);
|
|
230
|
+
|
|
231
|
+
const updated = await User.updateOrCreate(
|
|
232
|
+
{ email: "john@example.com" },
|
|
233
|
+
{ name: "Johnathan Doe" }
|
|
234
|
+
);
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
#### Smart Automatic Migrations CLI
|
|
238
|
+
|
|
239
|
+
When you create or modify models, simply run:
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
npx bluebird-js make:migration
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Bluebird inspects your models in `app/models/`, connects to your database, sorts tables by foreign key dependencies topologically, and detects all missing tables and columns (`CREATE TABLE` and `ALTER TABLE ADD COLUMN`). It generates a consolidated SQL migration file and asks:
|
|
246
|
+
|
|
247
|
+
```
|
|
248
|
+
[INFO] Detected database schema changes:
|
|
249
|
+
+ CREATE TABLE: users
|
|
250
|
+
+ CREATE TABLE: posts
|
|
251
|
+
[OK] Migration created: database/migrations/20261022_120000_auto_migration.sql
|
|
252
|
+
? Do you want to execute pending migrations now? (Y/n):
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
To run migrations directly without prompts (ideal for CI/CD):
|
|
256
|
+
```bash
|
|
257
|
+
npx bluebird-js migrate --yes
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
### 3. HTML `{{ }}` SSR Rendering & React Router SPA (`router.spa()`)
|
|
263
|
+
|
|
264
|
+
Bluebird separates **server-rendered HTML pages** (landings, storefronts, marketing, legal pages) from **client-rendered React Router SPAs** (dashboards, admin panels, interactive apps).
|
|
265
|
+
|
|
266
|
+
#### 404 Pages
|
|
267
|
+
|
|
268
|
+
Unknown routes return JSON under `/api` (and for JSON clients), and for browsers render `app/resources/html/notFound.html` (with `{{ path }}`) inside the `main` layout, or a built-in page when that view does not exist. Inside a `router.spa()` mount the React `NotFound` page (`{ path: "*" }` in `routes.jsx`) handles them. Disable it with `new App({ notFound: false })`.
|
|
269
|
+
|
|
270
|
+
#### HTML `{{ }}` Templates (`app/resources/html/`)
|
|
271
|
+
|
|
272
|
+
```javascript
|
|
273
|
+
// app/routes/web.js
|
|
274
|
+
import Router from "@seip/bluebird-js/core/router.js";
|
|
275
|
+
import Render from "@seip/bluebird-js/core/render.js";
|
|
276
|
+
|
|
277
|
+
const routerWeb = new Router("/", { seo: true });
|
|
278
|
+
|
|
279
|
+
routerWeb.get("/", (req, res) => {
|
|
280
|
+
const clientsHtml = clients.map((c) => `<span>${c.name}</span>`).join("");
|
|
281
|
+
return Render.html(
|
|
282
|
+
res,
|
|
283
|
+
"home",
|
|
284
|
+
{ title: "Welcome", clientsHtml, slides },
|
|
285
|
+
{ layout: "main", cache: 300 }
|
|
286
|
+
);
|
|
287
|
+
});
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
```html
|
|
291
|
+
<!-- app/resources/html/home.html -->
|
|
292
|
+
<section>
|
|
293
|
+
<h1>{{ title }}</h1>
|
|
294
|
+
<div>{{{ clientsHtml }}}</div>
|
|
295
|
+
{{#if slides}}
|
|
296
|
+
<div data-carousel data-autoplay="5000">
|
|
297
|
+
<div data-carousel-track>
|
|
298
|
+
{{#each slides}}<div data-carousel-slide>{{ title }}</div>{{/each}}
|
|
299
|
+
</div>
|
|
300
|
+
<div data-carousel-dots></div>
|
|
301
|
+
</div>
|
|
302
|
+
{{/if}}
|
|
303
|
+
</section>
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
#### React Router SPA (`router.spa()`)
|
|
307
|
+
|
|
308
|
+
The SPA config lives in `app/resources/spa.js`, so the web server and the static export share the same title, description, and meta tree. `router.spa()` renders the React shell `app/resources/index.html` with per-URL SEO tags, JSON-LD, canonical links, custom scripts/styles, and a full-width inline skeleton inside `<div id="root">`:
|
|
309
|
+
|
|
310
|
+
```javascript
|
|
311
|
+
// app/resources/spa.js
|
|
312
|
+
export default {
|
|
313
|
+
mount: "/app",
|
|
314
|
+
lang: "en",
|
|
315
|
+
titleTemplate: "%s — My App",
|
|
316
|
+
skeleton: "app",
|
|
317
|
+
meta: {
|
|
318
|
+
"*": { title: "Workspace", robots: "noindex, nofollow", skeleton: "app" },
|
|
319
|
+
"/": { title: "Explore", description: "Interactive workspace", robots: "index, follow", skeleton: "page" },
|
|
320
|
+
"login": { title: "Sign In", keywords: "login, auth", skeleton: "auth", jsonld: { "@type": "WebPage" } },
|
|
321
|
+
"/app/register": { title: "Register", skeleton: "auth" },
|
|
322
|
+
},
|
|
323
|
+
};
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
```javascript
|
|
327
|
+
// app/routes/web.js
|
|
328
|
+
import spa from "../resources/spa.js";
|
|
329
|
+
|
|
330
|
+
routerWeb.spa(spa.mount, spa);
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
Keys inside `meta` accept both relative (`"login"`) and absolute (`"/app/login"`) formats, dynamic functions `(req, params) => ({ ... })`, and `"*"` wildcard defaults. The React entry defaults to `app/resources/main.jsx` and the shell to `app/resources/index.html` (`template: false` uses the built-in shell).
|
|
334
|
+
|
|
335
|
+
The React shell (`app/resources/index.html`) and the HTML SSR layout (`app/resources/html/layouts/main.html`) are separate files on purpose: the first one is also the entry of the static export.
|
|
336
|
+
|
|
337
|
+
#### Design System & Theming
|
|
338
|
+
|
|
339
|
+
Bluebird ships a neutral, shadcn-style design system shared by React components and HTML `{{ }}` views. The Vite plugin injects it right after `@import "tailwindcss"` in your stylesheet, so there is nothing to import:
|
|
340
|
+
|
|
341
|
+
- **Tokens** (light and dark): `background`, `foreground`, `card`, `popover`, `primary`, `secondary`, `muted`, `accent`, `destructive`, `border`, `input`, `ring`, `brand`, `success`, `warning`, `info`, used as Tailwind utilities (`bg-primary`, `text-muted-foreground`, `border-border`...).
|
|
342
|
+
- **Component classes** for plain HTML: `btn` + `btn-primary | btn-secondary | btn-outline | btn-ghost | btn-danger | btn-link` + `btn-sm | btn-lg | btn-icon`, `card` / `card-title` / `card-description`, `field` / `field-label` / `field-hint` / `field-error`, `badge` / `badge-dot`, `nav-link` (active with `aria-current="page"`), `glass`, `bg-app`, and `brand`.
|
|
343
|
+
- **Color is used sparingly**: `primary` (near-black in light, near-white in dark) for the main action, `secondary`/`outline`/`ghost` for the rest, `danger` for destructive actions, and `brand` only for the logo. Badges and toasts stay neutral with a small colored dot for the tone.
|
|
344
|
+
|
|
345
|
+
```html
|
|
346
|
+
<a href="/app" class="btn btn-primary">Open app</a>
|
|
347
|
+
<button class="btn btn-outline btn-sm">Cancel</button>
|
|
348
|
+
<span class="badge"><span class="badge-dot bg-success"></span>Live</span>
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
```jsx
|
|
352
|
+
import { Button, Link, buttonVariants } from "@seip/bluebird-js/react";
|
|
353
|
+
|
|
354
|
+
<Button variant="danger" size="sm">Delete</Button>
|
|
355
|
+
<Link to="/new" className={buttonVariants({ variant: "outline" })}>New post</Link>
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
Customize it by overriding the variables in `app/resources/styles.css` (your values win over the defaults), or turn the injection off with `bluebird({ theme: false })` in `vite.config.js`:
|
|
359
|
+
|
|
360
|
+
```css
|
|
361
|
+
:root { --primary: oklch(0.55 0.2 264); --primary-foreground: oklch(0.98 0 0); --brand: oklch(0.65 0.2 30); }
|
|
362
|
+
.dark { --primary: oklch(0.7 0.16 264); --primary-foreground: oklch(0.15 0 0); }
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
#### DataTable (React and HTML views)
|
|
366
|
+
|
|
367
|
+
A responsive table with search, sortable columns, pagination with page sizes, row actions (view, edit, delete with a confirmation dialog, and custom ones), loading skeletons, and an empty state. Wide containers show a table; narrow ones (phones, sidebars) switch to cards with the `primary` column as the title and `mobile: "details"` columns behind "Show details". Labels follow the page language.
|
|
368
|
+
|
|
369
|
+
```jsx
|
|
370
|
+
import { Badge, DataTable, api } from "@seip/bluebird-js/react";
|
|
371
|
+
|
|
372
|
+
<DataTable
|
|
373
|
+
url="/api/users"
|
|
374
|
+
columns={[
|
|
375
|
+
{ key: "name", label: "Name", sortable: true, primary: true },
|
|
376
|
+
{ key: "email", label: "Email", sortable: true },
|
|
377
|
+
{ key: "role", label: "Role", render: (u) => <Badge>{u.role}</Badge> },
|
|
378
|
+
{ key: "sales", label: "Sales", numeric: true, sortable: true },
|
|
379
|
+
{ key: "created_at", label: "Joined", mobile: "details" },
|
|
380
|
+
]}
|
|
381
|
+
onView="/users/:id"
|
|
382
|
+
onEdit={(user) => openEditor(user)}
|
|
383
|
+
onDelete={(user) => api.delete(`/api/users/${user.id}`)}
|
|
384
|
+
actions={[{ label: "Resend invite", hidden: (u) => u.status !== "invited", onClick: resend }]}
|
|
385
|
+
toolbar={<Button size="sm">New user</Button>}
|
|
386
|
+
/>
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
- **Local data**: pass `rows={items}` for client-side search, sort, and pagination.
|
|
390
|
+
- **Server data**: pass `url`. It calls `?page&limit&search&sort&order` and accepts `res.paginate(items, { page, limit, total })`, `res.ok(await Model.paginate(...))`, or a plain array. Server tables reload after a delete; `ref.current.reload()` reloads on demand. Allowlist the `sort` column on the server.
|
|
391
|
+
- `api.get(url, { raw: true })` returns the whole JSON body (`{ data, pagination }`) when you need pagination metadata yourself.
|
|
392
|
+
|
|
393
|
+
In HTML `{{ }}` views, `public/js/bluebird.js` renders the same table from a declarative element. Pass the config with `safeJson()`; cell values are always inserted as text, and `format` covers `badge` (with `tones`), `number`, `currency`, `date`, `datetime`, and `boolean`:
|
|
394
|
+
|
|
395
|
+
```html
|
|
396
|
+
<div data-datatable data-url="/api/users" data-page-size="10">
|
|
397
|
+
<script type="application/json">{{{ tableConfig }}}</script>
|
|
398
|
+
</div>
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
```javascript
|
|
402
|
+
import { SafeHtml, safeJson } from "@seip/bluebird-js/core/html.js";
|
|
403
|
+
|
|
404
|
+
const tableConfig = new SafeHtml(safeJson({
|
|
405
|
+
columns: [
|
|
406
|
+
{ key: "name", label: "Name", sortable: true, primary: true },
|
|
407
|
+
{ key: "status", label: "Status", format: "badge", tones: { active: "success", invited: "info" } },
|
|
408
|
+
{ key: "created_at", label: "Joined", format: "date", mobile: "details" },
|
|
409
|
+
],
|
|
410
|
+
actions: [
|
|
411
|
+
{ action: "view", href: "/users/:id" },
|
|
412
|
+
{ action: "delete", url: "/api/users/:id" },
|
|
413
|
+
{ action: "invite", label: "Resend invite", when: { key: "status", value: "invited" } },
|
|
414
|
+
],
|
|
415
|
+
}));
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
`{ action: "delete", url }` asks in a native dialog and sends a CSRF-protected `DELETE`; every action also dispatches a bubbling `bluebird:datatable` event with `{ action, row }`. From JavaScript use `Bluebird.dataTable(el, { rows | url, columns, onView, onEdit, onDelete, actions })`, which returns `{ reload, setRows, destroy }`.
|
|
419
|
+
|
|
420
|
+
#### Component Languages (i18n)
|
|
421
|
+
|
|
422
|
+
Built-in UI strings (toast badges, close buttons, carousel controls, loading and error fallbacks, theme toggle labels) follow the page language from `<html lang>`: `{{ lang }}` in HTML views and `lang` in `app/resources/spa.js` for the React SPA. English, Spanish, Portuguese, French, German, and Italian are included; regional tags fall back to their base language (`es-AR` uses `es`) and unknown languages fall back to English. In Spanish, `toast.success()` shows **Correcto**, `toast.warning()` **Cuidado**, and `toast.error()` **Error**.
|
|
423
|
+
|
|
424
|
+
```jsx
|
|
425
|
+
import { addMessages, setLocale, useLocale } from "@seip/bluebird-js/react";
|
|
426
|
+
|
|
427
|
+
addMessages("es", { "toast.warning": "Atención" });
|
|
428
|
+
addMessages("ja", { "toast.success": "成功", "toast.warning": "注意", "toast.error": "エラー" });
|
|
429
|
+
setLocale("es");
|
|
430
|
+
|
|
431
|
+
const { locale, t } = useLocale();
|
|
432
|
+
t("carousel.status", { n: 2, total: 5 });
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
HTML views get the same strings from `public/js/bluebird.js` through `Bluebird.i18n.t()`, `Bluebird.i18n.addMessages()`, and `Bluebird.i18n.setLocale()`. A custom `badge` on a toast always wins over the translated label.
|
|
436
|
+
|
|
437
|
+
#### Client React API (`@seip/bluebird-js/react`) & Auth
|
|
438
|
+
|
|
439
|
+
```jsx
|
|
440
|
+
// app/resources/main.jsx
|
|
441
|
+
import { createRoot } from "react-dom/client";
|
|
442
|
+
import { RouterProvider } from "react-router/dom";
|
|
443
|
+
import { AuthProvider, Toaster } from "@seip/bluebird-js/react";
|
|
444
|
+
import "./styles.css";
|
|
445
|
+
import { router } from "./routes.jsx";
|
|
446
|
+
|
|
447
|
+
createRoot(document.getElementById("root")).render(
|
|
448
|
+
<AuthProvider>
|
|
449
|
+
<RouterProvider router={router} />
|
|
450
|
+
<Toaster />
|
|
451
|
+
</AuthProvider>
|
|
452
|
+
);
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
```jsx
|
|
456
|
+
// app/resources/routes.jsx
|
|
457
|
+
import { createRouter } from "@seip/bluebird-js/react";
|
|
458
|
+
|
|
459
|
+
export const router = createRouter(routes, { basename: "/app" });
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
- **Router**: `createRouter()` uses `createBrowserRouter` (with `basename`) on the server and `createHashRouter` in static exports or under `file://`.
|
|
463
|
+
- **Auth hooks & route guards**: `useAuth()` (`user`, `loading`, `authenticated`, `registerEnabled`, `login`, `register`, `logout`, `refresh`, `hasRole`), `<RequireAuth roles={["admin"]} />` (optional `roles` — without `roles`, any signed-in user passes), and `<GuestOnly />`.
|
|
464
|
+
- **REST helper**: `api.get/post/put/patch/delete(url, body)` sends `X-CSRF-Token` (cookie sessions) or `Authorization: Bearer` (token mode), parses JSON, and normalizes `Validator` errors into `ApiError.errors`. Configure with `configureApi({ baseUrl, auth: "cookie" | "token" })`.
|
|
465
|
+
- **UI Components (Light + Dark Tailwind)**: `Link`, `Button`, `Form`, `SubmitButton`, `Input`, `Textarea`, `Select`, `Card`, `Badge`, `Carousel`, `Modal`, `Drawer`, `Skeleton`, `PageSkeleton`, `ProgressBar`, `Spinner`, `ThemeToggle`, `useTheme`, `Toaster` / `toast`, `cn()`.
|
|
466
|
+
- **Vanilla Browser Helpers (`public/js/bluebird.js`)**: `data-carousel`, `data-toast`, `data-modal` / `data-modal-open`, `data-dropdown`, `data-tabs`, `data-theme-toggle`, `data-copy`, `data-confirm`, `data-password-toggle`, and `form[data-form]`.
|
|
467
|
+
|
|
468
|
+
#### Role-Protected Backend & Optional Register (`app/routes/auth.js`)
|
|
469
|
+
|
|
470
|
+
```javascript
|
|
471
|
+
import Auth from "@seip/bluebird-js/core/auth.js";
|
|
472
|
+
import { createAuthRouter } from "./app/routes/auth.js";
|
|
473
|
+
|
|
474
|
+
const routerAuth = createAuthRouter({ register: true });
|
|
475
|
+
|
|
476
|
+
routerApi.get("/profile", Auth.protect(), (req, res) => res.ok({ user: req.user }));
|
|
477
|
+
routerApi.get("/admin/stats", Auth.protect({ roles: "admin" }), (req, res) => res.ok({ ok: true }));
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
The auth and API routers apply `Csrf.middleware()`. Browser sessions use an HttpOnly cookie; clients sending `X-Auth-Mode: token` (static exports) receive `{ user, token }` and authenticate with `Authorization: Bearer`, which is CSRF-exempt because it is never sent automatically by the browser.
|
|
481
|
+
|
|
482
|
+
#### Static Export: Electron, Capacitor & Static Hosting (`npx bluebird-js export`)
|
|
483
|
+
|
|
484
|
+
Builds the same React code, `index.html` shell, and `spa.js` metadata into a 100% static HTML/JS/CSS folder:
|
|
485
|
+
|
|
486
|
+
```bash
|
|
487
|
+
npx bluebird-js export --api https://api.example.com # dist/client (hash router, ./ assets)
|
|
488
|
+
npx bluebird-js export --out mobile/www --api https://api.example.com
|
|
489
|
+
npx bluebird-js export --router browser --base / --out dist/web # static host with history fallback
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
| Option | Default | Purpose |
|
|
493
|
+
|---|---|---|
|
|
494
|
+
| `--out <dir>` | `dist/client` | Output folder (refuses `app/`, `core/`, `public/`, or the project root) |
|
|
495
|
+
| `--api <url>` | `EXPORT_API_URL` or `APP_URL` | Base URL prepended by `api()` to `/api/*` |
|
|
496
|
+
| `--router <mode>` | `hash` | `hash` (works with `file://`), `browser`, or `memory` |
|
|
497
|
+
| `--base <path>` | `./` (`/` for browser) | Asset base URL |
|
|
498
|
+
| `--auth <mode>` | `token` | `token` (Bearer in `localStorage`) or `cookie` |
|
|
499
|
+
| `--config <file>` | `app/resources/spa.js` | SPA config module |
|
|
500
|
+
| `--no-public` | | Skip copying `public/` |
|
|
501
|
+
|
|
502
|
+
```javascript
|
|
503
|
+
// Electron main process (static client, no embedded server)
|
|
504
|
+
mainWindow.loadFile(path.join(__dirname, "dist/client/index.html"));
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
```json
|
|
508
|
+
// capacitor.config.json
|
|
509
|
+
{ "appId": "com.example.app", "appName": "Example", "webDir": "dist/client" }
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
Use `isExported()` to hide web-only UI (for example links to HTML pages) inside the exported build. The embedded-server Electron mode (`desktop: true`) keeps working as before.
|
|
513
|
+
|
|
514
|
+
#### Development & Production
|
|
515
|
+
|
|
516
|
+
```bash
|
|
517
|
+
npm run dev # bluebird-js dev: Express + Vite on one port (HMR + Tailwind v4), restarts on server file changes
|
|
518
|
+
npx bluebird-js build # Builds client SPA & Tailwind CSS bundle into public/build/
|
|
519
|
+
npm start # Production: serves public/build/.vite/manifest.json
|
|
520
|
+
npx bluebird-js export # Static React build for Electron, Capacitor, or static hosting
|
|
521
|
+
```
|
|
522
|
+
|
|
523
|
+
---
|
|
524
|
+
|
|
525
|
+
### 4. Multi-Driver Caching (`core/cache.js`)
|
|
526
|
+
|
|
527
|
+
```javascript
|
|
528
|
+
import Cache from "@seip/bluebird-js/core/cache.js";
|
|
529
|
+
|
|
530
|
+
await Cache.set("metrics", { activeUsers: 450 }, 60, { driver: "memory" });
|
|
531
|
+
const metrics = await Cache.get("metrics", { driver: "memory" });
|
|
532
|
+
|
|
533
|
+
await Cache.set("report", htmlContent, 300, { driver: "file" });
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
HTML render caches (`Render.html(..., { cache: 300 })`, `Render.cache(300)`, `router.spa(..., { cache: 300 })`) are keyed by path. Query strings bypass the cache unless allowlisted (`cacheQuery: ["page"]` or `Render.cache(300, { query: ["page"] })`), preventing cache flooding. Cached pages restore each visitor's own CSRF token and CSP nonce.
|
|
537
|
+
|
|
538
|
+
#### Security Defaults (CORS & CSP)
|
|
539
|
+
|
|
540
|
+
```javascript
|
|
541
|
+
const app = new App({
|
|
542
|
+
routes: [routerWeb, routerApi],
|
|
543
|
+
// "*" never reflects origins nor sends credentials. Credentialed CORS requires an allowlist:
|
|
544
|
+
cors: { origin: ["https://app.example.com"], credentials: true },
|
|
545
|
+
// {nonce} becomes a per-request nonce added to every inline <script>/<style> Bluebird renders:
|
|
546
|
+
security: { csp: "default-src 'self'; script-src 'self' 'nonce-{nonce}'" },
|
|
547
|
+
});
|
|
548
|
+
```
|
|
549
|
+
|
|
550
|
+
---
|
|
551
|
+
|
|
552
|
+
### 5. Desktop Applications (Electron & Desktop Mode)
|
|
553
|
+
|
|
554
|
+
Bluebird.js runs natively embedded inside **Electron** applications with ultra-fast boot (<200ms) and minimal RAM consumption (~25–40 MB vs ~300 MB with Nextron):
|
|
555
|
+
|
|
556
|
+
- **Automatic Writable Paths:** Routes SQLite database, `logs/`, `app/cache/`, and file uploads (`Upload.storage()`) to `Config.userDataDir()` (`app.getPath("userData")`) to avoid read-only errors inside `.asar` archives.
|
|
557
|
+
- **Dynamic Port & LAN / QR Access:** Binds to dynamic port `0` and generates LAN URLs (`allowLan: true`) for companion mobile/QR code access.
|
|
558
|
+
- **Clean WAL Shutdown:** `await app.close()` truncates SQLite WAL and frees file locks cleanly on Windows/Mac/Linux.
|
|
559
|
+
|
|
560
|
+
```bash
|
|
561
|
+
npx bluebird-js add electron
|
|
562
|
+
```
|
|
563
|
+
|
|
564
|
+
The generated desktop scripts run `npx bluebird-js build` before `electron-builder`, so pages are served from the production build inside the `.asar` bundle.
|
|
565
|
+
|
|
566
|
+
Prefer a client-only desktop or mobile app that talks to a remote API? Use `npx bluebird-js export` (section 3) and load `dist/client/index.html` with `mainWindow.loadFile()` or Capacitor.
|
|
567
|
+
|
|
568
|
+
---
|
|
569
|
+
|
|
570
|
+
### 6. Unified AI Client (`core/ai.js`)
|
|
571
|
+
|
|
572
|
+
Built-in AI client (no provider SDKs required) supporting **DeepSeek (default)**, **Google Gemini**, and **OpenAI** with reversible PII data masking, 0ms prompt caching, sliding window rate limits, and JSON schema validation:
|
|
573
|
+
|
|
574
|
+
- **DeepSeek by Default (`deepseek-flash`):** Default endpoint `https://api.deepseek.com`, served by DeepSeek-V4.1-Flash-1017 (legacy names `deepseek-v4-flash`, `deepseek-chat` supported). Optional thinking mode (`thinking: { type: "enabled" }`, `reasoningEffort: "high"`).
|
|
575
|
+
- **Google Gemini & OpenAI:** Built-in REST connectors for `gemini-3.5-flash`, `gemini-3.8-flash`, `gemini-2.5-flash`, `gpt-4o-mini`, and custom endpoints via `baseURL`.
|
|
576
|
+
- **Accurate Real IP Detection (`getClientIp`):** Resolves real visitor IPs across Cloudflare (`cf-connecting-ip`, `true-client-ip`), Nginx (`x-real-ip`), proxy chains (`x-forwarded-for`), and cleans IPv6 mappings. Proxy headers are only trusted from local/private reverse proxies (`trustProxy` defaults to `"loopback, linklocal, uniquelocal"`; set it to your CDN hop count when needed), so clients cannot spoof them to bypass rate limits.
|
|
577
|
+
- **Reversible PII Masking:** Replaces sensitive user keys (`name`, `email`, `dni`, etc.) with anonymous tokens (`[name_01]`, `[email_01]`) before transmission, restoring original values in responses.
|
|
578
|
+
- **0ms Prompt Cache Hit:** Computes cache hashes on *anonymized* prompts so multiple users querying identical prompt templates trigger an immediate $0 / 0ms Cache Hit.
|
|
579
|
+
- **Rate Limit Protection ("Anti-Quiebra"):** Configurable per-minute/per-day sliding windows (e.g. `{ minute: 6, day: 30 }`), returning clean HTTP 429 errors via `ai.protect()` middleware before depleting API budget.
|
|
580
|
+
|
|
581
|
+
```javascript
|
|
582
|
+
import AI, { ai } from "@seip/bluebird-js/core/ai.js";
|
|
583
|
+
|
|
584
|
+
const supportAi = new AI({
|
|
585
|
+
provider: "deepseek", // "deepseek" (default) | "gemini" | "openai" | "custom"
|
|
586
|
+
model: "deepseek-flash",
|
|
587
|
+
rateLimit: { minute: 6, day: 30 }, // Sliding window rate limit
|
|
588
|
+
cacheTtl: 3600, // Cache responses for 1 hour
|
|
589
|
+
});
|
|
590
|
+
|
|
591
|
+
routerApi.post("/support/reply", supportAi.protect(), async (req, res) => {
|
|
592
|
+
const result = await supportAi.ask("Draft a courteous support reply for this user:", {
|
|
593
|
+
data: {
|
|
594
|
+
name: "Maria Garcia",
|
|
595
|
+
email: "maria@example.com",
|
|
596
|
+
dni: "45123987",
|
|
597
|
+
issue: "I would like to update my billing details",
|
|
598
|
+
},
|
|
599
|
+
sensitiveKeys: ["name", "email", "dni"], // Masked before leaving server!
|
|
600
|
+
request: req, // Automatic IP rate limiting
|
|
601
|
+
json: true,
|
|
602
|
+
});
|
|
603
|
+
|
|
604
|
+
// result.text is returned fully restored with 'Maria Garcia' and 'maria@example.com'!
|
|
605
|
+
res.ok(result);
|
|
606
|
+
});
|
|
607
|
+
|
|
608
|
+
// Real-time streaming directly to client response via Server-Sent Events (SSE)
|
|
609
|
+
routerApi.post("/support/stream", async (req, res) => {
|
|
610
|
+
await supportAi.pipe(res, req.body.message, { sse: true, request: req });
|
|
611
|
+
});
|
|
612
|
+
|
|
613
|
+
// Or iterate chunks manually via async generator
|
|
614
|
+
for await (const chunk of supportAi.askStream("Explain quantum computing in simple terms")) {
|
|
615
|
+
process.stdout.write(chunk.text);
|
|
616
|
+
}
|
|
617
|
+
```
|
|
618
|
+
|
|
619
|
+
---
|
|
620
|
+
|
|
621
|
+
### 7. Atomic Database Backups & Verification (`core/database.js`)
|
|
622
|
+
|
|
623
|
+
WAL-safe, non-blocking snapshots for SQLite using `VACUUM INTO` and gzip compression, with automated retention rotation and integrity-verified restore:
|
|
624
|
+
|
|
625
|
+
```javascript
|
|
626
|
+
import Database from "@seip/bluebird-js/core/database.js";
|
|
627
|
+
|
|
628
|
+
// Atomic, WAL-safe gzip backup with retention rotation (keeps latest 10)
|
|
629
|
+
const backup = await Database.backup({ out: "database/backups", keep: 10, compress: true });
|
|
630
|
+
|
|
631
|
+
// Integrity-verified restore with pre-restore safety snapshot
|
|
632
|
+
await Database.restore("database/backups/backup-sqlite-2026-11-03_170000_123.db.gz", {
|
|
633
|
+
safetyBackup: true,
|
|
634
|
+
verify: true,
|
|
635
|
+
});
|
|
636
|
+
```
|
|
637
|
+
|
|
638
|
+
---
|
|
639
|
+
|
|
640
|
+
## Developer Tooling CLI
|
|
641
|
+
|
|
642
|
+
```bash
|
|
643
|
+
npx bluebird-js [--blank|--auth|--blog|--api|--demo] # Scaffolds a project from a template (default: blank)
|
|
644
|
+
npx bluebird-js doctor # Diagnostic audit and HTTP smoke tests
|
|
645
|
+
npx bluebird-js make:model <Name> # Generates BaseModel class
|
|
646
|
+
npx bluebird-js make:route <name> [--auth] # Scaffolds REST route
|
|
647
|
+
npx bluebird-js make:view <name> [--partial|--layout] # Scaffolds an HTML {{ }} template view
|
|
648
|
+
npx bluebird-js build # Builds client SPA and Tailwind CSS bundle (public/build/)
|
|
649
|
+
npx bluebird-js export [--api url] [--out dir] # Static React export (Electron, Capacitor, static hosts)
|
|
650
|
+
npx bluebird-js make:migration [name] # Smart auto-migration from app/models/
|
|
651
|
+
npx bluebird-js make:migration --model <Model> # Generates migration for specific Model
|
|
652
|
+
npx bluebird-js migrate [--yes] # Executes pending migrations
|
|
653
|
+
npx bluebird-js migrate:status # Displays applied migration batches
|
|
654
|
+
npx bluebird-js migrate:rollback # Reverts latest migration batch
|
|
655
|
+
npx bluebird-js make:seed <name> # Creates database seed file
|
|
656
|
+
npx bluebird-js seed # Executes database seeds
|
|
657
|
+
npx bluebird-js db:backup [--keep 10] [--out dir] # Compressed WAL-safe database backup with retention rotation
|
|
658
|
+
npx bluebird-js dev [entry] [--watch dir] # Dev server (Vite HMR) restarting only on server file changes
|
|
659
|
+
npx bluebird-js db:restore <file> [--yes] # Safe database restore with pre-backup & integrity check
|
|
660
|
+
npx bluebird-js nginx:conf [domain] [port] [root] # Generates Nginx reverse proxy configuration
|
|
661
|
+
npx bluebird-js make:ecosystem [--start] # Generates PM2 clustering config
|
|
662
|
+
npx bluebird-js add electron # Scaffolds Electron desktop app & desktop.js
|
|
663
|
+
npx bluebird-js add <module> # Installs optional on-demand package
|
|
664
|
+
```
|
|
665
|
+
|
|
666
|
+
---
|
|
667
|
+
|
|
668
|
+
## License
|
|
669
|
+
|
|
670
|
+
MIT License. Copyright (c) 2026 Seip25.
|