create-better-t-stack 1.13.2 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/dist/index.js +95 -197
  2. package/package.json +72 -69
  3. package/templates/api/orpc/server/base/src/lib/context.ts.hbs +104 -0
  4. package/templates/api/orpc/server/base/src/lib/orpc.ts.hbs +17 -0
  5. package/templates/api/orpc/server/next/src/app/rpc/[...all]/route.ts.hbs +23 -0
  6. package/templates/api/orpc/web/base/src/utils/orpc.ts.hbs +57 -0
  7. package/templates/api/trpc/server/base/src/lib/context.ts.hbs +108 -0
  8. package/{template/with-auth/apps/server/src/lib/trpc.ts → templates/api/trpc/server/base/src/lib/trpc.ts.hbs} +2 -0
  9. package/templates/api/trpc/web/base/src/utils/trpc.ts.hbs +100 -0
  10. package/templates/auth/server/base/src/lib/auth.ts.hbs +30 -0
  11. package/templates/auth/web/base/src/lib/auth-client.ts.hbs +10 -0
  12. package/{template/with-auth/apps/web-next/src/app/dashboard/page.tsx → templates/auth/web/next/src/app/dashboard/page.tsx.hbs} +10 -0
  13. package/{template/with-auth/apps/web-react-router/src/routes/dashboard.tsx → templates/auth/web/react-router/src/routes/dashboard.tsx.hbs} +10 -0
  14. package/{template/with-auth/apps/web-tanstack-router/src/routes/dashboard.tsx → templates/auth/web/tanstack-router/src/routes/dashboard.tsx.hbs} +10 -0
  15. package/{template/with-auth/apps/web-tanstack-start/src/routes/dashboard.tsx → templates/auth/web/tanstack-start/src/routes/dashboard.tsx.hbs} +15 -0
  16. package/{template/with-auth/apps/server/src/with-elysia-index.ts → templates/backend/elysia/src/index.ts.hbs} +38 -3
  17. package/templates/backend/express/src/index.ts.hbs +86 -0
  18. package/templates/backend/hono/src/index.ts.hbs +105 -0
  19. package/{template/with-next/apps/server → templates/backend/next}/package.json +0 -2
  20. package/{template/base/apps/server → templates/backend/server-base}/package.json +0 -1
  21. package/templates/backend/server-base/src/routers/index.ts.hbs +51 -0
  22. package/templates/base/package.json +10 -0
  23. package/templates/examples/todo/server/drizzle/base/src/routers/todo.ts.hbs +79 -0
  24. package/{template/with-drizzle-sqlite/apps/server → templates/examples/todo/server/drizzle/sqlite}/src/db/schema/todo.ts +2 -2
  25. package/{template/examples/todo/apps/web-react-router/src/routes/todos.tsx → templates/examples/todo/web/react-router/src/routes/todos.tsx.hbs} +28 -0
  26. package/{template/examples/todo/apps/web-tanstack-router/src/routes/todos.tsx → templates/examples/todo/web/tanstack-router/src/routes/todos.tsx.hbs} +28 -0
  27. package/{template/examples/todo/apps/web-tanstack-start/src/routes/todos.tsx → templates/examples/todo/web/tanstack-start/src/routes/todos.tsx.hbs} +33 -0
  28. package/{template/base/apps/web-next → templates/frontend/next}/package.json +0 -2
  29. package/{template/base/apps/web-next/src/app/page.tsx → templates/frontend/next/src/app/page.tsx.hbs} +10 -0
  30. package/{template/base/apps/web-next/src/components/providers.tsx → templates/frontend/next/src/components/providers.tsx.hbs} +12 -0
  31. package/{template/base/apps/web-react-router → templates/frontend/react-router}/package.json +0 -3
  32. package/{template/base/apps/web-react-router/src/root.tsx → templates/frontend/react-router/src/root.tsx.hbs} +28 -1
  33. package/{template/base/apps/web-react-router/src/routes/_index.tsx → templates/frontend/react-router/src/routes/_index.tsx.hbs} +11 -0
  34. package/templates/frontend/react-router/vite.config.ts.hbs +37 -0
  35. package/{template/base/apps/web-tanstack-router → templates/frontend/tanstack-router}/package.json +0 -4
  36. package/{template/base/apps/web-tanstack-router/src/main.tsx → templates/frontend/tanstack-router/src/main.tsx.hbs} +20 -0
  37. package/{template/base/apps/web-tanstack-router/src/routes/__root.tsx → templates/frontend/tanstack-router/src/routes/__root.tsx.hbs} +48 -0
  38. package/{template/base/apps/web-tanstack-router/src/routes/index.tsx → templates/frontend/tanstack-router/src/routes/index.tsx.hbs} +10 -0
  39. package/templates/frontend/tanstack-router/vite.config.ts.hbs +43 -0
  40. package/{template/base/apps/web-tanstack-start → templates/frontend/tanstack-start}/package.json +0 -3
  41. package/{template/with-auth/apps/web-tanstack-start/src/router.tsx → templates/frontend/tanstack-start/src/router.tsx.hbs} +29 -3
  42. package/{template/base/apps/web-tanstack-start/src/routes/__root.tsx → templates/frontend/tanstack-start/src/routes/__root.tsx.hbs} +13 -0
  43. package/{template/base/apps/web-tanstack-start/src/routes/index.tsx → templates/frontend/tanstack-start/src/routes/index.tsx.hbs} +11 -0
  44. package/templates/frontend/web-base/src/components/header.tsx.hbs +80 -0
  45. package/template/base/apps/server/src/lib/trpc.ts +0 -8
  46. package/template/base/apps/server/src/routers/index.ts +0 -11
  47. package/template/base/apps/web-base/src/utils/trpc.ts +0 -33
  48. package/template/base/apps/web-next/src/components/header.tsx +0 -30
  49. package/template/base/apps/web-next/src/utils/trpc.ts +0 -33
  50. package/template/base/apps/web-react-router/src/components/header.tsx +0 -31
  51. package/template/base/apps/web-react-router/vite.config.ts +0 -8
  52. package/template/base/apps/web-tanstack-router/src/components/header.tsx +0 -31
  53. package/template/base/apps/web-tanstack-router/vite.config.ts +0 -14
  54. package/template/base/apps/web-tanstack-start/src/components/header.tsx +0 -27
  55. package/template/base/apps/web-tanstack-start/src/router.tsx +0 -70
  56. package/template/base/apps/web-tanstack-start/src/utils/trpc.ts +0 -5
  57. package/template/base/package.json +0 -18
  58. package/template/examples/todo/apps/server/src/routers/with-drizzle-todo.ts +0 -34
  59. package/template/with-auth/apps/server/src/lib/with-elysia-context.ts +0 -18
  60. package/template/with-auth/apps/server/src/lib/with-express-context.ts +0 -14
  61. package/template/with-auth/apps/server/src/lib/with-hono-context.ts +0 -18
  62. package/template/with-auth/apps/server/src/lib/with-next-context.ts +0 -14
  63. package/template/with-auth/apps/server/src/routers/index.ts +0 -17
  64. package/template/with-auth/apps/server/src/with-drizzle-mysql-lib/auth.ts +0 -15
  65. package/template/with-auth/apps/server/src/with-drizzle-postgres-lib/auth.ts +0 -15
  66. package/template/with-auth/apps/server/src/with-drizzle-sqlite-lib/auth.ts +0 -15
  67. package/template/with-auth/apps/server/src/with-express-index.ts +0 -34
  68. package/template/with-auth/apps/server/src/with-hono-index.ts +0 -39
  69. package/template/with-auth/apps/server/src/with-prisma-mongodb-lib/auth.ts +0 -11
  70. package/template/with-auth/apps/server/src/with-prisma-mysql-lib/auth.ts +0 -11
  71. package/template/with-auth/apps/server/src/with-prisma-postgres-lib/auth.ts +0 -11
  72. package/template/with-auth/apps/server/src/with-prisma-sqlite-lib/auth.ts +0 -11
  73. package/template/with-auth/apps/web-base/src/lib/auth-client.ts +0 -5
  74. package/template/with-auth/apps/web-next/src/components/header.tsx +0 -33
  75. package/template/with-auth/apps/web-next/src/lib/auth-client.ts +0 -5
  76. package/template/with-auth/apps/web-next/src/utils/trpc.ts +0 -39
  77. package/template/with-auth/apps/web-react-router/src/components/header.tsx +0 -34
  78. package/template/with-auth/apps/web-react-router/src/utils/trpc.ts +0 -39
  79. package/template/with-auth/apps/web-tanstack-router/src/components/header.tsx +0 -34
  80. package/template/with-auth/apps/web-tanstack-router/src/utils/trpc.ts +0 -39
  81. package/template/with-auth/apps/web-tanstack-start/src/components/header.tsx +0 -32
  82. package/template/with-elysia/apps/server/src/index.ts +0 -27
  83. package/template/with-elysia/apps/server/src/lib/context.ts +0 -13
  84. package/template/with-express/apps/server/src/index.ts +0 -29
  85. package/template/with-express/apps/server/src/lib/context.ts +0 -9
  86. package/template/with-hono/apps/server/src/index.ts +0 -33
  87. package/template/with-hono/apps/server/src/lib/context.ts +0 -13
  88. package/template/with-next/apps/server/src/lib/context.ts +0 -9
  89. /package/{template/with-biome → templates/addons/biome}/biome.json +0 -0
  90. /package/{template/with-husky → templates/addons/husky}/.husky/pre-commit +0 -0
  91. /package/{template/with-pwa → templates/addons/pwa}/apps/web/public/logo.png +0 -0
  92. /package/{template/with-pwa → templates/addons/pwa}/apps/web/pwa-assets.config.ts +0 -0
  93. /package/{template/base → templates/addons/turborepo}/turbo.json +0 -0
  94. /package/{template/with-next/apps/server → templates/api/trpc/server/next}/src/app/trpc/[trpc]/route.ts +0 -0
  95. /package/{template/with-auth/apps → templates/auth}/native/app/(drawer)/index.tsx +0 -0
  96. /package/{template/with-auth/apps → templates/auth}/native/components/sign-in.tsx +0 -0
  97. /package/{template/with-auth/apps → templates/auth}/native/components/sign-up.tsx +0 -0
  98. /package/{template/with-auth/apps → templates/auth}/native/lib/auth-client.ts +0 -0
  99. /package/{template/with-auth/apps → templates/auth}/native/utils/trpc.ts +0 -0
  100. /package/{template/with-drizzle-mysql/apps/server → templates/auth/server/db/drizzle/mysql}/src/db/schema/auth.ts +0 -0
  101. /package/{template/with-drizzle-postgres/apps/server → templates/auth/server/db/drizzle/postgres}/src/db/schema/auth.ts +0 -0
  102. /package/{template/with-drizzle-sqlite/apps/server → templates/auth/server/db/drizzle/sqlite}/src/db/schema/auth.ts +0 -0
  103. /package/{template/with-prisma-sqlite/apps/server → templates/auth/server/db/prisma/mongodb}/prisma/schema/auth.prisma +0 -0
  104. /package/{template/with-prisma-mysql/apps/server → templates/auth/server/db/prisma/mysql}/prisma/schema/auth.prisma +0 -0
  105. /package/{template/with-prisma-postgres/apps/server → templates/auth/server/db/prisma/postgres}/prisma/schema/auth.prisma +0 -0
  106. /package/{template/with-prisma-mongodb/apps/server → templates/auth/server/db/prisma/sqlite}/prisma/schema/auth.prisma +0 -0
  107. /package/{template/with-auth/apps/server/src/with-next-app → templates/auth/server/next/src/app}/api/auth/[...all]/route.ts +0 -0
  108. /package/{template/with-auth/apps/web-next → templates/auth/web/next}/src/app/login/page.tsx +0 -0
  109. /package/{template/with-auth/apps/web-next → templates/auth/web/next}/src/components/sign-in-form.tsx +0 -0
  110. /package/{template/with-auth/apps/web-next → templates/auth/web/next}/src/components/sign-up-form.tsx +0 -0
  111. /package/{template/with-auth/apps/web-next → templates/auth/web/next}/src/components/theme-provider.tsx +0 -0
  112. /package/{template/with-auth/apps/web-next → templates/auth/web/next}/src/components/user-menu.tsx +0 -0
  113. /package/{template/with-auth/apps/web-react-router → templates/auth/web/react-router}/src/components/sign-in-form.tsx +0 -0
  114. /package/{template/with-auth/apps/web-react-router → templates/auth/web/react-router}/src/components/sign-up-form.tsx +0 -0
  115. /package/{template/with-auth/apps/web-react-router → templates/auth/web/react-router}/src/components/user-menu.tsx +0 -0
  116. /package/{template/with-auth/apps/web-react-router → templates/auth/web/react-router}/src/routes/login.tsx +0 -0
  117. /package/{template/with-auth/apps/web-tanstack-start → templates/auth/web/tanstack-router}/src/components/sign-in-form.tsx +0 -0
  118. /package/{template/with-auth/apps/web-tanstack-start → templates/auth/web/tanstack-router}/src/components/sign-up-form.tsx +0 -0
  119. /package/{template/with-auth/apps/web-tanstack-start → templates/auth/web/tanstack-router}/src/components/user-menu.tsx +0 -0
  120. /package/{template/with-auth/apps/web-tanstack-start → templates/auth/web/tanstack-router}/src/routes/login.tsx +0 -0
  121. /package/{template/with-auth/apps/web-tanstack-router → templates/auth/web/tanstack-start}/src/components/sign-in-form.tsx +0 -0
  122. /package/{template/with-auth/apps/web-tanstack-router → templates/auth/web/tanstack-start}/src/components/sign-up-form.tsx +0 -0
  123. /package/{template/with-auth/apps/web-tanstack-router → templates/auth/web/tanstack-start}/src/components/user-menu.tsx +0 -0
  124. /package/{template/with-auth/apps/web-tanstack-router → templates/auth/web/tanstack-start}/src/routes/login.tsx +0 -0
  125. /package/{template/with-next/apps/server → templates/backend/next}/next-env.d.ts +0 -0
  126. /package/{template/with-next/apps/server → templates/backend/next}/next.config.ts +0 -0
  127. /package/{template/with-next/apps/server → templates/backend/next}/src/app/route.ts +0 -0
  128. /package/{template/with-next/apps/server → templates/backend/next}/src/middleware.ts +0 -0
  129. /package/{template/with-next/apps/server → templates/backend/next}/tsconfig.json +0 -0
  130. /package/{template/base/apps/server → templates/backend/server-base}/_gitignore +0 -0
  131. /package/{template/base/apps/server → templates/backend/server-base}/tsconfig.json +0 -0
  132. /package/{template → templates}/base/_gitignore +0 -0
  133. /package/{template/with-drizzle-mysql/apps/server → templates/db/drizzle/mysql}/drizzle.config.ts +0 -0
  134. /package/{template/with-drizzle-mysql/apps/server → templates/db/drizzle/mysql}/src/db/index.ts +0 -0
  135. /package/{template/with-drizzle-postgres/apps/server → templates/db/drizzle/postgres}/drizzle.config.ts +0 -0
  136. /package/{template/with-drizzle-postgres/apps/server → templates/db/drizzle/postgres}/src/db/index.ts +0 -0
  137. /package/{template/with-drizzle-sqlite/apps/server → templates/db/drizzle/sqlite}/drizzle.config.ts +0 -0
  138. /package/{template/with-drizzle-sqlite/apps/server → templates/db/drizzle/sqlite}/src/db/index.ts +0 -0
  139. /package/{template/with-prisma-sqlite/apps/server → templates/db/prisma/mongodb}/prisma/index.ts +0 -0
  140. /package/{template/with-prisma-mongodb/apps/server → templates/db/prisma/mongodb}/prisma/schema/schema.prisma +0 -0
  141. /package/{template/with-prisma-postgres/apps/server → templates/db/prisma/mysql}/prisma/index.ts +0 -0
  142. /package/{template/with-prisma-mysql/apps/server → templates/db/prisma/mysql}/prisma/schema/schema.prisma +0 -0
  143. /package/{template/with-prisma-mysql/apps/server → templates/db/prisma/postgres}/prisma/index.ts +0 -0
  144. /package/{template/with-prisma-postgres/apps/server → templates/db/prisma/postgres}/prisma/schema/schema.prisma +0 -0
  145. /package/{template/with-prisma-mongodb/apps/server → templates/db/prisma/sqlite}/prisma/index.ts +0 -0
  146. /package/{template/with-prisma-sqlite/apps/server → templates/db/prisma/sqlite}/prisma/schema/schema.prisma +0 -0
  147. /package/{template/examples/ai/apps/web-react-router → templates/examples/ai/apps/react-router}/src/routes/ai.tsx +0 -0
  148. /package/{template/examples/ai/apps/web-tanstack-start → templates/examples/ai/apps/tanstack-router}/src/routes/ai.tsx +0 -0
  149. /package/{template/examples/ai/apps/web-tanstack-router → templates/examples/ai/apps/tanstack-start}/src/routes/ai.tsx +0 -0
  150. /package/{template/with-drizzle-mysql/apps/server → templates/examples/todo/server/drizzle/mysql}/src/db/schema/todo.ts +0 -0
  151. /package/{template/with-drizzle-postgres/apps/server → templates/examples/todo/server/drizzle/postgres}/src/db/schema/todo.ts +0 -0
  152. /package/{template/examples/todo/apps/server/src/routers/with-prisma-todo.ts → templates/examples/todo/server/prisma/base/trpc/src/routers/todo.ts} +0 -0
  153. /package/{template/with-prisma-mongodb/apps/server → templates/examples/todo/server/prisma/mongodb}/prisma/schema/todo.prisma +0 -0
  154. /package/{template/with-prisma-sqlite/apps/server → templates/examples/todo/server/prisma/mysql}/prisma/schema/todo.prisma +0 -0
  155. /package/{template/with-prisma-postgres/apps/server → templates/examples/todo/server/prisma/postgres}/prisma/schema/todo.prisma +0 -0
  156. /package/{template/with-prisma-mysql/apps/server → templates/examples/todo/server/prisma/sqlite}/prisma/schema/todo.prisma +0 -0
  157. /package/{template/with-pnpm → templates/extras}/pnpm-workspace.yaml +0 -0
  158. /package/{template/base/apps → templates/frontend}/native/_gitignore +0 -0
  159. /package/{template/base/apps → templates/frontend}/native/app/(drawer)/(tabs)/_layout.tsx +0 -0
  160. /package/{template/base/apps → templates/frontend}/native/app/(drawer)/(tabs)/index.tsx +0 -0
  161. /package/{template/base/apps → templates/frontend}/native/app/(drawer)/(tabs)/two.tsx +0 -0
  162. /package/{template/base/apps → templates/frontend}/native/app/(drawer)/_layout.tsx +0 -0
  163. /package/{template/base/apps → templates/frontend}/native/app/(drawer)/index.tsx +0 -0
  164. /package/{template/base/apps → templates/frontend}/native/app/+html.tsx +0 -0
  165. /package/{template/base/apps → templates/frontend}/native/app/+not-found.tsx +0 -0
  166. /package/{template/base/apps → templates/frontend}/native/app/_layout.tsx +0 -0
  167. /package/{template/base/apps → templates/frontend}/native/app/modal.tsx +0 -0
  168. /package/{template/base/apps → templates/frontend}/native/app-env.d.ts +0 -0
  169. /package/{template/base/apps → templates/frontend}/native/app.json +0 -0
  170. /package/{template/base/apps → templates/frontend}/native/assets/adaptive-icon.png +0 -0
  171. /package/{template/base/apps → templates/frontend}/native/assets/favicon.png +0 -0
  172. /package/{template/base/apps → templates/frontend}/native/assets/icon.png +0 -0
  173. /package/{template/base/apps → templates/frontend}/native/assets/splash.png +0 -0
  174. /package/{template/base/apps → templates/frontend}/native/babel.config.js +0 -0
  175. /package/{template/base/apps → templates/frontend}/native/components/container.tsx +0 -0
  176. /package/{template/base/apps → templates/frontend}/native/components/header-button.tsx +0 -0
  177. /package/{template/base/apps → templates/frontend}/native/components/tabbar-icon.tsx +0 -0
  178. /package/{template/base/apps → templates/frontend}/native/global.css +0 -0
  179. /package/{template/base/apps → templates/frontend}/native/lib/android-navigation-bar.tsx +0 -0
  180. /package/{template/base/apps → templates/frontend}/native/lib/constants.ts +0 -0
  181. /package/{template/base/apps → templates/frontend}/native/lib/use-color-scheme.ts +0 -0
  182. /package/{template/base/apps → templates/frontend}/native/metro.config.js +0 -0
  183. /package/{template/base/apps → templates/frontend}/native/package.json +0 -0
  184. /package/{template/base/apps → templates/frontend}/native/tailwind.config.js +0 -0
  185. /package/{template/base/apps → templates/frontend}/native/tsconfig.json +0 -0
  186. /package/{template/base/apps → templates/frontend}/native/utils/trpc.ts +0 -0
  187. /package/{template/base/apps/web-next → templates/frontend/next}/next-env.d.ts +0 -0
  188. /package/{template/base/apps/web-next → templates/frontend/next}/next.config.ts +0 -0
  189. /package/{template/base/apps/web-next → templates/frontend/next}/postcss.config.mjs +0 -0
  190. /package/{template/base/apps/web-next → templates/frontend/next}/src/app/favicon.ico +0 -0
  191. /package/{template/base/apps/web-next → templates/frontend/next}/src/app/layout.tsx +0 -0
  192. /package/{template/base/apps/web-next → templates/frontend/next}/src/components/mode-toggle.tsx +0 -0
  193. /package/{template/base/apps/web-next → templates/frontend/next}/src/components/theme-provider.tsx +0 -0
  194. /package/{template/base/apps/web-next → templates/frontend/next}/tsconfig.json +0 -0
  195. /package/{template/base/apps/web-react-router → templates/frontend/react-router}/public/favicon.ico +0 -0
  196. /package/{template/base/apps/web-react-router → templates/frontend/react-router}/react-router.config.ts +0 -0
  197. /package/{template/base/apps/web-tanstack-router → templates/frontend/react-router}/src/components/mode-toggle.tsx +0 -0
  198. /package/{template/base/apps/web-tanstack-router → templates/frontend/react-router}/src/components/theme-provider.tsx +0 -0
  199. /package/{template/base/apps/web-react-router → templates/frontend/react-router}/src/routes.ts +0 -0
  200. /package/{template/base/apps/web-react-router → templates/frontend/react-router}/tsconfig.json +0 -0
  201. /package/{template/base/apps/web-tanstack-router → templates/frontend/tanstack-router}/index.html +0 -0
  202. /package/{template/base/apps/web-react-router → templates/frontend/tanstack-router}/src/components/mode-toggle.tsx +0 -0
  203. /package/{template/base/apps/web-react-router → templates/frontend/tanstack-router}/src/components/theme-provider.tsx +0 -0
  204. /package/{template/base/apps/web-tanstack-router → templates/frontend/tanstack-router}/tsconfig.json +0 -0
  205. /package/{template/base/apps/web-tanstack-start → templates/frontend/tanstack-start}/app.config.ts +0 -0
  206. /package/{template/base/apps/web-tanstack-start → templates/frontend/tanstack-start}/public/robots.txt +0 -0
  207. /package/{template/base/apps/web-tanstack-start → templates/frontend/tanstack-start}/src/api.ts +0 -0
  208. /package/{template/base/apps/web-tanstack-start → templates/frontend/tanstack-start}/src/client.tsx +0 -0
  209. /package/{template/base/apps/web-tanstack-start → templates/frontend/tanstack-start}/src/ssr.tsx +0 -0
  210. /package/{template/base/apps/web-tanstack-start → templates/frontend/tanstack-start}/tsconfig.json +0 -0
  211. /package/{template/base/apps → templates/frontend}/web-base/_gitignore +0 -0
  212. /package/{template/base/apps → templates/frontend}/web-base/components.json +0 -0
  213. /package/{template/base/apps → templates/frontend}/web-base/src/components/loader.tsx +0 -0
  214. /package/{template/base/apps → templates/frontend}/web-base/src/components/ui/button.tsx +0 -0
  215. /package/{template/base/apps → templates/frontend}/web-base/src/components/ui/card.tsx +0 -0
  216. /package/{template/base/apps → templates/frontend}/web-base/src/components/ui/checkbox.tsx +0 -0
  217. /package/{template/base/apps → templates/frontend}/web-base/src/components/ui/dropdown-menu.tsx +0 -0
  218. /package/{template/base/apps → templates/frontend}/web-base/src/components/ui/input.tsx +0 -0
  219. /package/{template/base/apps → templates/frontend}/web-base/src/components/ui/label.tsx +0 -0
  220. /package/{template/base/apps → templates/frontend}/web-base/src/components/ui/skeleton.tsx +0 -0
  221. /package/{template/base/apps → templates/frontend}/web-base/src/components/ui/sonner.tsx +0 -0
  222. /package/{template/base/apps → templates/frontend}/web-base/src/index.css +0 -0
  223. /package/{template/base/apps → templates/frontend}/web-base/src/lib/utils.ts +0 -0
@@ -1,34 +0,0 @@
1
- import { Link } from "@tanstack/react-router";
2
- import { ModeToggle } from "./mode-toggle";
3
- import UserMenu from "./user-menu";
4
-
5
- export default function Header() {
6
- const links = [
7
- { to: "/", label: "Home" },
8
- { to: "/dashboard", label: "Dashboard" },
9
- ];
10
-
11
- return (
12
- <div>
13
- <div className="flex flex-row items-center justify-between px-2 py-1">
14
- <nav className="flex gap-4 text-lg">
15
- {links.map(({ to, label }) => (
16
- <Link
17
- key={to}
18
- to={to}
19
- activeProps={{ className: "font-bold" }}
20
- activeOptions={{ exact: true }}
21
- >
22
- {label}
23
- </Link>
24
- ))}
25
- </nav>
26
- <div className="flex items-center gap-2">
27
- <ModeToggle />
28
- <UserMenu />
29
- </div>
30
- </div>
31
- <hr />
32
- </div>
33
- );
34
- }
@@ -1,39 +0,0 @@
1
- import type { AppRouter } from "../../../server/src/routers";
2
- import { QueryCache, QueryClient } from "@tanstack/react-query";
3
- import { createTRPCClient, httpBatchLink } from "@trpc/client";
4
- import { createTRPCOptionsProxy } from "@trpc/tanstack-react-query";
5
- import { toast } from "sonner";
6
-
7
- export const queryClient = new QueryClient({
8
- queryCache: new QueryCache({
9
- onError: (error) => {
10
- toast.error(error.message, {
11
- action: {
12
- label: "retry",
13
- onClick: () => {
14
- queryClient.invalidateQueries();
15
- },
16
- },
17
- });
18
- },
19
- }),
20
- });
21
-
22
- export const trpcClient = createTRPCClient<AppRouter>({
23
- links: [
24
- httpBatchLink({
25
- url: `${import.meta.env.VITE_SERVER_URL}/trpc`,
26
- fetch(url, options) {
27
- return fetch(url, {
28
- ...options,
29
- credentials: "include",
30
- });
31
- },
32
- }),
33
- ],
34
- });
35
-
36
- export const trpc = createTRPCOptionsProxy<AppRouter>({
37
- client: trpcClient,
38
- queryClient,
39
- });
@@ -1,32 +0,0 @@
1
- import { Link } from "@tanstack/react-router";
2
- import UserMenu from "./user-menu";
3
-
4
- export default function Header() {
5
- const links = [
6
- { to: "/", label: "Home" },
7
- { to: "/dashboard", label: "Dashboard" },
8
- ];
9
-
10
- return (
11
- <div>
12
- <div className="flex flex-row items-center justify-between px-2 py-1">
13
- <nav className="flex gap-4 text-lg">
14
- {links.map(({ to, label }) => (
15
- <Link
16
- key={to}
17
- to={to}
18
- activeProps={{ className: "font-bold" }}
19
- activeOptions={{ exact: true }}
20
- >
21
- {label}
22
- </Link>
23
- ))}
24
- </nav>
25
- <div className="flex items-center gap-2">
26
- <UserMenu />
27
- </div>
28
- </div>
29
- <hr />
30
- </div>
31
- );
32
- }
@@ -1,27 +0,0 @@
1
- import "dotenv/config";
2
- import { Elysia } from "elysia";
3
- import { cors } from "@elysiajs/cors";
4
- import { createContext } from "./lib/context";
5
- import { appRouter } from "./routers/index";
6
- import { fetchRequestHandler } from "@trpc/server/adapters/fetch";
7
-
8
- const app = new Elysia()
9
- .use(
10
- cors({
11
- origin: process.env.CORS_ORIGIN || "",
12
- methods: ["GET", "POST", "OPTIONS"],
13
- }),
14
- )
15
- .all("/trpc/*", async (context) => {
16
- const res = await fetchRequestHandler({
17
- endpoint: "/trpc",
18
- router: appRouter,
19
- req: context.request,
20
- createContext: () => createContext({ context }),
21
- });
22
- return res;
23
- })
24
- .get("/", () => "OK")
25
- .listen(3000, () => {
26
- console.log(`Server is running on http://localhost:3000`);
27
- });
@@ -1,13 +0,0 @@
1
- import type { Context as ElysiaContext } from "elysia";
2
-
3
- export type CreateContextOptions = {
4
- context: ElysiaContext;
5
- };
6
-
7
- export async function createContext({ context }: CreateContextOptions) {
8
- return {
9
- session: null,
10
- };
11
- }
12
-
13
- export type Context = Awaited<ReturnType<typeof createContext>>;
@@ -1,29 +0,0 @@
1
- import "dotenv/config";
2
- import { createExpressMiddleware } from "@trpc/server/adapters/express";
3
- import cors from "cors";
4
- import express from "express";
5
- import { createContext } from "./lib/context";
6
- import { appRouter } from "./routers/index";
7
-
8
- const app = express();
9
-
10
- app.use(
11
- cors({
12
- origin: process.env.CORS_ORIGIN || "",
13
- methods: ["GET", "POST", "OPTIONS"],
14
- allowedHeaders: ["Content-Type", "Authorization"],
15
- credentials: true,
16
- }),
17
- );
18
-
19
- app.use(express.json());
20
-
21
- app.use("/trpc", createExpressMiddleware({ router: appRouter, createContext }));
22
-
23
- app.get("/", (_req, res) => {
24
- res.status(200).send("OK");
25
- });
26
-
27
- app.listen(3000, () => {
28
- console.log("Server is running on port 3000");
29
- });
@@ -1,9 +0,0 @@
1
- import type { CreateExpressContextOptions } from "@trpc/server/adapters/express";
2
-
3
- export async function createContext(opts: CreateExpressContextOptions) {
4
- return {
5
- session: null,
6
- };
7
- }
8
-
9
- export type Context = Awaited<ReturnType<typeof createContext>>;
@@ -1,33 +0,0 @@
1
- import { trpcServer } from "@hono/trpc-server";
2
- import "dotenv/config";
3
- import { Hono } from "hono";
4
- import { cors } from "hono/cors";
5
- import { logger } from "hono/logger";
6
- import { createContext } from "./lib/context";
7
- import { appRouter } from "./routers/index";
8
-
9
- const app = new Hono();
10
-
11
- app.use(logger());
12
-
13
- app.use(
14
- "/*",
15
- cors({
16
- origin: process.env.CORS_ORIGIN || "",
17
- allowMethods: ["GET", "POST", "OPTIONS"],
18
- }),
19
- );
20
-
21
- app.use(
22
- "/trpc/*",
23
- trpcServer({
24
- router: appRouter,
25
- createContext: (_opts, context) => {
26
- return createContext({ context });
27
- },
28
- }),
29
- );
30
-
31
- app.get("/", (c) => {
32
- return c.text("OK");
33
- });
@@ -1,13 +0,0 @@
1
- import type { Context as HonoContext } from "hono";
2
-
3
- export type CreateContextOptions = {
4
- context: HonoContext;
5
- };
6
-
7
- export async function createContext({ context }: CreateContextOptions) {
8
- return {
9
- session: null,
10
- };
11
- }
12
-
13
- export type Context = Awaited<ReturnType<typeof createContext>>;
@@ -1,9 +0,0 @@
1
- import type { NextRequest } from "next/server";
2
-
3
- export async function createContext(req: NextRequest) {
4
- return {
5
- session: null,
6
- };
7
- }
8
-
9
- export type Context = Awaited<ReturnType<typeof createContext>>;
File without changes