@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,367 @@
1
+ /**
2
+ * boilerplate Theme- Application Configuration Overrides
3
+ *
4
+ * This file allows the theme to override core application configuration values.
5
+ * Only include properties you want to override - missing properties will use core defaults.
6
+ */
7
+
8
+ // Partial configuration type - all properties are optional
9
+ export const APP_CONFIG_OVERRIDES = {
10
+ // =============================================================================
11
+ // APPLICATION METADATA OVERRIDES
12
+ // =============================================================================
13
+ app: {
14
+ name: 'Boilerplate',
15
+ version: '1.0.0',
16
+ },
17
+
18
+ // =============================================================================
19
+ // TEAMS CONFIGURATION - MULTI-TENANT MODE
20
+ // =============================================================================
21
+ /**
22
+ * Multi-tenant mode:
23
+ * - Multiple work teams (workspaces)
24
+ * - Team switching enabled
25
+ * - Invitations enabled
26
+ * - Can create new teams
27
+ */
28
+ teams: {
29
+ mode: 'multi-tenant' as const,
30
+ options: {
31
+ maxMembersPerTeam: 50,
32
+ allowLeaveTeam: true,
33
+ allowCreateTeams: true,
34
+ },
35
+ },
36
+
37
+ // =============================================================================
38
+ // INTERNATIONALIZATION OVERRIDES
39
+ // =============================================================================
40
+ i18n: {
41
+ /**
42
+ * Supported locales for your project
43
+ * Add/remove locales as needed
44
+ */
45
+ supportedLocales: ['en', 'es'],
46
+
47
+ /**
48
+ * Default locale for your project
49
+ * Override to change the primary language
50
+ */
51
+ defaultLocale: 'es' as const,
52
+
53
+ /**
54
+ * Additional namespaces specific to Boilerplate
55
+ */
56
+ namespaces: [
57
+ 'common',
58
+ 'dashboard',
59
+ 'settings',
60
+ 'auth',
61
+ 'public',
62
+ 'validation',
63
+
64
+ // Project specific
65
+ 'tasks',
66
+ 'clients',
67
+ ],
68
+ },
69
+
70
+ // =============================================================================
71
+ // API CONFIGURATION OVERRIDES
72
+ // =============================================================================
73
+ api: {
74
+ cors: {
75
+ allowedOrigins: {
76
+ development: [
77
+ 'http://localhost:3000',
78
+ 'http://localhost:5173',
79
+ 'http://127.0.0.1:3000',
80
+ 'http://127.0.0.1:5173',
81
+ // Project specific development origins
82
+ ],
83
+ production: [
84
+ // Add Project production domains
85
+ // 'https://boilerplate-themoneyteam.xyz',
86
+ ],
87
+ },
88
+ },
89
+ },
90
+
91
+ // =============================================================================
92
+ // DOCUMENTATION CONFIGURATION
93
+ // =============================================================================
94
+ docs: {
95
+ /**
96
+ * Enable/disable documentation system
97
+ */
98
+ enabled: true,
99
+
100
+ /**
101
+ * Public access to documentation
102
+ * - true: Documentation accessible without authentication
103
+ * - false: Requires user to be logged in
104
+ */
105
+ public: true,
106
+
107
+ /**
108
+ * Enable search functionality in documentation
109
+ */
110
+ searchEnabled: true,
111
+
112
+ /**
113
+ * Show breadcrumbs in documentation pages
114
+ */
115
+ breadcrumbs: true,
116
+
117
+ /**
118
+ * Theme Documentation Configuration
119
+ * Controls how theme-level documentation appears in the sidebar
120
+ */
121
+ theme: {
122
+ /** Show/hide theme documentation category */
123
+ enabled: true,
124
+ /** Expand theme category by default on page load */
125
+ open: true,
126
+ /** Custom label displayed in sidebar for theme category */
127
+ label: "Default Theme",
128
+ },
129
+
130
+ /**
131
+ * Plugins Documentation Configuration
132
+ * Controls how plugin documentation appears in the sidebar
133
+ */
134
+ plugins: {
135
+ /** Show/hide plugin documentation category */
136
+ enabled: true,
137
+ /** Expand plugins category by default on page load */
138
+ open: false,
139
+ /** Custom label displayed in sidebar for plugins category */
140
+ label: "Plugins",
141
+ },
142
+
143
+ /**
144
+ * Core Documentation Configuration
145
+ * Controls how core framework documentation appears in the sidebar
146
+ */
147
+ core: {
148
+ /** Show/hide core documentation category */
149
+ enabled: true,
150
+ /** Expand core category by default on page load */
151
+ open: true,
152
+ /** Custom label displayed in sidebar for core category */
153
+ label: "Core",
154
+ },
155
+
156
+ /**
157
+ * Additional environment-based check for plugin docs in production
158
+ * Plugin docs will only show if BOTH conditions are met:
159
+ * 1. plugins.enabled is true
160
+ * 2. Either in development OR showPluginsDocsInProd is true
161
+ *
162
+ * @deprecated Prefer using plugins.enabled for simpler control
163
+ * By default plugins documentation is not available in prod environments
164
+ */
165
+ showPluginsDocsInProd: false,
166
+ },
167
+
168
+ // =============================================================================
169
+ // TEAM ROLES - NOW IN permissions.config.ts
170
+ // =============================================================================
171
+ // Team roles (additionalRoles, hierarchy, displayNames, descriptions) are now
172
+ // defined in permissions.config.ts under the `roles` section.
173
+ // This is the SINGLE SOURCE OF TRUTH for all permissions and roles.
174
+ //
175
+ // See: contents/themes/default/config/permissions.config.ts
176
+ //
177
+ // To add custom roles, edit permissions.config.ts:
178
+ // ```
179
+ // roles: {
180
+ // additionalRoles: ['editor'],
181
+ // hierarchy: { editor: 5 },
182
+ // displayNames: { editor: 'common.teamRoles.editor' },
183
+ // descriptions: { editor: 'Can view team content...' },
184
+ // },
185
+ // ```
186
+
187
+ // =============================================================================
188
+ // USER ROLES EXTENSION
189
+ // =============================================================================
190
+ // User roles (member, superadmin, developer) are system-level roles.
191
+ // For team roles configuration, see permissions.config.ts
192
+ //
193
+ // Uncomment to extend user roles:
194
+ // userRoles: {
195
+ // additionalRoles: ['moderator'] as const,
196
+ // hierarchy: { moderator: 50 },
197
+ // displayNames: { moderator: 'common.userRoles.moderator' },
198
+ // descriptions: { moderator: 'Can moderate content' },
199
+ // },
200
+
201
+ // =============================================================================
202
+ // MOBILE NAVIGATION OVERRIDES
203
+ // =============================================================================
204
+ // Uncomment and modify to customize mobile navigation items
205
+ // You can add/remove/reorder items, change icons, or disable items
206
+ //
207
+ mobileNav: {
208
+ /**
209
+ * Mobile bottom navigation items
210
+ * Configure which items appear in the mobile navigation bar
211
+ *
212
+ * Icon names use lucide-react icons (https://lucide.dev)
213
+ * Set isCentral: true for the highlighted center button (only one should have this)
214
+ */
215
+ items: [
216
+ {
217
+ id: 'home',
218
+ labelKey: 'common.mobileNav.home',
219
+ href: '/dashboard',
220
+ icon: 'Home',
221
+ enabled: true,
222
+ },
223
+ {
224
+ id: 'tasks',
225
+ labelKey: 'common.mobileNav.tasks',
226
+ href: '/dashboard/tasks',
227
+ icon: 'CheckSquare',
228
+ enabled: true,
229
+ },
230
+ {
231
+ id: 'create',
232
+ labelKey: 'common.mobileNav.create',
233
+ icon: 'Plus',
234
+ isCentral: true,
235
+ action: 'quickCreate',
236
+ enabled: true,
237
+ },
238
+ {
239
+ id: 'settings',
240
+ labelKey: 'common.mobileNav.settings',
241
+ href: '/dashboard/settings',
242
+ icon: 'Settings',
243
+ enabled: true,
244
+ },
245
+ {
246
+ id: 'more',
247
+ labelKey: 'common.mobileNav.more',
248
+ icon: 'Menu',
249
+ action: 'moreSheet',
250
+ enabled: true,
251
+ },
252
+ ],
253
+
254
+ /**
255
+ * More Sheet items
256
+ * Configure which items appear in the "More" sheet
257
+ *
258
+ * These are secondary navigation items that appear when the user taps "More"
259
+ * Typical use: Settings subpages, help, support, profile, etc.
260
+ */
261
+ moreSheetItems: [
262
+ {
263
+ id: 'profile',
264
+ labelKey: 'common.navigation.profile',
265
+ href: '/dashboard/settings/profile',
266
+ icon: 'User',
267
+ enabled: true,
268
+ },
269
+ {
270
+ id: 'billing',
271
+ labelKey: 'common.navigation.billing',
272
+ href: '/dashboard/settings/billing',
273
+ icon: 'CreditCard',
274
+ enabled: true,
275
+ },
276
+ {
277
+ id: 'api-keys',
278
+ labelKey: 'common.navigation.apiKeys',
279
+ href: '/dashboard/settings/api-keys',
280
+ icon: 'Key',
281
+ enabled: true,
282
+ },
283
+ {
284
+ id: 'help',
285
+ labelKey: 'common.navigation.help',
286
+ href: '/support',
287
+ icon: 'HelpCircle',
288
+ enabled: false,
289
+ external: true,
290
+ },
291
+ ],
292
+ },
293
+
294
+ // =============================================================================
295
+ // SCHEDULED ACTIONS CONFIGURATION
296
+ // =============================================================================
297
+ /**
298
+ * Scheduled Actions System
299
+ * Background task processing via external cron
300
+ */
301
+ scheduledActions: {
302
+ /** Enable/disable scheduled actions system */
303
+ enabled: true,
304
+
305
+ /** Retention period for completed/failed actions (days) */
306
+ retentionDays: 7,
307
+
308
+ /** Maximum number of actions to process per cron run */
309
+ batchSize: 10,
310
+
311
+ /** Default timeout per action (milliseconds) */
312
+ defaultTimeout: 30000,
313
+
314
+ /**
315
+ * Multi-endpoint Webhook Configuration
316
+ *
317
+ * Each webhook endpoint is identified by a key and reads its URL from an env variable.
318
+ * Webhooks can auto-match by event pattern or be explicitly called by key.
319
+ */
320
+ webhooks: {
321
+ endpoints: {
322
+ // Default catch-all webhook (disabled by default)
323
+ default: {
324
+ envVar: 'WEBHOOK_URL_DEFAULT',
325
+ description: 'Default webhook for general notifications',
326
+ patterns: ['*:*'],
327
+ enabled: false,
328
+ },
329
+ // Task lifecycle webhook
330
+ tasks: {
331
+ envVar: 'WEBHOOK_URL_TASKS',
332
+ description: 'Task create/update/delete notifications',
333
+ patterns: ['task:created', 'task:updated', 'task:deleted'],
334
+ enabled: true,
335
+ },
336
+ // Subscription lifecycle webhook
337
+ subscriptions: {
338
+ envVar: 'WEBHOOK_URL_SUBSCRIPTIONS',
339
+ description: 'Subscription lifecycle notifications (create, update, cancel, renewal, expiring)',
340
+ patterns: ['subscription:created', 'subscription:updated', 'subscription:renewed', 'subscription:cancelled', 'subscription:expiring_soon'],
341
+ enabled: true,
342
+ },
343
+ },
344
+ defaultEndpoint: 'default',
345
+ },
346
+
347
+ /**
348
+ * Deduplication Settings
349
+ *
350
+ * Prevents duplicate scheduled actions within a time window.
351
+ * Behavior:
352
+ * - windowSeconds > 0: Updates existing action's payload (always keeps latest)
353
+ * - windowSeconds = 0: Disables deduplication (track all changes)
354
+ */
355
+ deduplication: {
356
+ /** Time window in seconds (same entityId within window = duplicate). Set to 0 to disable. */
357
+ windowSeconds: 30,
358
+ },
359
+ },
360
+
361
+ // =============================================================================
362
+ // DEV KEYRING - MOVED TO dev.config.ts
363
+ // =============================================================================
364
+ // DevKeyring configuration has been moved to dev.config.ts
365
+ // This separates development-only settings from production configuration.
366
+ // See: contents/themes/default/config/dev.config.ts
367
+ }
@@ -0,0 +1,349 @@
1
+ /**
2
+ * Billing Configuration - Default Theme
3
+ *
4
+ * Defines plans, features, limits, and action mappings for the default theme.
5
+ * This configuration is used by BILLING_REGISTRY with pre-computed matrices
6
+ * for O(1) runtime lookups.
7
+ *
8
+ * The three-layer model:
9
+ * RESULT = Permission (RBAC) AND Feature (Plan) AND Quota (Limits)
10
+ */
11
+
12
+ import type { BillingConfig } from '@nextsparkjs/core/lib/billing/config-types'
13
+
14
+ export const billingConfig: BillingConfig = {
15
+ provider: 'stripe',
16
+ currency: 'usd',
17
+ defaultPlan: 'free',
18
+
19
+ // ===========================================
20
+ // FEATURE DEFINITIONS
21
+ // ===========================================
22
+ features: {
23
+ // Analytics features
24
+ basic_analytics: {
25
+ name: 'billing.features.basic_analytics',
26
+ description: 'billing.features.basic_analytics_description',
27
+ },
28
+ advanced_analytics: {
29
+ name: 'billing.features.advanced_analytics',
30
+ description: 'billing.features.advanced_analytics_description',
31
+ },
32
+ realtime_analytics: {
33
+ name: 'billing.features.realtime_analytics',
34
+ description: 'billing.features.realtime_analytics_description',
35
+ },
36
+
37
+ // API features
38
+ api_access: {
39
+ name: 'billing.features.api_access',
40
+ description: 'billing.features.api_access_description',
41
+ },
42
+ webhooks: {
43
+ name: 'billing.features.webhooks',
44
+ description: 'billing.features.webhooks_description',
45
+ },
46
+
47
+ // Customization features
48
+ custom_branding: {
49
+ name: 'billing.features.custom_branding',
50
+ description: 'billing.features.custom_branding_description',
51
+ },
52
+ white_label: {
53
+ name: 'billing.features.white_label',
54
+ description: 'billing.features.white_label_description',
55
+ },
56
+
57
+ // Security features
58
+ sso: {
59
+ name: 'billing.features.sso',
60
+ description: 'billing.features.sso_description',
61
+ },
62
+ audit_logs: {
63
+ name: 'billing.features.audit_logs',
64
+ description: 'billing.features.audit_logs_description',
65
+ },
66
+
67
+ // Support features
68
+ priority_support: {
69
+ name: 'billing.features.priority_support',
70
+ description: 'billing.features.priority_support_description',
71
+ },
72
+ dedicated_support: {
73
+ name: 'billing.features.dedicated_support',
74
+ description: 'billing.features.dedicated_support_description',
75
+ },
76
+
77
+ // Collaboration features
78
+ guest_access: {
79
+ name: 'billing.features.guest_access',
80
+ description: 'billing.features.guest_access_description',
81
+ },
82
+
83
+ // Domain-specific features (tasks & customers)
84
+ task_automation: {
85
+ name: 'billing.features.task_automation',
86
+ description: 'billing.features.task_automation_description',
87
+ },
88
+ customer_import: {
89
+ name: 'billing.features.customer_import',
90
+ description: 'billing.features.customer_import_description',
91
+ },
92
+ recurring_tasks: {
93
+ name: 'billing.features.recurring_tasks',
94
+ description: 'billing.features.recurring_tasks_description',
95
+ },
96
+ },
97
+
98
+ // ===========================================
99
+ // LIMIT DEFINITIONS
100
+ // ===========================================
101
+ // Note: Limits correspond to actual entities in the theme (tasks, customers)
102
+ // and system resources (team_members, storage, api_calls)
103
+ limits: {
104
+ team_members: {
105
+ name: 'billing.limits.team_members',
106
+ unit: 'count',
107
+ resetPeriod: 'never',
108
+ },
109
+ tasks: {
110
+ name: 'billing.limits.tasks',
111
+ unit: 'count',
112
+ resetPeriod: 'never',
113
+ },
114
+ customers: {
115
+ name: 'billing.limits.customers',
116
+ unit: 'count',
117
+ resetPeriod: 'never',
118
+ },
119
+ api_calls: {
120
+ name: 'billing.limits.api_calls',
121
+ unit: 'calls',
122
+ resetPeriod: 'monthly',
123
+ },
124
+ storage_gb: {
125
+ name: 'billing.limits.storage',
126
+ unit: 'bytes',
127
+ resetPeriod: 'never',
128
+ },
129
+ file_uploads: {
130
+ name: 'billing.limits.file_uploads',
131
+ unit: 'count',
132
+ resetPeriod: 'monthly',
133
+ },
134
+ webhooks_count: {
135
+ name: 'billing.limits.webhooks_count',
136
+ unit: 'count',
137
+ resetPeriod: 'never',
138
+ },
139
+ },
140
+
141
+ // ===========================================
142
+ // PLAN DEFINITIONS
143
+ // ===========================================
144
+ plans: [
145
+ // Free Plan - Basic access for small teams
146
+ {
147
+ slug: 'free',
148
+ name: 'billing.plans.free.name',
149
+ description: 'billing.plans.free.description',
150
+ type: 'free',
151
+ visibility: 'public',
152
+ price: { monthly: 0, yearly: 0 },
153
+ trialDays: 0,
154
+ features: [
155
+ 'basic_analytics',
156
+ ],
157
+ limits: {
158
+ team_members: 3,
159
+ tasks: 50,
160
+ customers: 25,
161
+ api_calls: 1000,
162
+ storage_gb: 1,
163
+ file_uploads: 100,
164
+ webhooks_count: 0,
165
+ },
166
+ stripePriceIdMonthly: null,
167
+ stripePriceIdYearly: null,
168
+ },
169
+
170
+ // Starter Plan - For growing teams
171
+ {
172
+ slug: 'starter',
173
+ name: 'billing.plans.starter.name',
174
+ description: 'billing.plans.starter.description',
175
+ type: 'paid',
176
+ visibility: 'public',
177
+ price: {
178
+ monthly: 1500, // $15.00
179
+ yearly: 14400, // $144.00 (20% savings)
180
+ },
181
+ trialDays: 7,
182
+ features: [
183
+ 'basic_analytics',
184
+ 'advanced_analytics',
185
+ 'api_access',
186
+ 'guest_access',
187
+ ],
188
+ limits: {
189
+ team_members: 5,
190
+ tasks: 200,
191
+ customers: 100,
192
+ api_calls: 10000,
193
+ storage_gb: 10,
194
+ file_uploads: 500,
195
+ webhooks_count: 3,
196
+ },
197
+ stripePriceIdMonthly: 'price_starter_monthly',
198
+ stripePriceIdYearly: 'price_starter_yearly',
199
+ },
200
+
201
+ // Pro Plan - For professional teams
202
+ {
203
+ slug: 'pro',
204
+ name: 'billing.plans.pro.name',
205
+ description: 'billing.plans.pro.description',
206
+ type: 'paid',
207
+ visibility: 'public',
208
+ price: {
209
+ monthly: 2900, // $29.00
210
+ yearly: 29000, // $290.00 (16% savings)
211
+ },
212
+ trialDays: 14,
213
+ features: [
214
+ 'basic_analytics',
215
+ 'advanced_analytics',
216
+ 'realtime_analytics',
217
+ 'api_access',
218
+ 'webhooks',
219
+ 'custom_branding',
220
+ 'guest_access',
221
+ 'priority_support',
222
+ 'task_automation',
223
+ ],
224
+ limits: {
225
+ team_members: 15,
226
+ tasks: 1000,
227
+ customers: 500,
228
+ api_calls: 100000,
229
+ storage_gb: 50,
230
+ file_uploads: 2000,
231
+ webhooks_count: 10,
232
+ },
233
+ stripePriceIdMonthly: 'price_pro_monthly',
234
+ stripePriceIdYearly: 'price_pro_yearly',
235
+ },
236
+
237
+ // Business Plan - For larger organizations
238
+ {
239
+ slug: 'business',
240
+ name: 'billing.plans.business.name',
241
+ description: 'billing.plans.business.description',
242
+ type: 'paid',
243
+ visibility: 'public',
244
+ price: {
245
+ monthly: 7900, // $79.00
246
+ yearly: 79000, // $790.00 (16% savings)
247
+ },
248
+ trialDays: 14,
249
+ features: [
250
+ 'basic_analytics',
251
+ 'advanced_analytics',
252
+ 'realtime_analytics',
253
+ 'api_access',
254
+ 'webhooks',
255
+ 'custom_branding',
256
+ 'sso',
257
+ 'audit_logs',
258
+ 'guest_access',
259
+ 'priority_support',
260
+ 'task_automation',
261
+ 'customer_import',
262
+ 'recurring_tasks',
263
+ ],
264
+ limits: {
265
+ team_members: 50,
266
+ tasks: 5000,
267
+ customers: 2000,
268
+ api_calls: 500000,
269
+ storage_gb: 200,
270
+ file_uploads: 10000,
271
+ webhooks_count: 50,
272
+ },
273
+ stripePriceIdMonthly: 'price_business_monthly',
274
+ stripePriceIdYearly: 'price_business_yearly',
275
+ },
276
+
277
+ // Enterprise Plan - Custom unlimited plan
278
+ {
279
+ slug: 'enterprise',
280
+ name: 'billing.plans.enterprise.name',
281
+ description: 'billing.plans.enterprise.description',
282
+ type: 'enterprise',
283
+ visibility: 'hidden',
284
+ trialDays: 30,
285
+ features: ['*'], // All features
286
+ limits: {
287
+ team_members: -1, // Unlimited
288
+ tasks: -1,
289
+ customers: -1,
290
+ api_calls: -1,
291
+ storage_gb: -1,
292
+ file_uploads: -1,
293
+ webhooks_count: -1,
294
+ },
295
+ stripePriceIdMonthly: null,
296
+ stripePriceIdYearly: null,
297
+ },
298
+ ],
299
+
300
+ // ===========================================
301
+ // ACTION MAPPINGS
302
+ // ===========================================
303
+ // Maps user actions to RBAC permissions, plan features, and limits.
304
+ // This is the "three-layer model": RESULT = Permission AND Feature AND Quota
305
+ actionMappings: {
306
+ // RBAC permissions (optional - integrates with existing permission system)
307
+ permissions: {
308
+ 'team.members.invite': 'team.members.invite',
309
+ 'team.settings.edit': 'team.settings.edit',
310
+ 'team.billing.manage': 'team.billing.manage',
311
+ },
312
+
313
+ // Feature requirements per action
314
+ features: {
315
+ // Analytics features
316
+ 'analytics.view_advanced': 'advanced_analytics',
317
+ 'analytics.view_realtime': 'realtime_analytics',
318
+ // API features
319
+ 'api.generate_key': 'api_access',
320
+ 'webhooks.create': 'webhooks',
321
+ // Branding features
322
+ 'branding.customize': 'custom_branding',
323
+ 'branding.white_label': 'white_label',
324
+ // Security features
325
+ 'auth.configure_sso': 'sso',
326
+ 'security.view_audit_logs': 'audit_logs',
327
+ // Support features
328
+ 'support.priority_access': 'priority_support',
329
+ 'support.dedicated_channel': 'dedicated_support',
330
+ // Collaboration features
331
+ 'team.invite_guest': 'guest_access',
332
+ // Domain-specific features (tasks & customers)
333
+ 'tasks.automate': 'task_automation',
334
+ 'tasks.create_recurring': 'recurring_tasks',
335
+ 'customers.bulk_import': 'customer_import',
336
+ },
337
+
338
+ // Limit consumption per action (maps to actual entities)
339
+ limits: {
340
+ 'team.members.invite': 'team_members',
341
+ 'tasks.create': 'tasks',
342
+ 'customers.create': 'customers',
343
+ 'api.call': 'api_calls',
344
+ 'files.upload': 'storage_gb',
345
+ 'files.upload_count': 'file_uploads',
346
+ 'webhooks.create': 'webhooks_count',
347
+ },
348
+ },
349
+ }