@nextsparkjs/core 0.1.0-beta.83 → 0.1.0-beta.85

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 (365) hide show
  1. package/dist/styles/classes.json +1 -1
  2. package/dist/templates/app/(auth)/forgot-password/page.tsx +216 -0
  3. package/dist/templates/app/(auth)/layout.tsx +51 -0
  4. package/dist/templates/app/(auth)/login/page.tsx +21 -0
  5. package/dist/templates/app/(auth)/reset-password/page.tsx +212 -0
  6. package/dist/templates/app/(auth)/signup/page.tsx +21 -0
  7. package/dist/templates/app/(auth)/verify-email/page.tsx +190 -0
  8. package/dist/templates/app/(public)/[...slug]/page.tsx +378 -0
  9. package/dist/templates/app/(public)/docs/[section]/[page]/page.tsx +90 -0
  10. package/dist/templates/app/(public)/docs/layout.tsx +25 -0
  11. package/dist/templates/app/(public)/docs/page.tsx +81 -0
  12. package/dist/templates/app/(public)/layout.tsx +41 -0
  13. package/dist/templates/app/(public)/page.tsx +19 -0
  14. package/dist/templates/app/403/page.tsx +89 -0
  15. package/dist/templates/app/api/auth/[...all]/route.ts +78 -0
  16. package/dist/templates/app/api/cron/billing/lifecycle/route.ts +98 -0
  17. package/dist/templates/app/api/csp-report/route.ts +175 -0
  18. package/dist/templates/app/api/devtools/config/entities/route.ts +108 -0
  19. package/dist/templates/app/api/devtools/config/theme/route.ts +66 -0
  20. package/dist/templates/app/api/devtools/tests/[...path]/route.ts +130 -0
  21. package/dist/templates/app/api/devtools/tests/route.ts +134 -0
  22. package/dist/templates/app/api/health/route.ts +29 -0
  23. package/dist/templates/app/api/internal/user-metadata/route.ts +36 -0
  24. package/dist/templates/app/api/superadmin/subscriptions/route.ts +310 -0
  25. package/dist/templates/app/api/superadmin/teams/[teamId]/route.ts +286 -0
  26. package/dist/templates/app/api/superadmin/teams/route.ts +188 -0
  27. package/dist/templates/app/api/superadmin/users/[userId]/route.ts +540 -0
  28. package/dist/templates/app/api/superadmin/users/route.ts +323 -0
  29. package/dist/templates/app/api/user/delete-account/route.ts +55 -0
  30. package/dist/templates/app/api/user/plan-flags/route.ts +283 -0
  31. package/dist/templates/app/api/user/profile/route.ts +133 -0
  32. package/dist/templates/app/api/v1/[entity]/[id]/child/[childType]/[childId]/route.ts +210 -0
  33. package/dist/templates/app/api/v1/[entity]/[id]/child/[childType]/route.ts +331 -0
  34. package/dist/templates/app/api/v1/[entity]/[id]/route.ts +35 -0
  35. package/dist/templates/app/api/v1/[entity]/docs.md +369 -0
  36. package/dist/templates/app/api/v1/[entity]/presets.ts +194 -0
  37. package/dist/templates/app/api/v1/[entity]/route.ts +31 -0
  38. package/dist/templates/app/api/v1/api-keys/[id]/route.ts +303 -0
  39. package/dist/templates/app/api/v1/api-keys/docs.md +101 -0
  40. package/dist/templates/app/api/v1/api-keys/presets.ts +31 -0
  41. package/dist/templates/app/api/v1/api-keys/route.ts +250 -0
  42. package/dist/templates/app/api/v1/auth/docs.md +184 -0
  43. package/dist/templates/app/api/v1/auth/presets.ts +44 -0
  44. package/dist/templates/app/api/v1/auth/signup-with-invite/route.ts +227 -0
  45. package/dist/templates/app/api/v1/billing/cancel/route.ts +206 -0
  46. package/dist/templates/app/api/v1/billing/change-plan/route.ts +97 -0
  47. package/dist/templates/app/api/v1/billing/check-action/route.ts +81 -0
  48. package/dist/templates/app/api/v1/billing/checkout/route.ts +124 -0
  49. package/dist/templates/app/api/v1/billing/docs.md +209 -0
  50. package/dist/templates/app/api/v1/billing/plans/route.ts +85 -0
  51. package/dist/templates/app/api/v1/billing/portal/route.ts +90 -0
  52. package/dist/templates/app/api/v1/billing/presets.ts +121 -0
  53. package/dist/templates/app/api/v1/billing/webhooks/stripe/route.ts +428 -0
  54. package/dist/templates/app/api/v1/blocks/[slug]/route.ts +29 -0
  55. package/dist/templates/app/api/v1/blocks/docs.md +173 -0
  56. package/dist/templates/app/api/v1/blocks/presets.ts +121 -0
  57. package/dist/templates/app/api/v1/blocks/route.ts +45 -0
  58. package/dist/templates/app/api/v1/blocks/validate/route.ts +45 -0
  59. package/dist/templates/app/api/v1/cron/docs.md +116 -0
  60. package/dist/templates/app/api/v1/cron/presets.ts +26 -0
  61. package/dist/templates/app/api/v1/cron/process/route.ts +108 -0
  62. package/dist/templates/app/api/v1/devtools/blocks/route.ts +82 -0
  63. package/dist/templates/app/api/v1/devtools/docs/route.ts +150 -0
  64. package/dist/templates/app/api/v1/devtools/docs.md +204 -0
  65. package/dist/templates/app/api/v1/devtools/features/route.ts +61 -0
  66. package/dist/templates/app/api/v1/devtools/flows/route.ts +61 -0
  67. package/dist/templates/app/api/v1/devtools/presets.ts +113 -0
  68. package/dist/templates/app/api/v1/devtools/scheduled-actions/route.ts +120 -0
  69. package/dist/templates/app/api/v1/devtools/testing/route.ts +82 -0
  70. package/dist/templates/app/api/v1/media/docs.md +117 -0
  71. package/dist/templates/app/api/v1/media/presets.ts +24 -0
  72. package/dist/templates/app/api/v1/media/upload/route.ts +150 -0
  73. package/dist/templates/app/api/v1/patterns/[id]/usages/route.ts +116 -0
  74. package/dist/templates/app/api/v1/plugin/[...path]/route.ts +373 -0
  75. package/dist/templates/app/api/v1/plugin/docs.md +79 -0
  76. package/dist/templates/app/api/v1/plugin/presets.ts +21 -0
  77. package/dist/templates/app/api/v1/plugin/route.ts +96 -0
  78. package/dist/templates/app/api/v1/post-categories/[id]/route.ts +255 -0
  79. package/dist/templates/app/api/v1/post-categories/docs.md +134 -0
  80. package/dist/templates/app/api/v1/post-categories/presets.ts +78 -0
  81. package/dist/templates/app/api/v1/post-categories/route.ts +119 -0
  82. package/dist/templates/app/api/v1/team-invitations/[token]/accept/route.ts +179 -0
  83. package/dist/templates/app/api/v1/team-invitations/[token]/decline/route.ts +120 -0
  84. package/dist/templates/app/api/v1/team-invitations/[token]/route.ts +89 -0
  85. package/dist/templates/app/api/v1/team-invitations/docs.md +88 -0
  86. package/dist/templates/app/api/v1/team-invitations/presets.ts +43 -0
  87. package/dist/templates/app/api/v1/team-invitations/route.ts +114 -0
  88. package/dist/templates/app/api/v1/teams/[teamId]/invitations/route.ts +171 -0
  89. package/dist/templates/app/api/v1/teams/[teamId]/invoices/[invoiceNumber]/route.ts +105 -0
  90. package/dist/templates/app/api/v1/teams/[teamId]/invoices/route.ts +125 -0
  91. package/dist/templates/app/api/v1/teams/[teamId]/members/[memberId]/route.ts +263 -0
  92. package/dist/templates/app/api/v1/teams/[teamId]/members/route.ts +358 -0
  93. package/dist/templates/app/api/v1/teams/[teamId]/route.ts +322 -0
  94. package/dist/templates/app/api/v1/teams/[teamId]/subscription/route.ts +50 -0
  95. package/dist/templates/app/api/v1/teams/[teamId]/usage/[limitSlug]/route.ts +91 -0
  96. package/dist/templates/app/api/v1/teams/docs.md +320 -0
  97. package/dist/templates/app/api/v1/teams/presets.ts +178 -0
  98. package/dist/templates/app/api/v1/teams/route.ts +293 -0
  99. package/dist/templates/app/api/v1/teams/switch/route.ts +88 -0
  100. package/dist/templates/app/api/v1/theme/[...path]/route.ts +361 -0
  101. package/dist/templates/app/api/v1/theme/docs.md +74 -0
  102. package/dist/templates/app/api/v1/theme/presets.ts +21 -0
  103. package/dist/templates/app/api/v1/theme/route.ts +96 -0
  104. package/dist/templates/app/api/v1/users/[id]/meta/[key]/route.ts +363 -0
  105. package/dist/templates/app/api/v1/users/[id]/route.ts +302 -0
  106. package/dist/templates/app/api/v1/users/docs.md +93 -0
  107. package/dist/templates/app/api/v1/users/presets.ts +59 -0
  108. package/dist/templates/app/api/v1/users/route.ts +197 -0
  109. package/dist/templates/app/dashboard/(main)/[entity]/[id]/edit/page.tsx +117 -0
  110. package/dist/templates/app/dashboard/(main)/[entity]/[id]/page.tsx +103 -0
  111. package/dist/templates/app/dashboard/(main)/[entity]/create/page.tsx +95 -0
  112. package/dist/templates/app/dashboard/(main)/[entity]/error.tsx +51 -0
  113. package/dist/templates/app/dashboard/(main)/[entity]/layout.tsx +113 -0
  114. package/dist/templates/app/dashboard/(main)/[entity]/loading.tsx +61 -0
  115. package/dist/templates/app/dashboard/(main)/[entity]/page.tsx +90 -0
  116. package/dist/templates/app/dashboard/(main)/layout.tsx +98 -0
  117. package/dist/templates/app/dashboard/(main)/loading.tsx +5 -0
  118. package/dist/templates/app/dashboard/(main)/page.tsx +201 -0
  119. package/dist/templates/app/dashboard/(main)/patterns/[id]/edit/page.tsx +114 -0
  120. package/dist/templates/app/dashboard/(main)/patterns/[id]/page.tsx +20 -0
  121. package/dist/templates/app/dashboard/(main)/patterns/[id]/reports/page.tsx +171 -0
  122. package/dist/templates/app/dashboard/(main)/patterns/create/page.tsx +86 -0
  123. package/dist/templates/app/dashboard/(main)/patterns/page.tsx +444 -0
  124. package/dist/templates/app/dashboard/features/analytics/page.tsx +35 -0
  125. package/dist/templates/app/dashboard/features/automation/page.tsx +35 -0
  126. package/dist/templates/app/dashboard/features/layout.tsx +13 -0
  127. package/dist/templates/app/dashboard/features/loading.tsx +5 -0
  128. package/dist/templates/app/dashboard/features/webhooks/page.tsx +35 -0
  129. package/dist/templates/app/dashboard/layout.tsx +86 -0
  130. package/dist/templates/app/dashboard/permission-denied/page.tsx +29 -0
  131. package/dist/templates/app/dashboard/settings/api-keys/loading.tsx +5 -0
  132. package/dist/templates/app/dashboard/settings/api-keys/page.tsx +513 -0
  133. package/dist/templates/app/dashboard/settings/billing/loading.tsx +5 -0
  134. package/dist/templates/app/dashboard/settings/billing/page.tsx +284 -0
  135. package/dist/templates/app/dashboard/settings/invoices/[invoiceNumber]/page.tsx +222 -0
  136. package/dist/templates/app/dashboard/settings/invoices/loading.tsx +5 -0
  137. package/dist/templates/app/dashboard/settings/invoices/page.tsx +82 -0
  138. package/dist/templates/app/dashboard/settings/layout.tsx +151 -0
  139. package/dist/templates/app/dashboard/settings/loading.tsx +5 -0
  140. package/dist/templates/app/dashboard/settings/notifications/loading.tsx +5 -0
  141. package/dist/templates/app/dashboard/settings/notifications/page.tsx +462 -0
  142. package/dist/templates/app/dashboard/settings/page.tsx +92 -0
  143. package/dist/templates/app/dashboard/settings/password/loading.tsx +5 -0
  144. package/dist/templates/app/dashboard/settings/password/page.tsx +306 -0
  145. package/dist/templates/app/dashboard/settings/plans/loading.tsx +5 -0
  146. package/dist/templates/app/dashboard/settings/plans/page.tsx +40 -0
  147. package/dist/templates/app/dashboard/settings/profile/loading.tsx +5 -0
  148. package/dist/templates/app/dashboard/settings/profile/page.tsx +686 -0
  149. package/dist/templates/app/dashboard/settings/security/loading.tsx +5 -0
  150. package/dist/templates/app/dashboard/settings/security/page.tsx +505 -0
  151. package/dist/templates/app/dashboard/settings/teams/loading.tsx +5 -0
  152. package/dist/templates/app/dashboard/settings/teams/page.tsx +272 -0
  153. package/dist/templates/app/dashboard/settings/teams/permissions/page.tsx +92 -0
  154. package/dist/templates/app/devtools/blocks/[slug]/page.tsx +39 -0
  155. package/dist/templates/app/devtools/blocks/page.tsx +31 -0
  156. package/dist/templates/app/devtools/config/page.tsx +31 -0
  157. package/dist/templates/app/devtools/features/page.tsx +31 -0
  158. package/dist/templates/app/devtools/flows/page.tsx +31 -0
  159. package/dist/templates/app/devtools/layout.tsx +58 -0
  160. package/dist/templates/app/devtools/page.tsx +121 -0
  161. package/dist/templates/app/devtools/scheduled-actions/page.tsx +157 -0
  162. package/dist/templates/app/devtools/style/page.tsx +330 -0
  163. package/dist/templates/app/devtools/tags/page.tsx +31 -0
  164. package/dist/templates/app/devtools/tests/[[...path]]/page.tsx +47 -0
  165. package/dist/templates/app/favicon.ico +0 -0
  166. package/dist/templates/app/globals.css +12 -0
  167. package/dist/templates/app/layout.tsx +96 -0
  168. package/dist/templates/app/public/page.tsx +30 -0
  169. package/dist/templates/app/superadmin/docs/[section]/[page]/page.tsx +92 -0
  170. package/dist/templates/app/superadmin/docs/page.tsx +75 -0
  171. package/dist/templates/app/superadmin/layout.tsx +67 -0
  172. package/dist/templates/app/superadmin/page.tsx +149 -0
  173. package/dist/templates/app/superadmin/subscriptions/page.tsx +655 -0
  174. package/dist/templates/app/superadmin/team-roles/page.tsx +493 -0
  175. package/dist/templates/app/superadmin/teams/[teamId]/page.tsx +687 -0
  176. package/dist/templates/app/superadmin/teams/page.tsx +302 -0
  177. package/dist/templates/app/superadmin/users/[userId]/page.tsx +548 -0
  178. package/dist/templates/app/superadmin/users/page.tsx +528 -0
  179. package/package.json +15 -15
  180. package/scripts/build/docs-registry.mjs +0 -0
  181. package/scripts/create-theme.mjs +0 -0
  182. package/scripts/deploy/release-version.mjs +0 -0
  183. package/scripts/deploy/vercel-deploy.mjs +0 -0
  184. package/scripts/dev/watch-plugins.mjs +0 -0
  185. package/scripts/maintenance/update-core.mjs +0 -0
  186. package/scripts/setup/npm-postinstall.mjs +0 -0
  187. package/scripts/setup/setup-claude.mjs +0 -0
  188. package/scripts/validation/check-imports.sh +0 -0
  189. package/templates/app/(auth)/forgot-password/page.tsx +216 -0
  190. package/templates/app/(auth)/layout.tsx +51 -0
  191. package/templates/app/(auth)/login/page.tsx +21 -0
  192. package/templates/app/(auth)/reset-password/page.tsx +212 -0
  193. package/templates/app/(auth)/signup/page.tsx +21 -0
  194. package/templates/app/(auth)/verify-email/page.tsx +190 -0
  195. package/templates/app/(public)/[...slug]/page.tsx +378 -0
  196. package/templates/app/(public)/docs/[section]/[page]/page.tsx +90 -0
  197. package/templates/app/(public)/docs/layout.tsx +25 -0
  198. package/templates/app/(public)/docs/page.tsx +81 -0
  199. package/templates/app/(public)/layout.tsx +41 -0
  200. package/templates/app/(public)/page.tsx +19 -0
  201. package/templates/app/403/page.tsx +89 -0
  202. package/templates/app/api/auth/[...all]/route.ts +78 -0
  203. package/templates/app/api/cron/billing/lifecycle/route.ts +98 -0
  204. package/templates/app/api/csp-report/route.ts +175 -0
  205. package/templates/app/api/devtools/config/entities/route.ts +108 -0
  206. package/templates/app/api/devtools/config/theme/route.ts +66 -0
  207. package/templates/app/api/devtools/tests/[...path]/route.ts +130 -0
  208. package/templates/app/api/devtools/tests/route.ts +134 -0
  209. package/templates/app/api/health/route.ts +29 -0
  210. package/templates/app/api/internal/user-metadata/route.ts +36 -0
  211. package/templates/app/api/superadmin/subscriptions/route.ts +310 -0
  212. package/templates/app/api/superadmin/teams/[teamId]/route.ts +286 -0
  213. package/templates/app/api/superadmin/teams/route.ts +188 -0
  214. package/templates/app/api/superadmin/users/[userId]/route.ts +540 -0
  215. package/templates/app/api/superadmin/users/route.ts +323 -0
  216. package/templates/app/api/user/delete-account/route.ts +55 -0
  217. package/templates/app/api/user/plan-flags/route.ts +283 -0
  218. package/templates/app/api/user/profile/route.ts +133 -0
  219. package/templates/app/api/v1/[entity]/[id]/child/[childType]/[childId]/route.ts +210 -0
  220. package/templates/app/api/v1/[entity]/[id]/child/[childType]/route.ts +331 -0
  221. package/templates/app/api/v1/[entity]/[id]/route.ts +35 -0
  222. package/templates/app/api/v1/[entity]/docs.md +369 -0
  223. package/templates/app/api/v1/[entity]/presets.ts +194 -0
  224. package/templates/app/api/v1/[entity]/route.ts +31 -0
  225. package/templates/app/api/v1/api-keys/[id]/route.ts +303 -0
  226. package/templates/app/api/v1/api-keys/docs.md +101 -0
  227. package/templates/app/api/v1/api-keys/presets.ts +31 -0
  228. package/templates/app/api/v1/api-keys/route.ts +250 -0
  229. package/templates/app/api/v1/auth/docs.md +184 -0
  230. package/templates/app/api/v1/auth/presets.ts +44 -0
  231. package/templates/app/api/v1/auth/signup-with-invite/route.ts +227 -0
  232. package/templates/app/api/v1/billing/cancel/route.ts +206 -0
  233. package/templates/app/api/v1/billing/change-plan/route.ts +97 -0
  234. package/templates/app/api/v1/billing/check-action/route.ts +81 -0
  235. package/templates/app/api/v1/billing/checkout/route.ts +124 -0
  236. package/templates/app/api/v1/billing/docs.md +209 -0
  237. package/templates/app/api/v1/billing/plans/route.ts +85 -0
  238. package/templates/app/api/v1/billing/portal/route.ts +90 -0
  239. package/templates/app/api/v1/billing/presets.ts +121 -0
  240. package/templates/app/api/v1/billing/webhooks/stripe/route.ts +428 -0
  241. package/templates/app/api/v1/blocks/[slug]/route.ts +29 -0
  242. package/templates/app/api/v1/blocks/docs.md +173 -0
  243. package/templates/app/api/v1/blocks/presets.ts +121 -0
  244. package/templates/app/api/v1/blocks/route.ts +45 -0
  245. package/templates/app/api/v1/blocks/validate/route.ts +45 -0
  246. package/templates/app/api/v1/cron/docs.md +116 -0
  247. package/templates/app/api/v1/cron/presets.ts +26 -0
  248. package/templates/app/api/v1/cron/process/route.ts +108 -0
  249. package/templates/app/api/v1/devtools/blocks/route.ts +82 -0
  250. package/templates/app/api/v1/devtools/docs/route.ts +150 -0
  251. package/templates/app/api/v1/devtools/docs.md +204 -0
  252. package/templates/app/api/v1/devtools/features/route.ts +61 -0
  253. package/templates/app/api/v1/devtools/flows/route.ts +61 -0
  254. package/templates/app/api/v1/devtools/presets.ts +113 -0
  255. package/templates/app/api/v1/devtools/scheduled-actions/route.ts +120 -0
  256. package/templates/app/api/v1/devtools/testing/route.ts +82 -0
  257. package/templates/app/api/v1/media/docs.md +117 -0
  258. package/templates/app/api/v1/media/presets.ts +24 -0
  259. package/templates/app/api/v1/media/upload/route.ts +150 -0
  260. package/templates/app/api/v1/patterns/[id]/usages/route.ts +116 -0
  261. package/templates/app/api/v1/plugin/[...path]/route.ts +373 -0
  262. package/templates/app/api/v1/plugin/docs.md +79 -0
  263. package/templates/app/api/v1/plugin/presets.ts +21 -0
  264. package/templates/app/api/v1/plugin/route.ts +96 -0
  265. package/templates/app/api/v1/post-categories/[id]/route.ts +255 -0
  266. package/templates/app/api/v1/post-categories/docs.md +134 -0
  267. package/templates/app/api/v1/post-categories/presets.ts +78 -0
  268. package/templates/app/api/v1/post-categories/route.ts +119 -0
  269. package/templates/app/api/v1/team-invitations/[token]/accept/route.ts +179 -0
  270. package/templates/app/api/v1/team-invitations/[token]/decline/route.ts +120 -0
  271. package/templates/app/api/v1/team-invitations/[token]/route.ts +89 -0
  272. package/templates/app/api/v1/team-invitations/docs.md +88 -0
  273. package/templates/app/api/v1/team-invitations/presets.ts +43 -0
  274. package/templates/app/api/v1/team-invitations/route.ts +114 -0
  275. package/templates/app/api/v1/teams/[teamId]/invitations/route.ts +171 -0
  276. package/templates/app/api/v1/teams/[teamId]/invoices/[invoiceNumber]/route.ts +105 -0
  277. package/templates/app/api/v1/teams/[teamId]/invoices/route.ts +125 -0
  278. package/templates/app/api/v1/teams/[teamId]/members/[memberId]/route.ts +263 -0
  279. package/templates/app/api/v1/teams/[teamId]/members/route.ts +358 -0
  280. package/templates/app/api/v1/teams/[teamId]/route.ts +322 -0
  281. package/templates/app/api/v1/teams/[teamId]/subscription/route.ts +50 -0
  282. package/templates/app/api/v1/teams/[teamId]/usage/[limitSlug]/route.ts +91 -0
  283. package/templates/app/api/v1/teams/docs.md +320 -0
  284. package/templates/app/api/v1/teams/presets.ts +178 -0
  285. package/templates/app/api/v1/teams/route.ts +293 -0
  286. package/templates/app/api/v1/teams/switch/route.ts +88 -0
  287. package/templates/app/api/v1/theme/[...path]/route.ts +361 -0
  288. package/templates/app/api/v1/theme/docs.md +74 -0
  289. package/templates/app/api/v1/theme/presets.ts +21 -0
  290. package/templates/app/api/v1/theme/route.ts +96 -0
  291. package/templates/app/api/v1/users/[id]/meta/[key]/route.ts +363 -0
  292. package/templates/app/api/v1/users/[id]/route.ts +302 -0
  293. package/templates/app/api/v1/users/docs.md +93 -0
  294. package/templates/app/api/v1/users/presets.ts +59 -0
  295. package/templates/app/api/v1/users/route.ts +197 -0
  296. package/templates/app/dashboard/(main)/[entity]/[id]/edit/page.tsx +117 -0
  297. package/templates/app/dashboard/(main)/[entity]/[id]/page.tsx +103 -0
  298. package/templates/app/dashboard/(main)/[entity]/create/page.tsx +95 -0
  299. package/templates/app/dashboard/(main)/[entity]/error.tsx +51 -0
  300. package/templates/app/dashboard/(main)/[entity]/layout.tsx +113 -0
  301. package/templates/app/dashboard/(main)/[entity]/loading.tsx +61 -0
  302. package/templates/app/dashboard/(main)/[entity]/page.tsx +90 -0
  303. package/templates/app/dashboard/(main)/layout.tsx +98 -0
  304. package/templates/app/dashboard/(main)/loading.tsx +5 -0
  305. package/templates/app/dashboard/(main)/page.tsx +201 -0
  306. package/templates/app/dashboard/(main)/patterns/[id]/edit/page.tsx +114 -0
  307. package/templates/app/dashboard/(main)/patterns/[id]/page.tsx +20 -0
  308. package/templates/app/dashboard/(main)/patterns/[id]/reports/page.tsx +171 -0
  309. package/templates/app/dashboard/(main)/patterns/create/page.tsx +86 -0
  310. package/templates/app/dashboard/(main)/patterns/page.tsx +444 -0
  311. package/templates/app/dashboard/features/analytics/page.tsx +35 -0
  312. package/templates/app/dashboard/features/automation/page.tsx +35 -0
  313. package/templates/app/dashboard/features/layout.tsx +13 -0
  314. package/templates/app/dashboard/features/loading.tsx +5 -0
  315. package/templates/app/dashboard/features/webhooks/page.tsx +35 -0
  316. package/templates/app/dashboard/layout.tsx +86 -0
  317. package/templates/app/dashboard/permission-denied/page.tsx +29 -0
  318. package/templates/app/dashboard/settings/api-keys/loading.tsx +5 -0
  319. package/templates/app/dashboard/settings/api-keys/page.tsx +513 -0
  320. package/templates/app/dashboard/settings/billing/loading.tsx +5 -0
  321. package/templates/app/dashboard/settings/billing/page.tsx +284 -0
  322. package/templates/app/dashboard/settings/invoices/[invoiceNumber]/page.tsx +222 -0
  323. package/templates/app/dashboard/settings/invoices/loading.tsx +5 -0
  324. package/templates/app/dashboard/settings/invoices/page.tsx +82 -0
  325. package/templates/app/dashboard/settings/layout.tsx +151 -0
  326. package/templates/app/dashboard/settings/loading.tsx +5 -0
  327. package/templates/app/dashboard/settings/notifications/loading.tsx +5 -0
  328. package/templates/app/dashboard/settings/notifications/page.tsx +462 -0
  329. package/templates/app/dashboard/settings/page.tsx +92 -0
  330. package/templates/app/dashboard/settings/password/loading.tsx +5 -0
  331. package/templates/app/dashboard/settings/password/page.tsx +306 -0
  332. package/templates/app/dashboard/settings/plans/loading.tsx +5 -0
  333. package/templates/app/dashboard/settings/plans/page.tsx +40 -0
  334. package/templates/app/dashboard/settings/profile/loading.tsx +5 -0
  335. package/templates/app/dashboard/settings/profile/page.tsx +686 -0
  336. package/templates/app/dashboard/settings/security/loading.tsx +5 -0
  337. package/templates/app/dashboard/settings/security/page.tsx +505 -0
  338. package/templates/app/dashboard/settings/teams/loading.tsx +5 -0
  339. package/templates/app/dashboard/settings/teams/page.tsx +272 -0
  340. package/templates/app/dashboard/settings/teams/permissions/page.tsx +92 -0
  341. package/templates/app/devtools/blocks/[slug]/page.tsx +39 -0
  342. package/templates/app/devtools/blocks/page.tsx +31 -0
  343. package/templates/app/devtools/config/page.tsx +31 -0
  344. package/templates/app/devtools/features/page.tsx +31 -0
  345. package/templates/app/devtools/flows/page.tsx +31 -0
  346. package/templates/app/devtools/layout.tsx +58 -0
  347. package/templates/app/devtools/page.tsx +121 -0
  348. package/templates/app/devtools/scheduled-actions/page.tsx +157 -0
  349. package/templates/app/devtools/style/page.tsx +330 -0
  350. package/templates/app/devtools/tags/page.tsx +31 -0
  351. package/templates/app/devtools/tests/[[...path]]/page.tsx +47 -0
  352. package/templates/app/favicon.ico +0 -0
  353. package/templates/app/globals.css +12 -0
  354. package/templates/app/layout.tsx +96 -0
  355. package/templates/app/public/page.tsx +30 -0
  356. package/templates/app/superadmin/docs/[section]/[page]/page.tsx +92 -0
  357. package/templates/app/superadmin/docs/page.tsx +75 -0
  358. package/templates/app/superadmin/layout.tsx +67 -0
  359. package/templates/app/superadmin/page.tsx +149 -0
  360. package/templates/app/superadmin/subscriptions/page.tsx +655 -0
  361. package/templates/app/superadmin/team-roles/page.tsx +493 -0
  362. package/templates/app/superadmin/teams/[teamId]/page.tsx +687 -0
  363. package/templates/app/superadmin/teams/page.tsx +302 -0
  364. package/templates/app/superadmin/users/[userId]/page.tsx +548 -0
  365. package/templates/app/superadmin/users/page.tsx +528 -0
@@ -0,0 +1,51 @@
1
+ 'use client'
2
+
3
+ import { useEffect } from 'react'
4
+ import { Button } from '@nextsparkjs/core/components/ui/button'
5
+ import { AlertCircle } from 'lucide-react'
6
+
7
+ export default function EntityError({
8
+ error,
9
+ reset,
10
+ }: {
11
+ error: Error & { digest?: string }
12
+ reset: () => void
13
+ }) {
14
+ useEffect(() => {
15
+ // Log the error to an error reporting service
16
+ console.error('Entity page error:', error)
17
+ }, [error])
18
+
19
+ return (
20
+ <div className="flex flex-col items-center justify-center min-h-[400px] gap-4 p-6">
21
+ <div className="flex flex-col items-center gap-2 text-center">
22
+ <AlertCircle className="h-12 w-12 text-destructive" />
23
+ <h2 className="text-xl font-semibold">Something went wrong!</h2>
24
+ <p className="text-sm text-muted-foreground max-w-md">
25
+ {error.message || 'An error occurred while loading this page. Please try again.'}
26
+ </p>
27
+ </div>
28
+
29
+ <div className="flex items-center gap-2">
30
+ <Button
31
+ variant="outline"
32
+ onClick={() => window.history.back()}
33
+ >
34
+ Go Back
35
+ </Button>
36
+ <Button
37
+ onClick={() => reset()}
38
+ >
39
+ Try Again
40
+ </Button>
41
+ </div>
42
+
43
+ {process.env.NODE_ENV === 'development' && error.stack && (
44
+ <details className="mt-4 p-4 bg-muted rounded-lg text-xs max-w-2xl w-full">
45
+ <summary className="cursor-pointer font-medium">Error Details (Development Only)</summary>
46
+ <pre className="mt-2 overflow-auto">{error.stack}</pre>
47
+ </details>
48
+ )}
49
+ </div>
50
+ )
51
+ }
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Entity Permission Layout
3
+ *
4
+ * Server Component that validates entity permissions BEFORE rendering any page.
5
+ * This layout is NOT overridable by themes to ensure security.
6
+ *
7
+ * IMPORTANT: Do NOT use getTemplateOrDefault here - security must not be bypassable.
8
+ *
9
+ * Flow:
10
+ * 1. User navigates to /dashboard/companies/create
11
+ * 2. Browser sends activeTeamId cookie automatically
12
+ * 3. This layout reads cookie and checks permission via checkPermission()
13
+ * 4. If denied, redirects to /dashboard/permission-denied
14
+ * 5. If allowed, renders the page (children)
15
+ */
16
+ import { headers, cookies } from 'next/headers'
17
+ import { redirect } from 'next/navigation'
18
+ import { checkPermission } from '@nextsparkjs/core/lib/permissions/check'
19
+ import { isValidPermission } from '@nextsparkjs/core/lib/permissions/init'
20
+ import type { Permission } from '@nextsparkjs/core/lib/permissions/types'
21
+
22
+ type EntityAction = 'list' | 'read' | 'create' | 'update' | 'delete'
23
+
24
+ /**
25
+ * Detect the required action from the pathname
26
+ *
27
+ * @param pathname - Full pathname (e.g., /dashboard/companies/create)
28
+ * @param entitySlug - Entity slug (e.g., companies)
29
+ * @returns The action being attempted
30
+ */
31
+ function detectActionFromPathname(pathname: string, entitySlug: string): EntityAction {
32
+ const entityPath = `/dashboard/${entitySlug}`
33
+ const relativePath = pathname.replace(entityPath, '')
34
+
35
+ // List: /dashboard/companies or /dashboard/companies/
36
+ if (relativePath === '' || relativePath === '/') return 'list'
37
+
38
+ // Create: /dashboard/companies/create
39
+ if (relativePath === '/create') return 'create'
40
+
41
+ // Update: /dashboard/companies/[id]/edit
42
+ if (relativePath.match(/^\/[^/]+\/edit$/)) return 'update'
43
+
44
+ // Read: /dashboard/companies/[id] (single detail view)
45
+ if (relativePath.match(/^\/[^/]+$/)) return 'read'
46
+
47
+ // Default fallback for any other path
48
+ return 'read'
49
+ }
50
+
51
+ interface EntityLayoutProps {
52
+ children: React.ReactNode
53
+ params: Promise<{ entity: string }>
54
+ }
55
+
56
+ export default async function EntityPermissionLayout({
57
+ children,
58
+ params
59
+ }: EntityLayoutProps) {
60
+ const { entity } = await params
61
+ const headersList = await headers()
62
+ const cookieStore = await cookies()
63
+
64
+ // Get pathname from middleware header
65
+ const pathname = headersList.get('x-pathname') || ''
66
+
67
+ // Get userId from middleware header (set for all authenticated routes)
68
+ const userId = headersList.get('x-user-id')
69
+
70
+ // Get teamId from cookie (set by TeamContext and /api/v1/teams/switch)
71
+ const teamId = cookieStore.get('activeTeamId')?.value
72
+
73
+ // Skip validation if missing required data
74
+ // - No userId: middleware will redirect to login (shouldn't happen for dashboard routes)
75
+ // - No teamId: user hasn't selected a team yet, let page handle it
76
+ if (!userId || !teamId) {
77
+ console.log('[EntityPermissionLayout] Skipping validation - missing data:', {
78
+ entity,
79
+ userId: !!userId,
80
+ teamId: !!teamId
81
+ })
82
+ return <>{children}</>
83
+ }
84
+
85
+ // Skip permission validation for routes that don't have entity permissions
86
+ // These are custom template pages (like agent-single, agent-multi) that aren't real entities
87
+ if (!isValidPermission(`${entity}.list` as Permission)) {
88
+ console.log('[EntityPermissionLayout] Skipping validation - no entity permission config for:', entity)
89
+ return <>{children}</>
90
+ }
91
+
92
+ // Detect required action from pathname
93
+ const action = detectActionFromPathname(pathname, entity)
94
+ const permission = `${entity}.${action}` as Permission
95
+
96
+ console.log('[EntityPermissionLayout] Checking permission:', {
97
+ entity,
98
+ action,
99
+ permission,
100
+ userId,
101
+ teamId
102
+ })
103
+
104
+ // Check permission using existing core function
105
+ const hasPermission = await checkPermission(userId, teamId, permission)
106
+
107
+ if (!hasPermission) {
108
+ console.log('[EntityPermissionLayout] Permission denied, redirecting')
109
+ redirect(`/dashboard/permission-denied?entity=${entity}&action=${action}`)
110
+ }
111
+
112
+ return <>{children}</>
113
+ }
@@ -0,0 +1,61 @@
1
+ import { Skeleton } from '@nextsparkjs/core/components/ui/skeleton'
2
+
3
+ export default function EntityLoading() {
4
+ return (
5
+ <div className="space-y-6 p-6">
6
+ {/* Header skeleton */}
7
+ <div className="flex items-center justify-between">
8
+ <div className="space-y-2">
9
+ <Skeleton className="h-8 w-48" />
10
+ <Skeleton className="h-4 w-64" />
11
+ </div>
12
+ <Skeleton className="h-10 w-32" />
13
+ </div>
14
+
15
+ {/* Table skeleton */}
16
+ <div className="rounded-md border">
17
+ <div className="p-4 border-b">
18
+ <Skeleton className="h-10 w-full max-w-sm" />
19
+ </div>
20
+ <div className="p-4 space-y-4">
21
+ {/* Table header */}
22
+ <div className="flex items-center justify-between pb-4 border-b">
23
+ <div className="flex items-center gap-4">
24
+ <Skeleton className="h-5 w-5" />
25
+ <Skeleton className="h-5 w-24" />
26
+ <Skeleton className="h-5 w-32" />
27
+ <Skeleton className="h-5 w-28" />
28
+ <Skeleton className="h-5 w-20" />
29
+ </div>
30
+ <Skeleton className="h-5 w-16" />
31
+ </div>
32
+
33
+ {/* Table rows */}
34
+ {Array.from({ length: 5 }).map((_, i) => (
35
+ <div key={i} className="flex items-center justify-between py-3">
36
+ <div className="flex items-center gap-4">
37
+ <Skeleton className="h-5 w-5" />
38
+ <Skeleton className="h-5 w-40" />
39
+ <Skeleton className="h-5 w-48" />
40
+ <Skeleton className="h-5 w-24" />
41
+ <Skeleton className="h-5 w-16" />
42
+ </div>
43
+ <Skeleton className="h-8 w-20" />
44
+ </div>
45
+ ))}
46
+ </div>
47
+
48
+ {/* Pagination skeleton */}
49
+ <div className="p-4 border-t flex items-center justify-between">
50
+ <Skeleton className="h-5 w-32" />
51
+ <div className="flex items-center gap-2">
52
+ <Skeleton className="h-8 w-8" />
53
+ <Skeleton className="h-8 w-8" />
54
+ <Skeleton className="h-8 w-8" />
55
+ <Skeleton className="h-8 w-8" />
56
+ </div>
57
+ </div>
58
+ </div>
59
+ </div>
60
+ )
61
+ }
@@ -0,0 +1,90 @@
1
+ import { notFound } from 'next/navigation'
2
+ import { getEntity, getEntityRegistry, setEntityRegistry } from '@nextsparkjs/core/lib/entities/queries'
3
+ import { EntityListWrapper } from '@nextsparkjs/core/components/entities/wrappers/EntityListWrapper'
4
+ import type { Metadata } from 'next'
5
+ import { getTemplateOrDefault } from '@nextsparkjs/core/lib/template-resolver'
6
+ import type { EntityConfig, ChildEntityDefinition } from '@nextsparkjs/core/lib/entities/types'
7
+ // Import registry directly - webpack resolves @nextsparkjs/registries alias at compile time
8
+ import { ENTITY_REGISTRY, ENTITY_METADATA } from '@nextsparkjs/registries/entity-registry'
9
+
10
+ // Initialize registry at module load time (before any component renders)
11
+ setEntityRegistry(ENTITY_REGISTRY, ENTITY_METADATA)
12
+
13
+ // Type guard to check if entity is a full EntityConfig
14
+ function isEntityConfig(entity: EntityConfig | ChildEntityDefinition): entity is EntityConfig {
15
+ return 'slug' in entity
16
+ }
17
+
18
+ interface PageProps {
19
+ params: Promise<{ entity: string }>
20
+ searchParams: Promise<{ [key: string]: string | string[] | undefined }>
21
+ }
22
+
23
+ async function EntityListPage({ params }: PageProps) {
24
+ const resolvedParams = await params
25
+ const entitySlug = resolvedParams.entity
26
+
27
+ // Verificar que la entidad existe usando el nuevo registry
28
+ const registry = getEntityRegistry()
29
+ if (!(entitySlug in registry)) {
30
+ notFound()
31
+ }
32
+
33
+ const entityConfig = getEntity(entitySlug)
34
+ if (!entityConfig || !isEntityConfig(entityConfig)) {
35
+ notFound()
36
+ }
37
+
38
+ // Verificar que la entidad está habilitada usando la nueva estructura
39
+ if (!entityConfig.enabled) {
40
+ notFound()
41
+ }
42
+
43
+ // Check if entity should be accessible via dashboard route
44
+ // Entities with showInMenu: false are managed elsewhere (e.g., settings)
45
+ if (!entityConfig.ui?.dashboard?.showInMenu) {
46
+ notFound()
47
+ }
48
+
49
+ // IMPORTANT: Try to resolve entity-specific template first
50
+ // This allows themes to override specific entities (e.g., /dashboard/orders)
51
+ // while falling back to the generic EntityListWrapper for others
52
+ const specificTemplatePath = `app/dashboard/(main)/${entitySlug}/page.tsx`
53
+ const SpecificTemplate = getTemplateOrDefault(specificTemplatePath, null) as React.ComponentType<PageProps> | null
54
+
55
+ if (SpecificTemplate) {
56
+ return <SpecificTemplate params={params} searchParams={Promise.resolve({})} />
57
+ }
58
+
59
+ return (
60
+ <EntityListWrapper
61
+ entityType={entityConfig.slug}
62
+ />
63
+ )
64
+ }
65
+
66
+ export async function generateMetadata({ params }: PageProps): Promise<Metadata> {
67
+ const resolvedParams = await params
68
+ const entitySlug = resolvedParams.entity
69
+
70
+ const registry = getEntityRegistry()
71
+ if (!(entitySlug in registry)) {
72
+ return {
73
+ title: 'Not Found - Dashboard'
74
+ }
75
+ }
76
+
77
+ const entityConfig = getEntity(entitySlug)
78
+ if (!entityConfig || !isEntityConfig(entityConfig)) {
79
+ return {
80
+ title: 'Not Found - Dashboard'
81
+ }
82
+ }
83
+
84
+ return {
85
+ title: `${entityConfig.names.plural} - Dashboard`,
86
+ description: `Manage ${entityConfig.names.plural.toLowerCase()} in your dashboard`
87
+ }
88
+ }
89
+
90
+ export default getTemplateOrDefault('app/dashboard/(main)/[entity]/page.tsx', EntityListPage)
@@ -0,0 +1,98 @@
1
+ /**
2
+ * Main Dashboard Layout with Permission Checking
3
+ *
4
+ * This layout handles:
5
+ * 1. Entity registry initialization
6
+ * 2. Server-side permission validation for entity routes
7
+ * 3. Rendering the DashboardShell with entity navigation
8
+ *
9
+ * IMPORTANT: Permission checking MUST be in this layout (not in [entity]/layout.tsx)
10
+ * because (templates) routes with specific paths take precedence over dynamic [entity] routes.
11
+ */
12
+ import { headers, cookies } from 'next/headers'
13
+ import { redirect } from 'next/navigation'
14
+ import { DashboardShell } from '@nextsparkjs/core/components/dashboard/layouts/DashboardShell'
15
+ import { serializeEntityConfig, type SerializableEntityConfig } from '@nextsparkjs/core/lib/entities/serialization'
16
+ import { setEntityRegistry } from '@nextsparkjs/core/lib/entities/queries'
17
+ import { getTemplateOrDefault } from '@nextsparkjs/core/lib/template-resolver'
18
+ import type { EntityConfig, ChildEntityDefinition } from '@nextsparkjs/core/lib/entities/types'
19
+ import { checkPermission } from '@nextsparkjs/core/lib/permissions/check'
20
+ import { isValidPermission } from '@nextsparkjs/core/lib/permissions/init'
21
+ import type { Permission } from '@nextsparkjs/core/lib/permissions/types'
22
+ // Import registry directly - webpack resolves @nextsparkjs/registries alias at compile time
23
+ import { ENTITY_REGISTRY, ENTITY_METADATA } from '@nextsparkjs/registries/entity-registry'
24
+
25
+ // Register entities globally so other parts of the app can access them via getRegisteredEntities()
26
+ setEntityRegistry(ENTITY_REGISTRY, ENTITY_METADATA)
27
+
28
+ type EntityAction = 'list' | 'read' | 'create' | 'update' | 'delete'
29
+
30
+ /**
31
+ * Parse entity and action from pathname
32
+ * Handles paths like: /dashboard/ai-agents, /dashboard/ai-agents/create, /dashboard/ai-agents/[id]/edit
33
+ */
34
+ function parseEntityFromPathname(pathname: string): { entity: string; action: EntityAction } | null {
35
+ const match = pathname.match(/^\/dashboard\/([^/]+)(?:\/(.*))?$/)
36
+ if (!match) return null
37
+
38
+ const entity = match[1]
39
+ const rest = match[2] || ''
40
+
41
+ if (rest === '' || rest === '/') return { entity, action: 'list' }
42
+ if (rest === 'create') return { entity, action: 'create' }
43
+ if (rest.match(/^[^/]+\/edit$/)) return { entity, action: 'update' }
44
+ if (rest.match(/^[^/]+$/)) return { entity, action: 'read' }
45
+
46
+ return { entity, action: 'read' }
47
+ }
48
+
49
+ // Type guard to check if entity is a full EntityConfig
50
+ function isEntityConfig(entity: EntityConfig | ChildEntityDefinition): entity is EntityConfig {
51
+ return 'slug' in entity
52
+ }
53
+
54
+ // Default main dashboard layout component with permission checking
55
+ async function DefaultMainDashboardLayout({
56
+ children
57
+ }: {
58
+ children: React.ReactNode
59
+ }) {
60
+ // Get entities directly from the imported registry
61
+ const allEntities = Object.values(ENTITY_REGISTRY).map(entry => entry.config)
62
+ const entities = allEntities.filter(isEntityConfig)
63
+ const serializedEntities: SerializableEntityConfig[] = entities.map(serializeEntityConfig)
64
+
65
+ // === PERMISSION CHECK ===
66
+ const headersList = await headers()
67
+ const cookieStore = await cookies()
68
+
69
+ const pathname = headersList.get('x-pathname') || ''
70
+ const userId = headersList.get('x-user-id')
71
+ const teamId = cookieStore.get('activeTeamId')?.value
72
+
73
+ if (userId && teamId && pathname) {
74
+ const parsed = parseEntityFromPathname(pathname)
75
+
76
+ if (parsed) {
77
+ const { entity, action } = parsed
78
+ const permission = `${entity}.${action}` as Permission
79
+
80
+ if (isValidPermission(`${entity}.list` as Permission)) {
81
+ const hasPermission = await checkPermission(userId, teamId, permission)
82
+
83
+ if (!hasPermission) {
84
+ redirect(`/dashboard/permission-denied?entity=${entity}&action=${action}`)
85
+ }
86
+ }
87
+ }
88
+ }
89
+
90
+ return (
91
+ <DashboardShell entities={serializedEntities}>
92
+ {children}
93
+ </DashboardShell>
94
+ )
95
+ }
96
+
97
+ // Export the resolved component (theme override or default)
98
+ export default getTemplateOrDefault('app/dashboard/(main)/layout.tsx', DefaultMainDashboardLayout)
@@ -0,0 +1,5 @@
1
+ import { SkeletonDashboardHome } from '@nextsparkjs/core/components/ui/skeleton-dashboard'
2
+
3
+ export default function DashboardLoading() {
4
+ return <SkeletonDashboardHome />
5
+ }
@@ -0,0 +1,201 @@
1
+ 'use client'
2
+
3
+ import { useUserProfile } from '@nextsparkjs/core/hooks/useUserProfile'
4
+ import { useRouter } from 'next/navigation'
5
+ import { useEffect } from 'react'
6
+ import { Button } from '@nextsparkjs/core/components/ui/button'
7
+ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@nextsparkjs/core/components/ui/card'
8
+ import { Badge } from '@nextsparkjs/core/components/ui/badge'
9
+ import { useTranslations } from 'next-intl'
10
+ import { getTemplateOrDefaultClient } from '@nextsparkjs/registries/template-registry.client'
11
+
12
+ import {
13
+ Loader2,
14
+ User,
15
+ Activity,
16
+ Settings,
17
+ CreditCard,
18
+ Users,
19
+ BarChart3,
20
+ ListTodo
21
+ } from 'lucide-react'
22
+
23
+ // Default dashboard page component
24
+ function DefaultDashboardPage() {
25
+ const { user, isLoading } = useUserProfile()
26
+ const router = useRouter()
27
+ const t = useTranslations('dashboard')
28
+
29
+ useEffect(() => {
30
+ if (!isLoading && !user) {
31
+ router.push('/login')
32
+ }
33
+ }, [user, isLoading, router])
34
+
35
+ if (isLoading) {
36
+ return (
37
+ <div className="min-h-screen flex items-center justify-center">
38
+ <Loader2 className="h-8 w-8 animate-spin text-muted-foreground" />
39
+ </div>
40
+ )
41
+ }
42
+
43
+ if (!user) {
44
+ return null
45
+ }
46
+
47
+ const stats = [
48
+ {
49
+ title: t('stats.accountStatus'),
50
+ value: t('stats.active'),
51
+ icon: <Activity className="h-4 w-4" />,
52
+ trend: t('badges.verified')
53
+ },
54
+ {
55
+ title: t('stats.plan'),
56
+ value: t('stats.free'),
57
+ icon: <CreditCard className="h-4 w-4" />,
58
+ trend: t('badges.basic')
59
+ },
60
+ {
61
+ title: t('stats.teamMembers'),
62
+ value: '1',
63
+ icon: <Users className="h-4 w-4" />,
64
+ trend: t('badges.solo')
65
+ },
66
+ {
67
+ title: t('stats.usage'),
68
+ value: '0%',
69
+ icon: <BarChart3 className="h-4 w-4" />,
70
+ trend: t('badges.low')
71
+ },
72
+ ]
73
+
74
+ return (
75
+ <div className="min-h-screen bg-gradient-to-b from-background to-muted/20 py-12 px-4 sm:px-6 lg:px-8">
76
+ <div className="max-w-7xl mx-auto space-y-8">
77
+ {/* Header */}
78
+ <div className="mb-8" data-cy="dashboard-welcome">
79
+ <h1 className="text-3xl font-bold">{t('title')}</h1>
80
+ <p className="text-muted-foreground mt-1">
81
+ {t('welcome', { name: user.firstName || user.email })}
82
+ </p>
83
+ </div>
84
+
85
+ {/* Stats Grid */}
86
+ <div className="grid gap-4 md:grid-cols-2 lg:grid-cols-4">
87
+ {stats.map((stat) => (
88
+ <Card key={stat.title}>
89
+ <CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
90
+ <CardTitle className="text-sm font-medium">
91
+ {stat.title}
92
+ </CardTitle>
93
+ {stat.icon}
94
+ </CardHeader>
95
+ <CardContent>
96
+ <div className="text-2xl font-bold">{stat.value}</div>
97
+ <Badge variant="secondary" className="mt-1">
98
+ {stat.trend}
99
+ </Badge>
100
+ </CardContent>
101
+ </Card>
102
+ ))}
103
+ </div>
104
+
105
+ {/* Quick Actions */}
106
+ <Card>
107
+ <CardHeader>
108
+ <CardTitle>{t('quickActions.title')}</CardTitle>
109
+ <CardDescription>
110
+ {t('quickActions.description')}
111
+ </CardDescription>
112
+ </CardHeader>
113
+ <CardContent>
114
+ <div className="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
115
+ <Button
116
+ variant="outline"
117
+ className="h-auto p-4 flex flex-col items-start gap-2"
118
+ onClick={() => router.push('/dashboard/tasks')}
119
+ >
120
+ <ListTodo className="h-5 w-5 text-blue-500" />
121
+ <div className="text-left">
122
+ <p className="font-medium">{t('quickActions.myTasks')}</p>
123
+ <p className="text-xs text-muted-foreground">{t('quickActions.myTasksDescription')}</p>
124
+ </div>
125
+ </Button>
126
+
127
+ <Button
128
+ variant="outline"
129
+ className="h-auto p-4 flex flex-col items-start gap-2"
130
+ onClick={() => router.push('/dashboard/settings/profile')}
131
+ >
132
+ <User className="h-5 w-5 text-green-500" />
133
+ <div className="text-left">
134
+ <p className="font-medium">{t('quickActions.myProfile')}</p>
135
+ <p className="text-xs text-muted-foreground">{t('quickActions.myProfileDescription')}</p>
136
+ </div>
137
+ </Button>
138
+
139
+ <Button
140
+ variant="outline"
141
+ className="h-auto p-4 flex flex-col items-start gap-2"
142
+ onClick={() => router.push('/dashboard/settings')}
143
+ >
144
+ <Settings className="h-5 w-5 text-purple-500" />
145
+ <div className="text-left">
146
+ <p className="font-medium">{t('quickActions.settings')}</p>
147
+ <p className="text-xs text-muted-foreground">{t('quickActions.settingsDescription')}</p>
148
+ </div>
149
+ </Button>
150
+
151
+ <Button
152
+ variant="outline"
153
+ className="h-auto p-4 flex flex-col items-start gap-2"
154
+ onClick={() => router.push('/dashboard/settings/billing')}
155
+ >
156
+ <CreditCard className="h-5 w-5 text-yellow-500" />
157
+ <div className="text-left">
158
+ <p className="font-medium">{t('quickActions.billing')}</p>
159
+ <p className="text-xs text-muted-foreground">{t('quickActions.billingDescription')}</p>
160
+ </div>
161
+ </Button>
162
+ </div>
163
+ </CardContent>
164
+ </Card>
165
+
166
+ {/* Activity Card */}
167
+ <Card>
168
+ <CardHeader>
169
+ <CardTitle>{t('activity.title')}</CardTitle>
170
+ <CardDescription>
171
+ {t('activity.description')}
172
+ </CardDescription>
173
+ </CardHeader>
174
+ <CardContent>
175
+ <div className="space-y-4">
176
+ <div className="flex items-center gap-4">
177
+ <div className="h-2 w-2 bg-blue-500 rounded-full" />
178
+ <div className="flex-1">
179
+ <p className="text-sm font-medium">{t('activity.signedIn')}</p>
180
+ <p className="text-xs text-muted-foreground">{t('activity.justNow')}</p>
181
+ </div>
182
+ </div>
183
+ <div className="flex items-center gap-4">
184
+ <div className="h-2 w-2 bg-green-500 rounded-full" />
185
+ <div className="flex-1">
186
+ <p className="text-sm font-medium">{t('activity.accountCreated')}</p>
187
+ <p className="text-xs text-muted-foreground">
188
+ {new Date(user.createdAt || '').toLocaleDateString()}
189
+ </p>
190
+ </div>
191
+ </div>
192
+ </div>
193
+ </CardContent>
194
+ </Card>
195
+ </div>
196
+ </div>
197
+ )
198
+ }
199
+
200
+ // Export the resolved component (theme override or default)
201
+ export default getTemplateOrDefaultClient('app/dashboard/(main)/page.tsx', DefaultDashboardPage)