@nextsparkjs/theme-default 0.1.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (333) hide show
  1. package/about/business.md +49 -0
  2. package/about/features.json +302 -0
  3. package/about/team.md +79 -0
  4. package/api/ai/chat/stream/route.ts +212 -0
  5. package/api/ai/orchestrator/route.ts +226 -0
  6. package/api/ai/single-agent/route.ts +291 -0
  7. package/api/ai/usage/route.ts +122 -0
  8. package/blocks/benefits/component.tsx +100 -0
  9. package/blocks/benefits/config.ts +11 -0
  10. package/blocks/benefits/examples.ts +85 -0
  11. package/blocks/benefits/fields.ts +156 -0
  12. package/blocks/benefits/schema.ts +33 -0
  13. package/blocks/cta-section/component.tsx +100 -0
  14. package/blocks/cta-section/config.ts +11 -0
  15. package/blocks/cta-section/examples.ts +41 -0
  16. package/blocks/cta-section/fields.ts +89 -0
  17. package/blocks/cta-section/index.ts +6 -0
  18. package/blocks/cta-section/schema.ts +32 -0
  19. package/blocks/cta-section/thumbnail.png +1 -0
  20. package/blocks/faq-accordion/component.tsx +156 -0
  21. package/blocks/faq-accordion/config.ts +11 -0
  22. package/blocks/faq-accordion/examples.ts +77 -0
  23. package/blocks/faq-accordion/fields.ts +119 -0
  24. package/blocks/faq-accordion/index.ts +6 -0
  25. package/blocks/faq-accordion/schema.ts +45 -0
  26. package/blocks/features-grid/component.tsx +112 -0
  27. package/blocks/features-grid/config.ts +11 -0
  28. package/blocks/features-grid/examples.ts +63 -0
  29. package/blocks/features-grid/fields.ts +97 -0
  30. package/blocks/features-grid/index.ts +6 -0
  31. package/blocks/features-grid/schema.ts +40 -0
  32. package/blocks/features-grid/thumbnail.png +1 -0
  33. package/blocks/hero/component.tsx +100 -0
  34. package/blocks/hero/config.ts +11 -0
  35. package/blocks/hero/examples.ts +35 -0
  36. package/blocks/hero/fields.ts +60 -0
  37. package/blocks/hero/index.ts +6 -0
  38. package/blocks/hero/schema.ts +32 -0
  39. package/blocks/hero/thumbnail.png +1 -0
  40. package/blocks/hero/thumbnail.png.txt +6 -0
  41. package/blocks/hero-with-form/component.tsx +232 -0
  42. package/blocks/hero-with-form/config.ts +11 -0
  43. package/blocks/hero-with-form/examples.ts +16 -0
  44. package/blocks/hero-with-form/fields.ts +207 -0
  45. package/blocks/hero-with-form/index.ts +6 -0
  46. package/blocks/hero-with-form/schema.ts +54 -0
  47. package/blocks/jumbotron/component.tsx +136 -0
  48. package/blocks/jumbotron/config.ts +11 -0
  49. package/blocks/jumbotron/examples.ts +36 -0
  50. package/blocks/jumbotron/fields.ts +202 -0
  51. package/blocks/jumbotron/index.ts +6 -0
  52. package/blocks/jumbotron/schema.ts +55 -0
  53. package/blocks/logo-cloud/component.tsx +154 -0
  54. package/blocks/logo-cloud/config.ts +11 -0
  55. package/blocks/logo-cloud/examples.ts +34 -0
  56. package/blocks/logo-cloud/fields.ts +133 -0
  57. package/blocks/logo-cloud/index.ts +6 -0
  58. package/blocks/logo-cloud/schema.ts +46 -0
  59. package/blocks/post-content/component.tsx +197 -0
  60. package/blocks/post-content/config.ts +11 -0
  61. package/blocks/post-content/examples.ts +33 -0
  62. package/blocks/post-content/fields.ts +165 -0
  63. package/blocks/post-content/index.ts +4 -0
  64. package/blocks/post-content/schema.ts +46 -0
  65. package/blocks/pricing-table/component.tsx +154 -0
  66. package/blocks/pricing-table/config.ts +11 -0
  67. package/blocks/pricing-table/examples.ts +96 -0
  68. package/blocks/pricing-table/fields.ts +161 -0
  69. package/blocks/pricing-table/index.ts +4 -0
  70. package/blocks/pricing-table/schema.ts +50 -0
  71. package/blocks/split-content/component.tsx +135 -0
  72. package/blocks/split-content/config.ts +11 -0
  73. package/blocks/split-content/examples.ts +38 -0
  74. package/blocks/split-content/fields.ts +198 -0
  75. package/blocks/split-content/index.ts +6 -0
  76. package/blocks/split-content/schema.ts +67 -0
  77. package/blocks/stats-counter/component.tsx +124 -0
  78. package/blocks/stats-counter/config.ts +11 -0
  79. package/blocks/stats-counter/examples.ts +61 -0
  80. package/blocks/stats-counter/fields.ts +134 -0
  81. package/blocks/stats-counter/index.ts +6 -0
  82. package/blocks/stats-counter/schema.ts +47 -0
  83. package/blocks/testimonials/component.tsx +114 -0
  84. package/blocks/testimonials/config.ts +11 -0
  85. package/blocks/testimonials/examples.ts +65 -0
  86. package/blocks/testimonials/fields.ts +105 -0
  87. package/blocks/testimonials/index.ts +6 -0
  88. package/blocks/testimonials/schema.ts +41 -0
  89. package/blocks/testimonials/thumbnail.png +1 -0
  90. package/blocks/text-content/component.tsx +97 -0
  91. package/blocks/text-content/config.ts +11 -0
  92. package/blocks/text-content/examples.ts +30 -0
  93. package/blocks/text-content/fields.ts +88 -0
  94. package/blocks/text-content/index.ts +6 -0
  95. package/blocks/text-content/schema.ts +30 -0
  96. package/blocks/text-content/thumbnail.png +1 -0
  97. package/blocks/timeline/component.tsx +267 -0
  98. package/blocks/timeline/config.ts +11 -0
  99. package/blocks/timeline/examples.ts +68 -0
  100. package/blocks/timeline/fields.ts +147 -0
  101. package/blocks/timeline/index.ts +6 -0
  102. package/blocks/timeline/schema.ts +49 -0
  103. package/blocks/video-hero/component.tsx +270 -0
  104. package/blocks/video-hero/config.ts +11 -0
  105. package/blocks/video-hero/examples.ts +24 -0
  106. package/blocks/video-hero/fields.ts +98 -0
  107. package/blocks/video-hero/index.ts +6 -0
  108. package/blocks/video-hero/schema.ts +39 -0
  109. package/components/ai-chat/ChatPanel.tsx +575 -0
  110. package/components/ai-chat/ConversationItem.tsx +266 -0
  111. package/components/ai-chat/ConversationSidebar.tsx +99 -0
  112. package/components/ai-chat/MarkdownRenderer.tsx +15 -0
  113. package/components/ai-chat/Message.tsx +42 -0
  114. package/components/ai-chat/MessageInput.tsx +49 -0
  115. package/components/ai-chat/MessageList.tsx +46 -0
  116. package/components/ai-chat/TypingIndicator.tsx +11 -0
  117. package/config/app.config.ts +367 -0
  118. package/config/billing.config.ts +349 -0
  119. package/config/dashboard.config.ts +506 -0
  120. package/config/dev.config.ts +104 -0
  121. package/config/features.config.ts +203 -0
  122. package/config/flows.config.ts +129 -0
  123. package/config/permissions.config.ts +245 -0
  124. package/config/theme.config.ts +74 -0
  125. package/docs/01-overview/01-introduction.md +335 -0
  126. package/docs/01-overview/02-customization.md +671 -0
  127. package/docs/02-features/01-components.md +155 -0
  128. package/docs/02-features/02-styling.md +139 -0
  129. package/docs/02-features/03-tasks-entity.md +407 -0
  130. package/docs/03-ai/01-overview.md +211 -0
  131. package/docs/03-ai/02-customization.md +436 -0
  132. package/entities/customers/customers.config.ts +75 -0
  133. package/entities/customers/customers.fields.ts +165 -0
  134. package/entities/customers/customers.service.ts +516 -0
  135. package/entities/customers/customers.types.ts +83 -0
  136. package/entities/customers/messages/en.json +66 -0
  137. package/entities/customers/messages/es.json +66 -0
  138. package/entities/customers/migrations/001_customers_table.sql +102 -0
  139. package/entities/customers/migrations/002_customers_metas.sql +92 -0
  140. package/entities/pages/messages/en.json +41 -0
  141. package/entities/pages/messages/es.json +41 -0
  142. package/entities/pages/migrations/001_pages_table.sql +112 -0
  143. package/entities/pages/migrations/002_pages_metas.sql +56 -0
  144. package/entities/pages/migrations/003_add_status.sql +50 -0
  145. package/entities/pages/pages-management.service.ts +610 -0
  146. package/entities/pages/pages.config.ts +94 -0
  147. package/entities/pages/pages.fields.ts +101 -0
  148. package/entities/pages/pages.service.ts +290 -0
  149. package/entities/pages/pages.types.ts +124 -0
  150. package/entities/posts/components/post-header.tsx +97 -0
  151. package/entities/posts/messages/en.json +55 -0
  152. package/entities/posts/messages/es.json +55 -0
  153. package/entities/posts/migrations/001_posts_table.sql +115 -0
  154. package/entities/posts/migrations/003_add_status.sql +44 -0
  155. package/entities/posts/migrations/004_entity_taxonomy_relations.sql +129 -0
  156. package/entities/posts/migrations/006_posts_metas.sql +56 -0
  157. package/entities/posts/posts.config.ts +101 -0
  158. package/entities/posts/posts.fields.ts +116 -0
  159. package/entities/posts/posts.service.ts +376 -0
  160. package/entities/posts/posts.types.ts +74 -0
  161. package/entities/tasks/messages/en.json +204 -0
  162. package/entities/tasks/messages/es.json +204 -0
  163. package/entities/tasks/migrations/001_tasks_table.sql +105 -0
  164. package/entities/tasks/migrations/002_task_metas.sql +85 -0
  165. package/entities/tasks/migrations/sample_data.json +77 -0
  166. package/entities/tasks/tasks.config.ts +79 -0
  167. package/entities/tasks/tasks.fields.ts +196 -0
  168. package/entities/tasks/tasks.service.ts +541 -0
  169. package/entities/tasks/tasks.types.ts +56 -0
  170. package/lib/hooks/useAiChat.ts +114 -0
  171. package/lib/hooks/useConversations.ts +376 -0
  172. package/lib/hooks/useOrchestratorChat.ts +122 -0
  173. package/lib/hooks/usePersistentChat.ts +315 -0
  174. package/lib/hooks/useStreamingChat.ts +127 -0
  175. package/lib/hooks/useTokenUsage.ts +63 -0
  176. package/lib/langchain/agents/customer-assistant.md +69 -0
  177. package/lib/langchain/agents/index.ts +61 -0
  178. package/lib/langchain/agents/orchestrator.md +59 -0
  179. package/lib/langchain/agents/page-assistant.md +85 -0
  180. package/lib/langchain/agents/single-agent.md +46 -0
  181. package/lib/langchain/agents/task-assistant.md +55 -0
  182. package/lib/langchain/config.ts +45 -0
  183. package/lib/langchain/handlers/customer-handler.ts +338 -0
  184. package/lib/langchain/handlers/page-handler.ts +232 -0
  185. package/lib/langchain/handlers/task-handler.ts +323 -0
  186. package/lib/langchain/langchain.config.ts +223 -0
  187. package/lib/langchain/observability.config.ts +30 -0
  188. package/lib/langchain/orchestrator.ts +562 -0
  189. package/lib/langchain/tools/customers.ts +176 -0
  190. package/lib/langchain/tools/index.ts +10 -0
  191. package/lib/langchain/tools/orchestrator.ts +92 -0
  192. package/lib/langchain/tools/pages.ts +289 -0
  193. package/lib/langchain/tools/tasks.ts +167 -0
  194. package/lib/scheduled-actions/billing.ts +149 -0
  195. package/lib/scheduled-actions/index.ts +170 -0
  196. package/lib/scheduled-actions/webhook.ts +231 -0
  197. package/lib/selectors.ts +197 -0
  198. package/messages/de/admin.json +219 -0
  199. package/messages/de/aiUsage.json +36 -0
  200. package/messages/de/buttons.json +19 -0
  201. package/messages/de/categories.json +35 -0
  202. package/messages/de/common.json +16 -0
  203. package/messages/de/dev.json +101 -0
  204. package/messages/de/docs.json +27 -0
  205. package/messages/de/entities.json +7 -0
  206. package/messages/de/features.json +119 -0
  207. package/messages/de/footer.json +22 -0
  208. package/messages/de/home.json +57 -0
  209. package/messages/de/index.ts +39 -0
  210. package/messages/de/mobileNav.json +13 -0
  211. package/messages/de/navigation.json +8 -0
  212. package/messages/de/observability.json +74 -0
  213. package/messages/de/posts.json +54 -0
  214. package/messages/de/pricing.json +102 -0
  215. package/messages/de/support.json +9 -0
  216. package/messages/de/teams.json +8 -0
  217. package/messages/en/admin.json +219 -0
  218. package/messages/en/aiUsage.json +36 -0
  219. package/messages/en/buttons.json +19 -0
  220. package/messages/en/categories.json +35 -0
  221. package/messages/en/common.json +16 -0
  222. package/messages/en/dev.json +106 -0
  223. package/messages/en/docs.json +27 -0
  224. package/messages/en/entities.json +7 -0
  225. package/messages/en/features.json +119 -0
  226. package/messages/en/footer.json +22 -0
  227. package/messages/en/home.json +57 -0
  228. package/messages/en/index.ts +39 -0
  229. package/messages/en/mobileNav.json +13 -0
  230. package/messages/en/navigation.json +8 -0
  231. package/messages/en/observability.json +74 -0
  232. package/messages/en/posts.json +54 -0
  233. package/messages/en/pricing.json +102 -0
  234. package/messages/en/support.json +9 -0
  235. package/messages/en/teams.json +8 -0
  236. package/messages/es/admin.json +219 -0
  237. package/messages/es/aiUsage.json +36 -0
  238. package/messages/es/buttons.json +19 -0
  239. package/messages/es/categories.json +35 -0
  240. package/messages/es/common.json +16 -0
  241. package/messages/es/dev.json +101 -0
  242. package/messages/es/docs.json +27 -0
  243. package/messages/es/entities.json +7 -0
  244. package/messages/es/features.json +119 -0
  245. package/messages/es/footer.json +22 -0
  246. package/messages/es/home.json +57 -0
  247. package/messages/es/index.ts +39 -0
  248. package/messages/es/mobileNav.json +13 -0
  249. package/messages/es/navigation.json +8 -0
  250. package/messages/es/observability.json +74 -0
  251. package/messages/es/posts.json +54 -0
  252. package/messages/es/pricing.json +102 -0
  253. package/messages/es/support.json +9 -0
  254. package/messages/es/teams.json +8 -0
  255. package/messages/fr/admin.json +219 -0
  256. package/messages/fr/aiUsage.json +36 -0
  257. package/messages/fr/buttons.json +19 -0
  258. package/messages/fr/categories.json +35 -0
  259. package/messages/fr/common.json +16 -0
  260. package/messages/fr/dev.json +101 -0
  261. package/messages/fr/docs.json +27 -0
  262. package/messages/fr/entities.json +7 -0
  263. package/messages/fr/features.json +119 -0
  264. package/messages/fr/footer.json +22 -0
  265. package/messages/fr/home.json +57 -0
  266. package/messages/fr/index.ts +39 -0
  267. package/messages/fr/mobileNav.json +13 -0
  268. package/messages/fr/navigation.json +8 -0
  269. package/messages/fr/observability.json +74 -0
  270. package/messages/fr/posts.json +54 -0
  271. package/messages/fr/pricing.json +102 -0
  272. package/messages/fr/support.json +9 -0
  273. package/messages/fr/teams.json +8 -0
  274. package/messages/it/admin.json +219 -0
  275. package/messages/it/aiUsage.json +36 -0
  276. package/messages/it/buttons.json +19 -0
  277. package/messages/it/categories.json +35 -0
  278. package/messages/it/common.json +16 -0
  279. package/messages/it/dev.json +101 -0
  280. package/messages/it/docs.json +27 -0
  281. package/messages/it/entities.json +7 -0
  282. package/messages/it/features.json +119 -0
  283. package/messages/it/footer.json +22 -0
  284. package/messages/it/home.json +57 -0
  285. package/messages/it/index.ts +39 -0
  286. package/messages/it/mobileNav.json +13 -0
  287. package/messages/it/navigation.json +8 -0
  288. package/messages/it/observability.json +74 -0
  289. package/messages/it/posts.json +54 -0
  290. package/messages/it/pricing.json +102 -0
  291. package/messages/it/support.json +9 -0
  292. package/messages/it/teams.json +8 -0
  293. package/messages/pt/admin.json +219 -0
  294. package/messages/pt/aiUsage.json +36 -0
  295. package/messages/pt/buttons.json +19 -0
  296. package/messages/pt/categories.json +35 -0
  297. package/messages/pt/common.json +16 -0
  298. package/messages/pt/dev.json +101 -0
  299. package/messages/pt/docs.json +27 -0
  300. package/messages/pt/entities.json +7 -0
  301. package/messages/pt/features.json +119 -0
  302. package/messages/pt/footer.json +22 -0
  303. package/messages/pt/home.json +57 -0
  304. package/messages/pt/index.ts +39 -0
  305. package/messages/pt/mobileNav.json +13 -0
  306. package/messages/pt/navigation.json +8 -0
  307. package/messages/pt/observability.json +74 -0
  308. package/messages/pt/posts.json +54 -0
  309. package/messages/pt/pricing.json +102 -0
  310. package/messages/pt/support.json +9 -0
  311. package/messages/pt/teams.json +8 -0
  312. package/migrations/089_add_editor_team_role.sql +39 -0
  313. package/migrations/090_demo_users_teams.sql +540 -0
  314. package/migrations/091_greek_teams_billing.sql +523 -0
  315. package/migrations/092_billing_sample_data.sql +774 -0
  316. package/migrations/093_pages_sample_data.sql +1158 -0
  317. package/migrations/094_posts_sample_data.sql +278 -0
  318. package/migrations/095_tasks_sample_data.sql +440 -0
  319. package/migrations/096_customers_sample_data.sql +358 -0
  320. package/migrations/097_scheduled_actions_sample_data.sql +111 -0
  321. package/package.json +22 -0
  322. package/public/docs/desktop-layout-example.png +0 -0
  323. package/styles/components.css +11 -0
  324. package/styles/globals.css +179 -0
  325. package/templates/(public)/blog/[slug]/page.tsx +65 -0
  326. package/templates/(public)/layout.tsx +25 -0
  327. package/templates/(public)/page.tsx +200 -0
  328. package/templates/(public)/support/page.tsx +321 -0
  329. package/templates/dashboard/(main)/agent-multi/page.tsx +63 -0
  330. package/templates/dashboard/(main)/agent-single/page.tsx +142 -0
  331. package/templates/dashboard/(main)/settings/ai-usage/page.tsx +157 -0
  332. package/templates/superadmin/ai-observability/[traceId]/page.tsx +27 -0
  333. package/templates/superadmin/ai-observability/page.tsx +17 -0
@@ -0,0 +1,203 @@
1
+ /**
2
+ * Default Theme - Features Configuration
3
+ *
4
+ * Defines all features of the application for this theme.
5
+ * Each feature key becomes a tag: @feat-{key}
6
+ *
7
+ * Features are enriched at build-time with:
8
+ * - Entity metadata (from entity-registry)
9
+ * - Permission details (from permissions-registry)
10
+ * - Documentation links (from docs-registry)
11
+ * - Test coverage (from tags-registry + test files)
12
+ */
13
+
14
+ import { defineFeatures } from '@nextsparkjs/core/lib/config/features-types'
15
+
16
+ export default defineFeatures({
17
+
18
+
19
+ // ===========================================================================
20
+ // AI FEATURES
21
+ // AI-powered assistant and tools
22
+ // ===========================================================================
23
+
24
+ ai: {
25
+ name: 'AI Assistant',
26
+ description: 'AI-powered assistant with multi-agent orchestration, chat, and usage tracking',
27
+ category: 'core',
28
+ icon: 'bot',
29
+ entities: [],
30
+ permissions: ['ai.*'],
31
+ docs: ['03-ai/*'],
32
+ },
33
+
34
+ // ===========================================================================
35
+ // ENTITY FEATURES
36
+ // Business entity CRUD features
37
+ // ===========================================================================
38
+
39
+ customers: {
40
+ name: 'Customers',
41
+ description: 'Customer management with metadata support',
42
+ category: 'entities',
43
+ icon: 'user-circle',
44
+ entities: ['customers'],
45
+ permissions: ['customers.*'],
46
+ docs: [],
47
+ },
48
+
49
+ tasks: {
50
+ name: 'Tasks',
51
+ description: 'Task tracking and assignment',
52
+ category: 'entities',
53
+ icon: 'check-square',
54
+ entities: ['tasks'],
55
+ permissions: ['tasks.*'],
56
+ docs: [],
57
+ },
58
+
59
+ posts: {
60
+ name: 'Posts',
61
+ description: 'Blog posts and content publishing',
62
+ category: 'entities',
63
+ icon: 'file-text',
64
+ entities: ['posts', 'categories'],
65
+ permissions: ['posts.*', 'categories.*'],
66
+ docs: [],
67
+ },
68
+
69
+ pages: {
70
+ name: 'Pages',
71
+ description: 'Page management, publishing, and SEO settings',
72
+ category: 'entities',
73
+ icon: 'file',
74
+ entities: ['pages'],
75
+ permissions: ['pages.*'],
76
+ docs: [],
77
+ },
78
+
79
+ // ===========================================================================
80
+ // CONTENT FEATURES
81
+ // Content creation and editing tools
82
+ // ===========================================================================
83
+
84
+ 'page-builder': {
85
+ name: 'Page Builder',
86
+ description: 'Visual block editor for page content',
87
+ category: 'content',
88
+ icon: 'layout',
89
+ entities: [],
90
+ permissions: ['blocks.*'],
91
+ docs: ['18-page-builder/*'],
92
+ },
93
+
94
+ // ===========================================================================
95
+ // CORE FEATURES
96
+ // Platform-level features that exist in all themes
97
+ // ===========================================================================
98
+
99
+ auth: {
100
+ name: 'Authentication',
101
+ description: 'User authentication, sessions, and account security',
102
+ category: 'core',
103
+ icon: 'shield',
104
+ entities: [],
105
+ permissions: ['auth.*'],
106
+ docs: ['06-authentication/*'],
107
+ },
108
+
109
+ teams: {
110
+ name: 'Teams',
111
+ description: 'Multi-tenant team management and membership',
112
+ category: 'core',
113
+ icon: 'users',
114
+ entities: [],
115
+ permissions: ['teams.*', 'members.*', 'invitations.*'],
116
+ docs: ['10-teams/*'],
117
+ },
118
+
119
+ // ===========================================================================
120
+ // BILLING FEATURES
121
+ // Plans, subscriptions, and payments
122
+ // ===========================================================================
123
+
124
+ plans: {
125
+ name: 'Plans',
126
+ description: 'Plan catalog, comparison, and selection',
127
+ category: 'settings',
128
+ icon: 'credit-card',
129
+ entities: [],
130
+ permissions: ['plans.*'],
131
+ docs: ['19-billing/02-configuration.md', '19-billing/07-pricing-strategies.md'],
132
+ },
133
+
134
+ billing: {
135
+ name: 'Billing',
136
+ description: 'Subscription management, payments, and invoices',
137
+ category: 'settings',
138
+ icon: 'receipt',
139
+ entities: [],
140
+ permissions: ['billing.*', 'subscriptions.*', 'invoices.*'],
141
+ docs: ['19-billing/*'],
142
+ },
143
+
144
+ // ===========================================================================
145
+ // SETTINGS FEATURES
146
+ // User and team settings
147
+ // ===========================================================================
148
+
149
+ users: {
150
+ name: 'User Profile',
151
+ description: 'User profile management and preferences',
152
+ category: 'settings',
153
+ icon: 'user',
154
+ entities: [],
155
+ permissions: ['profile.*'],
156
+ docs: [],
157
+ },
158
+
159
+ 'api-keys': {
160
+ name: 'API Keys',
161
+ description: 'API key generation and management for integrations',
162
+ category: 'settings',
163
+ icon: 'key',
164
+ entities: [],
165
+ permissions: ['api-keys.*'],
166
+ docs: ['05-api/*'],
167
+ },
168
+
169
+ // ===========================================================================
170
+ // ADMIN FEATURES
171
+ // Superadmin and developer tools
172
+ // ===========================================================================
173
+
174
+ superadmin: {
175
+ name: 'Superadmin',
176
+ description: 'Superadmin dashboard and system management',
177
+ category: 'admin',
178
+ icon: 'shield-check',
179
+ entities: [],
180
+ permissions: ['superadmin.*'],
181
+ docs: ['19-restricted-zones/02-admin.md'],
182
+ },
183
+
184
+ devtools: {
185
+ name: 'Developer Tools',
186
+ description: 'Development tools, test viewers, and configuration inspectors',
187
+ category: 'admin',
188
+ icon: 'terminal',
189
+ entities: [],
190
+ permissions: ['developer.*'],
191
+ docs: ['19-restricted-zones/03-devtools.md'],
192
+ },
193
+
194
+ 'scheduled-actions': {
195
+ name: 'Scheduled Actions',
196
+ description: 'Background task processing, webhooks, and recurring operations',
197
+ category: 'core',
198
+ icon: 'clock',
199
+ entities: [],
200
+ permissions: ['developer.*'],
201
+ docs: ['20-scheduled-actions/*'],
202
+ },
203
+ })
@@ -0,0 +1,129 @@
1
+ /**
2
+ * Default Theme - Flows Configuration
3
+ *
4
+ * Defines user journeys/flows that span multiple features.
5
+ * Each flow key becomes a tag: @flow-{key}
6
+ *
7
+ * Flows are enriched at build-time with:
8
+ * - Feature metadata (from features.config.ts)
9
+ * - Test coverage (from tags-registry + test files)
10
+ */
11
+
12
+ import { defineFlows } from '@nextsparkjs/core/lib/config/features-types'
13
+
14
+ export default defineFlows({
15
+ // ===========================================================================
16
+ // ACQUISITION FLOWS
17
+ // User acquisition and onboarding journeys
18
+ // ===========================================================================
19
+
20
+ onboarding: {
21
+ name: 'User Onboarding',
22
+ description: 'Complete journey from signup to first team creation',
23
+ category: 'acquisition',
24
+ icon: 'rocket',
25
+ criticalPath: true,
26
+
27
+ steps: [
28
+ {
29
+ feature: 'auth',
30
+ action: 'signup',
31
+ description: 'User creates account with email/password or OAuth',
32
+ },
33
+ {
34
+ feature: 'auth',
35
+ action: 'verify-email',
36
+ description: 'User verifies email address',
37
+ },
38
+ {
39
+ feature: 'teams',
40
+ action: 'create-team',
41
+ description: 'User creates their first team/workspace',
42
+ },
43
+ {
44
+ feature: 'teams',
45
+ action: 'invite-members',
46
+ description: 'User invites team members',
47
+ optional: true,
48
+ },
49
+ ],
50
+
51
+ features: ['auth', 'teams'],
52
+ },
53
+
54
+ // ===========================================================================
55
+ // NAVIGATION FLOWS
56
+ // Context switching and navigation journeys
57
+ // ===========================================================================
58
+
59
+ 'team-switch': {
60
+ name: 'Team Switching',
61
+ description: 'Context switch between different teams/workspaces',
62
+ category: 'navigation',
63
+ icon: 'repeat',
64
+ criticalPath: true,
65
+
66
+ steps: [
67
+ {
68
+ feature: 'teams',
69
+ action: 'open-switcher',
70
+ description: 'User opens the team switcher dropdown',
71
+ },
72
+ {
73
+ feature: 'teams',
74
+ action: 'select-team',
75
+ description: 'User selects a different team',
76
+ },
77
+ {
78
+ feature: 'teams',
79
+ action: 'load-context',
80
+ description: 'System loads new team context and redirects',
81
+ },
82
+ ],
83
+
84
+ features: ['teams'],
85
+ },
86
+
87
+ // ===========================================================================
88
+ // BILLING FLOWS
89
+ // Subscription and payment journeys
90
+ // ===========================================================================
91
+
92
+ 'upgrade-plan': {
93
+ name: 'Plan Upgrade',
94
+ description: 'Upgrade subscription to a higher tier plan',
95
+ category: 'settings',
96
+ icon: 'trending-up',
97
+ criticalPath: true,
98
+
99
+ steps: [
100
+ {
101
+ feature: 'plans',
102
+ action: 'view-plans',
103
+ description: 'User views available plans',
104
+ },
105
+ {
106
+ feature: 'plans',
107
+ action: 'compare-plans',
108
+ description: 'User compares features between plans',
109
+ },
110
+ {
111
+ feature: 'plans',
112
+ action: 'select-plan',
113
+ description: 'User selects a new plan',
114
+ },
115
+ {
116
+ feature: 'billing',
117
+ action: 'enter-payment',
118
+ description: 'User enters or confirms payment method',
119
+ },
120
+ {
121
+ feature: 'billing',
122
+ action: 'confirm-upgrade',
123
+ description: 'User confirms the upgrade',
124
+ },
125
+ ],
126
+
127
+ features: ['plans', 'billing'],
128
+ },
129
+ })
@@ -0,0 +1,245 @@
1
+ /**
2
+ * Default Theme - Permissions Configuration
3
+ *
4
+ * SINGLE SOURCE OF TRUTH for all permissions and roles in this theme.
5
+ *
6
+ * This file defines:
7
+ * - roles: Custom roles beyond core (owner, admin, member, viewer)
8
+ * - teams: Team-level permissions (team.view, team.edit, etc.)
9
+ * - entities: Entity CRUD permissions (customers, tasks, etc.)
10
+ * - features: Theme-specific feature permissions (page-builder, blog, media)
11
+ *
12
+ * All sections use unified format: { action: '...', roles: [...] }
13
+ *
14
+ * Use PermissionService.canDoAction(role, action) to check any permission.
15
+ */
16
+
17
+ import type { ThemePermissionsConfig } from '@nextsparkjs/core/lib/permissions/types'
18
+
19
+ export const PERMISSIONS_CONFIG_OVERRIDES: ThemePermissionsConfig = {
20
+ // ==========================================
21
+ // CUSTOM ROLES
22
+ // ==========================================
23
+ // Roles beyond core (owner, admin, member, viewer)
24
+ roles: {
25
+ additionalRoles: ['editor'] as const,
26
+ hierarchy: {
27
+ editor: 5, // Between viewer (1) and member (10)
28
+ },
29
+ displayNames: {
30
+ editor: 'common.teamRoles.editor',
31
+ },
32
+ descriptions: {
33
+ editor: 'Can view team content but has limited editing capabilities',
34
+ },
35
+ },
36
+
37
+ // ==========================================
38
+ // TEAM PERMISSIONS
39
+ // ==========================================
40
+ // Unified format: { action, label, description, roles, dangerous? }
41
+ teams: [
42
+ // View permissions
43
+ { action: 'team.view', label: 'View Team', description: 'Can view team details', roles: ['owner', 'admin', 'member', 'viewer', 'editor'] },
44
+ { action: 'team.members.view', label: 'View Members', description: 'Can see team member list', roles: ['owner', 'admin', 'member', 'viewer', 'editor'] },
45
+ { action: 'team.settings.view', label: 'View Settings', description: 'Can view team settings', roles: ['owner', 'admin', 'member', 'editor'] },
46
+ { action: 'team.billing.view', label: 'View Billing', description: 'Can view billing information', roles: ['owner', 'admin'] },
47
+
48
+ // Edit permissions
49
+ { action: 'team.edit', label: 'Edit Team', description: 'Can modify team name and details', roles: ['owner', 'admin'] },
50
+ { action: 'team.settings.edit', label: 'Edit Settings', description: 'Can modify team settings', roles: ['owner', 'admin'] },
51
+ { action: 'team.billing.manage', label: 'Manage Billing', description: 'Can manage subscriptions and payments', roles: ['owner'] },
52
+
53
+ // Member management
54
+ { action: 'team.members.invite', label: 'Invite Members', description: 'Can invite new team members', roles: ['owner', 'admin'] },
55
+ { action: 'team.members.remove', label: 'Remove Members', description: 'Can remove team members', roles: ['owner', 'admin'] },
56
+ { action: 'team.members.update_role', label: 'Update Roles', description: 'Can change member roles', roles: ['owner', 'admin'] },
57
+
58
+ // Dangerous
59
+ { action: 'team.delete', label: 'Delete Team', description: 'Can permanently delete the team', roles: ['owner'], dangerous: true },
60
+ ],
61
+
62
+ // ==========================================
63
+ // ENTITY PERMISSIONS
64
+ // ==========================================
65
+ entities: {
66
+ // ------------------------------------------
67
+ // CUSTOMERS
68
+ // ------------------------------------------
69
+ customers: [
70
+ { action: 'create', label: 'Create customers', description: 'Can create new customers', roles: ['owner', 'admin'] },
71
+ { action: 'read', label: 'View customers', description: 'Can view customer details', roles: ['owner', 'admin', 'member', 'editor'] },
72
+ { action: 'list', label: 'List customers', description: 'Can see the customers list', roles: ['owner', 'admin', 'member', 'editor'] },
73
+ { action: 'update', label: 'Edit customers', description: 'Can modify customer information', roles: ['owner', 'admin'] },
74
+ { action: 'delete', label: 'Delete customers', description: 'Can delete customers', roles: ['owner'], dangerous: true },
75
+ ],
76
+
77
+ // ------------------------------------------
78
+ // TASKS
79
+ // Note: Editor does NOT have access to tasks (per business rules)
80
+ // ------------------------------------------
81
+ tasks: [
82
+ { action: 'create', label: 'Create tasks', description: 'Can create new tasks', roles: ['owner', 'admin', 'member'] },
83
+ { action: 'read', label: 'View tasks', description: 'Can view task details', roles: ['owner', 'admin', 'member'] },
84
+ { action: 'list', label: 'List tasks', description: 'Can see the tasks list', roles: ['owner', 'admin', 'member'] },
85
+ { action: 'update', label: 'Edit tasks', description: 'Can modify task information', roles: ['owner', 'admin', 'member'] },
86
+ { action: 'delete', label: 'Delete tasks', description: 'Can delete tasks', roles: ['owner', 'admin'], dangerous: true },
87
+ { action: 'assign', label: 'Assign tasks', description: 'Can assign tasks to team members', roles: ['owner', 'admin'] },
88
+ ],
89
+
90
+ // ------------------------------------------
91
+ // POSTS
92
+ // ------------------------------------------
93
+ posts: [
94
+ { action: 'create', label: 'Create Posts', description: 'Can create new blog posts', roles: ['owner', 'admin', 'member'] },
95
+ { action: 'read', label: 'View Posts', description: 'Can view post details', roles: ['owner', 'admin', 'member', 'viewer'] },
96
+ { action: 'list', label: 'List Posts', description: 'Can see the posts list', roles: ['owner', 'admin', 'member', 'viewer'] },
97
+ { action: 'update', label: 'Edit Posts', description: 'Can modify post content', roles: ['owner', 'admin', 'member'] },
98
+ { action: 'delete', label: 'Delete Posts', description: 'Can delete posts', roles: ['owner', 'admin'], dangerous: true },
99
+ { action: 'publish', label: 'Publish Posts', description: 'Can publish posts to make them public', roles: ['owner', 'admin'] },
100
+ ],
101
+
102
+ // ------------------------------------------
103
+ // PAGES
104
+ // ------------------------------------------
105
+ pages: [
106
+ { action: 'create', label: 'Create Pages', description: 'Can create new pages', roles: ['owner', 'admin'] },
107
+ { action: 'read', label: 'View Pages', description: 'Can view page details', roles: ['owner', 'admin', 'member', 'viewer'] },
108
+ { action: 'list', label: 'List Pages', description: 'Can see the pages list', roles: ['owner', 'admin', 'member', 'viewer'] },
109
+ { action: 'update', label: 'Edit Pages', description: 'Can modify page content', roles: ['owner', 'admin'] },
110
+ { action: 'delete', label: 'Delete Pages', description: 'Can delete pages', roles: ['owner', 'admin'], dangerous: true },
111
+ { action: 'publish', label: 'Publish Pages', description: 'Can publish pages to make them public', roles: ['owner', 'admin'] },
112
+ ],
113
+ },
114
+
115
+ // ==========================================
116
+ // FEATURE PERMISSIONS
117
+ // ==========================================
118
+ // Unified format: uses 'action' instead of 'id'
119
+ features: [
120
+ // AI ASSISTANT
121
+ {
122
+ action: 'ai.access',
123
+ label: 'Access AI Assistant',
124
+ description: 'Can access the AI chat assistant',
125
+ category: 'AI Assistant',
126
+ roles: ['owner', 'admin', 'member'],
127
+ },
128
+ {
129
+ action: 'ai.chat',
130
+ label: 'Send Messages',
131
+ description: 'Can send messages to the AI assistant',
132
+ category: 'AI Assistant',
133
+ roles: ['owner', 'admin', 'member'],
134
+ },
135
+ {
136
+ action: 'ai.history',
137
+ label: 'View Chat History',
138
+ description: 'Can view past conversations with AI assistant',
139
+ category: 'AI Assistant',
140
+ roles: ['owner', 'admin', 'member'],
141
+ },
142
+ {
143
+ action: 'ai.settings',
144
+ label: 'Manage AI Settings',
145
+ description: 'Can configure AI assistant settings and preferences',
146
+ category: 'AI Assistant',
147
+ roles: ['owner', 'admin'],
148
+ },
149
+
150
+ // PAGE BUILDER
151
+ {
152
+ action: 'page-builder.access',
153
+ label: 'Access Page Builder',
154
+ description: 'Can use the visual page builder to create and edit content',
155
+ category: 'Page Builder',
156
+ roles: ['owner', 'admin', 'editor', 'member'],
157
+ },
158
+ {
159
+ action: 'page-builder.manage-blocks',
160
+ label: 'Manage Blocks',
161
+ description: 'Can add, remove, and configure blocks in the page builder',
162
+ category: 'Page Builder',
163
+ roles: ['owner', 'admin'],
164
+ },
165
+ {
166
+ action: 'page-builder.custom-css',
167
+ label: 'Custom CSS',
168
+ description: 'Can add custom CSS styles to pages and blocks',
169
+ category: 'Page Builder',
170
+ roles: ['owner', 'admin'],
171
+ dangerous: true,
172
+ },
173
+
174
+ // BLOG PUBLISHING
175
+ {
176
+ action: 'blog.schedule',
177
+ label: 'Schedule Posts',
178
+ description: 'Can schedule posts for future publication',
179
+ category: 'Blog',
180
+ roles: ['owner', 'admin'],
181
+ },
182
+ {
183
+ action: 'blog.featured',
184
+ label: 'Feature Posts',
185
+ description: 'Can mark posts as featured for homepage display',
186
+ category: 'Blog',
187
+ roles: ['owner', 'admin'],
188
+ },
189
+
190
+ // MEDIA MANAGEMENT
191
+ {
192
+ action: 'media.upload',
193
+ label: 'Upload Media',
194
+ description: 'Can upload images, videos, and other media files',
195
+ category: 'Media',
196
+ roles: ['owner', 'admin', 'editor', 'member'],
197
+ },
198
+ {
199
+ action: 'media.delete',
200
+ label: 'Delete Media',
201
+ description: 'Can permanently delete media files',
202
+ category: 'Media',
203
+ roles: ['owner', 'admin'],
204
+ dangerous: true,
205
+ },
206
+ ],
207
+
208
+ // ==========================================
209
+ // UI SECTIONS
210
+ // ==========================================
211
+ uiSections: [
212
+ {
213
+ id: 'ai',
214
+ label: 'AI Assistant',
215
+ description: 'AI-powered assistant features',
216
+ categories: ['AI Assistant'],
217
+ },
218
+ {
219
+ id: 'teams',
220
+ label: 'Teams',
221
+ description: 'Team management permissions',
222
+ categories: ['Teams'],
223
+ },
224
+ {
225
+ id: 'page-builder',
226
+ label: 'Page Builder',
227
+ description: 'Visual content editing features',
228
+ categories: ['Page Builder'],
229
+ },
230
+ {
231
+ id: 'blog',
232
+ label: 'Blog',
233
+ description: 'Blog publishing and management features',
234
+ categories: ['Blog'],
235
+ },
236
+ {
237
+ id: 'media',
238
+ label: 'Media',
239
+ description: 'Media library management',
240
+ categories: ['Media'],
241
+ },
242
+ ],
243
+ }
244
+
245
+ export default PERMISSIONS_CONFIG_OVERRIDES
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Boilerplate Theme Configuration
3
+ *
4
+ */
5
+
6
+ import type { ThemeConfig } from '@nextsparkjs/core/types/theme'
7
+
8
+ export const boilerplateThemeConfig: ThemeConfig = {
9
+ name: 'default',
10
+ displayName: 'Default',
11
+ version: '1.0.0',
12
+ description: 'Default neutral theme - black and white',
13
+ author: 'NextSpark Team',
14
+
15
+ plugins: ['langchain'],
16
+
17
+ // Styles configuration - colors come from globals.css only
18
+ styles: {
19
+ globals: 'globals.css',
20
+ components: 'components.css',
21
+ variables: {
22
+ // Custom spacing
23
+ '--spacing-xs': '0.125rem',
24
+ '--spacing-sm': '0.25rem',
25
+ '--spacing-md': '0.5rem',
26
+ '--spacing-lg': '1rem',
27
+ '--spacing-xl': '1.5rem',
28
+ '--spacing-2xl': '2rem'
29
+ }
30
+ },
31
+
32
+ // Theme configuration - NO colors here, they come from globals.css
33
+ config: {
34
+ // Typography
35
+ fonts: {
36
+ sans: 'system-ui, -apple-system, sans-serif',
37
+ serif: 'Georgia, serif',
38
+ mono: 'ui-monospace, monospace'
39
+ },
40
+
41
+ // Border radius
42
+ spacing: {
43
+ radius: '0.5rem',
44
+ 'radius-sm': 'calc(0.5rem - 4px)',
45
+ 'radius-md': 'calc(0.5rem - 2px)',
46
+ 'radius-lg': '0.5rem',
47
+ 'radius-xl': 'calc(0.5rem + 4px)'
48
+ }
49
+ },
50
+
51
+ // Component overrides and custom components
52
+ components: {
53
+ overrides: {
54
+ // Override core shadcn/ui components with theme-specific versions
55
+ // '@nextsparkjs/core/components/ui/button': () => import('../components/overrides/Button').then(m => m.Button),
56
+ // '@nextsparkjs/core/components/ui/card': () => import('../components/overrides/Card').then(m => ({
57
+ // Card: m.Card,
58
+ // CardHeader: m.CardHeader,
59
+ // CardTitle: m.CardTitle,
60
+ // CardDescription: m.CardDescription,
61
+ // CardContent: m.CardContent,
62
+ // CardFooter: m.CardFooter
63
+ // }))
64
+ },
65
+ custom: {
66
+ // Custom theme-specific components
67
+ // CustomHeader: () => import('../components/custom/CustomHeader').then(m => m.CustomHeader),
68
+ // CustomFooter: () => import('../components/custom/CustomFooter').then(m => m.CustomFooter),
69
+ // BrandLogo: () => import('../components/custom/BrandLogo').then(m => m.BrandLogo)
70
+ }
71
+ }
72
+ }
73
+
74
+ export default boilerplateThemeConfig