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,24 @@
1
+ import { ReactNode } from "react";
2
+ import DashboardTopNav from "./_components/navbar";
3
+ import DashboardSideBar from "./_components/sidebar";
4
+ /*AI_CHAT_START*/
5
+ import Chatbot from "./_components/chatbot";
6
+ /*AI_CHAT_END*/
7
+
8
+ export default async function DashboardLayout({
9
+ children,
10
+ }: {
11
+ children: ReactNode;
12
+ }) {
13
+ return (
14
+ <div className="flex h-screen overflow-hidden w-full">
15
+ <DashboardSideBar />
16
+ <main className="flex-1 overflow-y-auto">
17
+ <DashboardTopNav>{children}</DashboardTopNav>
18
+ </main>
19
+ {/*AI_CHAT_START*/}
20
+ <Chatbot />
21
+ {/*AI_CHAT_END*/}
22
+ </div>
23
+ );
24
+ }
@@ -0,0 +1,216 @@
1
+ import { auth } from "@/lib/auth";
2
+ import { headers } from "next/headers";
3
+ import { redirect } from "next/navigation";
4
+ import Link from "next/link";
5
+ import { Button } from "@/components/ui/button";
6
+ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
7
+ import { Badge } from "@/components/ui/badge";
8
+ import { Terminal, Zap, BookOpen, CreditCard, Download, CheckCircle2, XCircle } from "lucide-react";
9
+ import { getSubscriptionDetails } from "@/lib/subscription";
10
+ import { SubscribeButton } from "./_components/subscribe-button";
11
+
12
+ export default async function Dashboard() {
13
+ const session = await auth.api.getSession({
14
+ headers: await headers(),
15
+ });
16
+
17
+ if (!session?.session?.userId) {
18
+ redirect("/sign-in");
19
+ }
20
+
21
+ const subscription = await getSubscriptionDetails();
22
+ const user = session.user;
23
+
24
+ // Check if user has an active subscription
25
+ const hasActiveSubscription =
26
+ subscription.hasSubscription &&
27
+ subscription.subscription?.status === "active";
28
+
29
+ return (
30
+ <section className="flex flex-col items-start justify-start p-6 w-full max-w-7xl mx-auto">
31
+ {/* Header */}
32
+ <div className="w-full mb-8">
33
+ <h1 className="text-3xl font-bold tracking-tight text-white">
34
+ Welcome back, {user?.name || user?.email}
35
+ </h1>
36
+ <p className="text-gray-400 mt-2">
37
+ Manage your SaaS Scaffold subscription and start building.
38
+ </p>
39
+ </div>
40
+
41
+ {/* Subscription Status Card */}
42
+ <div className="w-full mb-6">
43
+ <Card className="bg-gradient-to-br from-[#1a1a1a] to-[#0a0a0a] border-[#2a2a2a]">
44
+ <CardHeader>
45
+ <div className="flex items-center justify-between">
46
+ <div>
47
+ <CardTitle className="text-white">Subscription Status</CardTitle>
48
+ <CardDescription>Your current plan and access level</CardDescription>
49
+ </div>
50
+ <div>
51
+ {hasActiveSubscription ? (
52
+ <Badge className="bg-green-500/20 text-green-400 border-green-500/30">
53
+ <CheckCircle2 className="w-3 h-3 mr-1" />
54
+ Active
55
+ </Badge>
56
+ ) : (
57
+ <Badge className="bg-red-500/20 text-red-400 border-red-500/30">
58
+ <XCircle className="w-3 h-3 mr-1" />
59
+ Inactive
60
+ </Badge>
61
+ )}
62
+ </div>
63
+ </div>
64
+ </CardHeader>
65
+ <CardContent>
66
+ {hasActiveSubscription ? (
67
+ <div className="space-y-4">
68
+ <div className="flex items-center justify-between">
69
+ <div>
70
+ <p className="text-sm text-gray-400">Plan</p>
71
+ <p className="text-lg font-semibold text-white">
72
+ {subscription.subscription?.productId || 'Premium'}
73
+ </p>
74
+ </div>
75
+ <div>
76
+ <p className="text-sm text-gray-400">Status</p>
77
+ <p className="text-lg font-semibold text-white capitalize">
78
+ {subscription.subscription?.status || 'Active'}
79
+ </p>
80
+ </div>
81
+ <div>
82
+ <p className="text-sm text-gray-400">Billing</p>
83
+ <p className="text-lg font-semibold text-white">
84
+ ${(subscription.subscription?.amount || 0) / 100}/{subscription.subscription?.recurringInterval || 'month'}
85
+ </p>
86
+ </div>
87
+ </div>
88
+ <div className="pt-4 border-t border-[#2a2a2a]">
89
+ <Link href="/dashboard/billing">
90
+ <Button variant="outline" className="w-full border-[#2a2a2a] hover:bg-[#1a1a1a]">
91
+ <CreditCard className="w-4 h-4 mr-2" />
92
+ Manage Subscription
93
+ </Button>
94
+ </Link>
95
+ </div>
96
+ </div>
97
+ ) : (
98
+ <div className="space-y-4 text-center py-4">
99
+ <p className="text-gray-400 mb-4">
100
+ You don&apos;t have an active subscription. Subscribe to get started.
101
+ </p>
102
+ <SubscribeButton />
103
+ <Link href="/pricing" className="block mt-2">
104
+ <Button variant="ghost" className="text-gray-400 hover:text-white text-sm">
105
+ View pricing details
106
+ </Button>
107
+ </Link>
108
+ </div>
109
+ )}
110
+ </CardContent>
111
+ </Card>
112
+ </div>
113
+
114
+ {/* Quick Start Guide */}
115
+ {hasActiveSubscription && (
116
+ <div className="w-full mb-6">
117
+ <Card className="bg-[#0a0a0a] border-[#2a2a2a]">
118
+ <CardHeader>
119
+ <CardTitle className="text-white flex items-center">
120
+ <Terminal className="w-5 h-5 mr-2 text-[#ff5722]" />
121
+ Quick Start
122
+ </CardTitle>
123
+ <CardDescription>Get started with SaaS Scaffold CLI in minutes</CardDescription>
124
+ </CardHeader>
125
+ <CardContent className="space-y-4">
126
+ <div>
127
+ <p className="text-sm text-gray-400 mb-2">1. Authenticate the CLI</p>
128
+ <div className="bg-black/50 p-4 rounded-lg border border-[#2a2a2a]">
129
+ <code className="text-[#ff5722] font-mono text-sm">
130
+ npx saas-scaffold login
131
+ </code>
132
+ </div>
133
+ </div>
134
+ <div>
135
+ <p className="text-sm text-gray-400 mb-2">2. Create your first project</p>
136
+ <div className="bg-black/50 p-4 rounded-lg border border-[#2a2a2a]">
137
+ <code className="text-[#ff5722] font-mono text-sm">
138
+ npx saas-scaffold init my-saas-app
139
+ </code>
140
+ </div>
141
+ </div>
142
+ <div className="pt-2">
143
+ <Link href="/dashboard/cli">
144
+ <Button variant="outline" className="border-[#2a2a2a] hover:bg-[#1a1a1a]">
145
+ <Download className="w-4 h-4 mr-2" />
146
+ View Full CLI Guide
147
+ </Button>
148
+ </Link>
149
+ </div>
150
+ </CardContent>
151
+ </Card>
152
+ </div>
153
+ )}
154
+
155
+ {/* Quick Actions Grid */}
156
+ <div className="w-full">
157
+ <h2 className="text-xl font-semibold text-white mb-4">Quick Actions</h2>
158
+ <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
159
+ {/* Documentation */}
160
+ <Link href="/docs">
161
+ <Card className="bg-[#0a0a0a] border-[#2a2a2a] hover:border-[#ff5722]/50 transition-colors cursor-pointer h-full">
162
+ <CardHeader>
163
+ <BookOpen className="w-8 h-8 text-[#ff5722] mb-2" />
164
+ <CardTitle className="text-white">Documentation</CardTitle>
165
+ <CardDescription>
166
+ Learn how to use SaaS Scaffold and build your SaaS
167
+ </CardDescription>
168
+ </CardHeader>
169
+ </Card>
170
+ </Link>
171
+
172
+ {/* Billing */}
173
+ <Link href="/dashboard/billing">
174
+ <Card className="bg-[#0a0a0a] border-[#2a2a2a] hover:border-[#ff5722]/50 transition-colors cursor-pointer h-full">
175
+ <CardHeader>
176
+ <CreditCard className="w-8 h-8 text-[#ff5722] mb-2" />
177
+ <CardTitle className="text-white">Billing</CardTitle>
178
+ <CardDescription>
179
+ Manage your subscription and payment methods
180
+ </CardDescription>
181
+ </CardHeader>
182
+ </Card>
183
+ </Link>
184
+ </div>
185
+ </div>
186
+
187
+ {/* Help Section */}
188
+ <div className="w-full mt-8">
189
+ <Card className="bg-[#1a1a1a] border-[#2a2a2a]">
190
+ <CardContent className="p-6">
191
+ <div className="flex items-center justify-between">
192
+ <div>
193
+ <h3 className="text-lg font-semibold text-white mb-1">Need Help?</h3>
194
+ <p className="text-gray-400 text-sm">
195
+ Check out our documentation or contact support
196
+ </p>
197
+ </div>
198
+ <div className="flex gap-2">
199
+ <Link href="/docs">
200
+ <Button variant="outline" className="border-[#2a2a2a] hover:bg-[#0a0a0a]">
201
+ View Docs
202
+ </Button>
203
+ </Link>
204
+ <Link href="mailto:support@saas-scaffold.com">
205
+ <Button className="bg-[#ff5722] hover:bg-[#d84315]">
206
+ Contact Support
207
+ </Button>
208
+ </Link>
209
+ </div>
210
+ </div>
211
+ </CardContent>
212
+ </Card>
213
+ </div>
214
+ </section>
215
+ );
216
+ }
@@ -0,0 +1,22 @@
1
+ "use client";
2
+ import { Button } from "@/components/ui/button";
3
+ import { ExternalLink } from "lucide-react";
4
+ import { authClient } from "@/lib/auth-client";
5
+
6
+ export default function ManageSubscription() {
7
+ return (
8
+ <Button
9
+ variant="outline"
10
+ onClick={async () => {
11
+ try {
12
+ await authClient.customer.portal();
13
+ } catch (error) {
14
+ console.error("Failed to open customer portal:", error);
15
+ }
16
+ }}
17
+ >
18
+ <ExternalLink className="h-4 w-4 mr-2" />
19
+ Manage Subscription
20
+ </Button>
21
+ );
22
+ }
@@ -0,0 +1,126 @@
1
+ import { Button } from "@/components/ui/button";
2
+ import {
3
+ Card,
4
+ CardContent,
5
+ CardDescription,
6
+ CardHeader,
7
+ CardTitle,
8
+ } from "@/components/ui/card";
9
+ import { getSubscriptionDetails } from "@/lib/subscription";
10
+ import Link from "next/link";
11
+ import ManageSubscription from "./_components/manage-subscription";
12
+
13
+ export default async function PaymentPage() {
14
+ const subscriptionDetails = await getSubscriptionDetails();
15
+
16
+ return (
17
+ <div>
18
+ <div className="p-6 space-y-4">
19
+ <div className="relative min-h-screen">
20
+ {!subscriptionDetails.hasSubscription ||
21
+ subscriptionDetails.subscription?.status !== "active" ? (
22
+ <>
23
+ <div className="absolute inset-0 z-10 rounded-lg flex items-center justify-center">
24
+ <div className="bg-white dark:bg-gray-900 p-8 rounded-lg shadow-lg text-center max-w-md">
25
+ <h3 className="text-xl font-semibold mb-2">
26
+ Subscription Required
27
+ </h3>
28
+ <p className="text-muted-foreground mb-4">
29
+ You need an active subscription to access payment management
30
+ features.
31
+ </p>
32
+ <Link href="/pricing">
33
+ <Button>Subscribe Now</Button>
34
+ </Link>
35
+ </div>
36
+ </div>
37
+ <div className="blur-sm pointer-events-none">
38
+ <Card>
39
+ <CardHeader>
40
+ <CardTitle>Payment Management</CardTitle>
41
+ <CardDescription>
42
+ Manage your billing and payment methods
43
+ </CardDescription>
44
+ </CardHeader>
45
+ <CardContent className="space-y-4">
46
+ <div className="grid grid-cols-2 gap-4">
47
+ <div>
48
+ <p className="text-sm font-medium text-muted-foreground">
49
+ Current Plan
50
+ </p>
51
+ <p className="text-md">Pro Plan</p>
52
+ </div>
53
+ <div>
54
+ <p className="text-sm font-medium text-muted-foreground">
55
+ Billing Status
56
+ </p>
57
+ <p className="text-md">Active</p>
58
+ </div>
59
+ </div>
60
+ </CardContent>
61
+ </Card>
62
+ </div>
63
+ </>
64
+ ) : (
65
+ <Card>
66
+ <CardHeader>
67
+ <CardTitle>Subscription Details</CardTitle>
68
+ <CardDescription>
69
+ Your current subscription information
70
+ </CardDescription>
71
+ </CardHeader>
72
+ <CardContent className="space-y-4">
73
+ <div className="grid grid-cols-2 gap-4">
74
+ <div>
75
+ <p className="text-sm font-semibold text-muted-foreground">
76
+ Status
77
+ </p>
78
+ <p className="text-md capitalize">
79
+ {subscriptionDetails.subscription.status}
80
+ </p>
81
+ </div>
82
+ <div>
83
+ <p className="text-sm font-semibold text-muted-foreground">
84
+ Amount
85
+ </p>
86
+ <p className="text-md">
87
+ {subscriptionDetails.subscription.amount / 100}{" "}
88
+ {subscriptionDetails.subscription.currency.toUpperCase()}
89
+ </p>
90
+ </div>
91
+ <div>
92
+ <p className="text-sm font-semibold text-muted-foreground">
93
+ Billing Interval
94
+ </p>
95
+ <p className="text-md capitalize">
96
+ {subscriptionDetails.subscription.recurringInterval}
97
+ </p>
98
+ </div>
99
+ <div>
100
+ <p className="text-sm font-semibold text-muted-foreground">
101
+ Current Period End
102
+ </p>
103
+ <p className="text-md">
104
+ {new Date(
105
+ subscriptionDetails.subscription.currentPeriodEnd,
106
+ ).toLocaleDateString()}
107
+ </p>
108
+ </div>
109
+ </div>
110
+ {subscriptionDetails.subscription.cancelAtPeriodEnd && (
111
+ <div className="p-4 bg-yellow-50 border border-yellow-200 rounded-lg">
112
+ <p className="text-sm text-yellow-800">
113
+ Your subscription will cancel at the end of the current
114
+ billing period.
115
+ </p>
116
+ </div>
117
+ )}
118
+ <ManageSubscription />
119
+ </CardContent>
120
+ </Card>
121
+ )}
122
+ </div>
123
+ </div>
124
+ </div>
125
+ );
126
+ }