create-nexwire 4.2.5 → 4.4.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 (399) hide show
  1. package/README.md +29 -12
  2. package/express/.env +1 -1
  3. package/express/package.json +1 -1
  4. package/express/src/config/database.ts +48 -29
  5. package/express/src/config/index.ts +83 -83
  6. package/express/src/config/openapi.ts +6 -24
  7. package/express/src/config/queue.ts +30 -30
  8. package/express/src/config/validate.ts +50 -40
  9. package/express/src/database/migrations/sqlite/0000_init.sql +47 -47
  10. package/express/src/database/migrations/sqlite/meta/0000_snapshot.json +1 -1
  11. package/express/src/database/migrations/sqlite/meta/_journal.json +1 -1
  12. package/express/src/framework/cache/cache.ts +40 -8
  13. package/express/src/framework/circuit-breaker/cb.ts +88 -60
  14. package/express/src/framework/database/connection.ts +52 -27
  15. package/express/src/framework/events/dispatcher.ts +61 -49
  16. package/express/src/framework/facade.ts +47 -3
  17. package/express/src/framework/http/app.ts +28 -22
  18. package/express/src/framework/http/logger.ts +37 -17
  19. package/express/src/framework/http/openapi.ts +9 -11
  20. package/express/src/framework/maker-cli/runtime/core.mjs +1 -2
  21. package/express/src/framework/modules/routes.ts +26 -21
  22. package/express/src/framework/notification/channels/broadcast.ts +15 -0
  23. package/express/src/framework/notification/channels/mail.ts +42 -0
  24. package/express/src/framework/notification/contracts.ts +29 -0
  25. package/express/src/framework/notification/index.ts +19 -94
  26. package/express/src/framework/notification/registry.ts +15 -0
  27. package/express/src/framework/providers/adapter.ts +27 -17
  28. package/express/src/framework/queue/queue.ts +43 -44
  29. package/express/src/framework/realtime/broadcast.ts +29 -5
  30. package/express/src/framework/realtime/socket.ts +149 -119
  31. package/express/src/framework/redis/client.ts +148 -151
  32. package/express/src/framework/runtime/server-adapter.ts +39 -34
  33. package/express/src/framework/scheduler/lock.ts +128 -116
  34. package/express/src/framework/server.ts +33 -49
  35. package/express/src/framework/session/session.ts +69 -14
  36. package/express/src/framework/storage/storage.ts +744 -785
  37. package/express/src/framework/support/mail.ts +15 -7
  38. package/express/src/middlewares/auth-middleware.ts +1 -2
  39. package/express/src/middlewares/role-middleware.ts +3 -13
  40. package/express/src/modules/auth/routes/index.ts +1 -2
  41. package/express/src/providers/notification.ts +4 -0
  42. package/express/src/resources/src/components/Switch.vue +60 -65
  43. package/express/src/resources/src/layouts/Layout/Header.vue +124 -105
  44. package/express/src/resources/src/pages/auth/forgetPassword.vue +23 -30
  45. package/express/src/resources/src/pages/auth/login.vue +25 -28
  46. package/express/src/resources/src/pages/auth/register.vue +35 -39
  47. package/express/src/resources/src/pages/auth/resetPassword.vue +29 -37
  48. package/express/src/resources/src/pages/auth/verifyEmail.vue +15 -19
  49. package/express/src/resources/src/plugins/gum.ts +519 -203
  50. package/express/src/resources/src/plugins/pulse.ts +157 -147
  51. package/express/src/resources/src/stores/auth.ts +9 -6
  52. package/express/src/resources/vite.config.ts +54 -43
  53. package/express/src/storage/database/nexwire.sqlite +0 -0
  54. package/express/src/storage/logs/app.log +0 -0
  55. package/express/src/storage/logs/fatal.log +0 -0
  56. package/express/src/types/global.d.ts +32 -26
  57. package/fastify/.dockerignore +14 -0
  58. package/fastify/.env +44 -0
  59. package/fastify/.env.example +42 -0
  60. package/fastify/.vscode/extensions.json +6 -0
  61. package/fastify/.vscode/settings.json +37 -0
  62. package/fastify/LICENSE +21 -0
  63. package/fastify/README.md +232 -0
  64. package/fastify/biome.json +99 -0
  65. package/fastify/drizzle.config.ts +25 -0
  66. package/fastify/gitignore-stub +31 -0
  67. package/fastify/package.json +130 -0
  68. package/fastify/public/.gitkeep +0 -0
  69. package/fastify/src/config/app.ts +41 -0
  70. package/fastify/src/config/auth.ts +12 -0
  71. package/fastify/src/config/cache.ts +16 -0
  72. package/fastify/src/config/cookie.ts +15 -0
  73. package/fastify/src/config/cors.ts +12 -0
  74. package/fastify/src/config/database.ts +48 -0
  75. package/fastify/src/config/index.ts +83 -0
  76. package/fastify/src/config/jwt.ts +19 -0
  77. package/fastify/src/config/logging.ts +13 -0
  78. package/fastify/src/config/mail.ts +24 -0
  79. package/fastify/src/config/openapi.ts +36 -0
  80. package/fastify/src/config/queue.ts +30 -0
  81. package/fastify/src/config/rateLimit.ts +17 -0
  82. package/fastify/src/config/realtime.ts +15 -0
  83. package/fastify/src/config/redis.ts +18 -0
  84. package/fastify/src/config/security.ts +44 -0
  85. package/fastify/src/config/session.ts +17 -0
  86. package/fastify/src/config/storage.ts +22 -0
  87. package/fastify/src/config/validate.ts +50 -0
  88. package/fastify/src/database/migrations/sqlite/0000_init.sql +48 -0
  89. package/fastify/src/database/migrations/sqlite/meta/0000_snapshot.json +324 -0
  90. package/fastify/src/database/migrations/sqlite/meta/_journal.json +13 -0
  91. package/fastify/src/database/schema.ts +2 -0
  92. package/fastify/src/env.ts +76 -0
  93. package/fastify/src/framework/cache/cache.ts +114 -0
  94. package/fastify/src/framework/circuit-breaker/cb.ts +88 -0
  95. package/fastify/src/framework/database/app-schema.ts +37 -0
  96. package/fastify/src/framework/database/connection.ts +223 -0
  97. package/fastify/src/framework/database/migrate-hooks.ts +87 -0
  98. package/fastify/src/framework/database/paginate.ts +226 -0
  99. package/fastify/src/framework/database/schema.ts +20 -0
  100. package/fastify/src/framework/database/seed.ts +152 -0
  101. package/fastify/src/framework/events/dispatcher.ts +61 -0
  102. package/fastify/src/framework/facade.ts +96 -0
  103. package/fastify/src/framework/http/app.ts +176 -0
  104. package/fastify/src/framework/http/cors.ts +13 -0
  105. package/fastify/src/framework/http/fastify.d.ts +13 -0
  106. package/fastify/src/framework/http/logger.ts +110 -0
  107. package/fastify/src/framework/http/metrics.ts +22 -0
  108. package/fastify/src/framework/http/openapi.ts +48 -0
  109. package/fastify/src/framework/http/ratelimiter.ts +47 -0
  110. package/fastify/src/framework/http/security.ts +25 -0
  111. package/fastify/src/framework/http/static.ts +83 -0
  112. package/fastify/src/framework/http/validation.ts +49 -0
  113. package/fastify/src/framework/kernel.ts +43 -0
  114. package/fastify/src/framework/maker-cli/db/core.mjs +291 -0
  115. package/fastify/src/framework/maker-cli/db/index.mjs +204 -0
  116. package/fastify/src/framework/maker-cli/deploy/core.mjs +1046 -0
  117. package/fastify/src/framework/maker-cli/deploy/index.mjs +91 -0
  118. package/fastify/src/framework/maker-cli/index.mjs +65 -0
  119. package/fastify/src/framework/maker-cli/middleware/core.mjs +41 -0
  120. package/fastify/src/framework/maker-cli/middleware/index.mjs +17 -0
  121. package/fastify/src/framework/maker-cli/module/core.mjs +1066 -0
  122. package/fastify/src/framework/maker-cli/module/index.mjs +211 -0
  123. package/fastify/src/framework/maker-cli/provider/core.mjs +49 -0
  124. package/fastify/src/framework/maker-cli/provider/index.mjs +12 -0
  125. package/fastify/src/framework/maker-cli/runtime/build-ui.mjs +16 -0
  126. package/fastify/src/framework/maker-cli/runtime/core.mjs +560 -0
  127. package/fastify/src/framework/maker-cli/runtime/index.mjs +120 -0
  128. package/fastify/src/framework/maker-cli/runtime/redis-commander-patch.cjs +20 -0
  129. package/fastify/src/framework/maker-cli/stubs/controller/openapi.ts.stub +74 -0
  130. package/fastify/src/framework/maker-cli/stubs/controller/plain.ts.stub +77 -0
  131. package/fastify/src/framework/maker-cli/stubs/controller/standalone.ts.stub +51 -0
  132. package/fastify/src/framework/maker-cli/stubs/deploy/Dockerfile.bun.stub +52 -0
  133. package/fastify/src/framework/maker-cli/stubs/deploy/Dockerfile.pnpm.stub +55 -0
  134. package/fastify/src/framework/maker-cli/stubs/deploy/Dockerfile.stub +51 -0
  135. package/fastify/src/framework/maker-cli/stubs/deploy/Dockerfile.yarn.stub +55 -0
  136. package/fastify/src/framework/maker-cli/stubs/deploy/README.stub +59 -0
  137. package/fastify/src/framework/maker-cli/stubs/deploy/compose/mysql.server.stub +45 -0
  138. package/fastify/src/framework/maker-cli/stubs/deploy/compose/postgres.server.stub +45 -0
  139. package/fastify/src/framework/maker-cli/stubs/deploy/compose/sqlite.stub +45 -0
  140. package/fastify/src/framework/maker-cli/stubs/deploy/env/mysql.server.stub +68 -0
  141. package/fastify/src/framework/maker-cli/stubs/deploy/env/postgres.server.stub +68 -0
  142. package/fastify/src/framework/maker-cli/stubs/deploy/env/sqlite.stub +67 -0
  143. package/fastify/src/framework/maker-cli/stubs/deploy/scripts/auto-migrate.sh.stub +41 -0
  144. package/fastify/src/framework/maker-cli/stubs/deploy/server/README.stub +78 -0
  145. package/fastify/src/framework/maker-cli/stubs/deploy/server/compose/noredis.stub +120 -0
  146. package/fastify/src/framework/maker-cli/stubs/deploy/server/compose/redis.dev.stub +133 -0
  147. package/fastify/src/framework/maker-cli/stubs/deploy/server/compose/redis.stub +131 -0
  148. package/fastify/src/framework/maker-cli/stubs/deploy/server/env/local.example.stub +11 -0
  149. package/fastify/src/framework/maker-cli/stubs/deploy/server/env/noredis.stub +25 -0
  150. package/fastify/src/framework/maker-cli/stubs/deploy/server/env/redis.stub +25 -0
  151. package/fastify/src/framework/maker-cli/stubs/deploy/server/nginx-vhost/README.stub +16 -0
  152. package/fastify/src/framework/maker-cli/stubs/deploy/server/nginx-vhost/app.example.com.stub +13 -0
  153. package/fastify/src/framework/maker-cli/stubs/deploy/server/pgadmin/servers.stub +14 -0
  154. package/fastify/src/framework/maker-cli/stubs/deploy/server/redis/redis.conf.stub +7 -0
  155. package/fastify/src/framework/maker-cli/stubs/deploy/supervisor/noredis.stub +54 -0
  156. package/fastify/src/framework/maker-cli/stubs/deploy/supervisor/redis.stub +70 -0
  157. package/fastify/src/framework/maker-cli/stubs/deploy/workflow/local.json.stub +25 -0
  158. package/fastify/src/framework/maker-cli/stubs/deploy/workflow/remote.json.stub +24 -0
  159. package/fastify/src/framework/maker-cli/stubs/facade/name.ts.stub +12 -0
  160. package/fastify/src/framework/maker-cli/stubs/helper/name.ts.stub +14 -0
  161. package/fastify/src/framework/maker-cli/stubs/job/name.ts.stub +25 -0
  162. package/fastify/src/framework/maker-cli/stubs/middleware/name.local.ts.stub +15 -0
  163. package/fastify/src/framework/maker-cli/stubs/middleware/name.ts.stub +15 -0
  164. package/fastify/src/framework/maker-cli/stubs/model/name.mysql.ts.stub +10 -0
  165. package/fastify/src/framework/maker-cli/stubs/model/name.postgresql.ts.stub +10 -0
  166. package/fastify/src/framework/maker-cli/stubs/model/name.sqlite.ts.stub +10 -0
  167. package/fastify/src/framework/maker-cli/stubs/notification/controller.ts.stub +79 -0
  168. package/fastify/src/framework/maker-cli/stubs/notification/job.ts.stub +11 -0
  169. package/fastify/src/framework/maker-cli/stubs/notification/model.ts.stub +29 -0
  170. package/fastify/src/framework/maker-cli/stubs/notification/provider.ts.stub +174 -0
  171. package/fastify/src/framework/maker-cli/stubs/notification/route.api.ts.stub +71 -0
  172. package/fastify/src/framework/maker-cli/stubs/notification/route.plain.ts.stub +15 -0
  173. package/fastify/src/framework/maker-cli/stubs/notification/schema.plain.ts.stub +26 -0
  174. package/fastify/src/framework/maker-cli/stubs/notification/schema.ts.stub +26 -0
  175. package/fastify/src/framework/maker-cli/stubs/provider/module-barrel.ts.stub +19 -0
  176. package/fastify/src/framework/maker-cli/stubs/provider/module.ts.stub +21 -0
  177. package/fastify/src/framework/maker-cli/stubs/provider/name.ts.stub +21 -0
  178. package/fastify/src/framework/maker-cli/stubs/route/api.ts.stub +101 -0
  179. package/fastify/src/framework/maker-cli/stubs/route/plain.ts.stub +23 -0
  180. package/fastify/src/framework/maker-cli/stubs/route/standalone.api.ts.stub +120 -0
  181. package/fastify/src/framework/maker-cli/stubs/route/standalone.plain.ts.stub +50 -0
  182. package/fastify/src/framework/maker-cli/stubs/schedule/name.ts.stub +36 -0
  183. package/fastify/src/framework/maker-cli/stubs/schema/name.plain.ts.stub +14 -0
  184. package/fastify/src/framework/maker-cli/stubs/schema/name.ts.stub +33 -0
  185. package/fastify/src/framework/maker-cli/stubs/seeder/name.ts.stub +18 -0
  186. package/fastify/src/framework/maker-cli/stubs/seeder/standalone.ts.stub +22 -0
  187. package/fastify/src/framework/maker-cli/stubs/service/name.plain.ts.stub +67 -0
  188. package/fastify/src/framework/maker-cli/stubs/service/name.ts.stub +65 -0
  189. package/fastify/src/framework/maker-cli/stubs/test/unit.ts.stub +22 -0
  190. package/fastify/src/framework/maker-cli/stubs/type/name.ts.stub +22 -0
  191. package/fastify/src/framework/maker-cli/utils/env-config.mjs +44 -0
  192. package/fastify/src/framework/maker-cli/utils/env-db.mjs +61 -0
  193. package/fastify/src/framework/maker-cli/utils/file-ops.mjs +30 -0
  194. package/fastify/src/framework/maker-cli/utils/flags.mjs +14 -0
  195. package/fastify/src/framework/maker-cli/utils/help.mjs +379 -0
  196. package/fastify/src/framework/maker-cli/utils/naming.mjs +119 -0
  197. package/fastify/src/framework/maker-cli/utils/process.mjs +52 -0
  198. package/fastify/src/framework/maker-cli/utils/project-commands.mjs +201 -0
  199. package/fastify/src/framework/modules/discover.ts +57 -0
  200. package/fastify/src/framework/modules/routes.ts +31 -0
  201. package/fastify/src/framework/notification/channels/broadcast.ts +15 -0
  202. package/fastify/src/framework/notification/channels/mail.ts +42 -0
  203. package/fastify/src/framework/notification/contracts.ts +29 -0
  204. package/fastify/src/framework/notification/index.ts +59 -0
  205. package/fastify/src/framework/notification/registry.ts +15 -0
  206. package/fastify/src/framework/providers/adapter.ts +149 -0
  207. package/fastify/src/framework/providers/contracts.ts +126 -0
  208. package/fastify/src/framework/providers/loader.ts +105 -0
  209. package/fastify/src/framework/providers/registry.ts +88 -0
  210. package/fastify/src/framework/queue/clear.ts +22 -0
  211. package/fastify/src/framework/queue/queue.ts +401 -0
  212. package/fastify/src/framework/queue/ui.ts +194 -0
  213. package/fastify/src/framework/queue/worker.ts +61 -0
  214. package/fastify/src/framework/realtime/broadcast.ts +70 -0
  215. package/fastify/src/framework/realtime/index.ts +2 -0
  216. package/fastify/src/framework/realtime/socket-cookie.ts +72 -0
  217. package/fastify/src/framework/realtime/socket.ts +149 -0
  218. package/fastify/src/framework/realtime/types.ts +6 -0
  219. package/fastify/src/framework/realtime/ui.ts +16 -0
  220. package/fastify/src/framework/redis/client.ts +148 -0
  221. package/fastify/src/framework/runtime/runtime.ts +23 -0
  222. package/fastify/src/framework/runtime/server-adapter.ts +33 -0
  223. package/fastify/src/framework/scheduler/lock.ts +128 -0
  224. package/fastify/src/framework/scheduler/run.ts +48 -0
  225. package/fastify/src/framework/scheduler/scheduler.ts +155 -0
  226. package/fastify/src/framework/server.ts +162 -0
  227. package/fastify/src/framework/session/session.ts +160 -0
  228. package/fastify/src/framework/storage/storage.ts +744 -0
  229. package/fastify/src/framework/support/cookie.ts +71 -0
  230. package/fastify/src/framework/support/jwt.ts +33 -0
  231. package/fastify/src/framework/support/lifecycle.ts +35 -0
  232. package/fastify/src/framework/support/logger.ts +148 -0
  233. package/fastify/src/framework/support/mail.ts +56 -0
  234. package/fastify/src/framework/support/password.ts +23 -0
  235. package/fastify/src/framework/support/status-codes.ts +75 -0
  236. package/fastify/src/framework/support/upload.ts +181 -0
  237. package/fastify/src/framework/support/url.ts +41 -0
  238. package/fastify/src/middlewares/auth-middleware.ts +134 -0
  239. package/fastify/src/middlewares/role-middleware.ts +19 -0
  240. package/fastify/src/modules/auth/__tests__/forgetpass.test.ts +200 -0
  241. package/fastify/src/modules/auth/__tests__/login.test.ts +171 -0
  242. package/fastify/src/modules/auth/__tests__/logout.test.ts +60 -0
  243. package/fastify/src/modules/auth/__tests__/logoutalldevices.test.ts +49 -0
  244. package/fastify/src/modules/auth/__tests__/me.test.ts +91 -0
  245. package/fastify/src/modules/auth/__tests__/refreshtoken.test.ts +305 -0
  246. package/fastify/src/modules/auth/__tests__/register.test.ts +291 -0
  247. package/fastify/src/modules/auth/__tests__/resetpass.test.ts +206 -0
  248. package/fastify/src/modules/auth/__tests__/verifyemail.test.ts +183 -0
  249. package/fastify/src/modules/auth/controllers/auth.ts +252 -0
  250. package/fastify/src/modules/auth/controllers/role.ts +35 -0
  251. package/fastify/src/modules/auth/database/models/role.ts +14 -0
  252. package/fastify/src/modules/auth/database/models/user.ts +46 -0
  253. package/fastify/src/modules/auth/database/seeders/role.ts +18 -0
  254. package/fastify/src/modules/auth/database/seeders/user.ts +35 -0
  255. package/fastify/src/modules/auth/facade.ts +12 -0
  256. package/fastify/src/modules/auth/helpers/auth.ts +115 -0
  257. package/fastify/src/modules/auth/jobs/forgetpass.ts +20 -0
  258. package/fastify/src/modules/auth/jobs/registeruser.ts +23 -0
  259. package/fastify/src/modules/auth/jobs/verifyemail.ts +18 -0
  260. package/fastify/src/modules/auth/routes/index.ts +185 -0
  261. package/fastify/src/modules/auth/routes/role.ts +56 -0
  262. package/fastify/src/modules/auth/schemas/auth.ts +116 -0
  263. package/fastify/src/modules/auth/services/forgetpassword.ts +66 -0
  264. package/fastify/src/modules/auth/services/login.ts +63 -0
  265. package/fastify/src/modules/auth/services/logout.ts +25 -0
  266. package/fastify/src/modules/auth/services/logoutalldevices.ts +19 -0
  267. package/fastify/src/modules/auth/services/me.ts +31 -0
  268. package/fastify/src/modules/auth/services/refreshtoken.ts +110 -0
  269. package/fastify/src/modules/auth/services/register.ts +141 -0
  270. package/fastify/src/modules/auth/services/resetpassword.ts +69 -0
  271. package/fastify/src/modules/auth/services/verifyemail.ts +77 -0
  272. package/fastify/src/modules/auth/types/auth.ts +31 -0
  273. package/fastify/src/providers/README.md +107 -0
  274. package/fastify/src/providers/notification.ts +4 -0
  275. package/fastify/src/resources/index.html +17 -0
  276. package/fastify/src/resources/src/App.vue +5 -0
  277. package/fastify/src/resources/src/assets/css/styles.css +14761 -0
  278. package/fastify/src/resources/src/assets/css/styles.css.map +1 -0
  279. package/fastify/src/resources/src/assets/fonts/public-sans/public-sans-latin-ext.woff2 +0 -0
  280. package/fastify/src/resources/src/assets/fonts/public-sans/public-sans-latin.woff2 +0 -0
  281. package/fastify/src/resources/src/assets/images/favicon/favicon.ico +0 -0
  282. package/fastify/src/resources/src/assets/images/logo.png +0 -0
  283. package/fastify/src/resources/src/assets/scss/custom.css +217 -0
  284. package/fastify/src/resources/src/assets/scss/custom.css.map +1 -0
  285. package/fastify/src/resources/src/assets/scss/custom.scss +1346 -0
  286. package/fastify/src/resources/src/components/Button.vue +32 -0
  287. package/fastify/src/resources/src/components/Checkbox.vue +32 -0
  288. package/fastify/src/resources/src/components/Datepicker.vue +106 -0
  289. package/fastify/src/resources/src/components/FeatureButton.vue +53 -0
  290. package/fastify/src/resources/src/components/FloatButton.vue +33 -0
  291. package/fastify/src/resources/src/components/Href.vue +32 -0
  292. package/fastify/src/resources/src/components/Input.vue +243 -0
  293. package/fastify/src/resources/src/components/InputGroup.vue +147 -0
  294. package/fastify/src/resources/src/components/InputPasswordToggle.vue +229 -0
  295. package/fastify/src/resources/src/components/Modal.vue +71 -0
  296. package/fastify/src/resources/src/components/Pagebar.vue +26 -0
  297. package/fastify/src/resources/src/components/Refresh.vue +19 -0
  298. package/fastify/src/resources/src/components/Select.vue +384 -0
  299. package/fastify/src/resources/src/components/Spinner.vue +42 -0
  300. package/fastify/src/resources/src/components/Switch.vue +60 -0
  301. package/fastify/src/resources/src/components/TextArea.vue +117 -0
  302. package/fastify/src/resources/src/components/Toast.vue +56 -0
  303. package/fastify/src/resources/src/components/datatable/DataTableSkeleton.vue +98 -0
  304. package/fastify/src/resources/src/components/datatable/Pagination.vue +147 -0
  305. package/fastify/src/resources/src/components/datatable/SelectOpption.vue +64 -0
  306. package/fastify/src/resources/src/components/datatable/index.vue +199 -0
  307. package/fastify/src/resources/src/composables/useAuth.ts +52 -0
  308. package/fastify/src/resources/src/helpers/assets.ts +51 -0
  309. package/fastify/src/resources/src/helpers/nformatter.ts +10 -0
  310. package/fastify/src/resources/src/helpers/utils.ts +75 -0
  311. package/fastify/src/resources/src/layouts/AuthLayout.vue +20 -0
  312. package/fastify/src/resources/src/layouts/Layout/Footer.vue +23 -0
  313. package/fastify/src/resources/src/layouts/Layout/Header.vue +124 -0
  314. package/fastify/src/resources/src/layouts/Layout/Sidebar.vue +137 -0
  315. package/fastify/src/resources/src/layouts/Layout/index.vue +87 -0
  316. package/fastify/src/resources/src/main.ts +28 -0
  317. package/fastify/src/resources/src/pages/auth/forgetPassword.vue +76 -0
  318. package/fastify/src/resources/src/pages/auth/login.vue +96 -0
  319. package/fastify/src/resources/src/pages/auth/register.vue +129 -0
  320. package/fastify/src/resources/src/pages/auth/resetPassword.vue +110 -0
  321. package/fastify/src/resources/src/pages/auth/verifyEmail.vue +64 -0
  322. package/fastify/src/resources/src/pages/dashboard/index.vue +66 -0
  323. package/fastify/src/resources/src/plugins/axios.ts +31 -0
  324. package/fastify/src/resources/src/plugins/browserDetect.ts +55 -0
  325. package/fastify/src/resources/src/plugins/dialog.ts +216 -0
  326. package/fastify/src/resources/src/plugins/gum.ts +683 -0
  327. package/fastify/src/resources/src/plugins/pulse.ts +157 -0
  328. package/fastify/src/resources/src/plugins/routeProgress.ts +87 -0
  329. package/fastify/src/resources/src/router/index.ts +85 -0
  330. package/fastify/src/resources/src/stores/admin-ui.ts +148 -0
  331. package/fastify/src/resources/src/stores/auth.ts +187 -0
  332. package/fastify/src/resources/tsconfig.json +19 -0
  333. package/fastify/src/resources/vite.config.ts +64 -0
  334. package/fastify/src/storage/app/private/.gitkeep +0 -0
  335. package/fastify/src/storage/app/public/.gitkeep +0 -0
  336. package/fastify/src/storage/app/tmp/generated/.gitkeep +0 -0
  337. package/fastify/src/storage/database/nexwire.sqlite +0 -0
  338. package/fastify/src/storage/logs/.gitkeep +0 -0
  339. package/fastify/src/storage/logs/app.log +0 -0
  340. package/fastify/src/storage/logs/fatal.log +0 -0
  341. package/fastify/src/storage/tmp/.gitkeep +0 -0
  342. package/fastify/src/storage/trash/modules/.gitkeep +0 -0
  343. package/fastify/src/types/global.d.ts +32 -0
  344. package/fastify/tsconfig.json +19 -0
  345. package/fastify/vitest.config.ts +38 -0
  346. package/hono/.env +1 -1
  347. package/hono/package.json +1 -1
  348. package/hono/src/config/database.ts +48 -29
  349. package/hono/src/config/index.ts +83 -83
  350. package/hono/src/config/openapi.ts +6 -24
  351. package/hono/src/config/queue.ts +30 -30
  352. package/hono/src/config/validate.ts +50 -40
  353. package/hono/src/database/migrations/sqlite/0000_init.sql +47 -47
  354. package/hono/src/database/migrations/sqlite/meta/0000_snapshot.json +1 -1
  355. package/hono/src/database/migrations/sqlite/meta/_journal.json +1 -1
  356. package/hono/src/framework/cache/cache.ts +40 -8
  357. package/hono/src/framework/circuit-breaker/cb.ts +88 -60
  358. package/hono/src/framework/database/connection.ts +52 -27
  359. package/hono/src/framework/events/dispatcher.ts +61 -49
  360. package/hono/src/framework/facade.ts +39 -1
  361. package/hono/src/framework/http/logger.ts +86 -81
  362. package/hono/src/framework/http/openapi.ts +7 -9
  363. package/hono/src/framework/maker-cli/runtime/core.mjs +1 -2
  364. package/hono/src/framework/notification/channels/broadcast.ts +15 -0
  365. package/hono/src/framework/notification/channels/mail.ts +42 -0
  366. package/hono/src/framework/notification/contracts.ts +29 -0
  367. package/hono/src/framework/notification/index.ts +19 -94
  368. package/hono/src/framework/notification/registry.ts +15 -0
  369. package/hono/src/framework/providers/adapter.ts +27 -17
  370. package/hono/src/framework/queue/queue.ts +43 -44
  371. package/hono/src/framework/realtime/broadcast.ts +29 -5
  372. package/hono/src/framework/realtime/socket.ts +217 -196
  373. package/hono/src/framework/redis/client.ts +148 -151
  374. package/hono/src/framework/scheduler/lock.ts +128 -116
  375. package/hono/src/framework/server.ts +27 -29
  376. package/hono/src/framework/session/session.ts +62 -14
  377. package/hono/src/framework/storage/storage.ts +744 -785
  378. package/hono/src/framework/support/mail.ts +56 -48
  379. package/hono/src/middlewares/auth-middleware.ts +1 -2
  380. package/hono/src/middlewares/role-middleware.ts +3 -13
  381. package/hono/src/modules/auth/routes/index.ts +1 -2
  382. package/hono/src/providers/notification.ts +4 -0
  383. package/hono/src/resources/src/components/Switch.vue +60 -65
  384. package/hono/src/resources/src/layouts/Layout/Header.vue +124 -105
  385. package/hono/src/resources/src/pages/auth/forgetPassword.vue +23 -29
  386. package/hono/src/resources/src/pages/auth/login.vue +26 -29
  387. package/hono/src/resources/src/pages/auth/register.vue +36 -40
  388. package/hono/src/resources/src/pages/auth/resetPassword.vue +29 -37
  389. package/hono/src/resources/src/pages/auth/verifyEmail.vue +15 -19
  390. package/hono/src/resources/src/plugins/gum.ts +519 -203
  391. package/hono/src/resources/src/plugins/pulse.ts +157 -147
  392. package/hono/src/resources/src/stores/auth.ts +9 -6
  393. package/hono/src/resources/vite.config.ts +54 -43
  394. package/hono/src/storage/database/nexwire.sqlite +0 -0
  395. package/hono/src/storage/logs/app.log +0 -0
  396. package/hono/src/storage/logs/fatal.log +0 -0
  397. package/hono/src/types/global.d.ts +32 -26
  398. package/package.json +4 -3
  399. package/src/index.js +143 -15
@@ -0,0 +1,37 @@
1
+ {
2
+ "editor.defaultFormatter": "biomejs.biome",
3
+ "[typescript]": {
4
+ "editor.defaultFormatter": "biomejs.biome"
5
+ },
6
+ "[typescriptreact]": {
7
+ "editor.defaultFormatter": "biomejs.biome"
8
+ },
9
+ "[javascript]": {
10
+ "editor.defaultFormatter": "biomejs.biome"
11
+ },
12
+ "[javascriptreact]": {
13
+ "editor.defaultFormatter": "biomejs.biome"
14
+ },
15
+ "[json]": {
16
+ "editor.defaultFormatter": "biomejs.biome"
17
+ },
18
+ "[jsonc]": {
19
+ "editor.defaultFormatter": "biomejs.biome"
20
+ },
21
+ "[vue]": {
22
+ "editor.defaultFormatter": "biomejs.biome"
23
+ },
24
+ "[css]": {
25
+ "editor.defaultFormatter": "biomejs.biome"
26
+ },
27
+ "[scss]": {
28
+ "editor.defaultFormatter": "biomejs.biome"
29
+ },
30
+ "editor.codeActionsOnSave": {
31
+ "source.organizeImports.biome": "explicit",
32
+ "source.fixAll.biome": "explicit"
33
+ },
34
+ "files.eol": "\n",
35
+ "files.trimTrailingWhitespace": true,
36
+ "files.insertFinalNewline": true
37
+ }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 - present, niYam
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,232 @@
1
+ <p align="center">
2
+ <a href="https://github.com/niyamulahsan/nexwire">
3
+ <img alt="nexwire" src="https://raw.githubusercontent.com/niyamulahsan/nexwire/main/logo-favicon/nexwire.png" width="300">
4
+ </a>
5
+ </p>
6
+
7
+ <h3 align="center">Full-stack TypeScript framework for modern web applications</h3>
8
+
9
+ <p align="center">
10
+ <a href="https://niyamulahsan.github.io/nexwire"><img src="https://img.shields.io/badge/docs%20%7C%20nexwire-3b8eed" alt="Documentation"></a>
11
+ <a href="https://www.npmjs.com/package/create-nexwire"><img src="https://img.shields.io/npm/v/create-nexwire" alt="npm version"></a>
12
+ <a href="https://www.npmjs.com/package/create-nexwire"><img src="https://img.shields.io/npm/dt/create-nexwire" alt="npm downloads"></a>
13
+ <a href="https://github.com/niyamulahsan/nexwire/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green" alt="MIT License"></a>
14
+ <a href="https://github.com/niyamulahsan/nexwire"><img src="https://img.shields.io/github/stars/niyamulahsan/nexwire?style=social" alt="GitHub Stars"></a>
15
+ </p>
16
+
17
+ ---
18
+
19
+ nexwire is a batteries-included TypeScript framework that combines modular backends (Hono, Express, Fastify) with Drizzle ORM, BullMQ, Socket.IO, Redis, and a Vue 3 SPA frontend — all scaffolded with a single command and deployed with Docker Compose.
20
+
21
+ ## Quick Start
22
+
23
+ ### Hono (default)
24
+
25
+ ```bash
26
+ npm create nexwire@latest my-app
27
+ cd my-app
28
+ npm install
29
+ npm run maker db:migrate --seed
30
+ npm run maker dev
31
+ ```
32
+
33
+ ### Express
34
+
35
+ ```bash
36
+ npm create nexwire@latest my-app -- --engine=express
37
+ cd my-app
38
+ npm install
39
+ npm run maker db:migrate --seed
40
+ npm run maker dev
41
+ ```
42
+
43
+ ### Fastify
44
+
45
+ ```bash
46
+ npm create nexwire@latest my-app -- --engine=fastify
47
+ cd my-app
48
+ npm install
49
+ npm run maker db:migrate --seed
50
+ npm run maker dev
51
+ ```
52
+
53
+ Your API is live at `http://localhost:3000`, Scalar docs at `/api-docs`, and the Vue frontend at `http://localhost:5173`.
54
+
55
+ Requires **Node.js >= 22.12**. Hono and Express also support **Bun >= 1.3**; Fastify is Node-only.
56
+
57
+ ### Current directory
58
+
59
+ Scaffold directly into the current directory:
60
+
61
+ ```bash
62
+ npm create nexwire@latest .
63
+ npm create nexwire@latest . -- --engine=express
64
+ npm create nexwire@latest . -- --engine=fastify
65
+ ```
66
+
67
+ Works with any package manager: `pnpm`, `yarn`, or `bun`.
68
+
69
+ ### Package Manager
70
+
71
+ All examples use `npm` as the default. nexwire works with any major package manager:
72
+
73
+ | Manager | Create project | Run commands |
74
+ | -------- | ----------------------------------- | --------------------- |
75
+ | **npm** | `npm create nexwire@latest my-app` | `npm run maker <cmd>` |
76
+ | **pnpm** | `pnpm create nexwire@latest my-app` | `pnpm maker <cmd>` |
77
+ | **yarn** | `yarn create nexwire@latest my-app` | `yarn maker <cmd>` |
78
+ | **bun** | `bun create nexwire@latest my-app` | `bun maker <cmd>` |
79
+ | **all** | `npm create nexwire@latest .` | current directory |
80
+
81
+ ### Runtime
82
+
83
+ nexwire runs on **Node.js** or **Bun** — pick whichever fits your deployment:
84
+
85
+ | Runtime | Minimum version | Notes |
86
+ | ----------- | --------------- | --------------------------------------------------------------------- |
87
+ | **Node.js** | `>= 22.12` | Default. Uses `node` in Dockerfile. Required by Fastify. |
88
+ | **Bun** | `>= 1.3` | Hono and Express only. Pass `--runtime=bun` to deploy:init. |
89
+
90
+ ::: tip
91
+ The Fastify template is **Node-only** and does not include Bun support.
92
+ :::
93
+
94
+ ## Features
95
+
96
+ | Category | What you get |
97
+ | ------------------- | -------------------------------------------------------------------------------------- |
98
+ | **API** | Hono/Express/Fastify HTTP server with Zod validation, OpenAPI/Scalar docs, CORS, rate limiting |
99
+ | **Database** | Drizzle ORM — SQLite, MySQL, or PostgreSQL. Auto-detected from `DATABASE_URL`. |
100
+ | **Auth** | JWT access + refresh token rotation, signed httpOnly cookies, role middleware |
101
+ | **Queue** | BullMQ background jobs with `shouldQueue` decorator and Bull Board dashboard |
102
+ | **Realtime** | Socket.IO with auto room joining (user, role, auth) and broadcast events |
103
+ | **Cache & Session** | Redis-backed with graceful fallback when Redis is disabled |
104
+ | **Scheduler** | Cron-based task scheduling with distributed Redis lock |
105
+ | **Storage** | Local disk or S3-compatible (AWS S3, R2, MinIO, DigitalOcean Spaces) |
106
+ | **Notifications** | Database-persisted notifications with broadcast + mail delivery |
107
+ | **Frontend** | Vue 3 SPA — Vite, Pinia, Vue Router, Bootstrap 5, real-time Pulse plugin |
108
+ | **Security** | CSP, HSTS, X-Frame headers — configured in one place, toggled per environment |
109
+ | **Reliability** | Circuit breakers for Redis, mail, and S3 with auto-fallback; startup config validation |
110
+ | **CLI** | `maker` command for code generation, migrations, runtime, and deploy |
111
+ | **Deploy** | Two-layer Docker Compose — nginx-proxy, auto SSL, supervisor |
112
+
113
+ ## Architecture
114
+
115
+ ```
116
+ src/
117
+ ├── env.ts # Zod-validated environment config
118
+ ├── database/ # Drizzle schema, migrations, seeders
119
+ ├── framework/ # Reusable engine (HTTP, auth, queue, cache, etc.)
120
+ ├── modules/ # Application modules (auto-discovered)
121
+ ├── middlewares/ # Auth & role guards
122
+ ├── resources/ # Vue 3 SPA frontend
123
+ └── storage/ # Uploaded files & logs
124
+ ```
125
+
126
+ ### Modules
127
+
128
+ Every feature is a self-contained module under `src/modules/<name>/`:
129
+
130
+ ```
131
+ src/modules/posts/
132
+ ├── __tests__/ # Unit tests
133
+ ├── console/ # CLI commands & scheduled tasks
134
+ ├── controllers/ # Request handlers
135
+ ├── database/
136
+ │ ├── models/ # Drizzle table definitions
137
+ │ └── seeders/ # Test data
138
+ ├── helpers/ # Pure functions — no I/O
139
+ ├── jobs/ # BullMQ queue handlers
140
+ ├── middlewares/ # Module-local middleware
141
+ ├── routes/ # HTTP route definitions (auto-discovered)
142
+ ├── schemas/ # Zod validation schemas
143
+ ├── services/ # Business logic — DB, files, network
144
+ ├── types/ # Shared TypeScript types
145
+ └── facade.ts # Public API for other modules
146
+ ```
147
+
148
+ Modules are **auto-discovered** — no manual registration. Create one with:
149
+
150
+ ```bash
151
+ npm run maker module:make blog
152
+ npm run maker module:make-controller blog post
153
+ npm run maker module:make-route blog post
154
+ npm run maker module:make-model blog post
155
+ ```
156
+
157
+ ### Framework Facade
158
+
159
+ Access all subsystems through a single import:
160
+
161
+ ```ts
162
+ import {
163
+ db,
164
+ cache,
165
+ session,
166
+ queue,
167
+ dispatchEvent,
168
+ notify,
169
+ storage,
170
+ jwt,
171
+ mail,
172
+ password,
173
+ urls,
174
+ logger,
175
+ } from "@/framework/facade.js";
176
+ ```
177
+
178
+ ## CLI Reference
179
+
180
+ | Command | Description |
181
+ | ------------------------------ | ---------------------------------------------- |
182
+ | `maker dev` | Start API server + frontend HMR + queue worker |
183
+ | `maker serve [--prod]` | API server (dev or production) |
184
+ | `maker queue:work` | BullMQ worker process |
185
+ | `maker schedule:work` | Cron scheduler |
186
+ | `maker db:migrate --seed` | Run migrations + seeders |
187
+ | `maker db:fresh` | Drop all tables, re-migrate, re-seed |
188
+ | `maker module:make <name>` | Scaffold a new module |
189
+ | `maker deploy:init` | Generate Docker deploy scaffolding |
190
+ | `maker deploy:workflow` | Local deploy (Docker Desktop) |
191
+ | `maker deploy:workflow:remote` | Remote deploy via SSH + rsync |
192
+
193
+ ## Deployment
194
+
195
+ nexwire includes a complete Docker deployment system out of the box.
196
+
197
+ ### Local (Docker Desktop)
198
+
199
+ ```bash
200
+ npm run maker deploy:init # Generate deploy files (one-time)
201
+ npm run maker deploy:workflow # Build and start everything
202
+ ```
203
+
204
+ ### Remote (VPS / Cloud)
205
+
206
+ ```bash
207
+ npm run maker deploy:init # Generate files
208
+ # Edit deploy/workflow.remote.json with your SSH details
209
+ npm run maker deploy:workflow:remote # Deploy to server
210
+ ```
211
+
212
+ The deploy system provisions:
213
+
214
+ - **Multi-stage Dockerfile** — builder (install + build) → runner (minimal production image)
215
+ - **Shared infrastructure** — nginx-proxy, MySQL/PostgreSQL, Redis, phpMyAdmin, pgAdmin
216
+ - **Auto SSL** — Let's Encrypt via nginx-proxy companion
217
+ - **Process supervisor** — API server, queue worker, cron scheduler, auto-migration
218
+ - **Two-layer architecture** — server infra runs once per host, app stack rebuilds per deploy
219
+
220
+ See the [deploy documentation](https://niyamulahsan.github.io/nexwire/deploy/overview) for full details.
221
+
222
+ ## Documentation
223
+
224
+ Complete documentation is available at **[Documentation](https://niyamulahsan.github.io/nexwire)**
225
+
226
+ ## Contributing
227
+
228
+ Contributions are welcome. Open an issue or pull request on [GitHub](https://github.com/niyamulahsan/nexwire).
229
+
230
+ ## License
231
+
232
+ nexwire is open-sourced software licensed under the [MIT license](LICENSE).
@@ -0,0 +1,99 @@
1
+ {
2
+ "$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
3
+ "vcs": {
4
+ "enabled": true,
5
+ "clientKind": "git",
6
+ "useIgnoreFile": true
7
+ },
8
+ "html": {
9
+ "experimentalFullSupportEnabled": true,
10
+ "formatter": {
11
+ "enabled": true
12
+ }
13
+ },
14
+ "formatter": {
15
+ "indentStyle": "space",
16
+ "indentWidth": 2,
17
+ "lineWidth": 140,
18
+ "bracketSameLine": false
19
+ },
20
+ "files": {
21
+ "includes": [
22
+ "**",
23
+ "!**/node_modules"
24
+ ]
25
+ },
26
+ "linter": {
27
+ "rules": {
28
+ "preset": "recommended",
29
+ "a11y": {
30
+ "noLabelWithoutControl": "off",
31
+ "useButtonType": "off",
32
+ "useSemanticElements": "off",
33
+ "noStaticElementInteractions": "off",
34
+ "useKeyWithClickEvents": "off",
35
+ "useValidAnchor": "off",
36
+ "useAnchorContent": "off",
37
+ "noDistractingElements": "off"
38
+ },
39
+ "correctness": {
40
+ "noUnusedVariables": "off",
41
+ "useVueValidTemplateRoot": "off",
42
+ "noUnusedImports": "off"
43
+ },
44
+ "complexity": {
45
+ "noUselessEscapeInRegex": "off",
46
+ "noImportantStyles": "off"
47
+ },
48
+ "style": {
49
+ "noNonNullAssertion": "off",
50
+ "useVueMultiWordComponentNames": "off",
51
+ "useImportType": "off"
52
+ },
53
+ "suspicious": {
54
+ "noEmptyBlockStatements": "off",
55
+ "noExplicitAny": "off",
56
+ "noRedeclare": "off",
57
+ "noAssignInExpressions": "off",
58
+ "useIterableCallbackReturn": "off"
59
+ }
60
+ }
61
+ },
62
+ "javascript": {
63
+ "formatter": {
64
+ "quoteStyle": "double",
65
+ "semicolons": "always",
66
+ "trailingCommas": "none"
67
+ }
68
+ },
69
+ "overrides": [
70
+ {
71
+ "includes": [
72
+ "**/*.{js,mjs,cjs,ts,tsx,vue}"
73
+ ],
74
+ "javascript": {
75
+ "globals": [
76
+ "exports",
77
+ "location"
78
+ ]
79
+ }
80
+ }
81
+ ],
82
+ "assist": {
83
+ "actions": {
84
+ "source": {
85
+ "organizeImports": {
86
+ "level": "on",
87
+ "options": {
88
+ "groups": [
89
+ ":NODE:",
90
+ ":PACKAGE:",
91
+ ":ALIAS:",
92
+ ":PATH:"
93
+ ]
94
+ }
95
+ }
96
+ }
97
+ }
98
+ }
99
+ }
@@ -0,0 +1,25 @@
1
+ import { config } from "dotenv";
2
+ import { defineConfig } from "drizzle-kit";
3
+
4
+ config({ path: ".env" });
5
+
6
+ function sqlitePathFromUrl(url: string) {
7
+ if (url.startsWith("sqlite:///")) return url.replace("sqlite:///", "");
8
+ if (url.startsWith("sqlite://")) return url.replace("sqlite://", "");
9
+ if (url.startsWith("sqlite:")) return url.replace("sqlite:", "");
10
+ return url;
11
+ }
12
+
13
+ const databaseUrl = process.env.DATABASE_URL || "sqlite:./src/storage/database/nexwire.sqlite";
14
+ const dialect = databaseUrl.startsWith("mysql") ? "mysql" : databaseUrl.startsWith("postgres") ? "postgresql" : "sqlite";
15
+
16
+ export default defineConfig({
17
+ schema: process.env.DRIZZLE_SCHEMA || "./src/database/schema.ts",
18
+ out: `./src/database/migrations/${dialect}`,
19
+ dialect,
20
+ dbCredentials: databaseUrl.startsWith("mysql")
21
+ ? { url: databaseUrl }
22
+ : databaseUrl.startsWith("postgres")
23
+ ? { url: databaseUrl }
24
+ : { url: `file:${sqlitePathFromUrl(databaseUrl)}` }
25
+ });
@@ -0,0 +1,31 @@
1
+ .env
2
+ node_modules/
3
+ dist/
4
+
5
+ # Coverage reports - regenerated by `npm run test:coverage`, ~130 HTML files
6
+ coverage/
7
+
8
+ public/*
9
+ !public/.gitkeep
10
+
11
+ deploy/.env
12
+ deploy/server/.env
13
+
14
+ *.log
15
+ npm-debug.log*
16
+ yarn-debug.log*
17
+ yarn-error.log*
18
+ pnpm-debug.log*
19
+
20
+ .DS_Store
21
+ Thumbs.db
22
+
23
+ # Lock files — regenerated per developer's package manager
24
+ # bun.lockb is the binary format used by bun before 1.2; bun.lock is the
25
+ # current text format. Both are ignored, so upgrading bun cannot turn a
26
+ # developer's local install into an untracked file.
27
+ bun.lock
28
+ bun.lockb
29
+ package-lock.json
30
+ pnpm-lock.yaml
31
+ yarn.lock
@@ -0,0 +1,130 @@
1
+ {
2
+ "name": "nexwire-fastify",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "bin": {
6
+ "maker": "./src/framework/maker-cli/index.mjs"
7
+ },
8
+ "type": "module",
9
+ "scripts": {
10
+ "build": "npm run build:all",
11
+ "build:all": "npm run build:backend && npm run build:ui",
12
+ "build:backend": "tsc -p tsconfig.json && tsc-alias -p tsconfig.json",
13
+ "build:ui": "npm run typecheck:ui && node src/framework/maker-cli/runtime/build-ui.mjs",
14
+ "typecheck:ui": "vue-tsc --noEmit -p src/resources/tsconfig.json",
15
+ "dev": "node src/framework/maker-cli/index.mjs dev",
16
+ "backend": "node src/framework/maker-cli/index.mjs serve --src",
17
+ "ui": "node src/framework/maker-cli/index.mjs ui:dev",
18
+ "maildev:view": "node src/framework/maker-cli/index.mjs maildev:view",
19
+ "redis:view": "node src/framework/maker-cli/index.mjs redis:view",
20
+ "db:studio": "node src/framework/maker-cli/index.mjs db:studio",
21
+ "maker": "node src/framework/maker-cli/index.mjs",
22
+ "lint": "biome check .",
23
+ "lint:fix": "biome check --write .",
24
+ "format": "biome format --write .",
25
+ "format:check": "biome format .",
26
+ "test": "vitest",
27
+ "test:run": "vitest run",
28
+ "test:ui": "vitest --ui",
29
+ "test:coverage": "vitest run --coverage"
30
+ },
31
+ "dependencies": {
32
+ "@aws-sdk/client-s3": "^3.1111.0",
33
+ "@aws-sdk/s3-request-presigner": "^3.1111.0",
34
+ "@bull-board/api": "^9.10.5",
35
+ "@bull-board/fastify": "^9.11.0",
36
+ "@fastify/cookie": "^11.1.5",
37
+ "@fastify/cors": "^11.4.1",
38
+ "@fastify/multipart": "^10.1.8",
39
+ "@fastify/rate-limit": "^11.2.2",
40
+ "@fastify/static": "^10.1.10",
41
+ "@fastify/swagger": "^9.9.3",
42
+ "@libsql/client": "^0.17.4",
43
+ "@scalar/fastify-api-reference": "^1.77.0",
44
+ "@socket.io/admin-ui": "^0.5.1",
45
+ "@socket.io/redis-adapter": "^8.3.0",
46
+ "@unhead/vue": "^3.4.3",
47
+ "@vitejs/plugin-vue": "^6.0.10",
48
+ "@vuepic/vue-datepicker": "^14.0.0",
49
+ "@vueuse/core": "^14.4.0",
50
+ "axios": "^1.19.0",
51
+ "bcryptjs": "^3.0.3",
52
+ "bootstrap": "^5.3.8",
53
+ "bootstrap-icons": "^1.13.1",
54
+ "bullmq": "^5.81.3",
55
+ "bullmq-durable": "^0.2.0",
56
+ "chalk": "^5.6.2",
57
+ "commander": "^15.0.0",
58
+ "croner": "^10.0.1",
59
+ "dotenv": "^17.4.2",
60
+ "dotenv-expand": "^13.0.0",
61
+ "drizzle-orm": "^0.45.4",
62
+ "fastify": "^5.12.8",
63
+ "fastify-plugin": "^6.0.1",
64
+ "fastify-type-provider-zod": "^7.0.0",
65
+ "glob": "^13.0.6",
66
+ "ioredis": "^5.11.1",
67
+ "jsonwebtoken": "^9.0.2",
68
+ "lodash-es": "^4.18.1",
69
+ "luxon": "^3.7.2",
70
+ "maildev": "^2.2.1",
71
+ "mysql2": "^3.23.3",
72
+ "nodemailer": "^10.2.1",
73
+ "pinia": "^3.0.4",
74
+ "pino": "^10.3.1",
75
+ "postgres": "^3.4.9",
76
+ "redis-commander": "^0.9.0",
77
+ "sass": "^1.100.0",
78
+ "socket.io": "^4.8.4",
79
+ "socket.io-client": "^4.8.4",
80
+ "vite": "^8.3.5",
81
+ "vue": "^3.5.41",
82
+ "vue-router": "^5.2.0",
83
+ "vue-select": "^4.0.0-beta.6",
84
+ "zod": "^4.6.7"
85
+ },
86
+ "devDependencies": {
87
+ "@biomejs/biome": "^2.5.7",
88
+ "@types/bootstrap": "^5.2.11",
89
+ "@types/jsonwebtoken": "^9.0.7",
90
+ "@types/lodash-es": "^4.17.12",
91
+ "@types/node": "^25.9.9",
92
+ "@vitest/coverage-v8": "^5.0.5",
93
+ "drizzle-kit": "^0.31.11",
94
+ "tsc-alias": "^1.9.9",
95
+ "tsx": "^4.23.15",
96
+ "typescript": "^6.0.3",
97
+ "vitest": "^5.0.5",
98
+ "vue-tsc": "^3.3.13"
99
+ },
100
+ "overrides": {
101
+ "@esbuild-kit/core-utils": {
102
+ "esbuild": "^0.25.12"
103
+ },
104
+ "@maildev/mcp": {
105
+ "zod": "^4.6.7"
106
+ },
107
+ "@maildev/smtp": {
108
+ "jsdom": "^27.4.0",
109
+ "nodemailer": "^10.2.1"
110
+ },
111
+ "redis-commander": {
112
+ "express": "^4.22.3",
113
+ "body-parser": "^1.20.9",
114
+ "bcrypt": "npm:bcryptjs@^3.0.3",
115
+ "bcryptjs": "^3.0.3"
116
+ }
117
+ },
118
+ "engines": {
119
+ "node": ">=22.12.0",
120
+ "pnpm": ">=11",
121
+ "yarn": ">=4"
122
+ },
123
+ "allowScripts": {
124
+ "@parcel/watcher": true,
125
+ "esbuild": true,
126
+ "msgpackr-extract": true,
127
+ "redis-commander": true,
128
+ "vue-demi": true
129
+ }
130
+ }
File without changes
@@ -0,0 +1,41 @@
1
+ import { env } from "@/env.js";
2
+
3
+ /**
4
+ * Why: Central, code-visible application identity and runtime settings.
5
+ * When: Server boot, route metadata, OpenAPI titles, and URL resolution.
6
+ * Where: src/config/app.ts.
7
+ * How: App-related values intentionally stay in .env so each deployment can
8
+ * set them without touching code. Feature toggles (openApi, ui)
9
+ * are plain literals you can flip here.
10
+ */
11
+ export const appConfig = {
12
+ name: env.APP_NAME,
13
+ environment: env.APP_ENV,
14
+ port: env.APP_PORT,
15
+ url: env.APP_URL,
16
+ /**
17
+ * frontendUrl
18
+ * Why: Tells the API where the SPA/UI lives when it is NOT served from
19
+ * the API's own origin.
20
+ * When: Only set this when the UI runs on a different domain or port
21
+ * than the API. Leave empty when the API serves the built SPA itself.
22
+ * How: Socket.IO adds it to the allowed CORS origins, and auth/session
23
+ * cookies switch to SameSite=None + Secure when this origin differs
24
+ * from appConfig.url (cross-site cookie handling).
25
+ */
26
+ frontendUrl: env.FRONTEND_URL,
27
+ openApiEnabled: env.OPEN_API,
28
+ /**
29
+ * uiEnabled
30
+ * Why: API-only switch. When false the API never serves the UI build:
31
+ * the public dir is not prepared and the `/*` static + SPA-index
32
+ * middlewares are not mounted — use this for pure API deployments.
33
+ * When: Set UI=false in .env for API-only mode; keep true when the API
34
+ * should serve the built SPA.
35
+ * How: kernel.ts gates ensurePublicDir() and the static/SPA middlewares;
36
+ * server.ts logs the enabled/disabled status.
37
+ */
38
+ uiEnabled: env.UI
39
+ };
40
+
41
+ export type AppConfig = typeof appConfig;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Why: Account/authentication policy settings.
3
+ * When: Register, login, and email verification flows.
4
+ * Where: src/config/auth.ts.
5
+ * How: Plain literals. `requireEmailVerification` adds a verify-email step
6
+ * before a new account can log in.
7
+ */
8
+ export const authConfig = {
9
+ requireEmailVerification: false
10
+ };
11
+
12
+ export type AuthConfig = typeof authConfig;
@@ -0,0 +1,16 @@
1
+ import { redisConfig } from "./redis.js";
2
+
3
+ /**
4
+ * Why: Redis cache TTL defaults and key namespace.
5
+ * When: Cache helpers store values with an implicit expiry.
6
+ * Where: src/config/cache.ts.
7
+ * How: `ttlSeconds` is a plain literal; `keyPrefix` is derived from the
8
+ * shared `REDIS_PREFIX` so cache keys stay in one namespace
9
+ * (`nexwire:cache:*` by default).
10
+ */
11
+ export const cacheConfig = {
12
+ ttlSeconds: 3600,
13
+ keyPrefix: `${redisConfig.prefix}:cache`
14
+ };
15
+
16
+ export type CacheConfig = typeof cacheConfig;
@@ -0,0 +1,15 @@
1
+ import { env } from "@/env.js";
2
+
3
+ /**
4
+ * Why: Auth/session cookie naming and signing.
5
+ * When: Setting, reading, and clearing signed auth cookies.
6
+ * Where: src/config/cookie.ts.
7
+ * How: `name` is a plain literal you can change here. `secret` is
8
+ * confidential and stays in .env (`COOKIE_SECRET`).
9
+ */
10
+ export const cookieConfig = {
11
+ name: "nexwire",
12
+ secret: env.COOKIE_SECRET
13
+ };
14
+
15
+ export type CookieConfig = typeof cookieConfig;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Why: CORS policy for the HTTP server.
3
+ * When: Global CORS middleware processes cross-origin requests.
4
+ * Where: src/config/cors.ts.
5
+ * How: `origin` accepts `"*"` for any origin or a comma-separated allow-list.
6
+ * `"*"` reflects the request origin (required for credentialed requests).
7
+ */
8
+ export const corsConfig = {
9
+ origin: "*"
10
+ };
11
+
12
+ export type CorsConfig = typeof corsConfig;