@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.
Files changed (152) hide show
  1. package/.vscode/extensions.json +7 -7
  2. package/.vscode/settings.json +10 -10
  3. package/AGENTS.md +266 -116
  4. package/README.md +258 -245
  5. package/app/models/user.js +19 -0
  6. package/app/resources/html/home.html +137 -0
  7. package/app/resources/html/layouts/main.html +54 -0
  8. package/app/resources/html/notFound.html +14 -0
  9. package/app/resources/html/terms.html +46 -0
  10. package/app/resources/index.html +27 -0
  11. package/app/resources/layouts/AppLayout.jsx +89 -0
  12. package/app/resources/main.jsx +18 -0
  13. package/app/resources/pages/Dashboard.jsx +98 -0
  14. package/app/resources/pages/Home.jsx +140 -0
  15. package/app/resources/pages/Login.jsx +35 -0
  16. package/app/resources/pages/NotFound.jsx +16 -0
  17. package/app/resources/pages/Register.jsx +55 -0
  18. package/app/resources/routes.jsx +54 -0
  19. package/app/resources/spa.js +67 -0
  20. package/app/resources/styles.css +9 -0
  21. package/app/routes/api.js +85 -50
  22. package/app/routes/auth.js +209 -0
  23. package/app/routes/web.js +49 -37
  24. package/core/ai.d.ts +151 -151
  25. package/core/ai.js +1071 -1051
  26. package/core/app.d.ts +2 -18
  27. package/core/app.js +978 -792
  28. package/core/auth.d.ts +2 -13
  29. package/core/auth.js +444 -326
  30. package/core/cli/backup.js +167 -167
  31. package/core/cli/build.js +37 -0
  32. package/core/cli/dev.js +155 -0
  33. package/core/cli/doctor.js +37 -2
  34. package/core/cli/export.js +191 -0
  35. package/core/cli/init.js +101 -332
  36. package/core/cli/nginx.js +1 -1
  37. package/core/cli/templates.js +139 -0
  38. package/core/cli/view.js +73 -136
  39. package/core/config.js +44 -2
  40. package/core/csrf.js +156 -24
  41. package/core/database.js +737 -684
  42. package/core/debug.js +1 -1
  43. package/core/html.js +8 -1
  44. package/core/index.d.ts +1286 -1431
  45. package/core/paths.js +55 -0
  46. package/core/ratelimit.js +10 -1
  47. package/core/react/client/api.js +237 -0
  48. package/core/react/client/auth.js +236 -0
  49. package/core/react/client/components.js +1321 -0
  50. package/core/react/client/i18n.js +338 -0
  51. package/core/react/client/index.d.ts +249 -0
  52. package/core/react/client/index.js +49 -0
  53. package/core/react/client/router.js +26 -0
  54. package/core/react/client/theme.css +512 -0
  55. package/core/render-cache.js +250 -212
  56. package/core/render.d.ts +25 -21
  57. package/core/render.js +613 -603
  58. package/core/router.d.ts +2 -3
  59. package/core/router.js +171 -171
  60. package/core/seo.js +10 -0
  61. package/core/spa.js +599 -0
  62. package/core/view-loader.js +81 -455
  63. package/core/vite-plugin.d.ts +18 -0
  64. package/core/vite-plugin.js +162 -0
  65. package/core/vite.js +250 -145
  66. package/index.js +22 -18
  67. package/jsconfig.json +5 -3
  68. package/package.json +114 -92
  69. package/production.md +8 -3
  70. package/public/js/bluebird.js +1160 -0
  71. package/templates/_auth/app/database.js +19 -0
  72. package/templates/_auth/app/models/user.js +22 -0
  73. package/templates/_auth/app/routes/auth-router.js +304 -0
  74. package/templates/_base/app/resources/html/layouts/main.html +55 -0
  75. package/templates/_base/app/resources/html/notFound.html +14 -0
  76. package/templates/_base/app/resources/index.html +27 -0
  77. package/templates/_base/app/resources/styles.css +9 -0
  78. package/templates/api/app/models/note.js +18 -0
  79. package/templates/api/app/routes/api.js +82 -0
  80. package/templates/api/app/routes/auth.js +11 -0
  81. package/templates/api/index.js +19 -0
  82. package/templates/api/template.json +13 -0
  83. package/templates/auth/app/mail.js +11 -0
  84. package/templates/auth/app/models/password_reset.js +18 -0
  85. package/templates/auth/app/resources/html/home.html +21 -0
  86. package/templates/auth/app/resources/html/partials/nav.html +2 -0
  87. package/templates/auth/app/resources/layouts/AppLayout.jsx +60 -0
  88. package/templates/auth/app/resources/main.jsx +18 -0
  89. package/templates/auth/app/resources/pages/Dashboard.jsx +51 -0
  90. package/templates/auth/app/resources/pages/ForgotPassword.jsx +34 -0
  91. package/templates/auth/app/resources/pages/Login.jsx +36 -0
  92. package/templates/auth/app/resources/pages/NotFound.jsx +16 -0
  93. package/templates/auth/app/resources/pages/Profile.jsx +99 -0
  94. package/templates/auth/app/resources/pages/Register.jsx +50 -0
  95. package/templates/auth/app/resources/pages/ResetPassword.jsx +50 -0
  96. package/templates/auth/app/resources/routes.jsx +54 -0
  97. package/templates/auth/app/resources/spa.js +29 -0
  98. package/templates/auth/app/routes/api.js +17 -0
  99. package/templates/auth/app/routes/auth.js +13 -0
  100. package/templates/auth/app/routes/web.js +21 -0
  101. package/templates/auth/index.js +19 -0
  102. package/templates/auth/template.json +15 -0
  103. package/templates/blank/app/models/.gitkeep +0 -0
  104. package/templates/blank/app/resources/html/home.html +27 -0
  105. package/templates/blank/app/resources/html/partials/nav.html +1 -0
  106. package/templates/blank/app/resources/main.jsx +16 -0
  107. package/templates/blank/app/resources/pages/Home.jsx +42 -0
  108. package/templates/blank/app/resources/pages/NotFound.jsx +27 -0
  109. package/templates/blank/app/resources/routes.jsx +15 -0
  110. package/templates/blank/app/resources/spa.js +24 -0
  111. package/templates/blank/app/routes/api.js +11 -0
  112. package/templates/blank/app/routes/web.js +21 -0
  113. package/templates/blank/index.js +13 -0
  114. package/templates/blank/template.json +12 -0
  115. package/templates/blog/app/lib/blog.js +149 -0
  116. package/templates/blog/app/models/post.js +22 -0
  117. package/templates/blog/app/resources/html/home.html +28 -0
  118. package/templates/blog/app/resources/html/not-found.html +5 -0
  119. package/templates/blog/app/resources/html/partials/nav.html +2 -0
  120. package/templates/blog/app/resources/html/partials/post-card.html +9 -0
  121. package/templates/blog/app/resources/html/post.html +8 -0
  122. package/templates/blog/app/resources/layouts/AdminLayout.jsx +54 -0
  123. package/templates/blog/app/resources/main.jsx +18 -0
  124. package/templates/blog/app/resources/pages/Login.jsx +31 -0
  125. package/templates/blog/app/resources/pages/NotFound.jsx +16 -0
  126. package/templates/blog/app/resources/pages/PostEditor.jsx +51 -0
  127. package/templates/blog/app/resources/pages/Posts.jsx +83 -0
  128. package/templates/blog/app/resources/pages/Register.jsx +43 -0
  129. package/templates/blog/app/resources/routes.jsx +51 -0
  130. package/templates/blog/app/resources/spa.js +25 -0
  131. package/templates/blog/app/resources/styles.css +40 -0
  132. package/templates/blog/app/routes/api.js +77 -0
  133. package/templates/blog/app/routes/auth.js +10 -0
  134. package/templates/blog/app/routes/web.js +114 -0
  135. package/templates/blog/index.js +21 -0
  136. package/templates/blog/template.json +14 -0
  137. package/vite.config.js +11 -0
  138. package/app/views/about.jsx +0 -98
  139. package/app/views/components/Header.jsx +0 -42
  140. package/app/views/components/LiveCounter.jsx +0 -66
  141. package/app/views/dashboard.jsx +0 -300
  142. package/app/views/index.jsx +0 -123
  143. package/app/views/layouts/main/view.jsx +0 -201
  144. package/app/views/legal/terms.html +0 -29
  145. package/app/views/login.jsx +0 -141
  146. package/core/actions.d.ts +0 -4
  147. package/core/actions.js +0 -329
  148. package/core/jsx.d.ts +0 -38
  149. package/core/jsx.js +0 -1432
  150. package/core/vite.d.ts +0 -3
  151. package/public/js/bluebird-client.js +0 -3161
  152. package/public/js/tailwind.js +0 -8
package/package.json CHANGED
@@ -1,92 +1,114 @@
1
- {
2
- "name": "@seip/bluebird-js",
3
- "version": "0.1.6",
4
- "description": "Performance-first Node.js API and web framework with built-in JWT auth, HTML rendering, validation, BaseModel, and multi-level caching",
5
- "type": "module",
6
- "main": "core/app.js",
7
- "types": "core/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "types": "./core/index.d.ts",
11
- "default": "./core/app.js"
12
- },
13
- "./core/*.js": {
14
- "types": "./core/*.d.ts",
15
- "default": "./core/*.js"
16
- },
17
- "./*": "./*"
18
- },
19
- "bin": {
20
- "bluebird-js": "core/cli/init.js",
21
- "blue-bird": "core/cli/init.js"
22
- },
23
- "repository": {
24
- "type": "git",
25
- "url": "git+https://github.com/seip25/bluebird-js.git"
26
- },
27
- "keywords": [
28
- "express",
29
- "framework",
30
- "react",
31
- "jsx",
32
- "ssr",
33
- "html",
34
- "api",
35
- "jwt",
36
- "render",
37
- "seo",
38
- "model",
39
- "sqlite",
40
- "tailwind"
41
- ],
42
- "author": "Seip25",
43
- "license": "MIT",
44
- "bugs": {
45
- "url": "https://github.com/seip25/bluebird-js/issues"
46
- },
47
- "homepage": "https://seip25.github.io/bluebird-js/",
48
- "engines": {
49
- "node": ">=22.18.0"
50
- },
51
- "scripts": {
52
- "dev": "node --watch --env-file=.env index.js",
53
- "start": "node --env-file=.env index.js",
54
- "init": "bluebird-js",
55
- "doctor": "bluebird-js doctor",
56
- "route": "bluebird-js make:route",
57
- "view": "bluebird-js make:view",
58
- "model": "bluebird-js make:model",
59
- "migrate": "bluebird-js migrate",
60
- "seed": "bluebird-js seed",
61
- "ecosystem": "bluebird-js make:ecosystem",
62
- "swagger-install": "bluebird-js swagger-install",
63
- "test": "node test/test_suite.js"
64
- },
65
- "publishConfig": {
66
- "access": "public"
67
- },
68
- "files": [
69
- "core",
70
- "app",
71
- "public",
72
- "index.js",
73
- "AGENTS.md",
74
- "production.md",
75
- ".env_example",
76
- "jsconfig.json",
77
- ".vscode"
78
- ],
79
- "dependencies": {
80
- "express": "^5.2.1"
81
- },
82
- "optionalDependencies": {
83
- "ejs": "^3.1.10",
84
- "helmet": "^8.1.0",
85
- "multer": "^2.0.2",
86
- "redis": "^6.1.0",
87
- "swagger-jsdoc": "^6.2.8",
88
- "swagger-ui-express": "^5.0.1",
89
- "ws": "^8.18.0"
90
- },
91
- "devDependencies": {}
92
- }
1
+ {
2
+ "name": "@seip/bluebird-js",
3
+ "version": "0.2.0",
4
+ "description": "Performance-first Node.js framework: Express + HTML {{ }} SSR templates + React Router SPA with Vite, Tailwind CSS, JWT auth, BaseModel, smart migrations, and multi-level caching",
5
+ "type": "module",
6
+ "main": "core/app.js",
7
+ "types": "core/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./core/index.d.ts",
11
+ "default": "./core/app.js"
12
+ },
13
+ "./react": {
14
+ "types": "./core/react/client/index.d.ts",
15
+ "default": "./core/react/client/index.js"
16
+ },
17
+ "./vite": {
18
+ "types": "./core/vite-plugin.d.ts",
19
+ "default": "./core/vite-plugin.js"
20
+ },
21
+ "./core/*.js": {
22
+ "types": "./core/*.d.ts",
23
+ "default": "./core/*.js"
24
+ },
25
+ "./*": "./*"
26
+ },
27
+ "bin": {
28
+ "bluebird-js": "core/cli/init.js",
29
+ "blue-bird": "core/cli/init.js"
30
+ },
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git+https://github.com/seip25/bluebird-js.git"
34
+ },
35
+ "keywords": [
36
+ "api",
37
+ "express",
38
+ "framework",
39
+ "html",
40
+ "jwt",
41
+ "model",
42
+ "react",
43
+ "react-router",
44
+ "render",
45
+ "seo",
46
+ "spa",
47
+ "sqlite",
48
+ "ssr",
49
+ "tailwind",
50
+ "vite"
51
+ ],
52
+ "author": "Seip25",
53
+ "license": "MIT",
54
+ "bugs": {
55
+ "url": "https://github.com/seip25/bluebird-js/issues"
56
+ },
57
+ "homepage": "https://seip25.github.io/bluebird-js/",
58
+ "engines": {
59
+ "node": ">=22.18.0"
60
+ },
61
+ "scripts": {
62
+ "dev": "node core/cli/init.js dev",
63
+ "start": "node --env-file-if-exists=.env index.js",
64
+ "build": "node core/cli/init.js build",
65
+ "export": "node core/cli/init.js export",
66
+ "lint": "node --check index.js",
67
+ "init": "node core/cli/init.js",
68
+ "doctor": "node core/cli/init.js doctor",
69
+ "route": "node core/cli/init.js make:route",
70
+ "view": "node core/cli/init.js make:view",
71
+ "model": "node core/cli/init.js make:model",
72
+ "migrate": "node core/cli/init.js migrate",
73
+ "seed": "node core/cli/init.js seed",
74
+ "ecosystem": "node core/cli/init.js make:ecosystem",
75
+ "swagger-install": "node core/cli/init.js swagger-install",
76
+ "test": "node test/test_suite.js && node test/regression_suite.js"
77
+ },
78
+ "publishConfig": {
79
+ "access": "public"
80
+ },
81
+ "files": [
82
+ "core",
83
+ "app",
84
+ "templates",
85
+ "public",
86
+ "!public/build",
87
+ "index.js",
88
+ "vite.config.js",
89
+ "AGENTS.md",
90
+ "production.md",
91
+ ".env_example",
92
+ "jsconfig.json",
93
+ ".vscode"
94
+ ],
95
+ "dependencies": {
96
+ "@tailwindcss/vite": "^4.3.5",
97
+ "@vitejs/plugin-react": "^5.2.0",
98
+ "express": "^5.2.1",
99
+ "react": "^19.3.1",
100
+ "react-dom": "^19.3.1",
101
+ "react-router": "^8.5.1",
102
+ "tailwindcss": "^4.3.5",
103
+ "vite": "^7.3.8"
104
+ },
105
+ "optionalDependencies": {
106
+ "ejs": "^3.1.10",
107
+ "helmet": "^8.1.0",
108
+ "multer": "^2.0.2",
109
+ "redis": "^6.1.0",
110
+ "swagger-jsdoc": "^6.2.8",
111
+ "swagger-ui-express": "^5.0.1",
112
+ "ws": "^8.18.0"
113
+ }
114
+ }
package/production.md CHANGED
@@ -6,9 +6,10 @@ This guide covers recommended strategies for deploying a `@seip/bluebird-js` app
6
6
 
7
7
  ## 1. Quick Start: Standard Node.js (`npm start`)
8
8
 
9
- For single-instance VPS hosts, developer previews, or container runtimes, you can start the application directly using Node.js:
9
+ For single-instance VPS hosts, developer previews, or container runtimes, build the Vite client bundle once and start the application directly using Node.js:
10
10
 
11
11
  ```bash
12
+ npx bluebird-js build # public/build/ (hashed client SPA & Tailwind CSS bundle + manifest)
12
13
  npm run start
13
14
  ```
14
15
 
@@ -18,6 +19,8 @@ node --env-file=.env index.js
18
19
  ```
19
20
 
20
21
  ### Production Checklist Before Starting
22
+ - Run `npx bluebird-js build` on every deployment (without a build, Vite compiles client assets on the fly in middleware mode and a warning is printed).
23
+ - Set `ASSET_VERSION` if you want to control when open browser tabs see updated build identifiers (defaults to the build manifest hash).
21
24
  - Set `DEBUG=false` in `.env`.
22
25
  - Ensure `JWT_SECRET` is set to a secure, random string (minimum 32 characters).
23
26
  - Ensure your database path or connection credentials in `.env` are secure and isolated.
@@ -159,7 +162,7 @@ server {
159
162
  return 404;
160
163
  }
161
164
 
162
- location /dist/ {
165
+ location /build/ {
163
166
  try_files $uri =404;
164
167
  expires 1y;
165
168
  add_header Cache-Control "public, max-age=31536000, immutable";
@@ -229,10 +232,12 @@ ENV NODE_ENV=production
229
232
 
230
233
  COPY package*.json ./
231
234
 
232
- RUN npm ci --only=production
235
+ RUN npm ci --omit=dev
233
236
 
234
237
  COPY . .
235
238
 
239
+ RUN npx bluebird-js build
240
+
236
241
  EXPOSE 3000
237
242
 
238
243
  CMD ["node", "--env-file=.env", "index.js"]