create-nextjs-cms 0.9.28 → 0.9.30
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.
- package/LICENSE +21 -21
- package/README.md +71 -71
- package/dist/helpers/utils.js +16 -16
- package/dist/lib/section-creators.js +166 -166
- package/package.json +2 -2
- package/templates/default/.eslintrc.json +5 -5
- package/templates/default/.prettierignore +7 -7
- package/templates/default/.prettierrc.json +27 -27
- package/templates/default/CHANGELOG.md +140 -140
- package/templates/default/_gitignore +57 -57
- package/templates/default/app/(auth)/auth/login/LoginPage.tsx +192 -192
- package/templates/default/app/(auth)/auth/login/page.tsx +11 -11
- package/templates/default/app/(auth)/auth-language-provider.tsx +34 -34
- package/templates/default/app/(auth)/layout.tsx +81 -81
- package/templates/default/app/(rootLayout)/admins/page.tsx +10 -10
- package/templates/default/app/(rootLayout)/browse/[section]/[page]/page.tsx +22 -22
- package/templates/default/app/(rootLayout)/categorized/[section]/page.tsx +15 -15
- package/templates/default/app/(rootLayout)/dashboard/page.tsx +70 -70
- package/templates/default/app/(rootLayout)/edit/[section]/[itemId]/page.tsx +20 -20
- package/templates/default/app/(rootLayout)/layout.tsx +81 -81
- package/templates/default/app/(rootLayout)/loading.tsx +10 -10
- package/templates/default/app/(rootLayout)/log/page.tsx +7 -7
- package/templates/default/app/(rootLayout)/new/[section]/page.tsx +15 -15
- package/templates/default/app/(rootLayout)/section/[section]/page.tsx +19 -19
- package/templates/default/app/(rootLayout)/settings/page.tsx +13 -13
- package/templates/default/app/api/auth/csrf/route.ts +25 -25
- package/templates/default/app/api/auth/refresh/route.ts +10 -10
- package/templates/default/app/api/auth/route.ts +49 -49
- package/templates/default/app/api/auth/session/route.ts +20 -20
- package/templates/default/app/api/document/route.ts +165 -165
- package/templates/default/app/api/editor/photo/route.ts +49 -49
- package/templates/default/app/api/photo/route.ts +27 -27
- package/templates/default/app/api/submit/section/item/[slug]/route.ts +95 -95
- package/templates/default/app/api/submit/section/item/route.ts +56 -56
- package/templates/default/app/api/submit/section/simple/route.ts +86 -86
- package/templates/default/app/api/video/route.ts +174 -174
- package/templates/default/app/globals.css +236 -236
- package/templates/default/cms.config.ts +56 -56
- package/templates/default/components/admin/admin-card.tsx +165 -165
- package/templates/default/components/admin/admin-edit-page.tsx +124 -124
- package/templates/default/components/admin/admin-privilege-card.tsx +184 -184
- package/templates/default/components/admin/new-admin-form.tsx +172 -172
- package/templates/default/components/container-box.tsx +24 -24
- package/templates/default/components/dnd-kit/draggable.tsx +21 -21
- package/templates/default/components/dnd-kit/droppable.tsx +20 -20
- package/templates/default/components/dnd-kit/sortable-item.tsx +18 -18
- package/templates/default/components/feedback/error-component.tsx +16 -16
- package/templates/default/components/feedback/info-card.tsx +93 -93
- package/templates/default/components/feedback/loading-spinners.tsx +67 -67
- package/templates/default/components/feedback/modal.tsx +166 -166
- package/templates/default/components/feedback/progress-bar.tsx +48 -48
- package/templates/default/components/feedback/tooltip-component.tsx +27 -27
- package/templates/default/components/form/form-input-element.tsx +70 -70
- package/templates/default/components/form/helpers/_section-hot-reload.js +1 -1
- package/templates/default/components/form/helpers/util.ts +17 -17
- package/templates/default/components/form/inputs/checkbox-form-input.tsx +46 -46
- package/templates/default/components/form/inputs/color-form-input.tsx +44 -44
- package/templates/default/components/form/inputs/date-form-input.tsx +93 -93
- package/templates/default/components/form/inputs/map-form-input.tsx +141 -141
- package/templates/default/components/form/inputs/multiple-select-form-input.tsx +85 -85
- package/templates/default/components/form/inputs/number-form-input.tsx +43 -43
- package/templates/default/components/form/inputs/password-form-input.tsx +47 -47
- package/templates/default/components/form/inputs/photo-form-input.tsx +279 -279
- package/templates/default/components/form/inputs/rich-text-form-input.tsx +148 -148
- package/templates/default/components/form/inputs/select-form-input.tsx +159 -159
- package/templates/default/components/form/inputs/slug-form-input.tsx +131 -131
- package/templates/default/components/form/inputs/tags-form-input.tsx +255 -255
- package/templates/default/components/form/inputs/text-form-input.tsx +61 -61
- package/templates/default/components/form/inputs/textarea-form-input.tsx +61 -61
- package/templates/default/components/layout/default-nav-items.tsx +3 -3
- package/templates/default/components/layout/layout.tsx +84 -84
- package/templates/default/components/layout/navbar.tsx +258 -258
- package/templates/default/components/layout/sidebar-dropdown-item.tsx +83 -83
- package/templates/default/components/layout/sidebar-item.tsx +24 -24
- package/templates/default/components/layout/sidebar.tsx +229 -229
- package/templates/default/components/layout/theme-provider.tsx +8 -8
- package/templates/default/components/layout/theme-toggle.tsx +39 -39
- package/templates/default/components/locale/locale-switcher.tsx +98 -98
- package/templates/default/components/media/dropzone.tsx +154 -154
- package/templates/default/components/media/protected-document.tsx +44 -44
- package/templates/default/components/media/protected-image.tsx +143 -143
- package/templates/default/components/media/protected-video.tsx +76 -76
- package/templates/default/components/multi-select.tsx +1150 -1150
- package/templates/default/components/pages/admins-page.tsx +43 -43
- package/templates/default/components/pages/browse-page.tsx +106 -106
- package/templates/default/components/pages/categorized-section-page.tsx +31 -31
- package/templates/default/components/pages/dashboard-page-alt.tsx +45 -45
- package/templates/default/components/pages/item-edit-page.tsx +267 -267
- package/templates/default/components/pages/log-page.tsx +107 -107
- package/templates/default/components/pages/new-page.tsx +183 -183
- package/templates/default/components/pages/section-page.tsx +203 -203
- package/templates/default/components/pages/settings-page.tsx +232 -232
- package/templates/default/components/pagination/pagination-buttons.tsx +147 -147
- package/templates/default/components/pagination/pagination.tsx +36 -36
- package/templates/default/components/sections/category-delete-confirm-page.tsx +130 -130
- package/templates/default/components/sections/category-section-select-input.tsx +139 -139
- package/templates/default/components/sections/conditional-fields.tsx +49 -49
- package/templates/default/components/sections/section-icon.tsx +8 -8
- package/templates/default/components/sections/section-item-card.tsx +143 -143
- package/templates/default/components/sections/section-item-status-badge.tsx +17 -17
- package/templates/default/components/sections/select-input-buttons.tsx +125 -125
- package/templates/default/components/select-box.tsx +98 -98
- package/templates/default/components/ui/accordion.tsx +53 -53
- package/templates/default/components/ui/alert-dialog.tsx +113 -113
- package/templates/default/components/ui/alert.tsx +47 -47
- package/templates/default/components/ui/badge.tsx +38 -38
- package/templates/default/components/ui/card.tsx +43 -43
- package/templates/default/components/ui/command.tsx +137 -137
- package/templates/default/components/ui/custom-alert-dialog.tsx +113 -113
- package/templates/default/components/ui/custom-dialog.tsx +123 -123
- package/templates/default/components/ui/dialog.tsx +123 -123
- package/templates/default/components/ui/direction.tsx +22 -22
- package/templates/default/components/ui/dropdown-menu.tsx +182 -182
- package/templates/default/components/ui/input-group.tsx +54 -54
- package/templates/default/components/ui/input.tsx +22 -22
- package/templates/default/components/ui/label.tsx +19 -19
- package/templates/default/components/ui/popover.tsx +42 -42
- package/templates/default/components/ui/progress.tsx +31 -31
- package/templates/default/components/ui/scroll-area.tsx +42 -42
- package/templates/default/components/ui/select.tsx +165 -165
- package/templates/default/components/ui/separator.tsx +28 -28
- package/templates/default/components/ui/sheet.tsx +103 -103
- package/templates/default/components/ui/spinner.tsx +16 -16
- package/templates/default/components/ui/switch.tsx +29 -29
- package/templates/default/components/ui/table.tsx +83 -83
- package/templates/default/components/ui/tabs.tsx +55 -55
- package/templates/default/components/ui/toast.tsx +113 -113
- package/templates/default/components/ui/toaster.tsx +35 -35
- package/templates/default/components/ui/tooltip.tsx +30 -30
- package/templates/default/components/ui/use-toast.ts +187 -187
- package/templates/default/drizzle.config.ts +4 -4
- package/templates/default/dynamic-schemas/schema.ts +75 -225
- package/templates/default/env/env.ts +46 -46
- package/templates/default/envConfig.ts +4 -4
- package/templates/default/lib/postinstall.js +14 -14
- package/templates/default/lib/utils.ts +6 -6
- package/templates/default/next-env.d.ts +6 -6
- package/templates/default/next.config.ts +24 -24
- package/templates/default/package.json +1 -1
- package/templates/default/postcss.config.mjs +6 -6
- package/templates/default/proxy.ts +32 -32
- package/templates/default/tsconfig.json +48 -48
|
@@ -45,10 +45,26 @@ export const TestSectionTable = mysqlTable('test_section', {
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
export const TestTagsTable = mysqlTable('test_tags', {
|
|
48
|
-
testId:
|
|
49
|
-
tagName: varchar('tag_name', { length: 255 }).notNull()
|
|
48
|
+
testId: varchar('test_id', { length: 255 }).notNull(),
|
|
49
|
+
tagName: varchar('tag_name', { length: 255 }).notNull(),
|
|
50
|
+
locale: varchar('locale', { length: 255 })
|
|
50
51
|
}, (table) => [
|
|
51
|
-
primaryKey({ columns: [table.testId, table.tagName] })
|
|
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)
|
|
52
68
|
]);
|
|
53
69
|
|
|
54
70
|
|
|
@@ -94,9 +110,7 @@ export const ServicesTable = mysqlTable('services', {
|
|
|
94
110
|
townId: int('town_id')
|
|
95
111
|
}, (table) => [
|
|
96
112
|
index('title_index').on(table.title),
|
|
97
|
-
unique('title_unique').on(table.title)
|
|
98
|
-
index('title_fulltext').on(table.title),
|
|
99
|
-
index('desc_fulltext').on(table.desc)
|
|
113
|
+
unique('title_unique').on(table.title)
|
|
100
114
|
]);
|
|
101
115
|
|
|
102
116
|
|
|
@@ -139,66 +153,10 @@ export const RealestateTable = mysqlTable('realestate', {
|
|
|
139
153
|
townId: int('town_id')
|
|
140
154
|
}, (table) => [
|
|
141
155
|
index('title_index').on(table.title),
|
|
142
|
-
unique('title_unique').on(table.title)
|
|
143
|
-
index('title_fulltext').on(table.title),
|
|
144
|
-
index('desc_fulltext').on(table.desc)
|
|
156
|
+
unique('title_unique').on(table.title)
|
|
145
157
|
]);
|
|
146
158
|
|
|
147
159
|
|
|
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
|
-
|
|
202
160
|
export const HomepageSliderTable = mysqlTable('homepage_slider', {
|
|
203
161
|
id: int('id').autoincrement().notNull().primaryKey(),
|
|
204
162
|
titleEn: varchar('title_en', { length: 255 }).notNull(),
|
|
@@ -219,7 +177,7 @@ export const HomepageSliderTable = mysqlTable('homepage_slider', {
|
|
|
219
177
|
export const ContestSubscribersTable = mysqlTable('contest_subscribers', {
|
|
220
178
|
id: int('id').autoincrement().notNull().primaryKey(),
|
|
221
179
|
userId: int('user_id').notNull(),
|
|
222
|
-
contestId:
|
|
180
|
+
contestId: varchar('contest_id', { length: 255 }).notNull()
|
|
223
181
|
}, (table) => [
|
|
224
182
|
unique('contest_subscriber_unique').on(table.contestId, table.userId)
|
|
225
183
|
]);
|
|
@@ -284,30 +242,10 @@ export const JobsTable = mysqlTable('jobs', {
|
|
|
284
242
|
townId: int('town_id')
|
|
285
243
|
}, (table) => [
|
|
286
244
|
index('title_index').on(table.title),
|
|
287
|
-
unique('title_unique').on(table.title)
|
|
288
|
-
index('title_fulltext').on(table.title),
|
|
289
|
-
index('desc_fulltext').on(table.desc)
|
|
245
|
+
unique('title_unique').on(table.title)
|
|
290
246
|
]);
|
|
291
247
|
|
|
292
248
|
|
|
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
|
-
|
|
311
249
|
export const FurnitureTable = mysqlTable('furniture', {
|
|
312
250
|
id: int('id').autoincrement().notNull().primaryKey(),
|
|
313
251
|
title: varchar('title', { length: 255 }).notNull(),
|
|
@@ -330,24 +268,10 @@ export const FurnitureTable = mysqlTable('furniture', {
|
|
|
330
268
|
townId: int('town_id')
|
|
331
269
|
}, (table) => [
|
|
332
270
|
index('title_index').on(table.title),
|
|
333
|
-
unique('title_unique').on(table.title)
|
|
334
|
-
index('title_fulltext').on(table.title),
|
|
335
|
-
index('desc_fulltext').on(table.desc)
|
|
271
|
+
unique('title_unique').on(table.title)
|
|
336
272
|
]);
|
|
337
273
|
|
|
338
274
|
|
|
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
|
-
|
|
351
275
|
export const FiltersTable = mysqlTable('filters', {
|
|
352
276
|
id: int('id').autoincrement().notNull().primaryKey(),
|
|
353
277
|
title: varchar('title', { length: 255 }).notNull(),
|
|
@@ -358,8 +282,7 @@ export const FiltersTable = mysqlTable('filters', {
|
|
|
358
282
|
isMandatory: boolean('is_mandatory')
|
|
359
283
|
}, (table) => [
|
|
360
284
|
unique('title_unique').on(table.title),
|
|
361
|
-
unique('key_unique').on(table.Key)
|
|
362
|
-
index('title_fulltext').on(table.title)
|
|
285
|
+
unique('key_unique').on(table.Key)
|
|
363
286
|
]);
|
|
364
287
|
|
|
365
288
|
|
|
@@ -374,11 +297,7 @@ export const FaqTable = mysqlTable('faq', {
|
|
|
374
297
|
}, (table) => [
|
|
375
298
|
unique('faq_q_en_unique').on(table.qEn),
|
|
376
299
|
unique('title_ar_unique').on(table.qAr),
|
|
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)
|
|
300
|
+
unique('title_tr_unique').on(table.qTr)
|
|
382
301
|
]);
|
|
383
302
|
|
|
384
303
|
|
|
@@ -391,9 +310,7 @@ export const ErrorsTable = mysqlTable('errors', {
|
|
|
391
310
|
desc: longtext('desc'),
|
|
392
311
|
isResolved: boolean('is_resolved')
|
|
393
312
|
}, (table) => [
|
|
394
|
-
unique('key_unique').on(table.caseId)
|
|
395
|
-
index('title_fulltext').on(table.title),
|
|
396
|
-
index('case_id_fulltext').on(table.caseId)
|
|
313
|
+
unique('key_unique').on(table.caseId)
|
|
397
314
|
]);
|
|
398
315
|
|
|
399
316
|
|
|
@@ -420,18 +337,10 @@ export const ElectronicsTable = mysqlTable('electronics', {
|
|
|
420
337
|
townId: int('town_id')
|
|
421
338
|
}, (table) => [
|
|
422
339
|
index('title_index').on(table.title),
|
|
423
|
-
unique('title_unique').on(table.title)
|
|
424
|
-
index('title_fulltext').on(table.title),
|
|
425
|
-
index('desc_fulltext').on(table.desc)
|
|
340
|
+
unique('title_unique').on(table.title)
|
|
426
341
|
]);
|
|
427
342
|
|
|
428
343
|
|
|
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
|
-
|
|
435
344
|
export const ClothesTable = mysqlTable('clothes', {
|
|
436
345
|
id: int('id').autoincrement().notNull().primaryKey(),
|
|
437
346
|
title: varchar('title', { length: 255 }).notNull(),
|
|
@@ -454,9 +363,7 @@ export const ClothesTable = mysqlTable('clothes', {
|
|
|
454
363
|
townId: int('town_id')
|
|
455
364
|
}, (table) => [
|
|
456
365
|
index('title_index').on(table.title),
|
|
457
|
-
unique('title_unique').on(table.title)
|
|
458
|
-
index('title_fulltext').on(table.title),
|
|
459
|
-
index('desc_fulltext').on(table.desc)
|
|
366
|
+
unique('title_unique').on(table.title)
|
|
460
367
|
]);
|
|
461
368
|
|
|
462
369
|
|
|
@@ -514,54 +421,10 @@ export const CarsTable = mysqlTable('cars', {
|
|
|
514
421
|
viewCount: int('view_count'),
|
|
515
422
|
status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired'])
|
|
516
423
|
}, (table) => [
|
|
517
|
-
index('title_index').on(table.title)
|
|
518
|
-
index('title_fulltext').on(table.title),
|
|
519
|
-
index('desc_fulltext').on(table.desc)
|
|
424
|
+
index('title_index').on(table.title)
|
|
520
425
|
]);
|
|
521
426
|
|
|
522
427
|
|
|
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
|
-
|
|
565
428
|
export const CarsDbTable = mysqlTable('cars_db', {
|
|
566
429
|
id: int('id').autoincrement().notNull().primaryKey(),
|
|
567
430
|
name: varchar('name', { length: 255 }).notNull(),
|
|
@@ -594,18 +457,10 @@ export const BooksTable = mysqlTable('books', {
|
|
|
594
457
|
townId: int('town_id')
|
|
595
458
|
}, (table) => [
|
|
596
459
|
index('title_index').on(table.title),
|
|
597
|
-
unique('title_unique').on(table.title)
|
|
598
|
-
index('title_fulltext').on(table.title),
|
|
599
|
-
index('desc_fulltext').on(table.desc)
|
|
460
|
+
unique('title_unique').on(table.title)
|
|
600
461
|
]);
|
|
601
462
|
|
|
602
463
|
|
|
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
|
-
|
|
609
464
|
export const AddressTable = mysqlTable('address', {
|
|
610
465
|
id: int('id').autoincrement().notNull().primaryKey(),
|
|
611
466
|
catOrder: int('cat_order').notNull(),
|
|
@@ -619,32 +474,6 @@ export const AddressTable = mysqlTable('address', {
|
|
|
619
474
|
});
|
|
620
475
|
|
|
621
476
|
|
|
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
|
-
|
|
648
477
|
export const E2eOptionalFieldsTable = mysqlTable('e2e_optional_fields', {
|
|
649
478
|
id: int('id').autoincrement().notNull().primaryKey(),
|
|
650
479
|
title: varchar('title', { length: 255 }),
|
|
@@ -673,29 +502,50 @@ export const E2eOptionalFieldsTable = mysqlTable('e2e_optional_fields', {
|
|
|
673
502
|
|
|
674
503
|
export const E2eAllFieldsTable = mysqlTable('e2e_all_fields', {
|
|
675
504
|
id: int('id').autoincrement().notNull().primaryKey(),
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
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()
|
|
698
548
|
}, (table) => [
|
|
699
|
-
index('e2e_title_index').on(table.
|
|
549
|
+
index('e2e_title_index').on(table.optTitle)
|
|
700
550
|
]);
|
|
701
551
|
|
|
@@ -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
|
|
@@ -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;
|