create-nextjs-cms 0.5.28 → 0.5.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/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import fs from 'fs-extra';
|
|
3
3
|
import { execSync } from 'node:child_process';
|
|
4
4
|
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import { randomBytes } from 'node:crypto';
|
|
5
6
|
import path, { dirname, resolve, relative, basename } from 'node:path';
|
|
6
7
|
import { Command } from 'commander';
|
|
7
8
|
import prompts from 'prompts';
|
|
@@ -166,6 +167,37 @@ export default hasItemsSection({
|
|
|
166
167
|
await fs.writeFile(blogSectionPath, blogSectionContent, 'utf-8');
|
|
167
168
|
console.log('✅ Blog section created successfully!');
|
|
168
169
|
}
|
|
170
|
+
/**
|
|
171
|
+
* Generates a random secret string using crypto.randomBytes
|
|
172
|
+
*/
|
|
173
|
+
function generateSecret() {
|
|
174
|
+
return randomBytes(32).toString('hex');
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Updates .env file with generated random secrets
|
|
178
|
+
*/
|
|
179
|
+
async function updateEnvSecrets(targetDir) {
|
|
180
|
+
const envPath = path.join(targetDir, '.env');
|
|
181
|
+
if (!(await fs.pathExists(envPath))) {
|
|
182
|
+
console.warn('⚠️ No .env file found; skipping secret generation.');
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
try {
|
|
186
|
+
let envContent = await fs.readFile(envPath, 'utf-8');
|
|
187
|
+
// Replace placeholder secrets with generated ones
|
|
188
|
+
envContent = envContent.replace(/ACCESS_TOKEN_SECRET=.*/, `ACCESS_TOKEN_SECRET=${generateSecret()}`);
|
|
189
|
+
envContent = envContent.replace(/REFRESH_TOKEN_SECRET=.*/, `REFRESH_TOKEN_SECRET=${generateSecret()}`);
|
|
190
|
+
envContent = envContent.replace(/CSRF_TOKEN_SECRET=.*/, `CSRF_TOKEN_SECRET=${generateSecret()}`);
|
|
191
|
+
envContent = envContent.replace(/ACCESS_TOKEN_EXPIRATION=.*/, 'ACCESS_TOKEN_EXPIRATION=2h');
|
|
192
|
+
envContent = envContent.replace(/REFRESH_TOKEN_EXPIRATION=.*/, 'REFRESH_TOKEN_EXPIRATION=1y');
|
|
193
|
+
await fs.writeFile(envPath, envContent, 'utf-8');
|
|
194
|
+
console.log('🔐 Generated random secrets and set token expirations in .env file');
|
|
195
|
+
}
|
|
196
|
+
catch (e) {
|
|
197
|
+
console.warn('⚠️ Could not update .env secrets automatically.');
|
|
198
|
+
console.warn(` Error: ${e instanceof Error ? e.message : 'Unknown error'}`);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
169
201
|
async function createNextjsCms() {
|
|
170
202
|
console.log('🚀 Welcome to NextJS CMS!');
|
|
171
203
|
console.log('Creating your new CMS project...\n');
|
|
@@ -291,6 +323,8 @@ async function createNextjsCms() {
|
|
|
291
323
|
errorOnExist: false,
|
|
292
324
|
});
|
|
293
325
|
console.log('✅ Template copied successfully!');
|
|
326
|
+
// Generate random secrets for .env file
|
|
327
|
+
await updateEnvSecrets(options.targetDir);
|
|
294
328
|
// npm excludes .gitignore from packages, so we rename it back from _gitignore
|
|
295
329
|
const gitignoreTemplatePath = path.join(options.targetDir, '_gitignore');
|
|
296
330
|
const gitignorePath = path.join(options.targetDir, '.gitignore');
|
package/package.json
CHANGED
|
@@ -1,373 +1,381 @@
|
|
|
1
|
-
import {mysqlTable,int,longtext,mysqlEnum,varchar,double,
|
|
2
|
-
|
|
3
|
-
export const AppInfoTable = mysqlTable('app_info', {
|
|
4
|
-
id: int('id').autoincrement().notNull().primaryKey(),
|
|
5
|
-
aboutEn: longtext('about_en').notNull(),
|
|
6
|
-
aboutAr: longtext('about_ar').notNull(),
|
|
7
|
-
aboutTr: longtext('about_tr').notNull(),
|
|
8
|
-
privacyEn: longtext('privacy_en').notNull(),
|
|
9
|
-
privacyAr: longtext('privacy_ar').notNull(),
|
|
10
|
-
privacyTr: longtext('privacy_tr').notNull()
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export const UserReportsTable = mysqlTable('user_reports', {
|
|
15
|
-
id: int('id').autoincrement().notNull().primaryKey(),
|
|
16
|
-
contentType: mysqlEnum('content_type', ['ad', 'user']).notNull(),
|
|
17
|
-
reportType: mysqlEnum('report_type', ['explicit_content', 'wrong_information', 'no_longer_available', 'user_not_responsive', 'other']).notNull(),
|
|
18
|
-
contentId: int('content_id').notNull(),
|
|
19
|
-
catId: int('cat_id').notNull(),
|
|
20
|
-
userId: int('user_id'),
|
|
21
|
-
appId: varchar('app_id', { length: 36 }).notNull()
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
export const FeaturedSliderTable = mysqlTable('featured_slider', {
|
|
26
|
-
id: int('id').autoincrement().notNull().primaryKey(),
|
|
27
|
-
image: varchar('image', { length: 255 }).notNull(),
|
|
28
|
-
titleEn: varchar('title_en', { length: 255 }).notNull(),
|
|
29
|
-
titleAr: varchar('title_ar', { length: 255 }).notNull(),
|
|
30
|
-
titleTr: varchar('title_tr', { length: 255 }).notNull(),
|
|
31
|
-
descEn: longtext('desc_en').notNull(),
|
|
32
|
-
descAr: longtext('desc_ar').notNull(),
|
|
33
|
-
descTr: longtext('desc_tr').notNull()
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
export const
|
|
38
|
-
id: int('id').autoincrement().notNull().primaryKey(),
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
})
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
export const
|
|
122
|
-
id: int('id').autoincrement().notNull().primaryKey(),
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
})
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
});
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
export const
|
|
340
|
-
id: int('id').autoincrement().notNull().primaryKey(),
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
1
|
+
import {mysqlTable,int,longtext,mysqlEnum,varchar,boolean,double,timestamp} from 'drizzle-orm/mysql-core'
|
|
2
|
+
|
|
3
|
+
export const AppInfoTable = mysqlTable('app_info', {
|
|
4
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
5
|
+
aboutEn: longtext('about_en').notNull(),
|
|
6
|
+
aboutAr: longtext('about_ar').notNull(),
|
|
7
|
+
aboutTr: longtext('about_tr').notNull(),
|
|
8
|
+
privacyEn: longtext('privacy_en').notNull(),
|
|
9
|
+
privacyAr: longtext('privacy_ar').notNull(),
|
|
10
|
+
privacyTr: longtext('privacy_tr').notNull()
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
export const UserReportsTable = mysqlTable('user_reports', {
|
|
15
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
16
|
+
contentType: mysqlEnum('content_type', ['ad', 'user']).notNull(),
|
|
17
|
+
reportType: mysqlEnum('report_type', ['explicit_content', 'wrong_information', 'no_longer_available', 'user_not_responsive', 'other']).notNull(),
|
|
18
|
+
contentId: int('content_id').notNull(),
|
|
19
|
+
catId: int('cat_id').notNull(),
|
|
20
|
+
userId: int('user_id'),
|
|
21
|
+
appId: varchar('app_id', { length: 36 }).notNull()
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
export const FeaturedSliderTable = mysqlTable('featured_slider', {
|
|
26
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
27
|
+
image: varchar('image', { length: 255 }).notNull(),
|
|
28
|
+
titleEn: varchar('title_en', { length: 255 }).notNull(),
|
|
29
|
+
titleAr: varchar('title_ar', { length: 255 }).notNull(),
|
|
30
|
+
titleTr: varchar('title_tr', { length: 255 }).notNull(),
|
|
31
|
+
descEn: longtext('desc_en').notNull(),
|
|
32
|
+
descAr: longtext('desc_ar').notNull(),
|
|
33
|
+
descTr: longtext('desc_tr').notNull()
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
export const MenuSettingsTable = mysqlTable('menu_settings', {
|
|
38
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
39
|
+
taxRate: varchar('tax_rate', { length: 255 }),
|
|
40
|
+
hideSlider: boolean('hide_slider')
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
export const ServicesTable = mysqlTable('services', {
|
|
45
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
46
|
+
title: varchar('title', { length: 255 }).notNull(),
|
|
47
|
+
catId: int('cat_id').notNull(),
|
|
48
|
+
coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
|
|
49
|
+
price: int('price'),
|
|
50
|
+
currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']),
|
|
51
|
+
coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
|
|
52
|
+
desc: longtext('desc'),
|
|
53
|
+
latitude: double('latitude'),
|
|
54
|
+
longitude: double('longitude'),
|
|
55
|
+
viewCount: int('view_count'),
|
|
56
|
+
status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
|
|
57
|
+
govId: int('gov_id').notNull(),
|
|
58
|
+
districtId: int('district_id').notNull(),
|
|
59
|
+
subDistrictId: int('sub_district_id'),
|
|
60
|
+
townId: int('town_id')
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
export const RealestateTable = mysqlTable('realestate', {
|
|
65
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
66
|
+
catId: int('cat_id').notNull(),
|
|
67
|
+
title: varchar('title', { length: 255 }).notNull(),
|
|
68
|
+
price: int('price').notNull(),
|
|
69
|
+
currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
|
|
70
|
+
spaceGross: int('space_gross').notNull(),
|
|
71
|
+
spaceNet: int('space_net').notNull(),
|
|
72
|
+
latitude: double('latitude').notNull(),
|
|
73
|
+
longitude: double('longitude').notNull(),
|
|
74
|
+
roomCount: varchar('room_count', { length: 255 }),
|
|
75
|
+
buildingAge: varchar('building_age', { length: 255 }),
|
|
76
|
+
floorCount: varchar('floor_count', { length: 255 }),
|
|
77
|
+
bathroomCount: varchar('bathroom_count', { length: 255 }),
|
|
78
|
+
floorLocation: varchar('floor_location', { length: 255 }),
|
|
79
|
+
heatingType: varchar('heating_type', { length: 255 }),
|
|
80
|
+
kitchenType: varchar('kitchen_type', { length: 255 }),
|
|
81
|
+
balcony: boolean('balcony'),
|
|
82
|
+
lift: boolean('lift'),
|
|
83
|
+
parkingType: varchar('parking_type', { length: 255 }),
|
|
84
|
+
furnished: boolean('furnished'),
|
|
85
|
+
belongsToSite: boolean('belongs_to_site'),
|
|
86
|
+
siteName: varchar('site_name', { length: 255 }),
|
|
87
|
+
installments: boolean('installments'),
|
|
88
|
+
exchangeable: boolean('exchangeable'),
|
|
89
|
+
fromWhom: varchar('from_whom', { length: 255 }),
|
|
90
|
+
buildingMembershipFees: int('building_membership_fees'),
|
|
91
|
+
deposit: int('deposit'),
|
|
92
|
+
coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
|
|
93
|
+
coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
|
|
94
|
+
desc: longtext('desc'),
|
|
95
|
+
viewCount: int('view_count'),
|
|
96
|
+
status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
|
|
97
|
+
govId: int('gov_id').notNull(),
|
|
98
|
+
districtId: int('district_id').notNull(),
|
|
99
|
+
subDistrictId: int('sub_district_id'),
|
|
100
|
+
townId: int('town_id')
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
export const HomepageSliderTable = mysqlTable('homepage_slider', {
|
|
105
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
106
|
+
titleEn: varchar('title_en', { length: 255 }).notNull(),
|
|
107
|
+
titleAr: varchar('title_ar', { length: 255 }).notNull(),
|
|
108
|
+
titleTr: varchar('title_tr', { length: 255 }).notNull(),
|
|
109
|
+
subtitleEn: varchar('subtitle_en', { length: 255 }).notNull(),
|
|
110
|
+
subtitleAr: varchar('subtitle_ar', { length: 255 }).notNull(),
|
|
111
|
+
subtitleTr: varchar('subtitle_tr', { length: 255 }).notNull(),
|
|
112
|
+
photo: varchar('photo', { length: 255 }).notNull(),
|
|
113
|
+
buttonUrl: varchar('button_url', { length: 255 }),
|
|
114
|
+
buttonTextEn: varchar('button_text_en', { length: 255 }),
|
|
115
|
+
buttonTextAr: varchar('button_text_ar', { length: 255 }),
|
|
116
|
+
buttonTextTr: varchar('button_text_tr', { length: 255 }),
|
|
117
|
+
buttonUrlTarget: mysqlEnum('button_url_target', ['_blank', '_self'])
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
export const ContestSubscribersTable = mysqlTable('contest_subscribers', {
|
|
122
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
123
|
+
contestId: varchar('contest_id', { length: 255 }).notNull(),
|
|
124
|
+
userId: int('user_id').notNull()
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
export const ContestsTable = mysqlTable('contests', {
|
|
129
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
130
|
+
date: timestamp('date').notNull(),
|
|
131
|
+
prize: varchar('prize', { length: 255 }).notNull(),
|
|
132
|
+
winnerId: int('winner_id'),
|
|
133
|
+
tags: varchar('tags', { length: 255 })
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
export const NotificationsTable = mysqlTable('notifications', {
|
|
138
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
139
|
+
type: mysqlEnum('type', ['ad_price_updated', 'ad_updated', 'ad_activated', 'ad_pending_review', 'ad_expired', 'ad_rejected', 'ad_viewed', 'ad_favorited', 'ad_shared', 'ad_reported', 'ad_deleted', 'ad_created', 'contest_winner', 'contest_reminder', 'contest_created', 'custom']).notNull(),
|
|
140
|
+
contentId: int('content_id'),
|
|
141
|
+
contentCatId: int('content_cat_id'),
|
|
142
|
+
userId: int('user_id'),
|
|
143
|
+
message: varchar('message', { length: 255 })
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
export const ModerationTable = mysqlTable('moderation', {
|
|
148
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
149
|
+
contentType: mysqlEnum('content_type', ['ad', 'user']).notNull(),
|
|
150
|
+
contentId: int('content_id').notNull(),
|
|
151
|
+
catId: int('cat_id'),
|
|
152
|
+
userId: int('user_id').notNull(),
|
|
153
|
+
flagged: int('flagged').notNull(),
|
|
154
|
+
result: varchar('result', { length: 255 }).notNull()
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
export const JobsTable = mysqlTable('jobs', {
|
|
159
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
160
|
+
title: varchar('title', { length: 255 }).notNull(),
|
|
161
|
+
catId: int('cat_id').notNull(),
|
|
162
|
+
salary: int('salary'),
|
|
163
|
+
currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
|
|
164
|
+
workMethod: varchar('work_method', { length: 255 }).notNull(),
|
|
165
|
+
minimumEducation: varchar('minimum_education', { length: 255 }).notNull(),
|
|
166
|
+
experienceLevel: varchar('experience_level', { length: 255 }).notNull(),
|
|
167
|
+
remote: boolean('remote'),
|
|
168
|
+
coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
|
|
169
|
+
coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
|
|
170
|
+
desc: longtext('desc'),
|
|
171
|
+
latitude: double('latitude'),
|
|
172
|
+
longitude: double('longitude'),
|
|
173
|
+
viewCount: int('view_count'),
|
|
174
|
+
status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
|
|
175
|
+
govId: int('gov_id').notNull(),
|
|
176
|
+
districtId: int('district_id').notNull(),
|
|
177
|
+
subDistrictId: int('sub_district_id'),
|
|
178
|
+
townId: int('town_id')
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
export const FurnitureTable = mysqlTable('furniture', {
|
|
183
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
184
|
+
title: varchar('title', { length: 255 }).notNull(),
|
|
185
|
+
catId: int('cat_id').notNull(),
|
|
186
|
+
condition: varchar('condition', { length: 255 }).notNull(),
|
|
187
|
+
price: int('price').notNull(),
|
|
188
|
+
currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
|
|
189
|
+
exchangeable: boolean('exchangeable'),
|
|
190
|
+
fromWhom: varchar('from_whom', { length: 255 }).notNull(),
|
|
191
|
+
coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
|
|
192
|
+
coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
|
|
193
|
+
desc: longtext('desc'),
|
|
194
|
+
latitude: double('latitude'),
|
|
195
|
+
longitude: double('longitude'),
|
|
196
|
+
viewCount: int('view_count'),
|
|
197
|
+
status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
|
|
198
|
+
govId: int('gov_id').notNull(),
|
|
199
|
+
districtId: int('district_id').notNull(),
|
|
200
|
+
subDistrictId: int('sub_district_id'),
|
|
201
|
+
townId: int('town_id')
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
export const FiltersTable = mysqlTable('filters', {
|
|
206
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
207
|
+
title: varchar('title', { length: 255 }).notNull(),
|
|
208
|
+
Key: varchar('_key', { length: 255 }).notNull(),
|
|
209
|
+
fieldName: varchar('field_name', { length: 255 }).notNull(),
|
|
210
|
+
type: mysqlEnum('type', ['checkbox', 'select', 'text', 'finance', 'number', 'point']).notNull(),
|
|
211
|
+
tableName: varchar('table_name', { length: 255 }),
|
|
212
|
+
isMandatory: boolean('is_mandatory')
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
export const FaqTable = mysqlTable('faq', {
|
|
217
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
218
|
+
qEn: varchar('q_en', { length: 255 }).notNull(),
|
|
219
|
+
qAr: varchar('q_ar', { length: 255 }).notNull(),
|
|
220
|
+
qTr: varchar('q_tr', { length: 255 }),
|
|
221
|
+
aEn: longtext('a_en').notNull(),
|
|
222
|
+
aAr: longtext('a_ar'),
|
|
223
|
+
aTr: longtext('a_tr')
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
export const ErrorsTable = mysqlTable('errors', {
|
|
228
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
229
|
+
title: varchar('title', { length: 255 }).notNull(),
|
|
230
|
+
caseId: varchar('case_id', { length: 255 }).notNull(),
|
|
231
|
+
userId: int('user_id'),
|
|
232
|
+
itemSlug: varchar('item_slug', { length: 255 }),
|
|
233
|
+
desc: longtext('desc'),
|
|
234
|
+
isResolved: boolean('is_resolved')
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
export const ElectronicsTable = mysqlTable('electronics', {
|
|
239
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
240
|
+
title: varchar('title', { length: 255 }).notNull(),
|
|
241
|
+
catId: int('cat_id').notNull(),
|
|
242
|
+
condition: varchar('condition', { length: 255 }).notNull(),
|
|
243
|
+
price: int('price').notNull(),
|
|
244
|
+
currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
|
|
245
|
+
exchangeable: boolean('exchangeable'),
|
|
246
|
+
installments: boolean('installments'),
|
|
247
|
+
fromWhom: varchar('from_whom', { length: 255 }).notNull(),
|
|
248
|
+
coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
|
|
249
|
+
coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
|
|
250
|
+
desc: longtext('desc'),
|
|
251
|
+
latitude: double('latitude'),
|
|
252
|
+
longitude: double('longitude'),
|
|
253
|
+
viewCount: int('view_count'),
|
|
254
|
+
status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
|
|
255
|
+
govId: int('gov_id').notNull(),
|
|
256
|
+
districtId: int('district_id').notNull(),
|
|
257
|
+
subDistrictId: int('sub_district_id'),
|
|
258
|
+
townId: int('town_id')
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
export const ClothesTable = mysqlTable('clothes', {
|
|
263
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
264
|
+
title: varchar('title', { length: 255 }).notNull(),
|
|
265
|
+
catId: int('cat_id').notNull(),
|
|
266
|
+
condition: varchar('condition', { length: 255 }).notNull(),
|
|
267
|
+
price: int('price').notNull(),
|
|
268
|
+
currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
|
|
269
|
+
exchangeable: boolean('exchangeable'),
|
|
270
|
+
fromWhom: varchar('from_whom', { length: 255 }).notNull(),
|
|
271
|
+
coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
|
|
272
|
+
coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
|
|
273
|
+
desc: longtext('desc'),
|
|
274
|
+
latitude: double('latitude'),
|
|
275
|
+
longitude: double('longitude'),
|
|
276
|
+
viewCount: int('view_count'),
|
|
277
|
+
status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
|
|
278
|
+
govId: int('gov_id').notNull(),
|
|
279
|
+
districtId: int('district_id').notNull(),
|
|
280
|
+
subDistrictId: int('sub_district_id'),
|
|
281
|
+
townId: int('town_id')
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
export const CatsTable = mysqlTable('cats', {
|
|
286
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
287
|
+
catOrder: int('cat_order').notNull(),
|
|
288
|
+
slug: varchar('slug', { length: 255 }).notNull(),
|
|
289
|
+
titleEn: varchar('title_en', { length: 255 }).notNull(),
|
|
290
|
+
titleAr: varchar('title_ar', { length: 255 }).notNull(),
|
|
291
|
+
titleTr: varchar('title_tr', { length: 255 }).notNull(),
|
|
292
|
+
fullTitleEn: varchar('full_title_en', { length: 255 }),
|
|
293
|
+
fullTitleAr: varchar('full_title_ar', { length: 255 }),
|
|
294
|
+
fullTitleTr: varchar('full_title_tr', { length: 255 }),
|
|
295
|
+
image: varchar('image', { length: 255 }),
|
|
296
|
+
metaDescEn: varchar('meta_desc_en', { length: 255 }),
|
|
297
|
+
metaDescAr: varchar('meta_desc_ar', { length: 255 }),
|
|
298
|
+
metaDescTr: varchar('meta_desc_tr', { length: 255 }),
|
|
299
|
+
filters: varchar('filters', { length: 255 }),
|
|
300
|
+
tableName: varchar('table_name', { length: 255 }).notNull(),
|
|
301
|
+
adCount: int('ad_count'),
|
|
302
|
+
parentId: int('parent_id'),
|
|
303
|
+
level: int('level')
|
|
304
|
+
});
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
export const CarsTable = mysqlTable('cars', {
|
|
308
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
309
|
+
modelYear: int('model_year').notNull(),
|
|
310
|
+
model: varchar('model', { length: 255 }).notNull(),
|
|
311
|
+
title: varchar('title', { length: 255 }).notNull(),
|
|
312
|
+
catId: int('cat_id').notNull(),
|
|
313
|
+
govId: int('gov_id').notNull(),
|
|
314
|
+
districtId: int('district_id').notNull(),
|
|
315
|
+
subDistrictId: int('sub_district_id'),
|
|
316
|
+
townId: int('town_id'),
|
|
317
|
+
price: int('price').notNull(),
|
|
318
|
+
currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
|
|
319
|
+
condition: varchar('condition', { length: 255 }).notNull(),
|
|
320
|
+
fromWhom: varchar('from_whom', { length: 255 }).notNull(),
|
|
321
|
+
engineCapacity: varchar('engine_capacity', { length: 255 }).notNull(),
|
|
322
|
+
enginePower: varchar('engine_power', { length: 255 }).notNull(),
|
|
323
|
+
tractionType: varchar('traction_type', { length: 255 }).notNull(),
|
|
324
|
+
bodyType: varchar('body_type', { length: 255 }).notNull(),
|
|
325
|
+
gearType: varchar('gear_type', { length: 255 }).notNull(),
|
|
326
|
+
fuelType: varchar('fuel_type', { length: 255 }).notNull(),
|
|
327
|
+
exchangeable: boolean('exchangeable'),
|
|
328
|
+
installments: boolean('installments'),
|
|
329
|
+
coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
|
|
330
|
+
coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
|
|
331
|
+
desc: longtext('desc'),
|
|
332
|
+
latitude: double('latitude'),
|
|
333
|
+
longitude: double('longitude'),
|
|
334
|
+
viewCount: int('view_count'),
|
|
335
|
+
status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired'])
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
export const CarsDbTable = mysqlTable('cars_db', {
|
|
340
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
341
|
+
name: varchar('name', { length: 255 }).notNull(),
|
|
342
|
+
parentId: int('parent_id'),
|
|
343
|
+
level: int('level')
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
export const BooksTable = mysqlTable('books', {
|
|
348
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
349
|
+
title: varchar('title', { length: 255 }).notNull(),
|
|
350
|
+
catId: int('cat_id').notNull(),
|
|
351
|
+
condition: varchar('condition', { length: 255 }).notNull(),
|
|
352
|
+
price: int('price').notNull(),
|
|
353
|
+
currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
|
|
354
|
+
exchangeable: boolean('exchangeable'),
|
|
355
|
+
fromWhom: varchar('from_whom', { length: 255 }).notNull(),
|
|
356
|
+
coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
|
|
357
|
+
coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
|
|
358
|
+
desc: longtext('desc'),
|
|
359
|
+
latitude: double('latitude'),
|
|
360
|
+
longitude: double('longitude'),
|
|
361
|
+
viewCount: int('view_count'),
|
|
362
|
+
status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
|
|
363
|
+
govId: int('gov_id').notNull(),
|
|
364
|
+
districtId: int('district_id').notNull(),
|
|
365
|
+
subDistrictId: int('sub_district_id'),
|
|
366
|
+
townId: int('town_id')
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
export const AddressTable = mysqlTable('address', {
|
|
371
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
372
|
+
catOrder: int('cat_order').notNull(),
|
|
373
|
+
titleEn: varchar('title_en', { length: 255 }).notNull(),
|
|
374
|
+
titleAr: varchar('title_ar', { length: 255 }).notNull(),
|
|
375
|
+
titleTr: varchar('title_tr', { length: 255 }).notNull(),
|
|
376
|
+
image: varchar('image', { length: 255 }),
|
|
377
|
+
path: varchar('path', { length: 255 }),
|
|
378
|
+
parentId: int('parent_id'),
|
|
379
|
+
level: int('level')
|
|
380
|
+
});
|
|
381
|
+
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"db:gen": "drizzle-kit generate",
|
|
15
15
|
"db:push": "drizzle-kit push --config=db/drizzle.config.ts",
|
|
16
16
|
"db:mig": "tsx db/migrate.ts",
|
|
17
|
-
"next-cms-kit": "
|
|
18
|
-
"next-cms-kit:dev": "
|
|
17
|
+
"next-cms-kit": "node --env-file=.env ./lib/cli.mjs",
|
|
18
|
+
"next-cms-kit:dev": "node --env-file=.env.development ./lib/cli.mjs --dev"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@dnd-kit/core": "^6.3.1",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"nanoid": "^5.1.2",
|
|
71
71
|
"next": "^15.5.5",
|
|
72
72
|
"next-themes": "^0.4.6",
|
|
73
|
-
"nextjs-cms": "0.5.
|
|
73
|
+
"nextjs-cms": "0.5.30",
|
|
74
74
|
"plaiceholder": "^3.0.0",
|
|
75
75
|
"prettier-plugin-tailwindcss": "^0.7.2",
|
|
76
76
|
"qrcode": "^1.5.4",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"eslint-config-prettier": "^10.0.1",
|
|
104
104
|
"eslint-plugin-prettier": "^5.2.3",
|
|
105
105
|
"fs-extra": "^11.3.3",
|
|
106
|
-
"nextjs-cms-kit": "0.5.
|
|
106
|
+
"nextjs-cms-kit": "0.5.30",
|
|
107
107
|
"postcss": "^8.5.1",
|
|
108
108
|
"prettier": "3.5.0",
|
|
109
109
|
"tailwindcss": "^4.1.18",
|
|
File without changes
|