shipd 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +205 -0
  3. package/dist/index.d.ts +1 -0
  4. package/dist/index.js +1366 -0
  5. package/docs-template/README.md +255 -0
  6. package/docs-template/[slug]/[subslug]/page.tsx +1242 -0
  7. package/docs-template/[slug]/page.tsx +422 -0
  8. package/docs-template/api/page.tsx +47 -0
  9. package/docs-template/components/docs/docs-category-page.tsx +162 -0
  10. package/docs-template/components/docs/docs-code-card.tsx +135 -0
  11. package/docs-template/components/docs/docs-header.tsx +69 -0
  12. package/docs-template/components/docs/docs-nav.ts +95 -0
  13. package/docs-template/components/docs/docs-sidebar.tsx +112 -0
  14. package/docs-template/components/docs/docs-toc.tsx +38 -0
  15. package/docs-template/components/ui/badge.tsx +47 -0
  16. package/docs-template/components/ui/button.tsx +60 -0
  17. package/docs-template/components/ui/card.tsx +93 -0
  18. package/docs-template/components/ui/sheet.tsx +140 -0
  19. package/docs-template/documentation/page.tsx +80 -0
  20. package/docs-template/layout.tsx +27 -0
  21. package/docs-template/lib/utils.ts +7 -0
  22. package/docs-template/page.tsx +360 -0
  23. package/package.json +66 -0
  24. package/template/.env.example +45 -0
  25. package/template/README.md +239 -0
  26. package/template/app/api/auth/[...all]/route.ts +4 -0
  27. package/template/app/api/chat/route.ts +16 -0
  28. package/template/app/api/subscription/route.ts +25 -0
  29. package/template/app/api/upload-image/route.ts +64 -0
  30. package/template/app/blog/[slug]/page.tsx +314 -0
  31. package/template/app/blog/page.tsx +107 -0
  32. package/template/app/dashboard/_components/chart-interactive.tsx +289 -0
  33. package/template/app/dashboard/_components/chatbot.tsx +39 -0
  34. package/template/app/dashboard/_components/mode-toggle.tsx +46 -0
  35. package/template/app/dashboard/_components/navbar.tsx +84 -0
  36. package/template/app/dashboard/_components/section-cards.tsx +102 -0
  37. package/template/app/dashboard/_components/sidebar.tsx +90 -0
  38. package/template/app/dashboard/_components/subscribe-button.tsx +49 -0
  39. package/template/app/dashboard/billing/page.tsx +277 -0
  40. package/template/app/dashboard/chat/page.tsx +73 -0
  41. package/template/app/dashboard/cli/page.tsx +260 -0
  42. package/template/app/dashboard/layout.tsx +24 -0
  43. package/template/app/dashboard/page.tsx +216 -0
  44. package/template/app/dashboard/payment/_components/manage-subscription.tsx +22 -0
  45. package/template/app/dashboard/payment/page.tsx +126 -0
  46. package/template/app/dashboard/settings/page.tsx +613 -0
  47. package/template/app/dashboard/upload/page.tsx +324 -0
  48. package/template/app/error.tsx +78 -0
  49. package/template/app/favicon.ico +0 -0
  50. package/template/app/globals.css +126 -0
  51. package/template/app/layout.tsx +135 -0
  52. package/template/app/not-found.tsx +45 -0
  53. package/template/app/page.tsx +28 -0
  54. package/template/app/pricing/_component/pricing-table.tsx +276 -0
  55. package/template/app/pricing/page.tsx +23 -0
  56. package/template/app/privacy-policy/page.tsx +280 -0
  57. package/template/app/robots.txt +12 -0
  58. package/template/app/sign-in/page.tsx +228 -0
  59. package/template/app/sign-up/page.tsx +243 -0
  60. package/template/app/sitemap.ts +62 -0
  61. package/template/app/success/page.tsx +123 -0
  62. package/template/app/terms-of-service/page.tsx +212 -0
  63. package/template/auth-schema.ts +47 -0
  64. package/template/components/homepage/cli-workflow-section.tsx +138 -0
  65. package/template/components/homepage/features-section.tsx +150 -0
  66. package/template/components/homepage/footer.tsx +53 -0
  67. package/template/components/homepage/hero-section.tsx +112 -0
  68. package/template/components/homepage/integrations.tsx +124 -0
  69. package/template/components/homepage/navigation.tsx +116 -0
  70. package/template/components/homepage/news-section.tsx +82 -0
  71. package/template/components/homepage/testimonials-section.tsx +34 -0
  72. package/template/components/logos/BetterAuth.tsx +21 -0
  73. package/template/components/logos/NeonPostgres.tsx +41 -0
  74. package/template/components/logos/Nextjs.tsx +72 -0
  75. package/template/components/logos/Polar.tsx +7 -0
  76. package/template/components/logos/TailwindCSS.tsx +27 -0
  77. package/template/components/logos/index.ts +6 -0
  78. package/template/components/logos/shadcnui.tsx +8 -0
  79. package/template/components/provider.tsx +8 -0
  80. package/template/components/ui/avatar.tsx +53 -0
  81. package/template/components/ui/badge.tsx +46 -0
  82. package/template/components/ui/button.tsx +59 -0
  83. package/template/components/ui/card.tsx +92 -0
  84. package/template/components/ui/chart.tsx +353 -0
  85. package/template/components/ui/checkbox.tsx +32 -0
  86. package/template/components/ui/dialog.tsx +135 -0
  87. package/template/components/ui/dropdown-menu.tsx +257 -0
  88. package/template/components/ui/form.tsx +167 -0
  89. package/template/components/ui/input.tsx +21 -0
  90. package/template/components/ui/label.tsx +24 -0
  91. package/template/components/ui/progress.tsx +31 -0
  92. package/template/components/ui/resizable.tsx +56 -0
  93. package/template/components/ui/select.tsx +185 -0
  94. package/template/components/ui/separator.tsx +28 -0
  95. package/template/components/ui/sheet.tsx +139 -0
  96. package/template/components/ui/skeleton.tsx +13 -0
  97. package/template/components/ui/sonner.tsx +25 -0
  98. package/template/components/ui/switch.tsx +31 -0
  99. package/template/components/ui/tabs.tsx +66 -0
  100. package/template/components/ui/textarea.tsx +18 -0
  101. package/template/components/ui/toggle-group.tsx +73 -0
  102. package/template/components/ui/toggle.tsx +47 -0
  103. package/template/components/ui/tooltip.tsx +61 -0
  104. package/template/components/user-profile.tsx +139 -0
  105. package/template/components.json +21 -0
  106. package/template/db/drizzle.ts +14 -0
  107. package/template/db/migrations/0000_worried_rawhide_kid.sql +77 -0
  108. package/template/db/migrations/meta/0000_snapshot.json +494 -0
  109. package/template/db/migrations/meta/_journal.json +13 -0
  110. package/template/db/schema.ts +85 -0
  111. package/template/drizzle.config.ts +13 -0
  112. package/template/emails/components/layout.tsx +181 -0
  113. package/template/emails/password-reset.tsx +67 -0
  114. package/template/emails/payment-failed.tsx +167 -0
  115. package/template/emails/subscription-confirmation.tsx +129 -0
  116. package/template/emails/welcome.tsx +100 -0
  117. package/template/eslint.config.mjs +16 -0
  118. package/template/hooks/use-mobile.ts +21 -0
  119. package/template/lib/auth-client.ts +8 -0
  120. package/template/lib/auth.ts +276 -0
  121. package/template/lib/email.ts +118 -0
  122. package/template/lib/polar-products.ts +49 -0
  123. package/template/lib/subscription.ts +148 -0
  124. package/template/lib/upload-image.ts +28 -0
  125. package/template/lib/utils.ts +6 -0
  126. package/template/middleware.ts +30 -0
  127. package/template/next-env.d.ts +5 -0
  128. package/template/next.config.ts +27 -0
  129. package/template/package.json +99 -0
  130. package/template/postcss.config.mjs +5 -0
  131. package/template/public/add.png +0 -0
  132. package/template/public/favicon.svg +4 -0
  133. package/template/public/file.svg +1 -0
  134. package/template/public/globe.svg +1 -0
  135. package/template/public/iphone.png +0 -0
  136. package/template/public/logo.png +0 -0
  137. package/template/public/next.svg +1 -0
  138. package/template/public/polar-sh.svg +1 -0
  139. package/template/public/shadcn-ui.svg +1 -0
  140. package/template/public/site.webmanifest +21 -0
  141. package/template/public/vercel.svg +1 -0
  142. package/template/public/window.svg +1 -0
  143. package/template/tailwind.config.ts +89 -0
  144. package/template/template.config.json +138 -0
  145. package/template/tsconfig.json +27 -0
@@ -0,0 +1,494 @@
1
+ {
2
+ "id": "888ccda8-7d0e-4ea2-9661-eca8ee6255e9",
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
+ "accountId": {
18
+ "name": "accountId",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "providerId": {
24
+ "name": "providerId",
25
+ "type": "text",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ },
29
+ "userId": {
30
+ "name": "userId",
31
+ "type": "text",
32
+ "primaryKey": false,
33
+ "notNull": true
34
+ },
35
+ "accessToken": {
36
+ "name": "accessToken",
37
+ "type": "text",
38
+ "primaryKey": false,
39
+ "notNull": false
40
+ },
41
+ "refreshToken": {
42
+ "name": "refreshToken",
43
+ "type": "text",
44
+ "primaryKey": false,
45
+ "notNull": false
46
+ },
47
+ "idToken": {
48
+ "name": "idToken",
49
+ "type": "text",
50
+ "primaryKey": false,
51
+ "notNull": false
52
+ },
53
+ "accessTokenExpiresAt": {
54
+ "name": "accessTokenExpiresAt",
55
+ "type": "timestamp",
56
+ "primaryKey": false,
57
+ "notNull": false
58
+ },
59
+ "refreshTokenExpiresAt": {
60
+ "name": "refreshTokenExpiresAt",
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
+ "createdAt": {
78
+ "name": "createdAt",
79
+ "type": "timestamp",
80
+ "primaryKey": false,
81
+ "notNull": true,
82
+ "default": "now()"
83
+ },
84
+ "updatedAt": {
85
+ "name": "updatedAt",
86
+ "type": "timestamp",
87
+ "primaryKey": false,
88
+ "notNull": true,
89
+ "default": "now()"
90
+ }
91
+ },
92
+ "indexes": {},
93
+ "foreignKeys": {
94
+ "account_userId_user_id_fk": {
95
+ "name": "account_userId_user_id_fk",
96
+ "tableFrom": "account",
97
+ "tableTo": "user",
98
+ "columnsFrom": [
99
+ "userId"
100
+ ],
101
+ "columnsTo": [
102
+ "id"
103
+ ],
104
+ "onDelete": "cascade",
105
+ "onUpdate": "no action"
106
+ }
107
+ },
108
+ "compositePrimaryKeys": {},
109
+ "uniqueConstraints": {},
110
+ "policies": {},
111
+ "checkConstraints": {},
112
+ "isRLSEnabled": false
113
+ },
114
+ "public.session": {
115
+ "name": "session",
116
+ "schema": "",
117
+ "columns": {
118
+ "id": {
119
+ "name": "id",
120
+ "type": "text",
121
+ "primaryKey": true,
122
+ "notNull": true
123
+ },
124
+ "expiresAt": {
125
+ "name": "expiresAt",
126
+ "type": "timestamp",
127
+ "primaryKey": false,
128
+ "notNull": true
129
+ },
130
+ "token": {
131
+ "name": "token",
132
+ "type": "text",
133
+ "primaryKey": false,
134
+ "notNull": true
135
+ },
136
+ "createdAt": {
137
+ "name": "createdAt",
138
+ "type": "timestamp",
139
+ "primaryKey": false,
140
+ "notNull": true,
141
+ "default": "now()"
142
+ },
143
+ "updatedAt": {
144
+ "name": "updatedAt",
145
+ "type": "timestamp",
146
+ "primaryKey": false,
147
+ "notNull": true,
148
+ "default": "now()"
149
+ },
150
+ "ipAddress": {
151
+ "name": "ipAddress",
152
+ "type": "text",
153
+ "primaryKey": false,
154
+ "notNull": false
155
+ },
156
+ "userAgent": {
157
+ "name": "userAgent",
158
+ "type": "text",
159
+ "primaryKey": false,
160
+ "notNull": false
161
+ },
162
+ "userId": {
163
+ "name": "userId",
164
+ "type": "text",
165
+ "primaryKey": false,
166
+ "notNull": true
167
+ }
168
+ },
169
+ "indexes": {},
170
+ "foreignKeys": {
171
+ "session_userId_user_id_fk": {
172
+ "name": "session_userId_user_id_fk",
173
+ "tableFrom": "session",
174
+ "tableTo": "user",
175
+ "columnsFrom": [
176
+ "userId"
177
+ ],
178
+ "columnsTo": [
179
+ "id"
180
+ ],
181
+ "onDelete": "cascade",
182
+ "onUpdate": "no action"
183
+ }
184
+ },
185
+ "compositePrimaryKeys": {},
186
+ "uniqueConstraints": {
187
+ "session_token_unique": {
188
+ "name": "session_token_unique",
189
+ "nullsNotDistinct": false,
190
+ "columns": [
191
+ "token"
192
+ ]
193
+ }
194
+ },
195
+ "policies": {},
196
+ "checkConstraints": {},
197
+ "isRLSEnabled": false
198
+ },
199
+ "public.subscription": {
200
+ "name": "subscription",
201
+ "schema": "",
202
+ "columns": {
203
+ "id": {
204
+ "name": "id",
205
+ "type": "text",
206
+ "primaryKey": true,
207
+ "notNull": true
208
+ },
209
+ "createdAt": {
210
+ "name": "createdAt",
211
+ "type": "timestamp",
212
+ "primaryKey": false,
213
+ "notNull": true
214
+ },
215
+ "modifiedAt": {
216
+ "name": "modifiedAt",
217
+ "type": "timestamp",
218
+ "primaryKey": false,
219
+ "notNull": false
220
+ },
221
+ "amount": {
222
+ "name": "amount",
223
+ "type": "integer",
224
+ "primaryKey": false,
225
+ "notNull": true
226
+ },
227
+ "currency": {
228
+ "name": "currency",
229
+ "type": "text",
230
+ "primaryKey": false,
231
+ "notNull": true
232
+ },
233
+ "recurringInterval": {
234
+ "name": "recurringInterval",
235
+ "type": "text",
236
+ "primaryKey": false,
237
+ "notNull": true
238
+ },
239
+ "status": {
240
+ "name": "status",
241
+ "type": "text",
242
+ "primaryKey": false,
243
+ "notNull": true
244
+ },
245
+ "currentPeriodStart": {
246
+ "name": "currentPeriodStart",
247
+ "type": "timestamp",
248
+ "primaryKey": false,
249
+ "notNull": true
250
+ },
251
+ "currentPeriodEnd": {
252
+ "name": "currentPeriodEnd",
253
+ "type": "timestamp",
254
+ "primaryKey": false,
255
+ "notNull": true
256
+ },
257
+ "cancelAtPeriodEnd": {
258
+ "name": "cancelAtPeriodEnd",
259
+ "type": "boolean",
260
+ "primaryKey": false,
261
+ "notNull": true,
262
+ "default": false
263
+ },
264
+ "canceledAt": {
265
+ "name": "canceledAt",
266
+ "type": "timestamp",
267
+ "primaryKey": false,
268
+ "notNull": false
269
+ },
270
+ "startedAt": {
271
+ "name": "startedAt",
272
+ "type": "timestamp",
273
+ "primaryKey": false,
274
+ "notNull": true
275
+ },
276
+ "endsAt": {
277
+ "name": "endsAt",
278
+ "type": "timestamp",
279
+ "primaryKey": false,
280
+ "notNull": false
281
+ },
282
+ "endedAt": {
283
+ "name": "endedAt",
284
+ "type": "timestamp",
285
+ "primaryKey": false,
286
+ "notNull": false
287
+ },
288
+ "customerId": {
289
+ "name": "customerId",
290
+ "type": "text",
291
+ "primaryKey": false,
292
+ "notNull": true
293
+ },
294
+ "productId": {
295
+ "name": "productId",
296
+ "type": "text",
297
+ "primaryKey": false,
298
+ "notNull": true
299
+ },
300
+ "discountId": {
301
+ "name": "discountId",
302
+ "type": "text",
303
+ "primaryKey": false,
304
+ "notNull": false
305
+ },
306
+ "checkoutId": {
307
+ "name": "checkoutId",
308
+ "type": "text",
309
+ "primaryKey": false,
310
+ "notNull": true
311
+ },
312
+ "customerCancellationReason": {
313
+ "name": "customerCancellationReason",
314
+ "type": "text",
315
+ "primaryKey": false,
316
+ "notNull": false
317
+ },
318
+ "customerCancellationComment": {
319
+ "name": "customerCancellationComment",
320
+ "type": "text",
321
+ "primaryKey": false,
322
+ "notNull": false
323
+ },
324
+ "metadata": {
325
+ "name": "metadata",
326
+ "type": "text",
327
+ "primaryKey": false,
328
+ "notNull": false
329
+ },
330
+ "customFieldData": {
331
+ "name": "customFieldData",
332
+ "type": "text",
333
+ "primaryKey": false,
334
+ "notNull": false
335
+ },
336
+ "userId": {
337
+ "name": "userId",
338
+ "type": "text",
339
+ "primaryKey": false,
340
+ "notNull": false
341
+ }
342
+ },
343
+ "indexes": {},
344
+ "foreignKeys": {
345
+ "subscription_userId_user_id_fk": {
346
+ "name": "subscription_userId_user_id_fk",
347
+ "tableFrom": "subscription",
348
+ "tableTo": "user",
349
+ "columnsFrom": [
350
+ "userId"
351
+ ],
352
+ "columnsTo": [
353
+ "id"
354
+ ],
355
+ "onDelete": "no action",
356
+ "onUpdate": "no action"
357
+ }
358
+ },
359
+ "compositePrimaryKeys": {},
360
+ "uniqueConstraints": {},
361
+ "policies": {},
362
+ "checkConstraints": {},
363
+ "isRLSEnabled": false
364
+ },
365
+ "public.user": {
366
+ "name": "user",
367
+ "schema": "",
368
+ "columns": {
369
+ "id": {
370
+ "name": "id",
371
+ "type": "text",
372
+ "primaryKey": true,
373
+ "notNull": true
374
+ },
375
+ "name": {
376
+ "name": "name",
377
+ "type": "text",
378
+ "primaryKey": false,
379
+ "notNull": true
380
+ },
381
+ "email": {
382
+ "name": "email",
383
+ "type": "text",
384
+ "primaryKey": false,
385
+ "notNull": true
386
+ },
387
+ "emailVerified": {
388
+ "name": "emailVerified",
389
+ "type": "boolean",
390
+ "primaryKey": false,
391
+ "notNull": true,
392
+ "default": false
393
+ },
394
+ "image": {
395
+ "name": "image",
396
+ "type": "text",
397
+ "primaryKey": false,
398
+ "notNull": false
399
+ },
400
+ "createdAt": {
401
+ "name": "createdAt",
402
+ "type": "timestamp",
403
+ "primaryKey": false,
404
+ "notNull": true,
405
+ "default": "now()"
406
+ },
407
+ "updatedAt": {
408
+ "name": "updatedAt",
409
+ "type": "timestamp",
410
+ "primaryKey": false,
411
+ "notNull": true,
412
+ "default": "now()"
413
+ }
414
+ },
415
+ "indexes": {},
416
+ "foreignKeys": {},
417
+ "compositePrimaryKeys": {},
418
+ "uniqueConstraints": {
419
+ "user_email_unique": {
420
+ "name": "user_email_unique",
421
+ "nullsNotDistinct": false,
422
+ "columns": [
423
+ "email"
424
+ ]
425
+ }
426
+ },
427
+ "policies": {},
428
+ "checkConstraints": {},
429
+ "isRLSEnabled": false
430
+ },
431
+ "public.verification": {
432
+ "name": "verification",
433
+ "schema": "",
434
+ "columns": {
435
+ "id": {
436
+ "name": "id",
437
+ "type": "text",
438
+ "primaryKey": true,
439
+ "notNull": true
440
+ },
441
+ "identifier": {
442
+ "name": "identifier",
443
+ "type": "text",
444
+ "primaryKey": false,
445
+ "notNull": true
446
+ },
447
+ "value": {
448
+ "name": "value",
449
+ "type": "text",
450
+ "primaryKey": false,
451
+ "notNull": true
452
+ },
453
+ "expiresAt": {
454
+ "name": "expiresAt",
455
+ "type": "timestamp",
456
+ "primaryKey": false,
457
+ "notNull": true
458
+ },
459
+ "createdAt": {
460
+ "name": "createdAt",
461
+ "type": "timestamp",
462
+ "primaryKey": false,
463
+ "notNull": true,
464
+ "default": "now()"
465
+ },
466
+ "updatedAt": {
467
+ "name": "updatedAt",
468
+ "type": "timestamp",
469
+ "primaryKey": false,
470
+ "notNull": true,
471
+ "default": "now()"
472
+ }
473
+ },
474
+ "indexes": {},
475
+ "foreignKeys": {},
476
+ "compositePrimaryKeys": {},
477
+ "uniqueConstraints": {},
478
+ "policies": {},
479
+ "checkConstraints": {},
480
+ "isRLSEnabled": false
481
+ }
482
+ },
483
+ "enums": {},
484
+ "schemas": {},
485
+ "sequences": {},
486
+ "roles": {},
487
+ "policies": {},
488
+ "views": {},
489
+ "_meta": {
490
+ "columns": {},
491
+ "schemas": {},
492
+ "tables": {}
493
+ }
494
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "version": "7",
3
+ "dialect": "postgresql",
4
+ "entries": [
5
+ {
6
+ "idx": 0,
7
+ "version": "7",
8
+ "when": 1749584207957,
9
+ "tag": "0000_worried_rawhide_kid",
10
+ "breakpoints": true
11
+ }
12
+ ]
13
+ }
@@ -0,0 +1,85 @@
1
+ import {
2
+ boolean,
3
+ integer,
4
+ pgTable,
5
+ text,
6
+ timestamp,
7
+ } from "drizzle-orm/pg-core";
8
+
9
+ // Better Auth Tables
10
+ export const user = pgTable("user", {
11
+ id: text("id").primaryKey(),
12
+ name: text("name").notNull(),
13
+ email: text("email").notNull().unique(),
14
+ emailVerified: boolean("emailVerified").notNull().default(false),
15
+ image: text("image"),
16
+ createdAt: timestamp("createdAt").notNull().defaultNow(),
17
+ updatedAt: timestamp("updatedAt").notNull().defaultNow(),
18
+ });
19
+
20
+ export const session = pgTable("session", {
21
+ id: text("id").primaryKey(),
22
+ expiresAt: timestamp("expiresAt").notNull(),
23
+ token: text("token").notNull().unique(),
24
+ createdAt: timestamp("createdAt").notNull().defaultNow(),
25
+ updatedAt: timestamp("updatedAt").notNull().defaultNow(),
26
+ ipAddress: text("ipAddress"),
27
+ userAgent: text("userAgent"),
28
+ userId: text("userId")
29
+ .notNull()
30
+ .references(() => user.id, { onDelete: "cascade" }),
31
+ });
32
+
33
+ export const account = pgTable("account", {
34
+ id: text("id").primaryKey(),
35
+ accountId: text("accountId").notNull(),
36
+ providerId: text("providerId").notNull(),
37
+ userId: text("userId")
38
+ .notNull()
39
+ .references(() => user.id, { onDelete: "cascade" }),
40
+ accessToken: text("accessToken"),
41
+ refreshToken: text("refreshToken"),
42
+ idToken: text("idToken"),
43
+ accessTokenExpiresAt: timestamp("accessTokenExpiresAt"),
44
+ refreshTokenExpiresAt: timestamp("refreshTokenExpiresAt"),
45
+ scope: text("scope"),
46
+ password: text("password"),
47
+ createdAt: timestamp("createdAt").notNull().defaultNow(),
48
+ updatedAt: timestamp("updatedAt").notNull().defaultNow(),
49
+ });
50
+
51
+ export const verification = pgTable("verification", {
52
+ id: text("id").primaryKey(),
53
+ identifier: text("identifier").notNull(),
54
+ value: text("value").notNull(),
55
+ expiresAt: timestamp("expiresAt").notNull(),
56
+ createdAt: timestamp("createdAt").notNull().defaultNow(),
57
+ updatedAt: timestamp("updatedAt").notNull().defaultNow(),
58
+ });
59
+
60
+ // Subscription table for Polar webhook data
61
+ export const subscription = pgTable("subscription", {
62
+ id: text("id").primaryKey(),
63
+ createdAt: timestamp("createdAt").notNull(),
64
+ modifiedAt: timestamp("modifiedAt"),
65
+ amount: integer("amount").notNull(),
66
+ currency: text("currency").notNull(),
67
+ recurringInterval: text("recurringInterval").notNull(),
68
+ status: text("status").notNull(),
69
+ currentPeriodStart: timestamp("currentPeriodStart").notNull(),
70
+ currentPeriodEnd: timestamp("currentPeriodEnd").notNull(),
71
+ cancelAtPeriodEnd: boolean("cancelAtPeriodEnd").notNull().default(false),
72
+ canceledAt: timestamp("canceledAt"),
73
+ startedAt: timestamp("startedAt").notNull(),
74
+ endsAt: timestamp("endsAt"),
75
+ endedAt: timestamp("endedAt"),
76
+ customerId: text("customerId").notNull(),
77
+ productId: text("productId").notNull(),
78
+ discountId: text("discountId"),
79
+ checkoutId: text("checkoutId").notNull(),
80
+ customerCancellationReason: text("customerCancellationReason"),
81
+ customerCancellationComment: text("customerCancellationComment"),
82
+ metadata: text("metadata"), // JSON string
83
+ customFieldData: text("customFieldData"), // JSON string
84
+ userId: text("userId").references(() => user.id),
85
+ });
@@ -0,0 +1,13 @@
1
+ import { config } from 'dotenv';
2
+ import { defineConfig } from "drizzle-kit";
3
+
4
+ config({ path: '.env' });
5
+
6
+ export default defineConfig({
7
+ schema: "./db/schema.ts",
8
+ out: "./db/migrations",
9
+ dialect: "postgresql",
10
+ dbCredentials: {
11
+ url: process.env.DATABASE_URL!,
12
+ },
13
+ });