@digilogiclabs/create-saas-app 2.9.1 → 2.11.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 (377) hide show
  1. package/README.md +153 -113
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/cli/commands/create.d.ts.map +1 -1
  4. package/dist/cli/commands/create.js +2 -6
  5. package/dist/cli/commands/create.js.map +1 -1
  6. package/dist/generators/template-generator.d.ts.map +1 -1
  7. package/dist/generators/template-generator.js +6 -3
  8. package/dist/generators/template-generator.js.map +1 -1
  9. package/dist/templates/shared/auth/supabase/web/src/middleware.ts +63 -0
  10. package/dist/templates/shared/database/supabase/web/src/lib/supabase/server.ts +3 -1
  11. package/dist/templates/shared/design/web/src/config/design.config.ts +14 -14
  12. package/dist/templates/shared/landing/web/src/components/LandingPage.tsx +0 -3
  13. package/dist/templates/shared/security/web/src/lib/api-security.ts +2 -2
  14. package/dist/templates/web/ai-platform/template/next.config.js +14 -14
  15. package/dist/templates/web/ai-platform/template/package.json +11 -22
  16. package/dist/templates/web/ai-platform/template/postcss.config.mjs +8 -0
  17. package/dist/templates/web/ai-platform/template/src/app/api/auth/route.ts +57 -0
  18. package/dist/templates/web/ai-platform/template/src/app/chat/page.tsx +234 -235
  19. package/dist/templates/web/ai-platform/template/src/app/dashboard/page.tsx +142 -142
  20. package/dist/templates/web/ai-platform/template/src/app/error.tsx +13 -13
  21. package/dist/templates/web/ai-platform/template/src/app/globals.css +97 -34
  22. package/dist/templates/web/ai-platform/template/src/app/layout.tsx +3 -0
  23. package/dist/templates/web/ai-platform/template/src/app/loading.tsx +22 -22
  24. package/dist/templates/web/ai-platform/template/src/app/login/page.tsx +112 -0
  25. package/dist/templates/web/ai-platform/template/src/app/models/page.tsx +186 -0
  26. package/dist/templates/web/ai-platform/template/src/app/page.tsx +248 -154
  27. package/dist/templates/web/ai-platform/template/src/app/playground/page.tsx +251 -0
  28. package/dist/templates/web/ai-platform/template/src/app/settings/page.tsx +190 -0
  29. package/dist/templates/web/ai-platform/template/src/app/signup/page.tsx +133 -0
  30. package/dist/templates/web/ai-platform/template/src/lib/auth-server.ts +32 -33
  31. package/dist/templates/web/ai-platform/template/src/lib/auth-session.ts +52 -0
  32. package/dist/templates/web/base/template/next.config.js +14 -15
  33. package/dist/templates/web/base/template/package.json +16 -31
  34. package/dist/templates/web/base/template/postcss.config.mjs +8 -0
  35. package/dist/templates/web/base/template/src/app/error.tsx +97 -97
  36. package/dist/templates/web/base/template/src/app/globals.css +87 -148
  37. package/dist/templates/web/base/template/src/app/layout.tsx +4 -1
  38. package/dist/templates/web/base/template/src/app/loading.tsx +52 -52
  39. package/dist/templates/web/base/template/tsconfig.json +27 -33
  40. package/dist/templates/web/iot-dashboard/template/next.config.js +14 -14
  41. package/dist/templates/web/iot-dashboard/template/package.json +12 -16
  42. package/dist/templates/web/iot-dashboard/template/postcss.config.mjs +8 -0
  43. package/dist/templates/web/iot-dashboard/template/src/app/alerts/page.tsx +157 -0
  44. package/dist/templates/web/iot-dashboard/template/src/app/api/auth/route.ts +57 -0
  45. package/dist/templates/web/iot-dashboard/template/src/app/dashboard/page.tsx +224 -224
  46. package/dist/templates/web/iot-dashboard/template/src/app/devices/[id]/page.tsx +204 -0
  47. package/dist/templates/web/iot-dashboard/template/src/app/devices/new/page.tsx +139 -0
  48. package/dist/templates/web/iot-dashboard/template/src/app/devices/page.tsx +171 -0
  49. package/dist/templates/web/iot-dashboard/template/src/app/error.tsx +8 -8
  50. package/dist/templates/web/iot-dashboard/template/src/app/globals.css +97 -20
  51. package/dist/templates/web/iot-dashboard/template/src/app/layout.tsx +3 -0
  52. package/dist/templates/web/iot-dashboard/template/src/app/loading.tsx +5 -5
  53. package/dist/templates/web/iot-dashboard/template/src/app/login/page.tsx +112 -0
  54. package/dist/templates/web/iot-dashboard/template/src/app/page.tsx +266 -189
  55. package/dist/templates/web/iot-dashboard/template/src/app/settings/page.tsx +186 -0
  56. package/dist/templates/web/iot-dashboard/template/src/app/signup/page.tsx +133 -0
  57. package/dist/templates/web/iot-dashboard/template/src/lib/auth-server.ts +32 -33
  58. package/dist/templates/web/iot-dashboard/template/src/lib/auth-session.ts +52 -0
  59. package/dist/templates/web/marketplace/template/next.config.js +14 -14
  60. package/dist/templates/web/marketplace/template/package.json +11 -18
  61. package/dist/templates/web/marketplace/template/postcss.config.mjs +8 -0
  62. package/dist/templates/web/marketplace/template/src/app/api/auth/route.ts +57 -0
  63. package/dist/templates/web/marketplace/template/src/app/cart/page.tsx +147 -147
  64. package/dist/templates/web/marketplace/template/src/app/dashboard/page.tsx +149 -149
  65. package/dist/templates/web/marketplace/template/src/app/error.tsx +7 -7
  66. package/dist/templates/web/marketplace/template/src/app/globals.css +97 -20
  67. package/dist/templates/web/marketplace/template/src/app/layout.tsx +3 -0
  68. package/dist/templates/web/marketplace/template/src/app/loading.tsx +5 -5
  69. package/dist/templates/web/marketplace/template/src/app/login/page.tsx +112 -0
  70. package/dist/templates/web/marketplace/template/src/app/orders/page.tsx +160 -0
  71. package/dist/templates/web/marketplace/template/src/app/page.tsx +370 -169
  72. package/dist/templates/web/marketplace/template/src/app/products/[id]/page.tsx +218 -0
  73. package/dist/templates/web/marketplace/template/src/app/products/page.tsx +129 -129
  74. package/dist/templates/web/marketplace/template/src/app/settings/page.tsx +150 -0
  75. package/dist/templates/web/marketplace/template/src/app/signup/page.tsx +133 -0
  76. package/dist/templates/web/marketplace/template/src/lib/auth-server.ts +32 -33
  77. package/dist/templates/web/marketplace/template/src/lib/auth-session.ts +52 -0
  78. package/dist/templates/web/micro-saas/template/next.config.js +14 -14
  79. package/dist/templates/web/micro-saas/template/package.json +9 -8
  80. package/dist/templates/web/micro-saas/template/postcss.config.mjs +8 -0
  81. package/dist/templates/web/micro-saas/template/src/app/api/auth/route.ts +57 -0
  82. package/dist/templates/web/micro-saas/template/src/app/dashboard/page.tsx +145 -117
  83. package/dist/templates/web/micro-saas/template/src/app/error.tsx +7 -7
  84. package/dist/templates/web/micro-saas/template/src/app/globals.css +97 -20
  85. package/dist/templates/web/micro-saas/template/src/app/layout.tsx +3 -0
  86. package/dist/templates/web/micro-saas/template/src/app/loading.tsx +43 -27
  87. package/dist/templates/web/micro-saas/template/src/app/login/page.tsx +112 -87
  88. package/dist/templates/web/micro-saas/template/src/app/page.tsx +227 -137
  89. package/dist/templates/web/micro-saas/template/src/app/signup/page.tsx +133 -108
  90. package/dist/templates/web/micro-saas/template/src/lib/auth-server.ts +32 -33
  91. package/dist/templates/web/micro-saas/template/src/lib/auth-session.ts +52 -0
  92. package/dist/templates/web/ui-auth/template/next.config.js +14 -12
  93. package/dist/templates/web/ui-auth/template/package.json +16 -26
  94. package/dist/templates/web/ui-auth/template/postcss.config.mjs +8 -0
  95. package/dist/templates/web/ui-auth/template/src/app/error.tsx +67 -67
  96. package/dist/templates/web/ui-auth/template/src/app/globals.css +85 -84
  97. package/dist/templates/web/ui-auth/template/src/app/layout.tsx +4 -1
  98. package/dist/templates/web/ui-auth/template/src/app/loading.tsx +20 -38
  99. package/dist/templates/web/ui-auth/template/tsconfig.json +27 -33
  100. package/dist/templates/web/ui-auth-ai/template/next.config.js +15 -13
  101. package/dist/templates/web/ui-auth-ai/template/package.json +25 -21
  102. package/dist/templates/web/ui-auth-ai/template/postcss.config.mjs +8 -0
  103. package/dist/templates/web/ui-auth-ai/template/src/app/error.tsx +7 -7
  104. package/dist/templates/web/ui-auth-ai/template/src/app/globals.css +87 -25
  105. package/dist/templates/web/ui-auth-ai/template/src/app/layout.tsx +3 -0
  106. package/dist/templates/web/ui-auth-ai/template/src/app/loading.tsx +4 -4
  107. package/dist/templates/web/ui-auth-ai/template/tsconfig.json +27 -28
  108. package/dist/templates/web/ui-auth-payments/template/next.config.js +14 -12
  109. package/dist/templates/web/ui-auth-payments/template/package.json +16 -29
  110. package/dist/templates/web/ui-auth-payments/template/postcss.config.mjs +8 -0
  111. package/dist/templates/web/ui-auth-payments/template/src/app/error.tsx +67 -67
  112. package/dist/templates/web/ui-auth-payments/template/src/app/globals.css +89 -204
  113. package/dist/templates/web/ui-auth-payments/template/src/app/layout.tsx +4 -1
  114. package/dist/templates/web/ui-auth-payments/template/src/app/loading.tsx +20 -20
  115. package/dist/templates/web/ui-auth-payments/template/tsconfig.json +27 -33
  116. package/dist/templates/web/ui-auth-payments-ai/template/next.config.js +14 -12
  117. package/dist/templates/web/ui-auth-payments-ai/template/package.json +17 -33
  118. package/dist/templates/web/ui-auth-payments-ai/template/postcss.config.mjs +8 -0
  119. package/dist/templates/web/ui-auth-payments-ai/template/src/app/error.tsx +67 -67
  120. package/dist/templates/web/ui-auth-payments-ai/template/src/app/globals.css +85 -85
  121. package/dist/templates/web/ui-auth-payments-ai/template/src/app/layout.tsx +4 -1
  122. package/dist/templates/web/ui-auth-payments-ai/template/src/app/loading.tsx +20 -20
  123. package/dist/templates/web/ui-auth-payments-ai/template/tsconfig.json +27 -33
  124. package/dist/templates/web/ui-auth-payments-audio/template/next.config.js +14 -12
  125. package/dist/templates/web/ui-auth-payments-audio/template/package.json +17 -30
  126. package/dist/templates/web/ui-auth-payments-audio/template/postcss.config.mjs +8 -0
  127. package/dist/templates/web/ui-auth-payments-audio/template/src/app/error.tsx +67 -67
  128. package/dist/templates/web/ui-auth-payments-audio/template/src/app/globals.css +85 -85
  129. package/dist/templates/web/ui-auth-payments-audio/template/src/app/layout.tsx +4 -1
  130. package/dist/templates/web/ui-auth-payments-audio/template/src/app/loading.tsx +20 -20
  131. package/dist/templates/web/ui-auth-payments-audio/template/tsconfig.json +27 -33
  132. package/dist/templates/web/ui-auth-payments-video/template/next.config.js +14 -12
  133. package/dist/templates/web/ui-auth-payments-video/template/package.json +17 -30
  134. package/dist/templates/web/ui-auth-payments-video/template/postcss.config.mjs +8 -0
  135. package/dist/templates/web/ui-auth-payments-video/template/src/app/error.tsx +67 -67
  136. package/dist/templates/web/ui-auth-payments-video/template/src/app/globals.css +89 -221
  137. package/dist/templates/web/ui-auth-payments-video/template/src/app/layout.tsx +4 -1
  138. package/dist/templates/web/ui-auth-payments-video/template/src/app/loading.tsx +20 -20
  139. package/dist/templates/web/ui-auth-payments-video/template/tsconfig.json +27 -33
  140. package/dist/templates/web/ui-only/template/next.config.js +14 -12
  141. package/dist/templates/web/ui-only/template/package.json +15 -25
  142. package/dist/templates/web/ui-only/template/postcss.config.mjs +8 -0
  143. package/dist/templates/web/ui-only/template/src/app/error.tsx +67 -67
  144. package/dist/templates/web/ui-only/template/src/app/globals.css +85 -31
  145. package/dist/templates/web/ui-only/template/src/app/layout.tsx +4 -1
  146. package/dist/templates/web/ui-only/template/src/app/loading.tsx +20 -20
  147. package/dist/templates/web/ui-only/template/tsconfig.json +27 -33
  148. package/package.json +1 -1
  149. package/src/templates/shared/auth/supabase/web/src/middleware.ts +63 -0
  150. package/src/templates/shared/database/supabase/web/src/lib/supabase/server.ts +3 -1
  151. package/src/templates/shared/design/web/src/config/design.config.ts +14 -14
  152. package/src/templates/shared/landing/web/src/components/LandingPage.tsx +0 -3
  153. package/src/templates/shared/security/web/src/lib/api-security.ts +2 -2
  154. package/src/templates/web/ai-platform/template/next.config.js +14 -14
  155. package/src/templates/web/ai-platform/template/package.json +11 -22
  156. package/src/templates/web/ai-platform/template/postcss.config.mjs +8 -0
  157. package/src/templates/web/ai-platform/template/src/app/api/auth/route.ts +57 -0
  158. package/src/templates/web/ai-platform/template/src/app/chat/page.tsx +234 -235
  159. package/src/templates/web/ai-platform/template/src/app/dashboard/page.tsx +142 -142
  160. package/src/templates/web/ai-platform/template/src/app/error.tsx +13 -13
  161. package/src/templates/web/ai-platform/template/src/app/globals.css +97 -34
  162. package/src/templates/web/ai-platform/template/src/app/layout.tsx +3 -0
  163. package/src/templates/web/ai-platform/template/src/app/loading.tsx +22 -22
  164. package/src/templates/web/ai-platform/template/src/app/login/page.tsx +112 -0
  165. package/src/templates/web/ai-platform/template/src/app/models/page.tsx +186 -0
  166. package/src/templates/web/ai-platform/template/src/app/page.tsx +248 -154
  167. package/src/templates/web/ai-platform/template/src/app/playground/page.tsx +251 -0
  168. package/src/templates/web/ai-platform/template/src/app/settings/page.tsx +190 -0
  169. package/src/templates/web/ai-platform/template/src/app/signup/page.tsx +133 -0
  170. package/src/templates/web/ai-platform/template/src/lib/auth-server.ts +32 -33
  171. package/src/templates/web/ai-platform/template/src/lib/auth-session.ts +52 -0
  172. package/src/templates/web/base/template/next.config.js +14 -15
  173. package/src/templates/web/base/template/package.json +16 -31
  174. package/src/templates/web/base/template/postcss.config.mjs +8 -0
  175. package/src/templates/web/base/template/src/app/error.tsx +97 -97
  176. package/src/templates/web/base/template/src/app/globals.css +87 -148
  177. package/src/templates/web/base/template/src/app/layout.tsx +4 -1
  178. package/src/templates/web/base/template/src/app/loading.tsx +52 -52
  179. package/src/templates/web/base/template/tsconfig.json +27 -33
  180. package/src/templates/web/iot-dashboard/template/next.config.js +14 -14
  181. package/src/templates/web/iot-dashboard/template/package.json +12 -16
  182. package/src/templates/web/iot-dashboard/template/postcss.config.mjs +8 -0
  183. package/src/templates/web/iot-dashboard/template/src/app/alerts/page.tsx +157 -0
  184. package/src/templates/web/iot-dashboard/template/src/app/api/auth/route.ts +57 -0
  185. package/src/templates/web/iot-dashboard/template/src/app/dashboard/page.tsx +224 -224
  186. package/src/templates/web/iot-dashboard/template/src/app/devices/[id]/page.tsx +204 -0
  187. package/src/templates/web/iot-dashboard/template/src/app/devices/new/page.tsx +139 -0
  188. package/src/templates/web/iot-dashboard/template/src/app/devices/page.tsx +171 -0
  189. package/src/templates/web/iot-dashboard/template/src/app/error.tsx +8 -8
  190. package/src/templates/web/iot-dashboard/template/src/app/globals.css +97 -20
  191. package/src/templates/web/iot-dashboard/template/src/app/layout.tsx +3 -0
  192. package/src/templates/web/iot-dashboard/template/src/app/loading.tsx +5 -5
  193. package/src/templates/web/iot-dashboard/template/src/app/login/page.tsx +112 -0
  194. package/src/templates/web/iot-dashboard/template/src/app/page.tsx +266 -189
  195. package/src/templates/web/iot-dashboard/template/src/app/settings/page.tsx +186 -0
  196. package/src/templates/web/iot-dashboard/template/src/app/signup/page.tsx +133 -0
  197. package/src/templates/web/iot-dashboard/template/src/lib/auth-server.ts +32 -33
  198. package/src/templates/web/iot-dashboard/template/src/lib/auth-session.ts +52 -0
  199. package/src/templates/web/marketplace/template/next.config.js +14 -14
  200. package/src/templates/web/marketplace/template/package.json +11 -18
  201. package/src/templates/web/marketplace/template/postcss.config.mjs +8 -0
  202. package/src/templates/web/marketplace/template/src/app/api/auth/route.ts +57 -0
  203. package/src/templates/web/marketplace/template/src/app/cart/page.tsx +147 -147
  204. package/src/templates/web/marketplace/template/src/app/dashboard/page.tsx +149 -149
  205. package/src/templates/web/marketplace/template/src/app/error.tsx +7 -7
  206. package/src/templates/web/marketplace/template/src/app/globals.css +97 -20
  207. package/src/templates/web/marketplace/template/src/app/layout.tsx +3 -0
  208. package/src/templates/web/marketplace/template/src/app/loading.tsx +5 -5
  209. package/src/templates/web/marketplace/template/src/app/login/page.tsx +112 -0
  210. package/src/templates/web/marketplace/template/src/app/orders/page.tsx +160 -0
  211. package/src/templates/web/marketplace/template/src/app/page.tsx +370 -169
  212. package/src/templates/web/marketplace/template/src/app/products/[id]/page.tsx +218 -0
  213. package/src/templates/web/marketplace/template/src/app/products/page.tsx +129 -129
  214. package/src/templates/web/marketplace/template/src/app/settings/page.tsx +150 -0
  215. package/src/templates/web/marketplace/template/src/app/signup/page.tsx +133 -0
  216. package/src/templates/web/marketplace/template/src/lib/auth-server.ts +32 -33
  217. package/src/templates/web/marketplace/template/src/lib/auth-session.ts +52 -0
  218. package/src/templates/web/micro-saas/template/next.config.js +14 -14
  219. package/src/templates/web/micro-saas/template/package.json +9 -8
  220. package/src/templates/web/micro-saas/template/postcss.config.mjs +8 -0
  221. package/src/templates/web/micro-saas/template/src/app/api/auth/route.ts +57 -0
  222. package/src/templates/web/micro-saas/template/src/app/dashboard/page.tsx +145 -117
  223. package/src/templates/web/micro-saas/template/src/app/error.tsx +7 -7
  224. package/src/templates/web/micro-saas/template/src/app/globals.css +97 -20
  225. package/src/templates/web/micro-saas/template/src/app/layout.tsx +3 -0
  226. package/src/templates/web/micro-saas/template/src/app/loading.tsx +43 -27
  227. package/src/templates/web/micro-saas/template/src/app/login/page.tsx +112 -87
  228. package/src/templates/web/micro-saas/template/src/app/page.tsx +227 -137
  229. package/src/templates/web/micro-saas/template/src/app/signup/page.tsx +133 -108
  230. package/src/templates/web/micro-saas/template/src/lib/auth-server.ts +32 -33
  231. package/src/templates/web/micro-saas/template/src/lib/auth-session.ts +52 -0
  232. package/src/templates/web/ui-auth/template/next.config.js +14 -12
  233. package/src/templates/web/ui-auth/template/package.json +16 -26
  234. package/src/templates/web/ui-auth/template/postcss.config.mjs +8 -0
  235. package/src/templates/web/ui-auth/template/src/app/error.tsx +67 -67
  236. package/src/templates/web/ui-auth/template/src/app/globals.css +85 -84
  237. package/src/templates/web/ui-auth/template/src/app/layout.tsx +4 -1
  238. package/src/templates/web/ui-auth/template/src/app/loading.tsx +20 -38
  239. package/src/templates/web/ui-auth/template/tsconfig.json +27 -33
  240. package/src/templates/web/ui-auth-ai/template/next.config.js +15 -13
  241. package/src/templates/web/ui-auth-ai/template/package.json +25 -21
  242. package/src/templates/web/ui-auth-ai/template/postcss.config.mjs +8 -0
  243. package/src/templates/web/ui-auth-ai/template/src/app/error.tsx +7 -7
  244. package/src/templates/web/ui-auth-ai/template/src/app/globals.css +87 -25
  245. package/src/templates/web/ui-auth-ai/template/src/app/layout.tsx +3 -0
  246. package/src/templates/web/ui-auth-ai/template/src/app/loading.tsx +4 -4
  247. package/src/templates/web/ui-auth-ai/template/tsconfig.json +27 -28
  248. package/src/templates/web/ui-auth-payments/template/next.config.js +14 -12
  249. package/src/templates/web/ui-auth-payments/template/package.json +16 -29
  250. package/src/templates/web/ui-auth-payments/template/postcss.config.mjs +8 -0
  251. package/src/templates/web/ui-auth-payments/template/src/app/error.tsx +67 -67
  252. package/src/templates/web/ui-auth-payments/template/src/app/globals.css +89 -204
  253. package/src/templates/web/ui-auth-payments/template/src/app/layout.tsx +4 -1
  254. package/src/templates/web/ui-auth-payments/template/src/app/loading.tsx +20 -20
  255. package/src/templates/web/ui-auth-payments/template/tsconfig.json +27 -33
  256. package/src/templates/web/ui-auth-payments-ai/template/next.config.js +14 -12
  257. package/src/templates/web/ui-auth-payments-ai/template/package.json +17 -33
  258. package/src/templates/web/ui-auth-payments-ai/template/postcss.config.mjs +8 -0
  259. package/src/templates/web/ui-auth-payments-ai/template/src/app/error.tsx +67 -67
  260. package/src/templates/web/ui-auth-payments-ai/template/src/app/globals.css +85 -85
  261. package/src/templates/web/ui-auth-payments-ai/template/src/app/layout.tsx +4 -1
  262. package/src/templates/web/ui-auth-payments-ai/template/src/app/loading.tsx +20 -20
  263. package/src/templates/web/ui-auth-payments-ai/template/tsconfig.json +27 -33
  264. package/src/templates/web/ui-auth-payments-audio/template/next.config.js +14 -12
  265. package/src/templates/web/ui-auth-payments-audio/template/package.json +17 -30
  266. package/src/templates/web/ui-auth-payments-audio/template/postcss.config.mjs +8 -0
  267. package/src/templates/web/ui-auth-payments-audio/template/src/app/error.tsx +67 -67
  268. package/src/templates/web/ui-auth-payments-audio/template/src/app/globals.css +85 -85
  269. package/src/templates/web/ui-auth-payments-audio/template/src/app/layout.tsx +4 -1
  270. package/src/templates/web/ui-auth-payments-audio/template/src/app/loading.tsx +20 -20
  271. package/src/templates/web/ui-auth-payments-audio/template/tsconfig.json +27 -33
  272. package/src/templates/web/ui-auth-payments-video/template/next.config.js +14 -12
  273. package/src/templates/web/ui-auth-payments-video/template/package.json +17 -30
  274. package/src/templates/web/ui-auth-payments-video/template/postcss.config.mjs +8 -0
  275. package/src/templates/web/ui-auth-payments-video/template/src/app/error.tsx +67 -67
  276. package/src/templates/web/ui-auth-payments-video/template/src/app/globals.css +89 -221
  277. package/src/templates/web/ui-auth-payments-video/template/src/app/layout.tsx +4 -1
  278. package/src/templates/web/ui-auth-payments-video/template/src/app/loading.tsx +20 -20
  279. package/src/templates/web/ui-auth-payments-video/template/tsconfig.json +27 -33
  280. package/src/templates/web/ui-only/template/next.config.js +14 -12
  281. package/src/templates/web/ui-only/template/package.json +15 -25
  282. package/src/templates/web/ui-only/template/postcss.config.mjs +8 -0
  283. package/src/templates/web/ui-only/template/src/app/error.tsx +67 -67
  284. package/src/templates/web/ui-only/template/src/app/globals.css +85 -31
  285. package/src/templates/web/ui-only/template/src/app/layout.tsx +4 -1
  286. package/src/templates/web/ui-only/template/src/app/loading.tsx +20 -20
  287. package/src/templates/web/ui-only/template/tsconfig.json +27 -33
  288. package/dist/templates/web/ai-platform/template/middleware.ts +0 -55
  289. package/dist/templates/web/ai-platform/template/src/lib/supabase/client.ts +0 -8
  290. package/dist/templates/web/ai-platform/template/src/lib/supabase/server.ts +0 -27
  291. package/dist/templates/web/base/template/postcss.config.js +0 -7
  292. package/dist/templates/web/base/template/tailwind.config.js +0 -77
  293. package/dist/templates/web/iot-dashboard/template/middleware.ts +0 -56
  294. package/dist/templates/web/iot-dashboard/template/src/lib/supabase/client.ts +0 -8
  295. package/dist/templates/web/iot-dashboard/template/src/lib/supabase/server.ts +0 -27
  296. package/dist/templates/web/marketplace/template/middleware.ts +0 -56
  297. package/dist/templates/web/marketplace/template/src/lib/supabase/client.ts +0 -8
  298. package/dist/templates/web/marketplace/template/src/lib/supabase/server.ts +0 -27
  299. package/dist/templates/web/micro-saas/template/middleware.ts +0 -53
  300. package/dist/templates/web/micro-saas/template/src/lib/supabase/client.ts +0 -8
  301. package/dist/templates/web/micro-saas/template/src/lib/supabase/server.ts +0 -29
  302. package/dist/templates/web/ui-auth/template/.claude +0 -21
  303. package/dist/templates/web/ui-auth/template/context.md +0 -105
  304. package/dist/templates/web/ui-auth/template/postcss.config.js +0 -7
  305. package/dist/templates/web/ui-auth/template/tailwind.config.js +0 -77
  306. package/dist/templates/web/ui-auth-ai/template/postcss.config.js +0 -6
  307. package/dist/templates/web/ui-auth-ai/template/tailwind.config.js +0 -22
  308. package/dist/templates/web/ui-auth-payments/template/middleware.ts +0 -68
  309. package/dist/templates/web/ui-auth-payments/template/package-lock.json +0 -12240
  310. package/dist/templates/web/ui-auth-payments/template/postcss.config.js +0 -7
  311. package/dist/templates/web/ui-auth-payments/template/tailwind.config.js +0 -77
  312. package/dist/templates/web/ui-auth-payments/template/tsconfig.tsbuildinfo +0 -1
  313. package/dist/templates/web/ui-auth-payments-ai/template/.claude +0 -21
  314. package/dist/templates/web/ui-auth-payments-ai/template/context.md +0 -169
  315. package/dist/templates/web/ui-auth-payments-ai/template/middleware.ts +0 -68
  316. package/dist/templates/web/ui-auth-payments-ai/template/package-lock.json +0 -12241
  317. package/dist/templates/web/ui-auth-payments-ai/template/postcss.config.js +0 -7
  318. package/dist/templates/web/ui-auth-payments-ai/template/tailwind.config.js +0 -77
  319. package/dist/templates/web/ui-auth-payments-ai/template/tsconfig.tsbuildinfo +0 -1
  320. package/dist/templates/web/ui-auth-payments-audio/template/middleware.ts +0 -68
  321. package/dist/templates/web/ui-auth-payments-audio/template/package-lock.json +0 -12241
  322. package/dist/templates/web/ui-auth-payments-audio/template/postcss.config.js +0 -7
  323. package/dist/templates/web/ui-auth-payments-audio/template/tailwind.config.js +0 -77
  324. package/dist/templates/web/ui-auth-payments-audio/template/tsconfig.tsbuildinfo +0 -1
  325. package/dist/templates/web/ui-auth-payments-video/template/postcss.config.js +0 -7
  326. package/dist/templates/web/ui-auth-payments-video/template/tailwind.config.js +0 -77
  327. package/dist/templates/web/ui-only/template/postcss.config.js +0 -7
  328. package/dist/templates/web/ui-only/template/tailwind.config.js +0 -77
  329. package/src/templates/web/ai-platform/template/middleware.ts +0 -55
  330. package/src/templates/web/ai-platform/template/src/lib/supabase/client.ts +0 -8
  331. package/src/templates/web/ai-platform/template/src/lib/supabase/server.ts +0 -27
  332. package/src/templates/web/base/template/postcss.config.js +0 -7
  333. package/src/templates/web/base/template/tailwind.config.js +0 -77
  334. package/src/templates/web/iot-dashboard/template/middleware.ts +0 -56
  335. package/src/templates/web/iot-dashboard/template/src/lib/supabase/client.ts +0 -8
  336. package/src/templates/web/iot-dashboard/template/src/lib/supabase/server.ts +0 -27
  337. package/src/templates/web/marketplace/template/middleware.ts +0 -56
  338. package/src/templates/web/marketplace/template/src/lib/supabase/client.ts +0 -8
  339. package/src/templates/web/marketplace/template/src/lib/supabase/server.ts +0 -27
  340. package/src/templates/web/micro-saas/template/middleware.ts +0 -53
  341. package/src/templates/web/micro-saas/template/src/lib/supabase/client.ts +0 -8
  342. package/src/templates/web/micro-saas/template/src/lib/supabase/server.ts +0 -29
  343. package/src/templates/web/ui-auth/template/.claude +0 -21
  344. package/src/templates/web/ui-auth/template/context.md +0 -105
  345. package/src/templates/web/ui-auth/template/postcss.config.js +0 -7
  346. package/src/templates/web/ui-auth/template/tailwind.config.js +0 -77
  347. package/src/templates/web/ui-auth-ai/template/postcss.config.js +0 -6
  348. package/src/templates/web/ui-auth-ai/template/tailwind.config.js +0 -22
  349. package/src/templates/web/ui-auth-payments/template/middleware.ts +0 -68
  350. package/src/templates/web/ui-auth-payments/template/package-lock.json +0 -12240
  351. package/src/templates/web/ui-auth-payments/template/postcss.config.js +0 -7
  352. package/src/templates/web/ui-auth-payments/template/tailwind.config.js +0 -77
  353. package/src/templates/web/ui-auth-payments/template/tsconfig.tsbuildinfo +0 -1
  354. package/src/templates/web/ui-auth-payments-ai/template/.claude +0 -21
  355. package/src/templates/web/ui-auth-payments-ai/template/context.md +0 -169
  356. package/src/templates/web/ui-auth-payments-ai/template/middleware.ts +0 -68
  357. package/src/templates/web/ui-auth-payments-ai/template/package-lock.json +0 -12241
  358. package/src/templates/web/ui-auth-payments-ai/template/postcss.config.js +0 -7
  359. package/src/templates/web/ui-auth-payments-ai/template/tailwind.config.js +0 -77
  360. package/src/templates/web/ui-auth-payments-ai/template/tsconfig.tsbuildinfo +0 -1
  361. package/src/templates/web/ui-auth-payments-audio/template/middleware.ts +0 -68
  362. package/src/templates/web/ui-auth-payments-audio/template/package-lock.json +0 -12241
  363. package/src/templates/web/ui-auth-payments-audio/template/postcss.config.js +0 -7
  364. package/src/templates/web/ui-auth-payments-audio/template/tailwind.config.js +0 -77
  365. package/src/templates/web/ui-auth-payments-audio/template/tsconfig.tsbuildinfo +0 -1
  366. package/src/templates/web/ui-auth-payments-video/template/postcss.config.js +0 -7
  367. package/src/templates/web/ui-auth-payments-video/template/tailwind.config.js +0 -77
  368. package/src/templates/web/ui-only/template/postcss.config.js +0 -7
  369. package/src/templates/web/ui-only/template/tailwind.config.js +0 -77
  370. /package/dist/templates/shared/admin/web/{components → src/components}/admin-nav.tsx +0 -0
  371. /package/dist/templates/shared/auth/keycloak/web/{auth.config.ts → src/auth.config.ts} +0 -0
  372. /package/dist/templates/shared/auth/keycloak/web/{auth.ts → src/auth.ts} +0 -0
  373. /package/dist/templates/shared/middleware/web/{middleware.ts → src/middleware.ts} +0 -0
  374. /package/src/templates/shared/admin/web/{components → src/components}/admin-nav.tsx +0 -0
  375. /package/src/templates/shared/auth/keycloak/web/{auth.config.ts → src/auth.config.ts} +0 -0
  376. /package/src/templates/shared/auth/keycloak/web/{auth.ts → src/auth.ts} +0 -0
  377. /package/src/templates/shared/middleware/web/{middleware.ts → src/middleware.ts} +0 -0
@@ -0,0 +1,133 @@
1
+ 'use client'
2
+
3
+ import { useState } from 'react'
4
+ import { Button, Card, CardContent } from '@digilogiclabs/saas-factory-ui'
5
+ import { ShoppingBag } from 'lucide-react'
6
+ import { useRouter } from 'next/navigation'
7
+ import Link from 'next/link'
8
+
9
+ export default function SignupPage() {
10
+ const [email, setEmail] = useState('')
11
+ const [password, setPassword] = useState('')
12
+ const [confirmPassword, setConfirmPassword] = useState('')
13
+ const [error, setError] = useState('')
14
+ const [loading, setLoading] = useState(false)
15
+ const router = useRouter()
16
+
17
+ const handleSubmit = async (e: React.FormEvent) => {
18
+ e.preventDefault()
19
+ setError('')
20
+ if (password !== confirmPassword) {
21
+ setError('Passwords do not match')
22
+ return
23
+ }
24
+ setLoading(true)
25
+ try {
26
+ const res = await fetch('/api/auth', {
27
+ method: 'POST',
28
+ headers: { 'Content-Type': 'application/json' },
29
+ body: JSON.stringify({ email, password, action: 'signup' }),
30
+ })
31
+ if (!res.ok) {
32
+ const data = await res.json()
33
+ throw new Error(data.error || 'Failed to create account')
34
+ }
35
+ router.push('/dashboard')
36
+ router.refresh()
37
+ } catch (err) {
38
+ setError(err instanceof Error ? err.message : 'Failed to create account')
39
+ } finally {
40
+ setLoading(false)
41
+ }
42
+ }
43
+
44
+ return (
45
+ <div className="min-h-screen flex items-center justify-center bg-background px-4">
46
+ <div className="w-full max-w-md">
47
+ {/* Logo */}
48
+ <Link href="/" className="flex items-center justify-center gap-2 mb-8 hover:opacity-80 transition-opacity">
49
+ <div className="w-10 h-10 rounded-xl bg-gradient-to-br from-brand-from via-brand-via to-brand-to flex items-center justify-center">
50
+ <ShoppingBag className="w-5 h-5 text-white" />
51
+ </div>
52
+ <span className="font-bold text-xl">Marketplace</span>
53
+ </Link>
54
+
55
+ <Card className="border border-border">
56
+ <CardContent className="p-8">
57
+ <div className="text-center mb-8">
58
+ <h1 className="text-2xl font-bold">Create your account</h1>
59
+ <p className="text-muted-foreground mt-2">Start buying and selling today</p>
60
+ </div>
61
+
62
+ {error && (
63
+ <div className="bg-destructive/10 text-destructive p-3 rounded-lg mb-6 text-sm" role="alert">
64
+ {error}
65
+ </div>
66
+ )}
67
+
68
+ <form onSubmit={handleSubmit} className="space-y-4">
69
+ <div>
70
+ <label htmlFor="email" className="block text-sm font-medium mb-1.5">
71
+ Email
72
+ </label>
73
+ <input
74
+ id="email"
75
+ type="email"
76
+ value={email}
77
+ onChange={(e) => setEmail(e.target.value)}
78
+ className="w-full px-3 py-2.5 rounded-lg border border-input bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-shadow"
79
+ placeholder="you@example.com"
80
+ required
81
+ />
82
+ </div>
83
+
84
+ <div>
85
+ <label htmlFor="password" className="block text-sm font-medium mb-1.5">
86
+ Password
87
+ </label>
88
+ <input
89
+ id="password"
90
+ type="password"
91
+ value={password}
92
+ onChange={(e) => setPassword(e.target.value)}
93
+ className="w-full px-3 py-2.5 rounded-lg border border-input bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-shadow"
94
+ placeholder="Minimum 8 characters"
95
+ required
96
+ minLength={8}
97
+ />
98
+ </div>
99
+
100
+ <div>
101
+ <label htmlFor="confirmPassword" className="block text-sm font-medium mb-1.5">
102
+ Confirm Password
103
+ </label>
104
+ <input
105
+ id="confirmPassword"
106
+ type="password"
107
+ value={confirmPassword}
108
+ onChange={(e) => setConfirmPassword(e.target.value)}
109
+ className="w-full px-3 py-2.5 rounded-lg border border-input bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-shadow"
110
+ placeholder="Re-enter your password"
111
+ required
112
+ />
113
+ </div>
114
+
115
+ <Button type="submit" className="w-full h-11 text-base cursor-pointer hover:brightness-110 active:scale-[0.98] transition-all duration-200" disabled={loading}>
116
+ {loading ? 'Creating account...' : 'Create Account'}
117
+ </Button>
118
+ </form>
119
+
120
+ <div className="mt-6 text-center">
121
+ <p className="text-muted-foreground text-sm">
122
+ Already have an account?{' '}
123
+ <Link href="/login" className="text-primary hover:underline font-medium">
124
+ Sign in
125
+ </Link>
126
+ </p>
127
+ </div>
128
+ </CardContent>
129
+ </Card>
130
+ </div>
131
+ </div>
132
+ )
133
+ }
@@ -1,33 +1,32 @@
1
- import { redirect } from 'next/navigation'
2
- import { createClient } from './supabase/server'
3
-
4
- export interface AuthUser {
5
- id: string
6
- email: string | null
7
- name?: string | null
8
- }
9
-
10
- export async function getUser(): Promise<AuthUser | null> {
11
- const supabase = await createClient()
12
- const { data: { user }, error } = await supabase.auth.getUser()
13
-
14
- if (error || !user) {
15
- return null
16
- }
17
-
18
- return {
19
- id: user.id,
20
- email: user.email ?? null,
21
- name: user.user_metadata?.name ?? user.user_metadata?.full_name ?? null,
22
- }
23
- }
24
-
25
- export async function requireAuth(): Promise<AuthUser> {
26
- const user = await getUser()
27
-
28
- if (!user) {
29
- redirect('/login')
30
- }
31
-
32
- return user
33
- }
1
+ import { redirect } from 'next/navigation'
2
+ import { getSession, getUser as getSessionUser } from './auth-session'
3
+
4
+ export interface AuthUser {
5
+ id: string
6
+ email: string | null
7
+ name?: string | null
8
+ }
9
+
10
+ export async function getUser(): Promise<AuthUser | null> {
11
+ const user = await getSessionUser()
12
+
13
+ if (!user || !user.id) {
14
+ return null
15
+ }
16
+
17
+ return {
18
+ id: user.id,
19
+ email: user.email ?? null,
20
+ name: user.name ?? null,
21
+ }
22
+ }
23
+
24
+ export async function requireAuth(): Promise<AuthUser> {
25
+ const user = await getUser()
26
+
27
+ if (!user) {
28
+ redirect('/login')
29
+ }
30
+
31
+ return user
32
+ }
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Auth session adapter — demo implementation.
3
+ *
4
+ * Replace this file with a real provider when configuring your app:
5
+ * - Keycloak: import { auth } from '@/auth' (Auth.js)
6
+ * - Supabase: import { createClient } from '@/lib/supabase/server'
7
+ * - Firebase: import { getServerSession } from 'next-auth'
8
+ *
9
+ * The getSession() and getUser() exports are consumed by auth-server.ts
10
+ * and must return the same shape regardless of provider.
11
+ */
12
+ import 'server-only'
13
+ import { cookies } from 'next/headers'
14
+
15
+ type SessionUser = {
16
+ id?: string
17
+ email?: string | null
18
+ name?: string | null
19
+ roles?: string[]
20
+ }
21
+
22
+ type Session = {
23
+ user?: SessionUser
24
+ }
25
+
26
+ /**
27
+ * Get the current session from cookies.
28
+ * Demo: reads a JSON cookie set at login. Replace with your auth provider.
29
+ */
30
+ export async function getSession(): Promise<Session | null> {
31
+ const cookieStore = await cookies()
32
+ const sessionCookie = cookieStore.get('session')
33
+
34
+ if (!sessionCookie?.value) {
35
+ return null
36
+ }
37
+
38
+ try {
39
+ const session = JSON.parse(sessionCookie.value) as Session
40
+ return session
41
+ } catch {
42
+ return null
43
+ }
44
+ }
45
+
46
+ /**
47
+ * Get the current authenticated user, or null.
48
+ */
49
+ export async function getUser(): Promise<SessionUser | null> {
50
+ const session = await getSession()
51
+ return session?.user ?? null
52
+ }
@@ -1,14 +1,14 @@
1
- /** @type {import('next').NextConfig} */
2
- const nextConfig = {
3
- reactStrictMode: true,
4
- images: {
5
- remotePatterns: [
6
- {
7
- protocol: 'https',
8
- hostname: '**.supabase.co',
9
- },
10
- ],
11
- },
12
- }
13
-
14
- module.exports = nextConfig
1
+ /** @type {import('next').NextConfig} */
2
+ const nextConfig = {
3
+ reactStrictMode: true,
4
+ images: {
5
+ remotePatterns: [
6
+ {
7
+ protocol: 'https',
8
+ hostname: '**',
9
+ },
10
+ ],
11
+ },
12
+ }
13
+
14
+ module.exports = nextConfig
@@ -11,22 +11,23 @@
11
11
  "type-check": "tsc --noEmit"
12
12
  },
13
13
  "dependencies": {
14
- "next": "^15.0.0",
14
+ "next": "^15.5.0",
15
15
  "react": "^19.0.0",
16
16
  "react-dom": "^19.0.0",
17
- "@digilogiclabs/platform-core": "^1.13.0",
18
- "@digilogiclabs/app-sdk": "^1.0.0",
19
- "@digilogiclabs/saas-factory-ui": "^1.4.0",
20
- "tailwindcss": "^4.0.0",
21
- "clsx": "^2.0.0",
17
+ "@digilogiclabs/platform-core": "^1.14.0",
18
+ "@digilogiclabs/app-sdk": "^1.1.0",
19
+ "@digilogiclabs/saas-factory-ui": "^1.8.1",
20
+ "tailwindcss": "^4.1.0",
21
+ "@tailwindcss/postcss": "^4.1.0",
22
+ "clsx": "^2.1.0",
22
23
  "class-variance-authority": "^0.7.0",
23
- "tailwind-merge": "^2.0.0",
24
+ "tailwind-merge": "^2.6.0",
24
25
  "next-themes": "^0.4.0",
25
26
  "lucide-react": "^0.460.0",
26
27
  "zod": "^4.1.0"
27
28
  },
28
29
  "devDependencies": {
29
- "typescript": "^5.7.0",
30
+ "typescript": "^5.8.0",
30
31
  "@types/node": "^22.0.0",
31
32
  "@types/react": "^19.0.0",
32
33
  "@types/react-dom": "^19.0.0",
@@ -0,0 +1,8 @@
1
+ /** @type {import('postcss-load-config').Config} */
2
+ const config = {
3
+ plugins: {
4
+ '@tailwindcss/postcss': {},
5
+ },
6
+ };
7
+
8
+ export default config;
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Demo auth API routes.
3
+ *
4
+ * POST /api/auth — Login or Signup
5
+ * DELETE /api/auth — Logout
6
+ *
7
+ * Replace with your real auth provider (Auth.js, Supabase Auth, etc.)
8
+ * when configuring your app for production.
9
+ */
10
+ import { NextRequest, NextResponse } from 'next/server'
11
+ import { cookies } from 'next/headers'
12
+
13
+ export async function POST(request: NextRequest) {
14
+ try {
15
+ const body = await request.json()
16
+ const { email, password, action } = body
17
+
18
+ if (!email || !password) {
19
+ return NextResponse.json(
20
+ { error: 'Email and password are required' },
21
+ { status: 400 }
22
+ )
23
+ }
24
+
25
+ // Demo: accept any email/password combination.
26
+ // Replace with real authentication (database lookup, bcrypt compare, etc.)
27
+ const user = {
28
+ id: crypto.randomUUID(),
29
+ email,
30
+ name: email.split('@')[0],
31
+ }
32
+
33
+ const session = JSON.stringify({ user })
34
+ const cookieStore = await cookies()
35
+
36
+ cookieStore.set('session', session, {
37
+ httpOnly: true,
38
+ secure: process.env.NODE_ENV === 'production',
39
+ sameSite: 'lax',
40
+ path: '/',
41
+ maxAge: 60 * 60 * 24 * 7, // 7 days
42
+ })
43
+
44
+ return NextResponse.json({ user })
45
+ } catch {
46
+ return NextResponse.json(
47
+ { error: 'Authentication failed' },
48
+ { status: 500 }
49
+ )
50
+ }
51
+ }
52
+
53
+ export async function DELETE() {
54
+ const cookieStore = await cookies()
55
+ cookieStore.delete('session')
56
+ return NextResponse.json({ success: true })
57
+ }
@@ -1,117 +1,145 @@
1
- import { Suspense } from 'react'
2
- import { Button, Card } from '@digilogiclabs/saas-factory-ui'
3
- import { User, Settings, Activity, Home, BarChart } from 'lucide-react'
4
- import { requireAuth } from '@/lib/auth-server'
5
- import Link from 'next/link'
6
-
7
- async function getStats(userId: string) {
8
- await new Promise(resolve => setTimeout(resolve, 100))
9
- return {
10
- activeUsers: 42,
11
- totalActions: 1337,
12
- weeklyGrowth: '+12%',
13
- }
14
- }
15
-
16
- function StatCard({ title, value, icon: Icon }: {
17
- title: string
18
- value: string | number
19
- icon: React.ComponentType<{ className?: string }>
20
- }) {
21
- return (
22
- <Card className="p-6">
23
- <div className="flex items-center justify-between">
24
- <div>
25
- <p className="text-sm font-medium text-gray-600 dark:text-gray-400">{title}</p>
26
- <p className="text-2xl font-bold text-gray-900 dark:text-white">{value}</p>
27
- </div>
28
- <Icon className="h-8 w-8 text-blue-600 dark:text-blue-400" />
29
- </div>
30
- </Card>
31
- )
32
- }
33
-
34
- async function Stats({ userId }: { userId: string }) {
35
- const stats = await getStats(userId)
36
-
37
- return (
38
- <div className="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8">
39
- <StatCard title="Active Users" value={stats.activeUsers} icon={User} />
40
- <StatCard title="Total Actions" value={stats.totalActions.toLocaleString()} icon={Activity} />
41
- <StatCard title="Weekly Growth" value={stats.weeklyGrowth} icon={BarChart} />
42
- </div>
43
- )
44
- }
45
-
46
- function StatsSkeleton() {
47
- return (
48
- <div className="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8">
49
- {[...Array(3)].map((_, i) => (
50
- <Card key={i} className="p-6">
51
- <div className="animate-pulse">
52
- <div className="h-4 bg-gray-200 dark:bg-gray-700 rounded w-1/2 mb-2"></div>
53
- <div className="h-8 bg-gray-200 dark:bg-gray-700 rounded w-1/3"></div>
54
- </div>
55
- </Card>
56
- ))}
57
- </div>
58
- )
59
- }
60
-
61
- export default async function DashboardPage() {
62
- const user = await requireAuth()
63
-
64
- return (
65
- <div className="min-h-screen bg-gray-50 dark:bg-gray-900">
66
- <div className="max-w-6xl mx-auto px-4 py-8">
67
- {/* Header */}
68
- <div className="flex items-center justify-between mb-8">
69
- <div>
70
- <h1 className="text-3xl font-bold text-gray-900 dark:text-white">
71
- Dashboard
72
- </h1>
73
- <p className="text-gray-600 dark:text-gray-300 mt-1">
74
- Welcome back, {user.name || user.email}
75
- </p>
76
- </div>
77
- <Link href="/">
78
- <Button variant="outline" size="sm">
79
- <Home className="w-4 h-4 mr-2" />
80
- Home
81
- </Button>
82
- </Link>
83
- </div>
84
-
85
- {/* Stats */}
86
- <Suspense fallback={<StatsSkeleton />}>
87
- <Stats userId={user.id} />
88
- </Suspense>
89
-
90
- {/* Quick Actions */}
91
- <div className="grid grid-cols-1 md:grid-cols-2 gap-6">
92
- <Card className="p-6">
93
- <div className="flex items-center mb-4">
94
- <User className="h-6 w-6 text-blue-600 mr-3" />
95
- <h3 className="text-lg font-semibold">Your Profile</h3>
96
- </div>
97
- <p className="text-gray-600 dark:text-gray-300 mb-4">
98
- Manage your account settings and preferences.
99
- </p>
100
- <Button className="w-full">Edit Profile</Button>
101
- </Card>
102
-
103
- <Card className="p-6">
104
- <div className="flex items-center mb-4">
105
- <Settings className="h-6 w-6 text-blue-600 mr-3" />
106
- <h3 className="text-lg font-semibold">Settings</h3>
107
- </div>
108
- <p className="text-gray-600 dark:text-gray-300 mb-4">
109
- Configure your application preferences.
110
- </p>
111
- <Button variant="outline" className="w-full">Open Settings</Button>
112
- </Card>
113
- </div>
114
- </div>
115
- </div>
116
- )
117
- }
1
+ import { Suspense } from 'react'
2
+ import { Button, Card, CardContent } from '@digilogiclabs/saas-factory-ui'
3
+ import { User, Settings, Activity, Home, BarChart, Zap } from 'lucide-react'
4
+ import { requireAuth } from '@/lib/auth-server'
5
+ import Link from 'next/link'
6
+
7
+ async function getStats(userId: string) {
8
+ await new Promise(resolve => setTimeout(resolve, 100))
9
+ return {
10
+ activeUsers: 42,
11
+ totalActions: 1337,
12
+ weeklyGrowth: '+12%',
13
+ }
14
+ }
15
+
16
+ function StatCard({ title, value, icon: Icon }: {
17
+ title: string
18
+ value: string | number
19
+ icon: React.ComponentType<{ className?: string }>
20
+ }) {
21
+ return (
22
+ <Card className="hover:shadow-md hover:-translate-y-0.5 transition-all duration-200">
23
+ <CardContent className="p-6">
24
+ <div className="flex items-center justify-between">
25
+ <div>
26
+ <p className="text-sm font-medium text-muted-foreground">{title}</p>
27
+ <p className="text-2xl font-bold mt-1">{value}</p>
28
+ </div>
29
+ <div className="w-12 h-12 rounded-xl bg-primary/10 flex items-center justify-center">
30
+ <Icon className="h-6 w-6 text-primary" />
31
+ </div>
32
+ </div>
33
+ </CardContent>
34
+ </Card>
35
+ )
36
+ }
37
+
38
+ async function Stats({ userId }: { userId: string }) {
39
+ const stats = await getStats(userId)
40
+ return (
41
+ <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 sm:gap-6 mb-8">
42
+ <StatCard title="Active Users" value={stats.activeUsers} icon={User} />
43
+ <StatCard title="Total Actions" value={stats.totalActions.toLocaleString()} icon={Activity} />
44
+ <StatCard title="Weekly Growth" value={stats.weeklyGrowth} icon={BarChart} />
45
+ </div>
46
+ )
47
+ }
48
+
49
+ function StatsSkeleton() {
50
+ return (
51
+ <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 sm:gap-6 mb-8">
52
+ {[1, 2, 3].map((i) => (
53
+ <Card key={i}>
54
+ <CardContent className="p-6">
55
+ <div className="flex items-center justify-between">
56
+ <div className="space-y-2">
57
+ <div className="h-4 w-20 rounded bg-muted animate-pulse" />
58
+ <div className="h-7 w-16 rounded bg-muted animate-pulse" />
59
+ </div>
60
+ <div className="w-12 h-12 rounded-xl bg-muted animate-pulse" />
61
+ </div>
62
+ </CardContent>
63
+ </Card>
64
+ ))}
65
+ </div>
66
+ )
67
+ }
68
+
69
+ export default async function DashboardPage() {
70
+ const user = await requireAuth()
71
+
72
+ return (
73
+ <div className="min-h-screen bg-background">
74
+ {/* Nav */}
75
+ <nav className="sticky top-0 z-50 border-b border-border bg-background/80 backdrop-blur-lg">
76
+ <div className="max-w-6xl mx-auto px-4 sm:px-6 h-16 flex items-center justify-between">
77
+ <Link href="/" className="flex items-center gap-2 hover:opacity-80 transition-opacity">
78
+ <div className="w-8 h-8 rounded-lg bg-gradient-to-br from-brand-from via-brand-via to-brand-to flex items-center justify-center">
79
+ <Zap className="w-4 h-4 text-white" />
80
+ </div>
81
+ <span className="font-bold text-lg">Micro Saas</span>
82
+ </Link>
83
+ <Link href="/">
84
+ <Button variant="outline" size="sm" className="hover:bg-accent active:scale-95 transition-all duration-200 cursor-pointer">
85
+ <Home className="w-4 h-4 mr-2" />
86
+ Home
87
+ </Button>
88
+ </Link>
89
+ </div>
90
+ </nav>
91
+
92
+ <div className="max-w-6xl mx-auto px-4 sm:px-6 py-8">
93
+ {/* Header */}
94
+ <div className="mb-8">
95
+ <h1 className="text-3xl font-bold">Dashboard</h1>
96
+ <p className="text-muted-foreground mt-1">
97
+ Welcome back, {user.name || user.email}
98
+ </p>
99
+ </div>
100
+
101
+ {/* Stats */}
102
+ <Suspense fallback={<StatsSkeleton />}>
103
+ <Stats userId={user.id} />
104
+ </Suspense>
105
+
106
+ {/* Quick Actions */}
107
+ <div className="grid grid-cols-1 sm:grid-cols-2 gap-4 sm:gap-6">
108
+ <Card className="group hover:shadow-md hover:-translate-y-0.5 hover:border-primary/20 transition-all duration-200">
109
+ <CardContent className="p-6">
110
+ <div className="flex items-center mb-4">
111
+ <div className="w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center mr-3">
112
+ <User className="h-5 w-5 text-primary" />
113
+ </div>
114
+ <h3 className="text-lg font-semibold group-hover:text-primary transition-colors">Your Profile</h3>
115
+ </div>
116
+ <p className="text-muted-foreground mb-4">
117
+ Manage your account settings and preferences.
118
+ </p>
119
+ <Button className="w-full cursor-pointer hover:brightness-110 active:scale-[0.98] transition-all duration-200">
120
+ Edit Profile
121
+ </Button>
122
+ </CardContent>
123
+ </Card>
124
+
125
+ <Card className="group hover:shadow-md hover:-translate-y-0.5 hover:border-primary/20 transition-all duration-200">
126
+ <CardContent className="p-6">
127
+ <div className="flex items-center mb-4">
128
+ <div className="w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center mr-3">
129
+ <Settings className="h-5 w-5 text-primary" />
130
+ </div>
131
+ <h3 className="text-lg font-semibold group-hover:text-primary transition-colors">Settings</h3>
132
+ </div>
133
+ <p className="text-muted-foreground mb-4">
134
+ Configure your application preferences.
135
+ </p>
136
+ <Button variant="outline" className="w-full cursor-pointer hover:bg-accent active:scale-[0.98] transition-all duration-200">
137
+ Open Settings
138
+ </Button>
139
+ </CardContent>
140
+ </Card>
141
+ </div>
142
+ </div>
143
+ </div>
144
+ )
145
+ }