create-deesse-app 0.4.4 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -2
- package/bin/cli.js +0 -0
- package/dist/bin/cli.js +0 -0
- package/dist/src/copy.d.ts +1 -1
- package/dist/src/copy.d.ts.map +1 -1
- package/dist/src/copy.js +3 -1
- package/dist/src/copy.js.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -11
- package/templates/default/drizzle/0000_cheerful_clea.sql +58 -0
- package/templates/default/drizzle/meta/0000_snapshot.json +405 -0
- package/templates/default/drizzle/meta/_journal.json +13 -0
- package/templates/default/drizzle.config.ts +11 -0
- package/templates/default/next.config.ts +1 -1
- package/templates/default/package.json +1 -0
- package/templates/default/src/app/(deesse)/admin/[[...slug]]/page.tsx +2 -2
- package/templates/default/src/app/(deesse)/admin/layout.tsx +5 -2
- package/templates/default/src/app/layout.tsx +1 -1
- package/templates/default/src/db/schema/auth-schema.ts +100 -0
- package/templates/default/src/deesse.config.ts +10 -1
- package/templates/default/src/deesse.pages.tsx +1 -0
- package/templates/default/src/lib/auth.ts +3 -0
- package/templates/default/src/lib/client.ts +7 -0
- package/templates/default/src/lib/deesse.ts +5 -0
- package/templates/without-admin/AGENTS.md +5 -0
- package/templates/without-admin/CLAUDE.md +1 -0
- package/templates/without-admin/README.md +36 -0
- package/templates/without-admin/components.json +25 -0
- package/templates/without-admin/drizzle.config.ts +11 -0
- package/templates/without-admin/eslint.config.mjs +18 -0
- package/templates/without-admin/next.config.ts +7 -0
- package/templates/without-admin/package-lock.json +11412 -0
- package/templates/without-admin/package.json +41 -0
- package/templates/without-admin/postcss.config.mjs +7 -0
- package/templates/without-admin/public/file.svg +1 -0
- package/templates/without-admin/public/globe.svg +1 -0
- package/templates/without-admin/public/nesalia.svg +50 -0
- package/templates/without-admin/public/next.svg +1 -0
- package/templates/without-admin/public/vercel.svg +1 -0
- package/templates/without-admin/public/window.svg +1 -0
- package/templates/without-admin/src/app/(deesse)/api/[...slug]/route.ts +5 -0
- package/templates/without-admin/src/app/(frontend)/(auth)/login/page.tsx +85 -0
- package/templates/without-admin/src/app/(frontend)/(auth)/signup/page.tsx +90 -0
- package/templates/without-admin/src/app/(frontend)/home/page.tsx +19 -0
- package/templates/without-admin/src/app/(frontend)/layout.tsx +14 -0
- package/templates/without-admin/src/app/(frontend)/page.tsx +50 -0
- package/templates/without-admin/src/app/globals.css +130 -0
- package/templates/without-admin/src/app/icon.svg +109 -0
- package/templates/without-admin/src/app/layout.tsx +37 -0
- package/templates/without-admin/src/components/header.tsx +123 -0
- package/templates/without-admin/src/components/password-input.tsx +50 -0
- package/templates/without-admin/src/components/providers/index.tsx +11 -0
- package/templates/without-admin/src/components/providers/theme-provider.tsx +11 -0
- package/templates/without-admin/src/components/ui/alert-dialog.tsx +199 -0
- package/templates/without-admin/src/components/ui/avatar.tsx +112 -0
- package/templates/without-admin/src/components/ui/button.tsx +67 -0
- package/templates/without-admin/src/components/ui/dialog.tsx +168 -0
- package/templates/without-admin/src/components/ui/dropdown-menu.tsx +269 -0
- package/templates/without-admin/src/components/ui/input.tsx +19 -0
- package/templates/without-admin/src/components/ui/label.tsx +24 -0
- package/templates/without-admin/src/components/ui/sonner.tsx +49 -0
- package/templates/without-admin/src/components/ui/tooltip.tsx +57 -0
- package/templates/without-admin/src/db/schema/auth-schema.ts +100 -0
- package/templates/without-admin/src/db/schema/index.ts +1 -0
- package/templates/without-admin/src/deesse.config.ts +18 -0
- package/templates/without-admin/src/lib/client.ts +7 -0
- package/templates/without-admin/src/lib/deesse.ts +5 -0
- package/templates/without-admin/src/lib/utils.ts +6 -0
- package/templates/without-admin/tsconfig.json +34 -0
- package/templates/minimal/.gitkeep +0 -0
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "124e1021-5753-4d97-9f7a-e26d7ecbacbb",
|
|
3
|
+
"prevId": "00000000-0000-0000-0000-000000000000",
|
|
4
|
+
"version": "7",
|
|
5
|
+
"dialect": "postgresql",
|
|
6
|
+
"tables": {
|
|
7
|
+
"public.account": {
|
|
8
|
+
"name": "account",
|
|
9
|
+
"schema": "",
|
|
10
|
+
"columns": {
|
|
11
|
+
"id": {
|
|
12
|
+
"name": "id",
|
|
13
|
+
"type": "text",
|
|
14
|
+
"primaryKey": true,
|
|
15
|
+
"notNull": true
|
|
16
|
+
},
|
|
17
|
+
"account_id": {
|
|
18
|
+
"name": "account_id",
|
|
19
|
+
"type": "text",
|
|
20
|
+
"primaryKey": false,
|
|
21
|
+
"notNull": true
|
|
22
|
+
},
|
|
23
|
+
"provider_id": {
|
|
24
|
+
"name": "provider_id",
|
|
25
|
+
"type": "text",
|
|
26
|
+
"primaryKey": false,
|
|
27
|
+
"notNull": true
|
|
28
|
+
},
|
|
29
|
+
"user_id": {
|
|
30
|
+
"name": "user_id",
|
|
31
|
+
"type": "text",
|
|
32
|
+
"primaryKey": false,
|
|
33
|
+
"notNull": true
|
|
34
|
+
},
|
|
35
|
+
"access_token": {
|
|
36
|
+
"name": "access_token",
|
|
37
|
+
"type": "text",
|
|
38
|
+
"primaryKey": false,
|
|
39
|
+
"notNull": false
|
|
40
|
+
},
|
|
41
|
+
"refresh_token": {
|
|
42
|
+
"name": "refresh_token",
|
|
43
|
+
"type": "text",
|
|
44
|
+
"primaryKey": false,
|
|
45
|
+
"notNull": false
|
|
46
|
+
},
|
|
47
|
+
"id_token": {
|
|
48
|
+
"name": "id_token",
|
|
49
|
+
"type": "text",
|
|
50
|
+
"primaryKey": false,
|
|
51
|
+
"notNull": false
|
|
52
|
+
},
|
|
53
|
+
"access_token_expires_at": {
|
|
54
|
+
"name": "access_token_expires_at",
|
|
55
|
+
"type": "timestamp",
|
|
56
|
+
"primaryKey": false,
|
|
57
|
+
"notNull": false
|
|
58
|
+
},
|
|
59
|
+
"refresh_token_expires_at": {
|
|
60
|
+
"name": "refresh_token_expires_at",
|
|
61
|
+
"type": "timestamp",
|
|
62
|
+
"primaryKey": false,
|
|
63
|
+
"notNull": false
|
|
64
|
+
},
|
|
65
|
+
"scope": {
|
|
66
|
+
"name": "scope",
|
|
67
|
+
"type": "text",
|
|
68
|
+
"primaryKey": false,
|
|
69
|
+
"notNull": false
|
|
70
|
+
},
|
|
71
|
+
"password": {
|
|
72
|
+
"name": "password",
|
|
73
|
+
"type": "text",
|
|
74
|
+
"primaryKey": false,
|
|
75
|
+
"notNull": false
|
|
76
|
+
},
|
|
77
|
+
"created_at": {
|
|
78
|
+
"name": "created_at",
|
|
79
|
+
"type": "timestamp",
|
|
80
|
+
"primaryKey": false,
|
|
81
|
+
"notNull": true,
|
|
82
|
+
"default": "now()"
|
|
83
|
+
},
|
|
84
|
+
"updated_at": {
|
|
85
|
+
"name": "updated_at",
|
|
86
|
+
"type": "timestamp",
|
|
87
|
+
"primaryKey": false,
|
|
88
|
+
"notNull": true
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"indexes": {
|
|
92
|
+
"account_userId_idx": {
|
|
93
|
+
"name": "account_userId_idx",
|
|
94
|
+
"columns": [
|
|
95
|
+
{
|
|
96
|
+
"expression": "user_id",
|
|
97
|
+
"isExpression": false,
|
|
98
|
+
"asc": true,
|
|
99
|
+
"nulls": "last"
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
"isUnique": false,
|
|
103
|
+
"concurrently": false,
|
|
104
|
+
"method": "btree",
|
|
105
|
+
"with": {}
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"foreignKeys": {
|
|
109
|
+
"account_user_id_user_id_fk": {
|
|
110
|
+
"name": "account_user_id_user_id_fk",
|
|
111
|
+
"tableFrom": "account",
|
|
112
|
+
"tableTo": "user",
|
|
113
|
+
"columnsFrom": [
|
|
114
|
+
"user_id"
|
|
115
|
+
],
|
|
116
|
+
"columnsTo": [
|
|
117
|
+
"id"
|
|
118
|
+
],
|
|
119
|
+
"onDelete": "cascade",
|
|
120
|
+
"onUpdate": "no action"
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"compositePrimaryKeys": {},
|
|
124
|
+
"uniqueConstraints": {},
|
|
125
|
+
"policies": {},
|
|
126
|
+
"checkConstraints": {},
|
|
127
|
+
"isRLSEnabled": false
|
|
128
|
+
},
|
|
129
|
+
"public.session": {
|
|
130
|
+
"name": "session",
|
|
131
|
+
"schema": "",
|
|
132
|
+
"columns": {
|
|
133
|
+
"id": {
|
|
134
|
+
"name": "id",
|
|
135
|
+
"type": "text",
|
|
136
|
+
"primaryKey": true,
|
|
137
|
+
"notNull": true
|
|
138
|
+
},
|
|
139
|
+
"expires_at": {
|
|
140
|
+
"name": "expires_at",
|
|
141
|
+
"type": "timestamp",
|
|
142
|
+
"primaryKey": false,
|
|
143
|
+
"notNull": true
|
|
144
|
+
},
|
|
145
|
+
"token": {
|
|
146
|
+
"name": "token",
|
|
147
|
+
"type": "text",
|
|
148
|
+
"primaryKey": false,
|
|
149
|
+
"notNull": true
|
|
150
|
+
},
|
|
151
|
+
"created_at": {
|
|
152
|
+
"name": "created_at",
|
|
153
|
+
"type": "timestamp",
|
|
154
|
+
"primaryKey": false,
|
|
155
|
+
"notNull": true,
|
|
156
|
+
"default": "now()"
|
|
157
|
+
},
|
|
158
|
+
"updated_at": {
|
|
159
|
+
"name": "updated_at",
|
|
160
|
+
"type": "timestamp",
|
|
161
|
+
"primaryKey": false,
|
|
162
|
+
"notNull": true
|
|
163
|
+
},
|
|
164
|
+
"ip_address": {
|
|
165
|
+
"name": "ip_address",
|
|
166
|
+
"type": "text",
|
|
167
|
+
"primaryKey": false,
|
|
168
|
+
"notNull": false
|
|
169
|
+
},
|
|
170
|
+
"user_agent": {
|
|
171
|
+
"name": "user_agent",
|
|
172
|
+
"type": "text",
|
|
173
|
+
"primaryKey": false,
|
|
174
|
+
"notNull": false
|
|
175
|
+
},
|
|
176
|
+
"user_id": {
|
|
177
|
+
"name": "user_id",
|
|
178
|
+
"type": "text",
|
|
179
|
+
"primaryKey": false,
|
|
180
|
+
"notNull": true
|
|
181
|
+
},
|
|
182
|
+
"impersonated_by": {
|
|
183
|
+
"name": "impersonated_by",
|
|
184
|
+
"type": "text",
|
|
185
|
+
"primaryKey": false,
|
|
186
|
+
"notNull": false
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
"indexes": {
|
|
190
|
+
"session_userId_idx": {
|
|
191
|
+
"name": "session_userId_idx",
|
|
192
|
+
"columns": [
|
|
193
|
+
{
|
|
194
|
+
"expression": "user_id",
|
|
195
|
+
"isExpression": false,
|
|
196
|
+
"asc": true,
|
|
197
|
+
"nulls": "last"
|
|
198
|
+
}
|
|
199
|
+
],
|
|
200
|
+
"isUnique": false,
|
|
201
|
+
"concurrently": false,
|
|
202
|
+
"method": "btree",
|
|
203
|
+
"with": {}
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
"foreignKeys": {
|
|
207
|
+
"session_user_id_user_id_fk": {
|
|
208
|
+
"name": "session_user_id_user_id_fk",
|
|
209
|
+
"tableFrom": "session",
|
|
210
|
+
"tableTo": "user",
|
|
211
|
+
"columnsFrom": [
|
|
212
|
+
"user_id"
|
|
213
|
+
],
|
|
214
|
+
"columnsTo": [
|
|
215
|
+
"id"
|
|
216
|
+
],
|
|
217
|
+
"onDelete": "cascade",
|
|
218
|
+
"onUpdate": "no action"
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
"compositePrimaryKeys": {},
|
|
222
|
+
"uniqueConstraints": {
|
|
223
|
+
"session_token_unique": {
|
|
224
|
+
"name": "session_token_unique",
|
|
225
|
+
"nullsNotDistinct": false,
|
|
226
|
+
"columns": [
|
|
227
|
+
"token"
|
|
228
|
+
]
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
"policies": {},
|
|
232
|
+
"checkConstraints": {},
|
|
233
|
+
"isRLSEnabled": false
|
|
234
|
+
},
|
|
235
|
+
"public.user": {
|
|
236
|
+
"name": "user",
|
|
237
|
+
"schema": "",
|
|
238
|
+
"columns": {
|
|
239
|
+
"id": {
|
|
240
|
+
"name": "id",
|
|
241
|
+
"type": "text",
|
|
242
|
+
"primaryKey": true,
|
|
243
|
+
"notNull": true
|
|
244
|
+
},
|
|
245
|
+
"name": {
|
|
246
|
+
"name": "name",
|
|
247
|
+
"type": "text",
|
|
248
|
+
"primaryKey": false,
|
|
249
|
+
"notNull": true
|
|
250
|
+
},
|
|
251
|
+
"email": {
|
|
252
|
+
"name": "email",
|
|
253
|
+
"type": "text",
|
|
254
|
+
"primaryKey": false,
|
|
255
|
+
"notNull": true
|
|
256
|
+
},
|
|
257
|
+
"email_verified": {
|
|
258
|
+
"name": "email_verified",
|
|
259
|
+
"type": "boolean",
|
|
260
|
+
"primaryKey": false,
|
|
261
|
+
"notNull": true,
|
|
262
|
+
"default": false
|
|
263
|
+
},
|
|
264
|
+
"image": {
|
|
265
|
+
"name": "image",
|
|
266
|
+
"type": "text",
|
|
267
|
+
"primaryKey": false,
|
|
268
|
+
"notNull": false
|
|
269
|
+
},
|
|
270
|
+
"created_at": {
|
|
271
|
+
"name": "created_at",
|
|
272
|
+
"type": "timestamp",
|
|
273
|
+
"primaryKey": false,
|
|
274
|
+
"notNull": true,
|
|
275
|
+
"default": "now()"
|
|
276
|
+
},
|
|
277
|
+
"updated_at": {
|
|
278
|
+
"name": "updated_at",
|
|
279
|
+
"type": "timestamp",
|
|
280
|
+
"primaryKey": false,
|
|
281
|
+
"notNull": true,
|
|
282
|
+
"default": "now()"
|
|
283
|
+
},
|
|
284
|
+
"role": {
|
|
285
|
+
"name": "role",
|
|
286
|
+
"type": "text",
|
|
287
|
+
"primaryKey": false,
|
|
288
|
+
"notNull": false
|
|
289
|
+
},
|
|
290
|
+
"banned": {
|
|
291
|
+
"name": "banned",
|
|
292
|
+
"type": "boolean",
|
|
293
|
+
"primaryKey": false,
|
|
294
|
+
"notNull": false,
|
|
295
|
+
"default": false
|
|
296
|
+
},
|
|
297
|
+
"ban_reason": {
|
|
298
|
+
"name": "ban_reason",
|
|
299
|
+
"type": "text",
|
|
300
|
+
"primaryKey": false,
|
|
301
|
+
"notNull": false
|
|
302
|
+
},
|
|
303
|
+
"ban_expires": {
|
|
304
|
+
"name": "ban_expires",
|
|
305
|
+
"type": "timestamp",
|
|
306
|
+
"primaryKey": false,
|
|
307
|
+
"notNull": false
|
|
308
|
+
}
|
|
309
|
+
},
|
|
310
|
+
"indexes": {},
|
|
311
|
+
"foreignKeys": {},
|
|
312
|
+
"compositePrimaryKeys": {},
|
|
313
|
+
"uniqueConstraints": {
|
|
314
|
+
"user_email_unique": {
|
|
315
|
+
"name": "user_email_unique",
|
|
316
|
+
"nullsNotDistinct": false,
|
|
317
|
+
"columns": [
|
|
318
|
+
"email"
|
|
319
|
+
]
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
"policies": {},
|
|
323
|
+
"checkConstraints": {},
|
|
324
|
+
"isRLSEnabled": false
|
|
325
|
+
},
|
|
326
|
+
"public.verification": {
|
|
327
|
+
"name": "verification",
|
|
328
|
+
"schema": "",
|
|
329
|
+
"columns": {
|
|
330
|
+
"id": {
|
|
331
|
+
"name": "id",
|
|
332
|
+
"type": "text",
|
|
333
|
+
"primaryKey": true,
|
|
334
|
+
"notNull": true
|
|
335
|
+
},
|
|
336
|
+
"identifier": {
|
|
337
|
+
"name": "identifier",
|
|
338
|
+
"type": "text",
|
|
339
|
+
"primaryKey": false,
|
|
340
|
+
"notNull": true
|
|
341
|
+
},
|
|
342
|
+
"value": {
|
|
343
|
+
"name": "value",
|
|
344
|
+
"type": "text",
|
|
345
|
+
"primaryKey": false,
|
|
346
|
+
"notNull": true
|
|
347
|
+
},
|
|
348
|
+
"expires_at": {
|
|
349
|
+
"name": "expires_at",
|
|
350
|
+
"type": "timestamp",
|
|
351
|
+
"primaryKey": false,
|
|
352
|
+
"notNull": true
|
|
353
|
+
},
|
|
354
|
+
"created_at": {
|
|
355
|
+
"name": "created_at",
|
|
356
|
+
"type": "timestamp",
|
|
357
|
+
"primaryKey": false,
|
|
358
|
+
"notNull": true,
|
|
359
|
+
"default": "now()"
|
|
360
|
+
},
|
|
361
|
+
"updated_at": {
|
|
362
|
+
"name": "updated_at",
|
|
363
|
+
"type": "timestamp",
|
|
364
|
+
"primaryKey": false,
|
|
365
|
+
"notNull": true,
|
|
366
|
+
"default": "now()"
|
|
367
|
+
}
|
|
368
|
+
},
|
|
369
|
+
"indexes": {
|
|
370
|
+
"verification_identifier_idx": {
|
|
371
|
+
"name": "verification_identifier_idx",
|
|
372
|
+
"columns": [
|
|
373
|
+
{
|
|
374
|
+
"expression": "identifier",
|
|
375
|
+
"isExpression": false,
|
|
376
|
+
"asc": true,
|
|
377
|
+
"nulls": "last"
|
|
378
|
+
}
|
|
379
|
+
],
|
|
380
|
+
"isUnique": false,
|
|
381
|
+
"concurrently": false,
|
|
382
|
+
"method": "btree",
|
|
383
|
+
"with": {}
|
|
384
|
+
}
|
|
385
|
+
},
|
|
386
|
+
"foreignKeys": {},
|
|
387
|
+
"compositePrimaryKeys": {},
|
|
388
|
+
"uniqueConstraints": {},
|
|
389
|
+
"policies": {},
|
|
390
|
+
"checkConstraints": {},
|
|
391
|
+
"isRLSEnabled": false
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
"enums": {},
|
|
395
|
+
"schemas": {},
|
|
396
|
+
"sequences": {},
|
|
397
|
+
"roles": {},
|
|
398
|
+
"policies": {},
|
|
399
|
+
"views": {},
|
|
400
|
+
"_meta": {
|
|
401
|
+
"columns": {},
|
|
402
|
+
"schemas": {},
|
|
403
|
+
"tables": {}
|
|
404
|
+
}
|
|
405
|
+
}
|
|
@@ -8,7 +8,7 @@ interface AdminPageProps {
|
|
|
8
8
|
|
|
9
9
|
export default async function AdminPage({ params, searchParams }: AdminPageProps) {
|
|
10
10
|
const resolvedParams = await params;
|
|
11
|
-
const resolvedSearchParams = await searchParams
|
|
11
|
+
const resolvedSearchParams = (await searchParams) as Record<string, string | string[]>;
|
|
12
12
|
|
|
13
13
|
return (
|
|
14
14
|
<RootPage
|
|
@@ -17,4 +17,4 @@ export default async function AdminPage({ params, searchParams }: AdminPageProps
|
|
|
17
17
|
searchParams={resolvedSearchParams}
|
|
18
18
|
/>
|
|
19
19
|
);
|
|
20
|
-
}
|
|
20
|
+
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { RootLayout } from "@deessejs/next/root-layout";
|
|
2
|
+
import { config } from "@deesse-config";
|
|
3
|
+
|
|
1
4
|
export default function AdminLayout({
|
|
2
5
|
children,
|
|
3
6
|
}: {
|
|
4
7
|
children: React.ReactNode;
|
|
5
8
|
}) {
|
|
6
|
-
return <
|
|
7
|
-
}
|
|
9
|
+
return <RootLayout config={config}>{children}</RootLayout>;
|
|
10
|
+
}
|
|
@@ -24,7 +24,7 @@ export default function RootLayout({
|
|
|
24
24
|
children: React.ReactNode;
|
|
25
25
|
}>) {
|
|
26
26
|
return (
|
|
27
|
-
<html lang="en" className={`${inter.variable} ${jetbrainsMono.variable} h-full antialiased`}>
|
|
27
|
+
<html lang="en" className={`${inter.variable} ${jetbrainsMono.variable} h-full antialiased`} suppressHydrationWarning>
|
|
28
28
|
<body className="min-h-full flex flex-col font-sans">
|
|
29
29
|
<AppProvider>{children}</AppProvider>
|
|
30
30
|
</body>
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { relations } from "drizzle-orm";
|
|
2
|
+
import { pgTable, text, timestamp, boolean, index } from "drizzle-orm/pg-core";
|
|
3
|
+
|
|
4
|
+
export const user = pgTable("user", {
|
|
5
|
+
id: text("id").primaryKey(),
|
|
6
|
+
name: text("name").notNull(),
|
|
7
|
+
email: text("email").notNull().unique(),
|
|
8
|
+
emailVerified: boolean("email_verified").default(false).notNull(),
|
|
9
|
+
image: text("image"),
|
|
10
|
+
createdAt: timestamp("created_at").defaultNow().notNull(),
|
|
11
|
+
updatedAt: timestamp("updated_at")
|
|
12
|
+
.defaultNow()
|
|
13
|
+
.$onUpdate(() => /* @__PURE__ */ new Date())
|
|
14
|
+
.notNull(),
|
|
15
|
+
role: text("role"),
|
|
16
|
+
banned: boolean("banned").default(false),
|
|
17
|
+
banReason: text("ban_reason"),
|
|
18
|
+
banExpires: timestamp("ban_expires"),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export const session = pgTable(
|
|
22
|
+
"session",
|
|
23
|
+
{
|
|
24
|
+
id: text("id").primaryKey(),
|
|
25
|
+
expiresAt: timestamp("expires_at").notNull(),
|
|
26
|
+
token: text("token").notNull().unique(),
|
|
27
|
+
createdAt: timestamp("created_at").defaultNow().notNull(),
|
|
28
|
+
updatedAt: timestamp("updated_at")
|
|
29
|
+
.$onUpdate(() => /* @__PURE__ */ new Date())
|
|
30
|
+
.notNull(),
|
|
31
|
+
ipAddress: text("ip_address"),
|
|
32
|
+
userAgent: text("user_agent"),
|
|
33
|
+
userId: text("user_id")
|
|
34
|
+
.notNull()
|
|
35
|
+
.references(() => user.id, { onDelete: "cascade" }),
|
|
36
|
+
impersonatedBy: text("impersonated_by"),
|
|
37
|
+
},
|
|
38
|
+
(table) => [index("session_userId_idx").on(table.userId)],
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
export const account = pgTable(
|
|
42
|
+
"account",
|
|
43
|
+
{
|
|
44
|
+
id: text("id").primaryKey(),
|
|
45
|
+
accountId: text("account_id").notNull(),
|
|
46
|
+
providerId: text("provider_id").notNull(),
|
|
47
|
+
userId: text("user_id")
|
|
48
|
+
.notNull()
|
|
49
|
+
.references(() => user.id, { onDelete: "cascade" }),
|
|
50
|
+
accessToken: text("access_token"),
|
|
51
|
+
refreshToken: text("refresh_token"),
|
|
52
|
+
idToken: text("id_token"),
|
|
53
|
+
accessTokenExpiresAt: timestamp("access_token_expires_at"),
|
|
54
|
+
refreshTokenExpiresAt: timestamp("refresh_token_expires_at"),
|
|
55
|
+
scope: text("scope"),
|
|
56
|
+
password: text("password"),
|
|
57
|
+
createdAt: timestamp("created_at").defaultNow().notNull(),
|
|
58
|
+
updatedAt: timestamp("updated_at")
|
|
59
|
+
.$onUpdate(() => /* @__PURE__ */ new Date())
|
|
60
|
+
.notNull(),
|
|
61
|
+
},
|
|
62
|
+
(table) => [index("account_userId_idx").on(table.userId)],
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
export const verification = pgTable(
|
|
66
|
+
"verification",
|
|
67
|
+
{
|
|
68
|
+
id: text("id").primaryKey(),
|
|
69
|
+
identifier: text("identifier").notNull(),
|
|
70
|
+
value: text("value").notNull(),
|
|
71
|
+
expiresAt: timestamp("expires_at").notNull(),
|
|
72
|
+
createdAt: timestamp("created_at").defaultNow().notNull(),
|
|
73
|
+
updatedAt: timestamp("updated_at")
|
|
74
|
+
.defaultNow()
|
|
75
|
+
.$onUpdate(() => /* @__PURE__ */ new Date())
|
|
76
|
+
.notNull(),
|
|
77
|
+
},
|
|
78
|
+
(table) => [index("verification_identifier_idx").on(table.identifier)],
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
export const userRelations = relations(user, ({ many }) => ({
|
|
82
|
+
sessions: many(session),
|
|
83
|
+
accounts: many(account),
|
|
84
|
+
}));
|
|
85
|
+
|
|
86
|
+
export const sessionRelations = relations(session, ({ one }) => ({
|
|
87
|
+
user: one(user, {
|
|
88
|
+
fields: [session.userId],
|
|
89
|
+
references: [user.id],
|
|
90
|
+
}),
|
|
91
|
+
}));
|
|
92
|
+
|
|
93
|
+
export const accountRelations = relations(account, ({ one }) => ({
|
|
94
|
+
user: one(user, {
|
|
95
|
+
fields: [account.userId],
|
|
96
|
+
references: [user.id],
|
|
97
|
+
}),
|
|
98
|
+
}));
|
|
99
|
+
|
|
100
|
+
export const schema = { user, session, account, verification };
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import { defineConfig } from 'deesse';
|
|
2
2
|
import { drizzle } from 'drizzle-orm/node-postgres';
|
|
3
3
|
import { Pool } from 'pg';
|
|
4
|
+
import { deessePages } from './deesse.pages';
|
|
5
|
+
import { schema } from './db/schema/auth-schema';
|
|
4
6
|
|
|
5
7
|
export const config = defineConfig({
|
|
8
|
+
name: "DeesseJS App",
|
|
6
9
|
database: drizzle({
|
|
7
10
|
client: new Pool({
|
|
8
11
|
connectionString: process.env.DATABASE_URL,
|
|
9
12
|
}),
|
|
13
|
+
schema,
|
|
10
14
|
}),
|
|
11
|
-
|
|
15
|
+
pages: deessePages,
|
|
16
|
+
secret: process.env.DEESSE_SECRET!,
|
|
17
|
+
auth: {
|
|
18
|
+
baseURL: process.env.NEXT_PUBLIC_BASE_URL || 'http://localhost:3000',
|
|
19
|
+
},
|
|
20
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const deessePages = [];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<!-- BEGIN:nextjs-agent-rules -->
|
|
2
|
+
# This is NOT the Next.js you know
|
|
3
|
+
|
|
4
|
+
This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` before writing any code. Heed deprecation notices.
|
|
5
|
+
<!-- END:nextjs-agent-rules -->
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@AGENTS.md
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
|
|
2
|
+
|
|
3
|
+
## Getting Started
|
|
4
|
+
|
|
5
|
+
First, run the development server:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm run dev
|
|
9
|
+
# or
|
|
10
|
+
yarn dev
|
|
11
|
+
# or
|
|
12
|
+
pnpm dev
|
|
13
|
+
# or
|
|
14
|
+
bun dev
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
|
18
|
+
|
|
19
|
+
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
|
|
20
|
+
|
|
21
|
+
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
|
|
22
|
+
|
|
23
|
+
## Learn More
|
|
24
|
+
|
|
25
|
+
To learn more about Next.js, take a look at the following resources:
|
|
26
|
+
|
|
27
|
+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
|
28
|
+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
|
29
|
+
|
|
30
|
+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
|
|
31
|
+
|
|
32
|
+
## Deploy on Vercel
|
|
33
|
+
|
|
34
|
+
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
|
|
35
|
+
|
|
36
|
+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
|