create-nextjs-cms 0.9.30 → 0.9.32

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 (145) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +71 -71
  3. package/dist/helpers/utils.js +16 -16
  4. package/dist/lib/section-creators.js +166 -166
  5. package/package.json +1 -1
  6. package/templates/default/.eslintrc.json +5 -5
  7. package/templates/default/.prettierignore +7 -7
  8. package/templates/default/.prettierrc.json +27 -27
  9. package/templates/default/CHANGELOG.md +140 -140
  10. package/templates/default/_gitignore +57 -57
  11. package/templates/default/app/(auth)/auth/login/LoginPage.tsx +192 -192
  12. package/templates/default/app/(auth)/auth/login/page.tsx +11 -11
  13. package/templates/default/app/(auth)/auth-language-provider.tsx +34 -34
  14. package/templates/default/app/(auth)/layout.tsx +81 -81
  15. package/templates/default/app/(rootLayout)/(plugins)/[...slug]/error.tsx +64 -0
  16. package/templates/default/app/(rootLayout)/(plugins)/[...slug]/page.tsx +59 -47
  17. package/templates/default/app/(rootLayout)/(plugins)/[...slug]/plugin-server-registry.ts +14 -16
  18. package/templates/default/app/(rootLayout)/admins/page.tsx +10 -10
  19. package/templates/default/app/(rootLayout)/browse/[section]/[page]/page.tsx +22 -22
  20. package/templates/default/app/(rootLayout)/categorized/[section]/page.tsx +15 -15
  21. package/templates/default/app/(rootLayout)/dashboard/page.tsx +68 -70
  22. package/templates/default/app/(rootLayout)/edit/[section]/[itemId]/page.tsx +20 -20
  23. package/templates/default/app/(rootLayout)/layout.tsx +81 -81
  24. package/templates/default/app/(rootLayout)/loading.tsx +10 -10
  25. package/templates/default/app/(rootLayout)/log/page.tsx +5 -7
  26. package/templates/default/app/(rootLayout)/new/[section]/page.tsx +15 -15
  27. package/templates/default/app/(rootLayout)/section/[section]/page.tsx +19 -19
  28. package/templates/default/app/(rootLayout)/settings/page.tsx +11 -13
  29. package/templates/default/app/api/auth/csrf/route.ts +25 -25
  30. package/templates/default/app/api/auth/refresh/route.ts +10 -10
  31. package/templates/default/app/api/auth/route.ts +49 -49
  32. package/templates/default/app/api/auth/session/route.ts +20 -20
  33. package/templates/default/app/api/document/route.ts +165 -165
  34. package/templates/default/app/api/editor/photo/route.ts +49 -49
  35. package/templates/default/app/api/photo/route.ts +27 -27
  36. package/templates/default/app/api/submit/section/item/[slug]/route.ts +95 -95
  37. package/templates/default/app/api/submit/section/item/route.ts +56 -56
  38. package/templates/default/app/api/submit/section/simple/route.ts +86 -86
  39. package/templates/default/app/api/video/route.ts +174 -174
  40. package/templates/default/app/globals.css +236 -236
  41. package/templates/default/cms.config.ts +56 -56
  42. package/templates/default/components/admin/admin-card.tsx +165 -165
  43. package/templates/default/components/admin/admin-edit-page.tsx +124 -124
  44. package/templates/default/components/admin/admin-privilege-card.tsx +184 -184
  45. package/templates/default/components/admin/new-admin-form.tsx +172 -172
  46. package/templates/default/components/container-box.tsx +24 -24
  47. package/templates/default/components/dnd-kit/draggable.tsx +21 -21
  48. package/templates/default/components/dnd-kit/droppable.tsx +20 -20
  49. package/templates/default/components/dnd-kit/sortable-item.tsx +18 -18
  50. package/templates/default/components/feedback/error-component.tsx +16 -16
  51. package/templates/default/components/feedback/info-card.tsx +93 -93
  52. package/templates/default/components/feedback/loading-spinners.tsx +67 -67
  53. package/templates/default/components/feedback/modal.tsx +166 -166
  54. package/templates/default/components/feedback/progress-bar.tsx +48 -48
  55. package/templates/default/components/feedback/tooltip-component.tsx +27 -27
  56. package/templates/default/components/form/form-input-element.tsx +70 -70
  57. package/templates/default/components/form/helpers/_section-hot-reload.js +1 -1
  58. package/templates/default/components/form/helpers/util.ts +17 -17
  59. package/templates/default/components/form/inputs/checkbox-form-input.tsx +46 -46
  60. package/templates/default/components/form/inputs/color-form-input.tsx +44 -44
  61. package/templates/default/components/form/inputs/date-form-input.tsx +93 -93
  62. package/templates/default/components/form/inputs/map-form-input.tsx +141 -141
  63. package/templates/default/components/form/inputs/multiple-select-form-input.tsx +85 -85
  64. package/templates/default/components/form/inputs/number-form-input.tsx +43 -43
  65. package/templates/default/components/form/inputs/password-form-input.tsx +47 -47
  66. package/templates/default/components/form/inputs/photo-form-input.tsx +279 -279
  67. package/templates/default/components/form/inputs/rich-text-form-input.tsx +148 -148
  68. package/templates/default/components/form/inputs/select-form-input.tsx +159 -159
  69. package/templates/default/components/form/inputs/slug-form-input.tsx +131 -131
  70. package/templates/default/components/form/inputs/tags-form-input.tsx +255 -255
  71. package/templates/default/components/form/inputs/text-form-input.tsx +61 -61
  72. package/templates/default/components/form/inputs/textarea-form-input.tsx +61 -61
  73. package/templates/default/components/layout/default-nav-items.tsx +3 -3
  74. package/templates/default/components/layout/layout.tsx +84 -84
  75. package/templates/default/components/layout/navbar.tsx +258 -258
  76. package/templates/default/components/layout/sidebar-dropdown-item.tsx +83 -83
  77. package/templates/default/components/layout/sidebar-item.tsx +24 -24
  78. package/templates/default/components/layout/sidebar.tsx +229 -229
  79. package/templates/default/components/layout/theme-provider.tsx +8 -8
  80. package/templates/default/components/layout/theme-toggle.tsx +39 -39
  81. package/templates/default/components/locale/locale-switcher.tsx +98 -98
  82. package/templates/default/components/media/dropzone.tsx +154 -154
  83. package/templates/default/components/media/protected-document.tsx +44 -44
  84. package/templates/default/components/media/protected-image.tsx +143 -143
  85. package/templates/default/components/media/protected-video.tsx +76 -76
  86. package/templates/default/components/multi-select.tsx +1150 -1150
  87. package/templates/default/components/pages/admins-page.tsx +43 -43
  88. package/templates/default/components/pages/browse-page.tsx +106 -106
  89. package/templates/default/components/pages/categorized-section-page.tsx +31 -31
  90. package/templates/default/components/pages/dashboard-page-alt.tsx +45 -45
  91. package/templates/default/components/pages/item-edit-page.tsx +267 -267
  92. package/templates/default/components/pages/log-page.tsx +107 -107
  93. package/templates/default/components/pages/new-page.tsx +183 -183
  94. package/templates/default/components/pages/section-page.tsx +203 -203
  95. package/templates/default/components/pages/settings-page.tsx +232 -232
  96. package/templates/default/components/pagination/pagination-buttons.tsx +147 -147
  97. package/templates/default/components/pagination/pagination.tsx +36 -36
  98. package/templates/default/components/sections/category-delete-confirm-page.tsx +130 -130
  99. package/templates/default/components/sections/category-section-select-input.tsx +139 -139
  100. package/templates/default/components/sections/conditional-fields.tsx +49 -49
  101. package/templates/default/components/sections/section-icon.tsx +8 -8
  102. package/templates/default/components/sections/section-item-card.tsx +143 -143
  103. package/templates/default/components/sections/section-item-status-badge.tsx +17 -17
  104. package/templates/default/components/sections/select-input-buttons.tsx +125 -125
  105. package/templates/default/components/select-box.tsx +98 -98
  106. package/templates/default/components/ui/accordion.tsx +53 -53
  107. package/templates/default/components/ui/alert-dialog.tsx +113 -113
  108. package/templates/default/components/ui/alert.tsx +47 -47
  109. package/templates/default/components/ui/badge.tsx +38 -38
  110. package/templates/default/components/ui/card.tsx +43 -43
  111. package/templates/default/components/ui/command.tsx +137 -137
  112. package/templates/default/components/ui/custom-alert-dialog.tsx +113 -113
  113. package/templates/default/components/ui/custom-dialog.tsx +123 -123
  114. package/templates/default/components/ui/dialog.tsx +123 -123
  115. package/templates/default/components/ui/direction.tsx +22 -22
  116. package/templates/default/components/ui/dropdown-menu.tsx +182 -182
  117. package/templates/default/components/ui/input-group.tsx +54 -54
  118. package/templates/default/components/ui/input.tsx +22 -22
  119. package/templates/default/components/ui/label.tsx +19 -19
  120. package/templates/default/components/ui/popover.tsx +42 -42
  121. package/templates/default/components/ui/progress.tsx +31 -31
  122. package/templates/default/components/ui/scroll-area.tsx +42 -42
  123. package/templates/default/components/ui/select.tsx +165 -165
  124. package/templates/default/components/ui/separator.tsx +28 -28
  125. package/templates/default/components/ui/sheet.tsx +103 -103
  126. package/templates/default/components/ui/spinner.tsx +16 -16
  127. package/templates/default/components/ui/switch.tsx +29 -29
  128. package/templates/default/components/ui/table.tsx +83 -83
  129. package/templates/default/components/ui/tabs.tsx +55 -55
  130. package/templates/default/components/ui/toast.tsx +113 -113
  131. package/templates/default/components/ui/toaster.tsx +35 -35
  132. package/templates/default/components/ui/tooltip.tsx +30 -30
  133. package/templates/default/components/ui/use-toast.ts +187 -187
  134. package/templates/default/drizzle.config.ts +4 -4
  135. package/templates/default/dynamic-schemas/schema.ts +225 -75
  136. package/templates/default/env/env.ts +46 -46
  137. package/templates/default/envConfig.ts +4 -4
  138. package/templates/default/lib/postinstall.js +14 -14
  139. package/templates/default/lib/utils.ts +6 -6
  140. package/templates/default/next-env.d.ts +6 -6
  141. package/templates/default/next.config.ts +24 -24
  142. package/templates/default/package.json +1 -1
  143. package/templates/default/postcss.config.mjs +6 -6
  144. package/templates/default/proxy.ts +32 -32
  145. package/templates/default/tsconfig.json +48 -48
@@ -45,26 +45,10 @@ export const TestSectionTable = mysqlTable('test_section', {
45
45
 
46
46
 
47
47
  export const TestTagsTable = mysqlTable('test_tags', {
48
- testId: varchar('test_id', { length: 255 }).notNull(),
49
- tagName: varchar('tag_name', { length: 255 }).notNull(),
50
- locale: varchar('locale', { length: 255 })
48
+ testId: int('test_id').notNull(),
49
+ tagName: varchar('tag_name', { length: 255 }).notNull()
51
50
  }, (table) => [
52
- primaryKey({ columns: [table.testId, table.tagName, table.locale] })
53
- ]);
54
-
55
-
56
- export const TestSectionLocalesTable = mysqlTable('test_section_locales', {
57
- id: int('id').autoincrement().notNull().primaryKey(),
58
- parentId: int('parent_id').notNull(),
59
- locale: varchar('locale', { length: 10 }).notNull(),
60
- contentType: mysqlEnum('content_type', ['ad', 'user']).notNull(),
61
- price: int('price'),
62
- appId: varchar('app_id', { length: 36 }).notNull(),
63
- title: varchar('title', { length: 255 }).notNull(),
64
- photo: varchar('photo', { length: 255 }),
65
- category: varchar('category', { length: 255 }).notNull()
66
- }, (table) => [
67
- unique('test_section_locales_parent_id_locale_unique').on(table.parentId, table.locale)
51
+ primaryKey({ columns: [table.testId, table.tagName] })
68
52
  ]);
69
53
 
70
54
 
@@ -110,7 +94,9 @@ export const ServicesTable = mysqlTable('services', {
110
94
  townId: int('town_id')
111
95
  }, (table) => [
112
96
  index('title_index').on(table.title),
113
- unique('title_unique').on(table.title)
97
+ unique('title_unique').on(table.title),
98
+ index('title_fulltext').on(table.title),
99
+ index('desc_fulltext').on(table.desc)
114
100
  ]);
115
101
 
116
102
 
@@ -153,10 +139,66 @@ export const RealestateTable = mysqlTable('realestate', {
153
139
  townId: int('town_id')
154
140
  }, (table) => [
155
141
  index('title_index').on(table.title),
156
- unique('title_unique').on(table.title)
142
+ unique('title_unique').on(table.title),
143
+ index('title_fulltext').on(table.title),
144
+ index('desc_fulltext').on(table.desc)
157
145
  ]);
158
146
 
159
147
 
148
+ export const RoomCountsTable = mysqlTable('room_counts', {
149
+ id: varchar('id', { length: 255 }).notNull().primaryKey(),
150
+ label: varchar('label', { length: 255 }).notNull()
151
+ });
152
+
153
+
154
+ export const BuildingAgesTable = mysqlTable('building_ages', {
155
+ id: varchar('id', { length: 255 }).notNull().primaryKey(),
156
+ label: varchar('label', { length: 255 }).notNull()
157
+ });
158
+
159
+
160
+ export const FloorCountsTable = mysqlTable('floor_counts', {
161
+ id: varchar('id', { length: 255 }).notNull().primaryKey(),
162
+ label: varchar('label', { length: 255 }).notNull()
163
+ });
164
+
165
+
166
+ export const BathroomCountsTable = mysqlTable('bathroom_counts', {
167
+ id: varchar('id', { length: 255 }).notNull().primaryKey(),
168
+ label: varchar('label', { length: 255 }).notNull()
169
+ });
170
+
171
+
172
+ export const FloorLocationsTable = mysqlTable('floor_locations', {
173
+ id: varchar('id', { length: 255 }).notNull().primaryKey(),
174
+ label: varchar('label', { length: 255 }).notNull()
175
+ });
176
+
177
+
178
+ export const HeatingTypesTable = mysqlTable('heating_types', {
179
+ id: varchar('id', { length: 255 }).notNull().primaryKey(),
180
+ label: varchar('label', { length: 255 }).notNull()
181
+ });
182
+
183
+
184
+ export const KitchenTypesTable = mysqlTable('kitchen_types', {
185
+ id: varchar('id', { length: 255 }).notNull().primaryKey(),
186
+ label: varchar('label', { length: 255 }).notNull()
187
+ });
188
+
189
+
190
+ export const ParkingTypesTable = mysqlTable('parking_types', {
191
+ id: varchar('id', { length: 255 }).notNull().primaryKey(),
192
+ label: varchar('label', { length: 255 }).notNull()
193
+ });
194
+
195
+
196
+ export const FromWhomTypesTable = mysqlTable('from_whom_types', {
197
+ id: varchar('id', { length: 255 }).notNull().primaryKey(),
198
+ label: varchar('label', { length: 255 }).notNull()
199
+ });
200
+
201
+
160
202
  export const HomepageSliderTable = mysqlTable('homepage_slider', {
161
203
  id: int('id').autoincrement().notNull().primaryKey(),
162
204
  titleEn: varchar('title_en', { length: 255 }).notNull(),
@@ -177,7 +219,7 @@ export const HomepageSliderTable = mysqlTable('homepage_slider', {
177
219
  export const ContestSubscribersTable = mysqlTable('contest_subscribers', {
178
220
  id: int('id').autoincrement().notNull().primaryKey(),
179
221
  userId: int('user_id').notNull(),
180
- contestId: varchar('contest_id', { length: 255 }).notNull()
222
+ contestId: int('contest_id').notNull()
181
223
  }, (table) => [
182
224
  unique('contest_subscriber_unique').on(table.contestId, table.userId)
183
225
  ]);
@@ -242,10 +284,30 @@ export const JobsTable = mysqlTable('jobs', {
242
284
  townId: int('town_id')
243
285
  }, (table) => [
244
286
  index('title_index').on(table.title),
245
- unique('title_unique').on(table.title)
287
+ unique('title_unique').on(table.title),
288
+ index('title_fulltext').on(table.title),
289
+ index('desc_fulltext').on(table.desc)
246
290
  ]);
247
291
 
248
292
 
293
+ export const JobWorkMethodTable = mysqlTable('job_work_method', {
294
+ id: varchar('id', { length: 255 }).notNull().primaryKey(),
295
+ label: varchar('label', { length: 255 }).notNull()
296
+ });
297
+
298
+
299
+ export const JobEducationLevelTable = mysqlTable('job_education_level', {
300
+ id: varchar('id', { length: 255 }).notNull().primaryKey(),
301
+ label: varchar('label', { length: 255 }).notNull()
302
+ });
303
+
304
+
305
+ export const JobExperienceLevelTable = mysqlTable('job_experience_level', {
306
+ id: varchar('id', { length: 255 }).notNull().primaryKey(),
307
+ label: varchar('label', { length: 255 }).notNull()
308
+ });
309
+
310
+
249
311
  export const FurnitureTable = mysqlTable('furniture', {
250
312
  id: int('id').autoincrement().notNull().primaryKey(),
251
313
  title: varchar('title', { length: 255 }).notNull(),
@@ -268,10 +330,24 @@ export const FurnitureTable = mysqlTable('furniture', {
268
330
  townId: int('town_id')
269
331
  }, (table) => [
270
332
  index('title_index').on(table.title),
271
- unique('title_unique').on(table.title)
333
+ unique('title_unique').on(table.title),
334
+ index('title_fulltext').on(table.title),
335
+ index('desc_fulltext').on(table.desc)
272
336
  ]);
273
337
 
274
338
 
339
+ export const ConditionTypesTable = mysqlTable('condition_types', {
340
+ id: varchar('id', { length: 255 }).notNull().primaryKey(),
341
+ label: varchar('label', { length: 255 }).notNull()
342
+ });
343
+
344
+
345
+ export const ClothesFromWhomTypesTable = mysqlTable('clothes_from_whom_types', {
346
+ id: varchar('id', { length: 255 }).notNull().primaryKey(),
347
+ label: varchar('label', { length: 255 }).notNull()
348
+ });
349
+
350
+
275
351
  export const FiltersTable = mysqlTable('filters', {
276
352
  id: int('id').autoincrement().notNull().primaryKey(),
277
353
  title: varchar('title', { length: 255 }).notNull(),
@@ -282,7 +358,8 @@ export const FiltersTable = mysqlTable('filters', {
282
358
  isMandatory: boolean('is_mandatory')
283
359
  }, (table) => [
284
360
  unique('title_unique').on(table.title),
285
- unique('key_unique').on(table.Key)
361
+ unique('key_unique').on(table.Key),
362
+ index('title_fulltext').on(table.title)
286
363
  ]);
287
364
 
288
365
 
@@ -297,7 +374,11 @@ export const FaqTable = mysqlTable('faq', {
297
374
  }, (table) => [
298
375
  unique('faq_q_en_unique').on(table.qEn),
299
376
  unique('title_ar_unique').on(table.qAr),
300
- unique('title_tr_unique').on(table.qTr)
377
+ unique('title_tr_unique').on(table.qTr),
378
+ index('titles_fulltext').on(table.qAr, table.qTr),
379
+ index('faq_a_en_fulltext').on(table.aEn),
380
+ index('faq_a_ar_fulltext').on(table.aAr),
381
+ index('faq_a_tr_fulltext').on(table.aTr)
301
382
  ]);
302
383
 
303
384
 
@@ -310,7 +391,9 @@ export const ErrorsTable = mysqlTable('errors', {
310
391
  desc: longtext('desc'),
311
392
  isResolved: boolean('is_resolved')
312
393
  }, (table) => [
313
- unique('key_unique').on(table.caseId)
394
+ unique('key_unique').on(table.caseId),
395
+ index('title_fulltext').on(table.title),
396
+ index('case_id_fulltext').on(table.caseId)
314
397
  ]);
315
398
 
316
399
 
@@ -337,10 +420,18 @@ export const ElectronicsTable = mysqlTable('electronics', {
337
420
  townId: int('town_id')
338
421
  }, (table) => [
339
422
  index('title_index').on(table.title),
340
- unique('title_unique').on(table.title)
423
+ unique('title_unique').on(table.title),
424
+ index('title_fulltext').on(table.title),
425
+ index('desc_fulltext').on(table.desc)
341
426
  ]);
342
427
 
343
428
 
429
+ export const ElectronicsFromWhomTypesTable = mysqlTable('electronics_from_whom_types', {
430
+ id: varchar('id', { length: 255 }).notNull().primaryKey(),
431
+ label: varchar('label', { length: 255 }).notNull()
432
+ });
433
+
434
+
344
435
  export const ClothesTable = mysqlTable('clothes', {
345
436
  id: int('id').autoincrement().notNull().primaryKey(),
346
437
  title: varchar('title', { length: 255 }).notNull(),
@@ -363,7 +454,9 @@ export const ClothesTable = mysqlTable('clothes', {
363
454
  townId: int('town_id')
364
455
  }, (table) => [
365
456
  index('title_index').on(table.title),
366
- unique('title_unique').on(table.title)
457
+ unique('title_unique').on(table.title),
458
+ index('title_fulltext').on(table.title),
459
+ index('desc_fulltext').on(table.desc)
367
460
  ]);
368
461
 
369
462
 
@@ -421,10 +514,54 @@ export const CarsTable = mysqlTable('cars', {
421
514
  viewCount: int('view_count'),
422
515
  status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired'])
423
516
  }, (table) => [
424
- index('title_index').on(table.title)
517
+ index('title_index').on(table.title),
518
+ index('title_fulltext').on(table.title),
519
+ index('desc_fulltext').on(table.desc)
425
520
  ]);
426
521
 
427
522
 
523
+ export const CarFromWhomTypesTable = mysqlTable('car_from_whom_types', {
524
+ Key: varchar('_key', { length: 255 }).notNull().primaryKey(),
525
+ label: varchar('label', { length: 255 }).notNull()
526
+ });
527
+
528
+
529
+ export const CarEngineCapacityTypesTable = mysqlTable('car_engine_capacity_types', {
530
+ Key: varchar('_key', { length: 255 }).notNull().primaryKey(),
531
+ label: varchar('label', { length: 255 }).notNull()
532
+ });
533
+
534
+
535
+ export const CarEnginePowerTypesTable = mysqlTable('car_engine_power_types', {
536
+ Key: varchar('_key', { length: 255 }).notNull().primaryKey(),
537
+ label: varchar('label', { length: 255 }).notNull()
538
+ });
539
+
540
+
541
+ export const CarTractionTypesTable = mysqlTable('car_traction_types', {
542
+ Key: varchar('_key', { length: 255 }).notNull().primaryKey(),
543
+ label: varchar('label', { length: 255 }).notNull()
544
+ });
545
+
546
+
547
+ export const CarBodyTypesTable = mysqlTable('car_body_types', {
548
+ Key: varchar('_key', { length: 255 }).notNull().primaryKey(),
549
+ label: varchar('label', { length: 255 }).notNull()
550
+ });
551
+
552
+
553
+ export const CarGearTypesTable = mysqlTable('car_gear_types', {
554
+ Key: varchar('_key', { length: 255 }).notNull().primaryKey(),
555
+ label: varchar('label', { length: 255 }).notNull()
556
+ });
557
+
558
+
559
+ export const CarFuelTypesTable = mysqlTable('car_fuel_types', {
560
+ Key: varchar('_key', { length: 255 }).notNull().primaryKey(),
561
+ label: varchar('label', { length: 255 }).notNull()
562
+ });
563
+
564
+
428
565
  export const CarsDbTable = mysqlTable('cars_db', {
429
566
  id: int('id').autoincrement().notNull().primaryKey(),
430
567
  name: varchar('name', { length: 255 }).notNull(),
@@ -457,10 +594,18 @@ export const BooksTable = mysqlTable('books', {
457
594
  townId: int('town_id')
458
595
  }, (table) => [
459
596
  index('title_index').on(table.title),
460
- unique('title_unique').on(table.title)
597
+ unique('title_unique').on(table.title),
598
+ index('title_fulltext').on(table.title),
599
+ index('desc_fulltext').on(table.desc)
461
600
  ]);
462
601
 
463
602
 
603
+ export const BookFromWhomTypesTable = mysqlTable('book_from_whom_types', {
604
+ id: varchar('id', { length: 255 }).notNull().primaryKey(),
605
+ label: varchar('label', { length: 255 }).notNull()
606
+ });
607
+
608
+
464
609
  export const AddressTable = mysqlTable('address', {
465
610
  id: int('id').autoincrement().notNull().primaryKey(),
466
611
  catOrder: int('cat_order').notNull(),
@@ -474,6 +619,32 @@ export const AddressTable = mysqlTable('address', {
474
619
  });
475
620
 
476
621
 
622
+ export const E2eRequiredFieldsTable = mysqlTable('e2e_required_fields', {
623
+ id: int('id').autoincrement().notNull().primaryKey(),
624
+ title: varchar('title', { length: 255 }).notNull(),
625
+ slug: varchar('slug', { length: 255 }).notNull(),
626
+ subtitle: longtext('subtitle').notNull(),
627
+ secret: varchar('secret', { length: 255 }).notNull(),
628
+ quantity: int('quantity').notNull(),
629
+ price: float('price').notNull(),
630
+ rating: double('rating').notNull(),
631
+ isPublished: boolean('is_published').notNull(),
632
+ status: mysqlEnum('status', ['draft', 'published', 'archived']).notNull(),
633
+ categories: varchar('categories', { length: 255 }).notNull(),
634
+ tags: varchar('tags', { length: 255 }).notNull(),
635
+ coverPhoto: varchar('cover_photo', { length: 255 }).notNull(),
636
+ videoClip: varchar('video_clip', { length: 255 }).notNull(),
637
+ attachment: varchar('attachment', { length: 255 }).notNull(),
638
+ bodyContent: longtext('body_content').notNull(),
639
+ publishDate: date('publish_date').notNull(),
640
+ startsAt: datetime('starts_at').notNull(),
641
+ availableFrom: date('available_from'),
642
+ availableUntil: date('available_until'),
643
+ brandColor: varchar('brand_color', { length: 7 }).notNull(),
644
+ mapLocation: varchar('map_location', { length: 255 })
645
+ });
646
+
647
+
477
648
  export const E2eOptionalFieldsTable = mysqlTable('e2e_optional_fields', {
478
649
  id: int('id').autoincrement().notNull().primaryKey(),
479
650
  title: varchar('title', { length: 255 }),
@@ -502,50 +673,29 @@ export const E2eOptionalFieldsTable = mysqlTable('e2e_optional_fields', {
502
673
 
503
674
  export const E2eAllFieldsTable = mysqlTable('e2e_all_fields', {
504
675
  id: int('id').autoincrement().notNull().primaryKey(),
505
- optTitle: varchar('opt_title', { length: 255 }),
506
- optSlug: varchar('opt_slug', { length: 255 }),
507
- optSubtitle: longtext('opt_subtitle'),
508
- optSecret: varchar('opt_secret', { length: 255 }),
509
- optQuantity: int('opt_quantity'),
510
- optPrice: float('opt_price'),
511
- optRating: double('opt_rating'),
512
- optViewCount: int('opt_view_count'),
513
- optIsPublished: boolean('opt_is_published'),
514
- optStatus: mysqlEnum('opt_status', ['draft', 'published', 'archived', 'scheduled']),
515
- optCategories: varchar('opt_categories', { length: 255 }),
516
- optTags: varchar('opt_tags', { length: 255 }),
517
- optCoverPhoto: varchar('opt_cover_photo', { length: 255 }),
518
- optVideoClip: varchar('opt_video_clip', { length: 255 }),
519
- optAttachment: varchar('opt_attachment', { length: 255 }),
520
- optBodyContent: longtext('opt_body_content'),
521
- optPublishDate: date('opt_publish_date'),
522
- optStartsAt: datetime('opt_starts_at'),
523
- optAvailableFrom: date('opt_available_from'),
524
- optAvailableUntil: date('opt_available_until'),
525
- optBrandColor: varchar('opt_brand_color', { length: 7 }),
526
- optMapLocation: varchar('opt_map_location', { length: 255 }),
527
- reqTitle: varchar('req_title', { length: 255 }).notNull(),
528
- reqSlug: varchar('req_slug', { length: 255 }),
529
- reqSubtitle: longtext('req_subtitle').notNull(),
530
- reqSecret: varchar('req_secret', { length: 255 }).notNull(),
531
- reqQuantity: int('req_quantity').notNull(),
532
- reqPrice: float('req_price').notNull(),
533
- reqRating: double('req_rating').notNull(),
534
- reqIsPublished: boolean('req_is_published').notNull(),
535
- reqStatus: mysqlEnum('req_status', ['draft', 'published', 'archived', 'scheduled']).notNull(),
536
- reqCategories: varchar('req_categories', { length: 255 }).notNull(),
537
- reqTags: varchar('req_tags', { length: 255 }).notNull(),
538
- reqCoverPhoto: varchar('req_cover_photo', { length: 255 }).notNull(),
539
- reqVideoClip: varchar('req_video_clip', { length: 255 }).notNull(),
540
- reqAttachment: varchar('req_attachment', { length: 255 }).notNull(),
541
- reqBodyContent: longtext('req_body_content').notNull(),
542
- reqPublishDate: date('req_publish_date').notNull(),
543
- reqStartsAt: datetime('req_starts_at').notNull(),
544
- reqAvailableFrom: date('req_available_from'),
545
- reqAvailableUntil: date('req_available_until'),
546
- reqBrandColor: varchar('req_brand_color', { length: 7 }).notNull(),
547
- reqMapLocation: varchar('req_map_location', { length: 255 }).notNull()
676
+ title: varchar('title', { length: 255 }).notNull(),
677
+ slug: varchar('slug', { length: 255 }),
678
+ subtitle: longtext('subtitle'),
679
+ secret: varchar('secret', { length: 255 }),
680
+ quantity: int('quantity'),
681
+ price: float('price'),
682
+ rating: double('rating'),
683
+ viewCount: int('view_count'),
684
+ isPublished: boolean('is_published'),
685
+ status: mysqlEnum('status', ['draft', 'published', 'archived', 'scheduled']).notNull(),
686
+ categories: varchar('categories', { length: 255 }),
687
+ tags: varchar('tags', { length: 255 }),
688
+ coverPhoto: varchar('cover_photo', { length: 255 }),
689
+ videoClip: varchar('video_clip', { length: 255 }),
690
+ attachment: varchar('attachment', { length: 255 }),
691
+ bodyContent: longtext('body_content'),
692
+ publishDate: date('publish_date'),
693
+ startsAt: datetime('starts_at'),
694
+ availableFrom: date('available_from'),
695
+ availableUntil: date('available_until'),
696
+ brandColor: varchar('brand_color', { length: 7 }),
697
+ mapLocation: varchar('map_location', { length: 255 })
548
698
  }, (table) => [
549
- index('e2e_title_index').on(table.optTitle)
699
+ index('e2e_title_index').on(table.title)
550
700
  ]);
551
701
 
@@ -1,46 +1,46 @@
1
- import { createEnv } from '@t3-oss/env-nextjs'
2
- import * as z from 'zod'
3
-
4
- export const env = createEnv({
5
- /**
6
- * Specify your server-side environment variables schema here. This way you can ensure the app
7
- * isn't built with invalid env vars.
8
- */
9
- server: {
10
- ACCESS_TOKEN_SECRET: z.string(),
11
- REFRESH_TOKEN_SECRET: z.string(),
12
- CSRF_TOKEN_SECRET: z.string(),
13
- ACCESS_TOKEN_EXPIRATION: z.string(),
14
- REFRESH_TOKEN_EXPIRATION: z.string(),
15
- },
16
-
17
- /**
18
- * Specify your client-side environment variables schema here. This way you can ensure the app
19
- * isn't built with invalid env vars. To expose them to the client, prefix them with
20
- * `NEXT_PUBLIC_`.
21
- */
22
- client: {
23
- NEXT_PUBLIC_RICHTEXT_INLINE_PUBLIC_URL: z.string().optional(),
24
- NEXT_PUBLIC_GOOGLE_MAPS_API_KEY: z.string().optional(),
25
- },
26
-
27
- shared: {
28
- NODE_ENV: z.enum(['development', 'test', 'production']).default('development'),
29
- },
30
-
31
- experimental__runtimeEnv: {
32
- NEXT_PUBLIC_RICHTEXT_INLINE_PUBLIC_URL: process.env.NEXT_PUBLIC_RICHTEXT_INLINE_PUBLIC_URL,
33
- NEXT_PUBLIC_GOOGLE_MAPS_API_KEY: process.env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY,
34
- NODE_ENV: process.env.NODE_ENV,
35
- },
36
- /**
37
- * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially
38
- * useful for Docker builds.
39
- */
40
- skipValidation: !!process.env.SKIP_ENV_VALIDATION,
41
- /**
42
- * Makes it so that empty strings are treated as undefined. `SOME_VAR: z.string()` and
43
- * `SOME_VAR=''` will throw an error.
44
- */
45
- emptyStringAsUndefined: true,
46
- })
1
+ import { createEnv } from '@t3-oss/env-nextjs'
2
+ import * as z from 'zod'
3
+
4
+ export const env = createEnv({
5
+ /**
6
+ * Specify your server-side environment variables schema here. This way you can ensure the app
7
+ * isn't built with invalid env vars.
8
+ */
9
+ server: {
10
+ ACCESS_TOKEN_SECRET: z.string(),
11
+ REFRESH_TOKEN_SECRET: z.string(),
12
+ CSRF_TOKEN_SECRET: z.string(),
13
+ ACCESS_TOKEN_EXPIRATION: z.string(),
14
+ REFRESH_TOKEN_EXPIRATION: z.string(),
15
+ },
16
+
17
+ /**
18
+ * Specify your client-side environment variables schema here. This way you can ensure the app
19
+ * isn't built with invalid env vars. To expose them to the client, prefix them with
20
+ * `NEXT_PUBLIC_`.
21
+ */
22
+ client: {
23
+ NEXT_PUBLIC_RICHTEXT_INLINE_PUBLIC_URL: z.string().optional(),
24
+ NEXT_PUBLIC_GOOGLE_MAPS_API_KEY: z.string().optional(),
25
+ },
26
+
27
+ shared: {
28
+ NODE_ENV: z.enum(['development', 'test', 'production']).default('development'),
29
+ },
30
+
31
+ experimental__runtimeEnv: {
32
+ NEXT_PUBLIC_RICHTEXT_INLINE_PUBLIC_URL: process.env.NEXT_PUBLIC_RICHTEXT_INLINE_PUBLIC_URL,
33
+ NEXT_PUBLIC_GOOGLE_MAPS_API_KEY: process.env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY,
34
+ NODE_ENV: process.env.NODE_ENV,
35
+ },
36
+ /**
37
+ * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially
38
+ * useful for Docker builds.
39
+ */
40
+ skipValidation: !!process.env.SKIP_ENV_VALIDATION,
41
+ /**
42
+ * Makes it so that empty strings are treated as undefined. `SOME_VAR: z.string()` and
43
+ * `SOME_VAR=''` will throw an error.
44
+ */
45
+ emptyStringAsUndefined: true,
46
+ })
@@ -1,4 +1,4 @@
1
- import { loadEnvConfig } from '@next/env'
2
-
3
- const projectDir = process.cwd()
4
- loadEnvConfig(projectDir)
1
+ import { loadEnvConfig } from '@next/env'
2
+
3
+ const projectDir = process.cwd()
4
+ loadEnvConfig(projectDir)
@@ -1,14 +1,14 @@
1
- const fse = require('fs-extra')
2
- const path = require('path')
3
-
4
- // Resolve the TinyMCE package path
5
- const tinymcePath = path.dirname(require.resolve('tinymce/package.json'))
6
-
7
- // Define the target directory
8
- const targetDir = path.join(__dirname, '../public', 'tinymce')
9
-
10
- // Empty and copy the directory
11
- fse.emptyDirSync(targetDir)
12
- fse.copySync(tinymcePath, targetDir, { overwrite: true })
13
-
14
- // console.log('Successfully copied TinyMCE to public directory')
1
+ const fse = require('fs-extra')
2
+ const path = require('path')
3
+
4
+ // Resolve the TinyMCE package path
5
+ const tinymcePath = path.dirname(require.resolve('tinymce/package.json'))
6
+
7
+ // Define the target directory
8
+ const targetDir = path.join(__dirname, '../public', 'tinymce')
9
+
10
+ // Empty and copy the directory
11
+ fse.emptyDirSync(targetDir)
12
+ fse.copySync(tinymcePath, targetDir, { overwrite: true })
13
+
14
+ // console.log('Successfully copied TinyMCE to public directory')
@@ -1,6 +1,6 @@
1
- import { clsx, type ClassValue } from 'clsx'
2
- import { twMerge } from 'tailwind-merge'
3
-
4
- export function cn(...inputs: ClassValue[]) {
5
- return twMerge(clsx(inputs))
6
- }
1
+ import { clsx, type ClassValue } from 'clsx'
2
+ import { twMerge } from 'tailwind-merge'
3
+
4
+ export function cn(...inputs: ClassValue[]) {
5
+ return twMerge(clsx(inputs))
6
+ }
@@ -1,6 +1,6 @@
1
- /// <reference types="next" />
2
- /// <reference types="next/image-types/global" />
3
- import "./.next/types/routes.d.ts";
4
-
5
- // NOTE: This file should not be edited
6
- // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
1
+ /// <reference types="next" />
2
+ /// <reference types="next/image-types/global" />
3
+ import "./.next/types/routes.d.ts";
4
+
5
+ // NOTE: This file should not be edited
6
+ // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
@@ -1,26 +1,26 @@
1
- import type { NextConfig } from 'next'
2
- import '@/env/env'
3
-
1
+ import type { NextConfig } from 'next'
2
+ import '@/env/env'
3
+
4
4
  const nextConfig: NextConfig = {
5
5
  serverExternalPackages: [
6
6
  'jiti',
7
- ],
8
-
9
- reactStrictMode: true,
10
- async rewrites() {
11
- return [
12
- {
13
- source: '/browse/:section',
14
- destination: '/browse/:section/1',
15
- },
16
- {
17
- source: '/',
18
- destination: '/dashboard',
19
- },
20
- ]
21
- },
22
- images: {
23
- formats: ['image/avif', 'image/webp'],
7
+ ],
8
+
9
+ reactStrictMode: true,
10
+ async rewrites() {
11
+ return [
12
+ {
13
+ source: '/browse/:section',
14
+ destination: '/browse/:section/1',
15
+ },
16
+ {
17
+ source: '/',
18
+ destination: '/dashboard',
19
+ },
20
+ ]
21
+ },
22
+ images: {
23
+ formats: ['image/avif', 'image/webp'],
24
24
  remotePatterns: [
25
25
  // Use remotePatterns in your next.config.js file to allow images from specific external paths and block all others.
26
26
  // https://nextjs.org/docs/app/api-reference/components/image#remotepatterns
@@ -31,7 +31,7 @@ const nextConfig: NextConfig = {
31
31
  // pathname: '/**',
32
32
  // },
33
33
  ],
34
- },
35
- }
36
-
37
- export default nextConfig
34
+ },
35
+ }
36
+
37
+ export default nextConfig
@@ -70,7 +70,7 @@
70
70
  "nanoid": "^5.1.2",
71
71
  "next": "16.2.5",
72
72
  "next-themes": "^0.4.6",
73
- "nextjs-cms": "0.9.30",
73
+ "nextjs-cms": "0.9.32",
74
74
  "plaiceholder": "^3.0.0",
75
75
  "prettier-plugin-tailwindcss": "^0.7.2",
76
76
  "qrcode": "^1.5.4",
@@ -1,7 +1,7 @@
1
- const config = {
2
- plugins: {
3
- "@tailwindcss/postcss": {},
4
- },
5
- };
6
-
1
+ const config = {
2
+ plugins: {
3
+ "@tailwindcss/postcss": {},
4
+ },
5
+ };
6
+
7
7
  export default config;