wexts 3.0.1 → 4.0.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 (276) hide show
  1. package/README.md +49 -346
  2. package/bin/wexts.cjs +2 -0
  3. package/dist/chunk-2KAQYLVN.js +0 -0
  4. package/dist/chunk-2KAQYLVN.js.map +1 -1
  5. package/dist/{chunk-O42L6HOX.js → chunk-2LJVUMXW.js} +79 -93
  6. package/dist/chunk-2LJVUMXW.js.map +1 -0
  7. package/dist/chunk-7QKLIVRF.js +94 -0
  8. package/dist/chunk-7QKLIVRF.js.map +1 -0
  9. package/dist/{chunk-FCEZDH42.mjs → chunk-7WULUGLH.mjs} +5 -3
  10. package/dist/chunk-7WULUGLH.mjs.map +1 -0
  11. package/dist/{chunk-WF65EDRZ.js → chunk-BG56B4DE.js} +20 -2
  12. package/dist/chunk-BG56B4DE.js.map +1 -0
  13. package/dist/chunk-CLM5PNSG.mjs +496 -0
  14. package/dist/chunk-CLM5PNSG.mjs.map +1 -0
  15. package/dist/chunk-DNLGCKTT.js +31 -0
  16. package/dist/chunk-DNLGCKTT.js.map +1 -0
  17. package/dist/{chunk-VNNVLQLJ.mjs → chunk-JHOVXH3X.mjs} +2 -2
  18. package/dist/chunk-JHOVXH3X.mjs.map +1 -0
  19. package/dist/chunk-MXINIFPC.js +105 -0
  20. package/dist/chunk-MXINIFPC.js.map +1 -0
  21. package/dist/chunk-SE32ZPOZ.js +496 -0
  22. package/dist/chunk-SE32ZPOZ.js.map +1 -0
  23. package/dist/{chunk-STTOPUZ2.mjs → chunk-UAL54DVV.mjs} +21 -3
  24. package/dist/chunk-UAL54DVV.mjs.map +1 -0
  25. package/dist/{chunk-3OM7CHCA.js → chunk-WCKSKU3C.js} +1 -1
  26. package/dist/chunk-WCKSKU3C.js.map +1 -0
  27. package/dist/chunk-WU6FW77M.mjs +105 -0
  28. package/dist/chunk-WU6FW77M.mjs.map +1 -0
  29. package/dist/chunk-XE4OXN2W.js +0 -0
  30. package/dist/chunk-XE4OXN2W.js.map +1 -1
  31. package/dist/chunk-YBM3IJEA.mjs +94 -0
  32. package/dist/chunk-YBM3IJEA.mjs.map +1 -0
  33. package/dist/{chunk-KXYLEUSW.mjs → chunk-YN6WIWNQ.mjs} +69 -83
  34. package/dist/chunk-YN6WIWNQ.mjs.map +1 -0
  35. package/dist/chunk-YSLEF5C5.mjs +0 -0
  36. package/dist/chunk-YSLEF5C5.mjs.map +0 -0
  37. package/dist/chunk-ZX7QIN24.mjs +31 -0
  38. package/dist/chunk-ZX7QIN24.mjs.map +1 -0
  39. package/dist/cli/index.d.mts +10 -0
  40. package/dist/cli/index.d.ts +10 -0
  41. package/dist/cli/index.js +292 -292
  42. package/dist/cli/index.js.map +1 -1
  43. package/dist/cli/index.mjs +294 -293
  44. package/dist/cli/index.mjs.map +1 -1
  45. package/dist/client/index.d.mts +10 -1
  46. package/dist/client/index.d.ts +10 -1
  47. package/dist/client/index.js +4 -2
  48. package/dist/client/index.js.map +1 -1
  49. package/dist/client/index.mjs +6 -4
  50. package/dist/client/index.mjs.map +0 -0
  51. package/dist/codegen/index.d.mts +2 -1
  52. package/dist/codegen/index.d.ts +2 -1
  53. package/dist/codegen/index.js +5 -3
  54. package/dist/codegen/index.js.map +1 -1
  55. package/dist/codegen/index.mjs +7 -5
  56. package/dist/codegen/index.mjs.map +0 -0
  57. package/dist/decorators-BT1FFqN0.d.mts +29 -0
  58. package/dist/decorators-DvS58PqC.d.ts +29 -0
  59. package/dist/dev-server/index.d.mts +1 -1
  60. package/dist/dev-server/index.d.ts +1 -1
  61. package/dist/dev-server/index.js +3 -3
  62. package/dist/dev-server/index.js.map +1 -1
  63. package/dist/dev-server/index.mjs +3 -3
  64. package/dist/dev-server/index.mjs.map +0 -0
  65. package/dist/{index-SjUaHgFr.d.ts → index-7QeQEf37.d.ts} +27 -10
  66. package/dist/{index-tFGPFVfQ.d.mts → index-7RvU-jGE.d.mts} +0 -1
  67. package/dist/{index-tFGPFVfQ.d.ts → index-7RvU-jGE.d.ts} +0 -1
  68. package/dist/{index-SjUaHgFr.d.mts → index-8nzxy0NN.d.mts} +27 -10
  69. package/dist/index-Co5ZsLqq.d.ts +58 -0
  70. package/dist/index-D94W1__r.d.mts +58 -0
  71. package/dist/index-DQmyVp6F.d.mts +27 -0
  72. package/dist/index-KL_1BrQb.d.ts +27 -0
  73. package/dist/index.d.mts +17 -6
  74. package/dist/index.d.ts +17 -6
  75. package/dist/index.js +57 -30
  76. package/dist/index.js.map +1 -1
  77. package/dist/index.mjs +48 -21
  78. package/dist/index.mjs.map +1 -1
  79. package/dist/nest/index.d.mts +3 -1
  80. package/dist/nest/index.d.ts +3 -1
  81. package/dist/nest/index.js +20 -2
  82. package/dist/nest/index.js.map +1 -1
  83. package/dist/nest/index.mjs +21 -3
  84. package/dist/nest/index.mjs.map +0 -0
  85. package/dist/next/index.d.mts +7 -2
  86. package/dist/next/index.d.ts +7 -2
  87. package/dist/next/index.js +72 -5
  88. package/dist/next/index.js.map +1 -1
  89. package/dist/next/index.mjs +70 -4
  90. package/dist/next/index.mjs.map +1 -1
  91. package/dist/rpc/index.d.mts +2 -0
  92. package/dist/rpc/index.d.ts +2 -0
  93. package/dist/rpc/index.js +23 -0
  94. package/dist/rpc/index.js.map +1 -0
  95. package/dist/rpc/index.mjs +23 -0
  96. package/dist/{chunk-7NSRDJ5C.mjs.map → rpc/index.mjs.map} +0 -0
  97. package/dist/runtime/index.d.mts +55 -0
  98. package/dist/runtime/index.d.ts +55 -0
  99. package/dist/runtime/index.js +213 -0
  100. package/dist/runtime/index.js.map +1 -0
  101. package/dist/runtime/index.mjs +213 -0
  102. package/dist/runtime/index.mjs.map +1 -0
  103. package/dist/types/index.d.mts +0 -0
  104. package/dist/types/index.d.ts +0 -0
  105. package/dist/types/index.js +0 -0
  106. package/dist/types/index.js.map +1 -1
  107. package/dist/types/index.mjs +1 -1
  108. package/dist/types/index.mjs.map +0 -0
  109. package/dist/types-7d_fC-C3.d.mts +32 -0
  110. package/dist/types-7d_fC-C3.d.ts +32 -0
  111. package/dist/vercel-builder/index.d.mts +58 -0
  112. package/dist/vercel-builder/index.d.ts +58 -0
  113. package/dist/vercel-builder/index.js +330 -0
  114. package/dist/vercel-builder/index.js.map +1 -0
  115. package/dist/vercel-builder/index.mjs +330 -0
  116. package/dist/vercel-builder/index.mjs.map +1 -0
  117. package/package.json +37 -16
  118. package/templates/.dockerignore +43 -43
  119. package/templates/.env.example +0 -0
  120. package/templates/Dockerfile +60 -60
  121. package/templates/Procfile +1 -1
  122. package/templates/README.md +67 -58
  123. package/templates/api-sdk.ts +115 -115
  124. package/templates/docker-compose.yml +34 -34
  125. package/templates/nestjs-api/.env.example +0 -0
  126. package/templates/nestjs-api/README.md +87 -79
  127. package/templates/nestjs-api/nest-cli.json +6 -6
  128. package/templates/nestjs-api/package-lock.json +5623 -5623
  129. package/templates/nestjs-api/package.json +40 -40
  130. package/templates/nestjs-api/prisma/dev.db +0 -0
  131. package/templates/nestjs-api/prisma/migrations/20251123205437_init/migration.sql +0 -0
  132. package/templates/nestjs-api/prisma/migrations/migration_lock.toml +0 -0
  133. package/templates/nestjs-api/prisma/schema.prisma +29 -29
  134. package/templates/nestjs-api/src/app.module.ts +17 -17
  135. package/templates/nestjs-api/src/auth/auth.controller.ts +27 -27
  136. package/templates/nestjs-api/src/auth/auth.module.ts +37 -29
  137. package/templates/nestjs-api/src/auth/auth.service.ts +86 -86
  138. package/templates/nestjs-api/src/auth/dto/auth.dto.ts +22 -22
  139. package/templates/nestjs-api/src/auth/guards/jwt-auth.guard.ts +5 -5
  140. package/templates/nestjs-api/src/auth/strategies/jwt.strategy.ts +27 -19
  141. package/templates/nestjs-api/src/main.ts +32 -32
  142. package/templates/nestjs-api/src/prisma/prisma.module.ts +9 -9
  143. package/templates/nestjs-api/src/prisma/prisma.service.ts +14 -14
  144. package/templates/nestjs-api/src/todos/dto/todo.dto.ts +24 -24
  145. package/templates/nestjs-api/src/todos/todos.controller.ts +39 -39
  146. package/templates/nestjs-api/src/todos/todos.module.ts +11 -11
  147. package/templates/nestjs-api/src/todos/todos.service.ts +53 -53
  148. package/templates/nestjs-api/src/users/users.controller.ts +14 -14
  149. package/templates/nestjs-api/src/users/users.module.ts +12 -12
  150. package/templates/nestjs-api/src/users/users.service.ts +19 -19
  151. package/templates/nestjs-api/tsconfig.json +39 -39
  152. package/templates/nextjs-web/README.md +76 -68
  153. package/templates/nextjs-web/app/actions/auth.ts +108 -108
  154. package/templates/nextjs-web/app/dashboard/error.tsx +39 -39
  155. package/templates/nextjs-web/app/dashboard/loading.tsx +14 -14
  156. package/templates/nextjs-web/app/dashboard/page.tsx +5 -5
  157. package/templates/nextjs-web/app/globals.css +93 -93
  158. package/templates/nextjs-web/app/layout.tsx +29 -29
  159. package/templates/nextjs-web/app/login/page.tsx +5 -5
  160. package/templates/nextjs-web/app/page.tsx +28 -28
  161. package/templates/nextjs-web/app/register/page.tsx +5 -5
  162. package/templates/nextjs-web/components/ui/button.tsx +56 -56
  163. package/templates/nextjs-web/components/ui/card.tsx +79 -79
  164. package/templates/nextjs-web/components/ui/input.tsx +25 -25
  165. package/templates/nextjs-web/components/ui/label.tsx +24 -24
  166. package/templates/nextjs-web/features/auth/LoginForm.tsx +140 -140
  167. package/templates/nextjs-web/features/auth/RegisterForm.tsx +159 -159
  168. package/templates/nextjs-web/features/auth/api.ts +35 -35
  169. package/templates/nextjs-web/features/auth/index.ts +3 -3
  170. package/templates/nextjs-web/features/dashboard/DashboardView.tsx +204 -204
  171. package/templates/nextjs-web/features/dashboard/api.ts +9 -9
  172. package/templates/nextjs-web/features/dashboard/components.tsx +74 -74
  173. package/templates/nextjs-web/features/dashboard/index.ts +3 -3
  174. package/templates/nextjs-web/hooks/index.ts +4 -4
  175. package/templates/nextjs-web/lib/api-client.ts +89 -89
  176. package/templates/nextjs-web/lib/api.ts +115 -115
  177. package/templates/nextjs-web/lib/axios-global-config.ts +17 -17
  178. package/templates/nextjs-web/lib/utils.ts +6 -6
  179. package/templates/nextjs-web/lib/wexts-client.ts +4 -4
  180. package/templates/nextjs-web/next-env.d.ts +6 -6
  181. package/templates/nextjs-web/next.config.ts +20 -20
  182. package/templates/nextjs-web/package-lock.json +3254 -3254
  183. package/templates/nextjs-web/package.json +37 -37
  184. package/templates/nextjs-web/postcss.config.js +6 -6
  185. package/templates/nextjs-web/tailwind.config.ts +69 -69
  186. package/templates/nextjs-web/tsconfig.json +1 -1
  187. package/templates/nixpacks.toml +11 -11
  188. package/templates/root-package.json +31 -31
  189. package/templates/server.ts +66 -66
  190. package/templates/tsconfig.json +30 -30
  191. package/dist/chunk-2MCBBWEA.js +0 -1
  192. package/dist/chunk-2MCBBWEA.js.map +0 -1
  193. package/dist/chunk-3OM7CHCA.js.map +0 -1
  194. package/dist/chunk-63MTCWU2.mjs +0 -361
  195. package/dist/chunk-63MTCWU2.mjs.map +0 -1
  196. package/dist/chunk-667BQCEM.js +0 -375
  197. package/dist/chunk-667BQCEM.js.map +0 -1
  198. package/dist/chunk-67IJ6H4J.mjs +0 -44
  199. package/dist/chunk-67IJ6H4J.mjs.map +0 -1
  200. package/dist/chunk-6SVQEGEX.mjs +0 -44
  201. package/dist/chunk-6SVQEGEX.mjs.map +0 -1
  202. package/dist/chunk-7NSRDJ5C.mjs +0 -1
  203. package/dist/chunk-ASDXAK6G.js +0 -44
  204. package/dist/chunk-ASDXAK6G.js.map +0 -1
  205. package/dist/chunk-CKZ4VSCB.mjs +0 -18
  206. package/dist/chunk-CKZ4VSCB.mjs.map +0 -1
  207. package/dist/chunk-DW6GOKMF.js +0 -57
  208. package/dist/chunk-DW6GOKMF.js.map +0 -1
  209. package/dist/chunk-EFZPSZWO.mjs +0 -1
  210. package/dist/chunk-EFZPSZWO.mjs.map +0 -1
  211. package/dist/chunk-FCEZDH42.mjs.map +0 -1
  212. package/dist/chunk-FYGXL4V7.js +0 -361
  213. package/dist/chunk-FYGXL4V7.js.map +0 -1
  214. package/dist/chunk-GKVPGKAH.js +0 -66
  215. package/dist/chunk-GKVPGKAH.js.map +0 -1
  216. package/dist/chunk-GWP6PNSP.js +0 -225
  217. package/dist/chunk-GWP6PNSP.js.map +0 -1
  218. package/dist/chunk-HQKTXE7E.mjs +0 -225
  219. package/dist/chunk-HQKTXE7E.mjs.map +0 -1
  220. package/dist/chunk-HSFLZUJN.mjs +0 -57
  221. package/dist/chunk-HSFLZUJN.mjs.map +0 -1
  222. package/dist/chunk-HU63F22V.js +0 -361
  223. package/dist/chunk-HU63F22V.js.map +0 -1
  224. package/dist/chunk-J5LGTIGS.mjs +0 -10
  225. package/dist/chunk-J5LGTIGS.mjs.map +0 -1
  226. package/dist/chunk-JMBD6DOP.js +0 -225
  227. package/dist/chunk-JMBD6DOP.js.map +0 -1
  228. package/dist/chunk-K7EIJSYQ.js +0 -1
  229. package/dist/chunk-K7EIJSYQ.js.map +0 -1
  230. package/dist/chunk-KXYLEUSW.mjs.map +0 -1
  231. package/dist/chunk-MTHKZO55.js +0 -44
  232. package/dist/chunk-MTHKZO55.js.map +0 -1
  233. package/dist/chunk-NNQFLD7O.mjs +0 -361
  234. package/dist/chunk-NNQFLD7O.mjs.map +0 -1
  235. package/dist/chunk-NU2UB242.js +0 -82
  236. package/dist/chunk-NU2UB242.js.map +0 -1
  237. package/dist/chunk-NULGSZFE.mjs +0 -57
  238. package/dist/chunk-NULGSZFE.mjs.map +0 -1
  239. package/dist/chunk-O42L6HOX.js.map +0 -1
  240. package/dist/chunk-ONXNE2A6.mjs +0 -375
  241. package/dist/chunk-ONXNE2A6.mjs.map +0 -1
  242. package/dist/chunk-OTBYRUBE.mjs +0 -225
  243. package/dist/chunk-OTBYRUBE.mjs.map +0 -1
  244. package/dist/chunk-OTSAVKLY.mjs +0 -66
  245. package/dist/chunk-OTSAVKLY.mjs.map +0 -1
  246. package/dist/chunk-PZ5AY32C.js +0 -10
  247. package/dist/chunk-PZ5AY32C.js.map +0 -1
  248. package/dist/chunk-QP2TMRLG.js +0 -57
  249. package/dist/chunk-QP2TMRLG.js.map +0 -1
  250. package/dist/chunk-RS23R3ZQ.mjs +0 -82
  251. package/dist/chunk-RS23R3ZQ.mjs.map +0 -1
  252. package/dist/chunk-STTOPUZ2.mjs.map +0 -1
  253. package/dist/chunk-VMT3LALB.mjs +0 -51
  254. package/dist/chunk-VMT3LALB.mjs.map +0 -1
  255. package/dist/chunk-VNNVLQLJ.mjs.map +0 -1
  256. package/dist/chunk-W3YRVEFQ.js +0 -66
  257. package/dist/chunk-W3YRVEFQ.js.map +0 -1
  258. package/dist/chunk-WF65EDRZ.js.map +0 -1
  259. package/dist/chunk-WMHVXEYQ.mjs +0 -66
  260. package/dist/chunk-WMHVXEYQ.mjs.map +0 -1
  261. package/dist/chunk-XVKTIYHY.js +0 -51
  262. package/dist/chunk-XVKTIYHY.js.map +0 -1
  263. package/dist/codegen-MRZDLCYI.js +0 -13
  264. package/dist/codegen-MRZDLCYI.js.map +0 -1
  265. package/dist/codegen-UI5HTMXE.mjs +0 -13
  266. package/dist/codegen-UI5HTMXE.mjs.map +0 -1
  267. package/dist/dev-server-JKRVBWPY.mjs +0 -13
  268. package/dist/dev-server-JKRVBWPY.mjs.map +0 -1
  269. package/dist/dev-server-TLL7UQMR.js +0 -13
  270. package/dist/dev-server-TLL7UQMR.js.map +0 -1
  271. package/dist/index-BsNaOUtH.d.mts +0 -44
  272. package/dist/index-BsNaOUtH.d.ts +0 -44
  273. package/dist/index-CrbXnXsO.d.ts +0 -62
  274. package/dist/index-kEbGExWM.d.mts +0 -62
  275. package/templates/nestjs-api/.env +0 -4
  276. package/templates/nextjs-web/.env +0 -1
@@ -1,60 +1,60 @@
1
- # Stage 1: Build
2
- FROM node:20-alpine AS builder
3
-
4
- # Install pnpm
5
- RUN npm install -g pnpm
6
-
7
- # Set working directory
8
- WORKDIR /app
9
-
10
- # Copy package files
11
- COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
12
- COPY apps/web/package.json ./apps/web/
13
- COPY apps/api/package.json ./apps/api/
14
-
15
- # Install dependencies
16
- RUN pnpm install --frozen-lockfile
17
-
18
- # Copy source code
19
- COPY . .
20
-
21
- # Generate Prisma Client
22
- RUN cd apps/api && npx prisma generate
23
-
24
- # Build all apps
25
- RUN pnpm run build
26
-
27
- # Stage 2: Production
28
- FROM node:20-alpine AS runner
29
-
30
- # Install pnpm
31
- RUN npm install -g pnpm
32
-
33
- WORKDIR /app
34
-
35
- # Copy package files
36
- COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
37
- COPY apps/web/package.json ./apps/web/
38
- COPY apps/api/package.json ./apps/api/
39
-
40
- # Install production dependencies only
41
- RUN pnpm install --prod --frozen-lockfile
42
-
43
- # Copy built files from builder
44
- COPY --from=builder /app/dist ./dist
45
- COPY --from=builder /app/apps/web/.next ./apps/web/.next
46
- COPY --from=builder /app/apps/web/public ./apps/web/public
47
- COPY --from=builder /app/apps/api/dist ./apps/api/dist
48
- COPY --from=builder /app/apps/api/prisma ./apps/api/prisma
49
- COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma
50
- COPY --from=builder /app/server.ts ./server.ts
51
-
52
- # Expose port
53
- EXPOSE 3000
54
-
55
- # Set environment
56
- ENV NODE_ENV=production
57
- ENV PORT=3000
58
-
59
- # Start application
60
- CMD ["node", "dist/server.js"]
1
+ # Stage 1: Build
2
+ FROM node:20-alpine AS builder
3
+
4
+ # Install pnpm
5
+ RUN npm install -g pnpm
6
+
7
+ # Set working directory
8
+ WORKDIR /app
9
+
10
+ # Copy package files
11
+ COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
12
+ COPY apps/web/package.json ./apps/web/
13
+ COPY apps/api/package.json ./apps/api/
14
+
15
+ # Install dependencies
16
+ RUN pnpm install --frozen-lockfile
17
+
18
+ # Copy source code
19
+ COPY . .
20
+
21
+ # Generate Prisma Client
22
+ RUN cd apps/api && npx prisma generate
23
+
24
+ # Build all apps
25
+ RUN pnpm run build
26
+
27
+ # Stage 2: Production
28
+ FROM node:20-alpine AS runner
29
+
30
+ # Install pnpm
31
+ RUN npm install -g pnpm
32
+
33
+ WORKDIR /app
34
+
35
+ # Copy package files
36
+ COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
37
+ COPY apps/web/package.json ./apps/web/
38
+ COPY apps/api/package.json ./apps/api/
39
+
40
+ # Install production dependencies only
41
+ RUN pnpm install --prod --frozen-lockfile
42
+
43
+ # Copy built files from builder
44
+ COPY --from=builder /app/dist ./dist
45
+ COPY --from=builder /app/apps/web/.next ./apps/web/.next
46
+ COPY --from=builder /app/apps/web/public ./apps/web/public
47
+ COPY --from=builder /app/apps/api/dist ./apps/api/dist
48
+ COPY --from=builder /app/apps/api/prisma ./apps/api/prisma
49
+ COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma
50
+ COPY --from=builder /app/server.ts ./server.ts
51
+
52
+ # Expose port
53
+ EXPOSE 3000
54
+
55
+ # Set environment
56
+ ENV NODE_ENV=production
57
+ ENV PORT=3000
58
+
59
+ # Start application
60
+ CMD ["node", "dist/server.js"]
@@ -1 +1 @@
1
- web: pnpm start
1
+ web: pnpm start
@@ -1,58 +1,67 @@
1
- # WEXTS Templates
2
-
3
- This directory contains all the templates needed to create a WEXTS unified server application.
4
-
5
- ## 📁 Files Included
6
-
7
- ### Core Templates
8
- - `server.ts` - Unified server that runs Next.js + NestJS in one process
9
- - `api-sdk.ts` - Type-safe SDK for API calls (zero URLs needed!)
10
- - `root-package.json` - Root package.json with all scripts
11
- - `tsconfig.json` - TypeScript configuration
12
- - `.env.example` - Environment variables template
13
-
14
- ### Deployment Templates
15
- - `Dockerfile` - Docker multi-stage build
16
- - `docker-compose.yml` - Docker Compose with PostgreSQL
17
- - `.dockerignore` - Docker ignore file
18
- - `nixpacks.toml` - Railway deployment config
19
- - `Procfile` - Render/Heroku deployment
20
-
21
- ### App Templates
22
- - `nestjs-api/` - NestJS backend template
23
- - `nextjs-web/` - Next.js frontend template
24
-
25
- ## 🚀 Usage
26
-
27
- These templates are used by the WEXTS CLI when creating a new project:
28
-
29
- ```bash
30
- npx wexts create my-app
31
- ```
32
-
33
- ## Features
34
-
35
- **Unified Server** - Single Node.js process for frontend + backend
36
- ✅ **Zero URLs** - Type-safe SDK without explicit API URLs
37
- ✅ **Smart Routing** - Automatic routing between Next.js and NestJS
38
- **Docker Ready** - Complete Docker setup included
39
- **Multi-Platform Deploy** - Railway, Render, Docker, VPS
40
-
41
- ## 📦 Template Structure
42
-
43
- ```
44
- project/
45
- ├── server.ts ← Unified server
46
- ├── package.json ← Root package
47
- ├── tsconfig.json ← TS config
48
- ├── .env.example ← Env template
49
- ├── Dockerfile ← Docker build
50
- ├── docker-compose.yml ← Docker + DB
51
- ├── apps/
52
- │ ├── api/ ← From nestjs-api template
53
- │ └── web/ ← From nextjs-web template
54
- ```
55
-
56
- ## 🔧 Customization
57
-
58
- Templates can be customized before project creation. See CLI documentation for details.
1
+ # Deprecated Legacy Templates
2
+
3
+ These templates predate the verified `examples/hello-rpc` runtime/RPC/security model. They are retained for compatibility while the scaffold is consolidated.
4
+
5
+ For release validation and production guidance, use `examples/hello-rpc`. Do not treat these legacy templates as the recommended production app structure.
6
+
7
+ ---
8
+
9
+ # WEXTS Legacy Templates
10
+
11
+ This directory contains all the templates needed to create a WEXTS unified server application.
12
+
13
+ ## 📁 Files Included
14
+
15
+ ### Core Templates
16
+ - `server.ts` - Unified server that runs Next.js + NestJS in one process
17
+ - `api-sdk.ts` - legacy SDK scaffold retained for compatibility
18
+ - `root-package.json` - Root package.json with all scripts
19
+ - `tsconfig.json` - TypeScript configuration
20
+ - `.env.example` - Environment variables template
21
+
22
+ ### Deployment Templates
23
+ - `Dockerfile` - Docker multi-stage build
24
+ - `docker-compose.yml` - Docker Compose with PostgreSQL
25
+ - `.dockerignore` - Docker ignore file
26
+ - `nixpacks.toml` - Railway deployment config
27
+ - `Procfile` - Render/Heroku deployment
28
+
29
+ ### App Templates
30
+ - `nestjs-api/` - NestJS backend template
31
+ - `nextjs-web/` - Next.js frontend template
32
+
33
+ ## 🚀 Usage
34
+
35
+ These templates are legacy scaffold assets. The canonical verified example is:
36
+
37
+ ```bash
38
+ pnpm --filter wexts-example-hello-rpc generate
39
+ pnpm --filter wexts-example-hello-rpc build
40
+ ```
41
+
42
+ ## ✨ Features
43
+
44
+ ✅ **Unified Server** - Single Node.js process for frontend + backend
45
+ **Generated RPC** - In the canonical `examples/hello-rpc` path
46
+ **Smart Routing** - In the production Fastify runtime
47
+ **Docker Ready** - Complete Docker setup included
48
+ **Multi-Platform Deploy** - Railway, Render, Docker, VPS
49
+
50
+ ## 📦 Template Structure
51
+
52
+ ```
53
+ project/
54
+ ├── server.ts ← Unified server
55
+ ├── package.json ← Root package
56
+ ├── tsconfig.json ← TS config
57
+ ├── .env.example ← Env template
58
+ ├── Dockerfile ← Docker build
59
+ ├── docker-compose.yml ← Docker + DB
60
+ ├── apps/
61
+ │ ├── api/ ← From nestjs-api template
62
+ │ └── web/ ← From nextjs-web template
63
+ ```
64
+
65
+ ## 🔧 Customization
66
+
67
+ Templates can be customized before project creation. See CLI documentation for details.
@@ -1,115 +1,115 @@
1
- /**
2
- * WEXTS Internal SDK
3
- * Type-safe API client - ZERO URLs needed!
4
- * Works in both Client and Server Components
5
- */
6
-
7
- // HTTP client - uses relative paths only
8
- async function request<T>(method: string, path: string, data?: any): Promise<T> {
9
- const url = `/api${path}`;
10
-
11
- const options: RequestInit = {
12
- method,
13
- headers: {
14
- 'Content-Type': 'application/json',
15
- },
16
- credentials: 'include',
17
- };
18
-
19
- if (data) {
20
- options.body = JSON.stringify(data);
21
- }
22
-
23
- const response = await fetch(url, options);
24
-
25
- if (!response.ok) {
26
- const error = await response.json().catch(() => ({ message: response.statusText }));
27
- throw new Error(error.message || 'Request failed');
28
- }
29
-
30
- return response.json();
31
- }
32
-
33
- // ==========================================
34
- // TYPE-SAFE API - NO URLs ANYWHERE!
35
- // ==========================================
36
-
37
- export const api = {
38
- /**
39
- * Authentication API
40
- */
41
- auth: {
42
- /**
43
- * Register new user
44
- * @example await api.auth.register({ email, password, name })
45
- */
46
- register: (data: { email: string; password: string; name?: string }) =>
47
- request<{ user: any; access_token: string }>('POST', '/auth/register', data),
48
-
49
- /**
50
- * Login user
51
- * @example await api.auth.login({ email, password })
52
- */
53
- login: (data: { email: string; password: string }) =>
54
- request<{ user: any; access_token: string }>('POST', '/auth/login', data),
55
-
56
- /**
57
- * Get current user
58
- * @example const user = await api.auth.me()
59
- */
60
- me: () => request<any>('GET', '/auth/me'),
61
- },
62
-
63
- /**
64
- * Users API
65
- */
66
- users: {
67
- /**
68
- * Get current user profile
69
- * @example const profile = await api.users.me()
70
- */
71
- me: () => request<any>('GET', '/users/me'),
72
- },
73
-
74
- /**
75
- * Todos API
76
- */
77
- todos: {
78
- /**
79
- * Get all todos
80
- * @example const todos = await api.todos.findAll()
81
- */
82
- findAll: () => request<any[]>('GET', '/todos'),
83
-
84
- /**
85
- * Get single todo
86
- * @example const todo = await api.todos.findOne('123')
87
- */
88
- findOne: (id: string) => request<any>('GET', `/todos/${id}`),
89
-
90
- /**
91
- * Create new todo
92
- * @example await api.todos.create({ title: 'Task', description: 'Do it' })
93
- */
94
- create: (data: { title: string; description?: string }) =>
95
- request<any>('POST', '/todos', data),
96
-
97
- /**
98
- * Update todo
99
- * @example await api.todos.update('123', { completed: true })
100
- */
101
- update: (id: string, data: { title?: string; description?: string; completed?: boolean }) =>
102
- request<any>('PUT', `/todos/${id}`, data),
103
-
104
- /**
105
- * Delete todo
106
- * @example await api.todos.delete('123')
107
- */
108
- delete: (id: string) => request<void>('DELETE', `/todos/${id}`),
109
- },
110
- };
111
-
112
- /**
113
- * Export type-safe API
114
- */
115
- export type API = typeof api;
1
+ /**
2
+ * WEXTS Internal SDK
3
+ * Type-safe API client - ZERO URLs needed!
4
+ * Works in both Client and Server Components
5
+ */
6
+
7
+ // HTTP client - uses relative paths only
8
+ async function request<T>(method: string, path: string, data?: any): Promise<T> {
9
+ const url = `/api${path}`;
10
+
11
+ const options: RequestInit = {
12
+ method,
13
+ headers: {
14
+ 'Content-Type': 'application/json',
15
+ },
16
+ credentials: 'include',
17
+ };
18
+
19
+ if (data) {
20
+ options.body = JSON.stringify(data);
21
+ }
22
+
23
+ const response = await fetch(url, options);
24
+
25
+ if (!response.ok) {
26
+ const error = await response.json().catch(() => ({ message: response.statusText }));
27
+ throw new Error(error.message || 'Request failed');
28
+ }
29
+
30
+ return response.json();
31
+ }
32
+
33
+ // ==========================================
34
+ // TYPE-SAFE API - NO URLs ANYWHERE!
35
+ // ==========================================
36
+
37
+ export const api = {
38
+ /**
39
+ * Authentication API
40
+ */
41
+ auth: {
42
+ /**
43
+ * Register new user
44
+ * @example await api.auth.register({ email, password, name })
45
+ */
46
+ register: (data: { email: string; password: string; name?: string }) =>
47
+ request<{ user: any; access_token: string }>('POST', '/auth/register', data),
48
+
49
+ /**
50
+ * Login user
51
+ * @example await api.auth.login({ email, password })
52
+ */
53
+ login: (data: { email: string; password: string }) =>
54
+ request<{ user: any; access_token: string }>('POST', '/auth/login', data),
55
+
56
+ /**
57
+ * Get current user
58
+ * @example const user = await api.auth.me()
59
+ */
60
+ me: () => request<any>('GET', '/auth/me'),
61
+ },
62
+
63
+ /**
64
+ * Users API
65
+ */
66
+ users: {
67
+ /**
68
+ * Get current user profile
69
+ * @example const profile = await api.users.me()
70
+ */
71
+ me: () => request<any>('GET', '/users/me'),
72
+ },
73
+
74
+ /**
75
+ * Todos API
76
+ */
77
+ todos: {
78
+ /**
79
+ * Get all todos
80
+ * @example const todos = await api.todos.findAll()
81
+ */
82
+ findAll: () => request<any[]>('GET', '/todos'),
83
+
84
+ /**
85
+ * Get single todo
86
+ * @example const todo = await api.todos.findOne('123')
87
+ */
88
+ findOne: (id: string) => request<any>('GET', `/todos/${id}`),
89
+
90
+ /**
91
+ * Create new todo
92
+ * @example await api.todos.create({ title: 'Task', description: 'Do it' })
93
+ */
94
+ create: (data: { title: string; description?: string }) =>
95
+ request<any>('POST', '/todos', data),
96
+
97
+ /**
98
+ * Update todo
99
+ * @example await api.todos.update('123', { completed: true })
100
+ */
101
+ update: (id: string, data: { title?: string; description?: string; completed?: boolean }) =>
102
+ request<any>('PUT', `/todos/${id}`, data),
103
+
104
+ /**
105
+ * Delete todo
106
+ * @example await api.todos.delete('123')
107
+ */
108
+ delete: (id: string) => request<void>('DELETE', `/todos/${id}`),
109
+ },
110
+ };
111
+
112
+ /**
113
+ * Export type-safe API
114
+ */
115
+ export type API = typeof api;
@@ -1,34 +1,34 @@
1
- version: '3.8'
2
-
3
- services:
4
- # WEXTS Application
5
- app:
6
- build:
7
- context: .
8
- dockerfile: Dockerfile
9
- ports:
10
- - "3000:3000"
11
- environment:
12
- - NODE_ENV=production
13
- - DATABASE_URL=postgresql://wexts:wexts_password@postgres:5432/wexts_db
14
- - JWT_SECRET=your-super-secret-jwt-key-change-this
15
- - PORT=3000
16
- depends_on:
17
- - postgres
18
- restart: unless-stopped
19
-
20
- # PostgreSQL Database
21
- postgres:
22
- image: postgres:16-alpine
23
- ports:
24
- - "5432:5432"
25
- environment:
26
- - POSTGRES_USER=wexts
27
- - POSTGRES_PASSWORD=wexts_password
28
- - POSTGRES_DB=wexts_db
29
- volumes:
30
- - postgres_data:/var/lib/postgresql/data
31
- restart: unless-stopped
32
-
33
- volumes:
34
- postgres_data:
1
+ version: '3.8'
2
+
3
+ services:
4
+ # WEXTS Application
5
+ app:
6
+ build:
7
+ context: .
8
+ dockerfile: Dockerfile
9
+ ports:
10
+ - "3000:3000"
11
+ environment:
12
+ - NODE_ENV=production
13
+ - DATABASE_URL=postgresql://wexts:wexts_password@postgres:5432/wexts_db
14
+ - JWT_SECRET=your-super-secret-jwt-key-change-this
15
+ - PORT=3000
16
+ depends_on:
17
+ - postgres
18
+ restart: unless-stopped
19
+
20
+ # PostgreSQL Database
21
+ postgres:
22
+ image: postgres:16-alpine
23
+ ports:
24
+ - "5432:5432"
25
+ environment:
26
+ - POSTGRES_USER=wexts
27
+ - POSTGRES_PASSWORD=wexts_password
28
+ - POSTGRES_DB=wexts_db
29
+ volumes:
30
+ - postgres_data:/var/lib/postgresql/data
31
+ restart: unless-stopped
32
+
33
+ volumes:
34
+ postgres_data:
File without changes