@digilogiclabs/create-saas-app 1.1.2 → 1.3.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.
- package/CHANGELOG.md +7 -7
- package/bin/index.js +36 -36
- package/dist/.tsbuildinfo +1 -1
- package/dist/index.js +56 -12
- package/dist/index.js.map +1 -1
- package/dist/templates/mobile/base/template/.env.example +15 -15
- package/dist/templates/mobile/base/template/app/checkout.tsx +20 -20
- package/dist/templates/web/base/template/src/app/checkout/page.tsx +28 -28
- package/dist/templates/web/ui-auth/template/next.config.js +12 -0
- package/dist/templates/web/ui-auth/template/package.json +40 -0
- package/dist/templates/web/ui-auth/template/postcss.config.js +7 -0
- package/dist/templates/web/ui-auth/template/src/app/auth/callback/route.ts +12 -0
- package/{src/templates/web/web-ui-package → dist/templates/web/ui-auth}/template/src/app/checkout/page.tsx +25 -28
- package/dist/templates/web/ui-auth/template/src/app/globals.css +42 -0
- package/dist/templates/web/ui-auth/template/src/app/layout.tsx +29 -0
- package/dist/templates/web/ui-auth/template/src/app/login/page.tsx +109 -0
- package/dist/templates/web/ui-auth/template/src/app/page.tsx +129 -0
- package/dist/templates/web/ui-auth/template/src/app/signup/page.tsx +128 -0
- package/dist/templates/web/ui-auth/template/src/components/providers/app-providers.tsx +25 -0
- package/{src/templates/web/web-ui-package → dist/templates/web/ui-auth}/template/src/components/shared/header.tsx +17 -8
- package/dist/templates/web/ui-auth/template/src/components/ui/badge.tsx +36 -0
- package/dist/templates/web/ui-auth/template/src/lib/utils.ts +7 -0
- package/dist/templates/web/ui-auth/template/tailwind.config.js +77 -0
- package/dist/templates/web/ui-auth/template/tsconfig.json +33 -0
- package/dist/templates/web/ui-auth-payments/template/README.md +165 -0
- package/dist/templates/web/ui-auth-payments/template/next.config.js +12 -0
- package/dist/templates/web/ui-auth-payments/template/package.json +42 -0
- package/dist/templates/web/ui-auth-payments/template/postcss.config.js +7 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/auth/callback/route.ts +12 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/billing/page.tsx +211 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/checkout/page.tsx +142 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/globals.css +42 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/layout.tsx +29 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/login/page.tsx +109 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/page.tsx +143 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/signup/page.tsx +128 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/providers/app-providers.tsx +28 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/shared/header.tsx +60 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/ui/badge.tsx +36 -0
- package/dist/templates/web/ui-auth-payments/template/src/lib/utils.ts +7 -0
- package/dist/templates/web/ui-auth-payments/template/tailwind.config.js +77 -0
- package/dist/templates/web/ui-auth-payments/template/tsconfig.json +33 -0
- package/dist/templates/web/ui-auth-payments-audio/template/README.md +187 -0
- package/{src/templates/web/web-ui-package → dist/templates/web/ui-auth-payments-audio}/template/next.config.js +0 -3
- package/dist/templates/web/ui-auth-payments-audio/template/package.json +42 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/auth/callback/route.ts +12 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/billing/page.tsx +211 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/checkout/page.tsx +142 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/login/page.tsx +109 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/page.tsx +181 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/signup/page.tsx +128 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/providers/app-providers.tsx +28 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/shared/header.tsx +60 -0
- package/{src/templates/web/web-ui-package → dist/templates/web/ui-auth-payments-audio}/template/tailwind.config.js +1 -1
- package/dist/templates/web/ui-auth-payments-video/template/README.md +190 -0
- package/dist/templates/web/{web-ui-package → ui-auth-payments-video}/template/next.config.js +0 -3
- package/dist/templates/web/ui-auth-payments-video/template/package.json +42 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/app/auth/callback/route.ts +12 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/app/billing/page.tsx +211 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/app/checkout/page.tsx +142 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/app/login/page.tsx +109 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/app/page.tsx +187 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/app/signup/page.tsx +128 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/components/providers/app-providers.tsx +28 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/components/shared/header.tsx +60 -0
- package/dist/templates/web/{web-ui-package → ui-auth-payments-video}/template/tailwind.config.js +1 -1
- package/dist/templates/web/ui-only/template/next.config.js +12 -0
- package/dist/templates/web/{web-ui-package → ui-only}/template/package.json +3 -3
- package/dist/templates/web/ui-only/template/postcss.config.js +7 -0
- package/dist/templates/web/ui-only/template/src/app/auth/callback/route.ts +12 -0
- package/dist/templates/web/{web-ui-package → ui-only}/template/src/app/checkout/page.tsx +25 -28
- package/dist/templates/web/ui-only/template/src/app/globals.css +42 -0
- package/dist/templates/web/ui-only/template/src/app/layout.tsx +29 -0
- package/dist/templates/web/ui-only/template/src/app/login/page.tsx +63 -0
- package/dist/templates/web/ui-only/template/src/app/signup/page.tsx +79 -0
- package/dist/templates/web/ui-only/template/src/components/providers/app-providers.tsx +22 -0
- package/dist/templates/web/{web-ui-package → ui-only}/template/src/components/shared/header.tsx +17 -8
- package/dist/templates/web/ui-only/template/src/components/ui/badge.tsx +36 -0
- package/dist/templates/web/ui-only/template/src/lib/utils.ts +7 -0
- package/dist/templates/web/ui-only/template/tailwind.config.js +77 -0
- package/dist/templates/web/ui-only/template/tsconfig.json +33 -0
- package/dist/templates/web/ui-package-test/template/package.json +2 -2
- package/package.json +1 -1
- package/src/templates/mobile/base/template/.env.example +15 -15
- package/src/templates/mobile/base/template/app/checkout.tsx +20 -20
- package/src/templates/web/base/template/src/app/checkout/page.tsx +28 -28
- package/src/templates/web/ui-auth/template/README.md +68 -0
- package/src/templates/web/ui-auth/template/next.config.js +12 -0
- package/src/templates/web/ui-auth/template/package.json +40 -0
- package/src/templates/web/ui-auth/template/postcss.config.js +7 -0
- package/src/templates/web/ui-auth/template/src/app/auth/callback/route.ts +12 -0
- package/src/templates/web/ui-auth/template/src/app/checkout/page.tsx +25 -0
- package/src/templates/web/ui-auth/template/src/app/globals.css +42 -0
- package/src/templates/web/ui-auth/template/src/app/layout.tsx +29 -0
- package/src/templates/web/ui-auth/template/src/app/login/page.tsx +109 -0
- package/src/templates/web/ui-auth/template/src/app/page.tsx +129 -0
- package/src/templates/web/ui-auth/template/src/app/signup/page.tsx +128 -0
- package/src/templates/web/ui-auth/template/src/components/providers/app-providers.tsx +25 -0
- package/src/templates/web/ui-auth/template/src/components/shared/header.tsx +51 -0
- package/src/templates/web/ui-auth/template/src/components/ui/badge.tsx +36 -0
- package/src/templates/web/ui-auth/template/src/lib/utils.ts +7 -0
- package/src/templates/web/ui-auth/template/tailwind.config.js +77 -0
- package/src/templates/web/ui-auth/template/tsconfig.json +33 -0
- package/src/templates/web/ui-auth-payments/template/README.md +165 -0
- package/src/templates/web/ui-auth-payments/template/next.config.js +12 -0
- package/src/templates/web/ui-auth-payments/template/package.json +42 -0
- package/src/templates/web/ui-auth-payments/template/postcss.config.js +7 -0
- package/src/templates/web/ui-auth-payments/template/src/app/auth/callback/route.ts +12 -0
- package/src/templates/web/ui-auth-payments/template/src/app/billing/page.tsx +211 -0
- package/src/templates/web/ui-auth-payments/template/src/app/checkout/page.tsx +142 -0
- package/src/templates/web/ui-auth-payments/template/src/app/globals.css +42 -0
- package/src/templates/web/ui-auth-payments/template/src/app/layout.tsx +29 -0
- package/src/templates/web/ui-auth-payments/template/src/app/login/page.tsx +109 -0
- package/src/templates/web/ui-auth-payments/template/src/app/page.tsx +143 -0
- package/src/templates/web/ui-auth-payments/template/src/app/signup/page.tsx +128 -0
- package/src/templates/web/ui-auth-payments/template/src/components/providers/app-providers.tsx +28 -0
- package/src/templates/web/ui-auth-payments/template/src/components/shared/header.tsx +60 -0
- package/src/templates/web/ui-auth-payments/template/src/components/ui/badge.tsx +36 -0
- package/src/templates/web/ui-auth-payments/template/src/lib/utils.ts +7 -0
- package/src/templates/web/ui-auth-payments/template/tailwind.config.js +77 -0
- package/src/templates/web/ui-auth-payments/template/tsconfig.json +33 -0
- package/src/templates/web/ui-auth-payments-audio/template/README.md +187 -0
- package/src/templates/web/ui-auth-payments-audio/template/next.config.js +12 -0
- package/src/templates/web/ui-auth-payments-audio/template/package.json +42 -0
- package/src/templates/web/ui-auth-payments-audio/template/postcss.config.js +7 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/app/auth/callback/route.ts +12 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/app/billing/page.tsx +211 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/app/checkout/page.tsx +142 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/app/globals.css +42 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/app/layout.tsx +29 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/app/login/page.tsx +109 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/app/page.tsx +181 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/app/signup/page.tsx +128 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/components/providers/app-providers.tsx +28 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/components/shared/header.tsx +60 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/components/ui/badge.tsx +36 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/lib/utils.ts +7 -0
- package/src/templates/web/ui-auth-payments-audio/template/tailwind.config.js +77 -0
- package/src/templates/web/ui-auth-payments-audio/template/tsconfig.json +33 -0
- package/src/templates/web/ui-auth-payments-video/template/README.md +190 -0
- package/src/templates/web/ui-auth-payments-video/template/next.config.js +12 -0
- package/src/templates/web/ui-auth-payments-video/template/package.json +42 -0
- package/src/templates/web/ui-auth-payments-video/template/postcss.config.js +7 -0
- package/src/templates/web/ui-auth-payments-video/template/src/app/auth/callback/route.ts +12 -0
- package/src/templates/web/ui-auth-payments-video/template/src/app/billing/page.tsx +211 -0
- package/src/templates/web/ui-auth-payments-video/template/src/app/checkout/page.tsx +142 -0
- package/src/templates/web/ui-auth-payments-video/template/src/app/globals.css +42 -0
- package/src/templates/web/ui-auth-payments-video/template/src/app/layout.tsx +29 -0
- package/src/templates/web/ui-auth-payments-video/template/src/app/login/page.tsx +109 -0
- package/src/templates/web/ui-auth-payments-video/template/src/app/page.tsx +187 -0
- package/src/templates/web/ui-auth-payments-video/template/src/app/signup/page.tsx +128 -0
- package/src/templates/web/ui-auth-payments-video/template/src/components/providers/app-providers.tsx +28 -0
- package/src/templates/web/ui-auth-payments-video/template/src/components/shared/header.tsx +60 -0
- package/src/templates/web/ui-auth-payments-video/template/src/components/ui/badge.tsx +36 -0
- package/src/templates/web/ui-auth-payments-video/template/src/lib/utils.ts +7 -0
- package/src/templates/web/ui-auth-payments-video/template/tailwind.config.js +77 -0
- package/src/templates/web/ui-auth-payments-video/template/tsconfig.json +33 -0
- package/src/templates/web/ui-only/template/.env.example +15 -0
- package/src/templates/web/ui-only/template/README.md +68 -0
- package/src/templates/web/ui-only/template/next.config.js +12 -0
- package/src/templates/web/{web-ui-package → ui-only}/template/package.json +3 -3
- package/src/templates/web/ui-only/template/postcss.config.js +7 -0
- package/src/templates/web/ui-only/template/src/app/auth/callback/route.ts +12 -0
- package/src/templates/web/ui-only/template/src/app/checkout/page.tsx +25 -0
- package/src/templates/web/ui-only/template/src/app/globals.css +42 -0
- package/src/templates/web/ui-only/template/src/app/layout.tsx +29 -0
- package/src/templates/web/ui-only/template/src/app/login/page.tsx +63 -0
- package/src/templates/web/ui-only/template/src/app/signup/page.tsx +79 -0
- package/src/templates/web/ui-only/template/src/components/providers/app-providers.tsx +22 -0
- package/src/templates/web/ui-only/template/src/components/shared/header.tsx +51 -0
- package/src/templates/web/ui-only/template/src/components/ui/badge.tsx +36 -0
- package/src/templates/web/ui-only/template/src/lib/utils.ts +7 -0
- package/src/templates/web/ui-only/template/tailwind.config.js +77 -0
- package/src/templates/web/ui-only/template/tsconfig.json +33 -0
- package/src/templates/web/ui-only/template.backup/.env.example +15 -0
- package/{dist/mobile/base/template → src/templates/web/ui-only/template.backup.20250817}/.env.example +15 -15
- package/src/templates/web/ui-package-test/template/package.json +2 -2
- package/dist/templates/web/web-ui-package/template/src/app/auth/callback/route.ts +0 -18
- package/dist/templates/web/web-ui-package/template/src/app/login/page.tsx +0 -39
- package/dist/templates/web/web-ui-package/template/src/app/signup/page.tsx +0 -39
- package/dist/templates/web/web-ui-package/template/src/components/providers/app-providers.tsx +0 -29
- package/src/templates/web/web-ui-package/template/.eslintrc.js +0 -8
- package/src/templates/web/web-ui-package/template/src/app/auth/callback/route.ts +0 -18
- package/src/templates/web/web-ui-package/template/src/app/login/page.tsx +0 -39
- package/src/templates/web/web-ui-package/template/src/app/signup/page.tsx +0 -39
- package/src/templates/web/web-ui-package/template/src/components/providers/app-providers.tsx +0 -29
- /package/dist/{web/base → templates/web/ui-auth}/template/.env.example +0 -0
- /package/dist/templates/web/{web-ui-package → ui-auth}/template/.eslintrc.js +0 -0
- /package/dist/templates/web/{web-ui-package → ui-auth}/template/README.md +0 -0
- /package/dist/{web/base → templates/web/ui-auth}/template.backup/.env.example +0 -0
- /package/dist/{web/base → templates/web/ui-auth}/template.backup.20250817/.env.example +0 -0
- /package/dist/templates/web/{web-ui-package → ui-auth-payments}/template/.env.example +0 -0
- /package/dist/templates/web/{web-ui-package/template.backup.20250817 → ui-auth-payments-audio/template}/.env.example +0 -0
- /package/dist/templates/web/{web-ui-package → ui-auth-payments-audio}/template/postcss.config.js +0 -0
- /package/dist/templates/web/{web-ui-package → ui-auth-payments-audio}/template/src/app/globals.css +0 -0
- /package/dist/templates/web/{web-ui-package → ui-auth-payments-audio}/template/src/app/layout.tsx +0 -0
- /package/dist/templates/web/{web-ui-package → ui-auth-payments-audio}/template/src/components/ui/badge.tsx +0 -0
- /package/dist/templates/web/{web-ui-package → ui-auth-payments-audio}/template/src/lib/utils.ts +0 -0
- /package/dist/templates/web/{web-ui-package → ui-auth-payments-audio}/template/tsconfig.json +0 -0
- /package/dist/templates/web/{web-ui-package/template.backup → ui-auth-payments-video/template}/.env.example +0 -0
- /package/{src/templates/web/web-ui-package → dist/templates/web/ui-auth-payments-video}/template/postcss.config.js +0 -0
- /package/{src/templates/web/web-ui-package → dist/templates/web/ui-auth-payments-video}/template/src/app/globals.css +0 -0
- /package/{src/templates/web/web-ui-package → dist/templates/web/ui-auth-payments-video}/template/src/app/layout.tsx +0 -0
- /package/{src/templates/web/web-ui-package → dist/templates/web/ui-auth-payments-video}/template/src/components/ui/badge.tsx +0 -0
- /package/{src/templates/web/web-ui-package → dist/templates/web/ui-auth-payments-video}/template/src/lib/utils.ts +0 -0
- /package/{src/templates/web/web-ui-package → dist/templates/web/ui-auth-payments-video}/template/tsconfig.json +0 -0
- /package/dist/{web/ui-package-test → templates/web/ui-only}/template/.env.example +0 -0
- /package/dist/{web/base → templates/web/ui-only}/template/.eslintrc.js +0 -0
- /package/{src/templates/web/web-ui-package → dist/templates/web/ui-only}/template/README.md +0 -0
- /package/dist/templates/web/{web-ui-package → ui-only}/template/src/app/page.tsx +0 -0
- /package/dist/{web/ui-package-test → templates/web/ui-only}/template.backup/.env.example +0 -0
- /package/dist/{web/ui-package-test → templates/web/ui-only}/template.backup.20250817/.env.example +0 -0
- /package/src/templates/web/{web-ui-package → ui-auth}/template/.env.example +0 -0
- /package/{dist/web/ui-package-test → src/templates/web/ui-auth}/template/.eslintrc.js +0 -0
- /package/src/templates/web/{web-ui-package → ui-auth}/template.backup/.env.example +0 -0
- /package/src/templates/web/{web-ui-package → ui-auth}/template.backup.20250817/.env.example +0 -0
- /package/{dist/web/web-ui-package → src/templates/web/ui-auth-payments}/template/.env.example +0 -0
- /package/{dist/web/web-ui-package/template.backup.20250817 → src/templates/web/ui-auth-payments-audio/template}/.env.example +0 -0
- /package/{dist/web/web-ui-package/template.backup → src/templates/web/ui-auth-payments-video/template}/.env.example +0 -0
- /package/{dist/web/web-ui-package → src/templates/web/ui-only}/template/.eslintrc.js +0 -0
- /package/src/templates/web/{web-ui-package → ui-only}/template/src/app/page.tsx +0 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { usePayments, formatCurrency } from '@digilogiclabs/saas-factory-payments';
|
|
5
|
+
import { Button, Card } from '@digilogiclabs/saas-factory-ui';
|
|
6
|
+
|
|
7
|
+
export default function CheckoutPage() {
|
|
8
|
+
const { loading } = usePayments();
|
|
9
|
+
|
|
10
|
+
const handlePlanSelect = (planId: string) => {
|
|
11
|
+
console.log('Plan selected:', planId);
|
|
12
|
+
// Handle plan selection - redirect to payment processing
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const handlePayment = () => {
|
|
16
|
+
console.log('Processing payment...');
|
|
17
|
+
// Handle payment processing
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// Example pricing plans - in real app these would come from your backend/Stripe
|
|
21
|
+
const plans = [
|
|
22
|
+
{
|
|
23
|
+
id: 'basic',
|
|
24
|
+
name: 'Basic Plan',
|
|
25
|
+
price: 999, // in cents
|
|
26
|
+
interval: 'month',
|
|
27
|
+
features: ['Feature 1', 'Feature 2', 'Feature 3'],
|
|
28
|
+
stripePriceId: 'price_basic_monthly'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: 'pro',
|
|
32
|
+
name: 'Pro Plan',
|
|
33
|
+
price: 1999, // in cents
|
|
34
|
+
interval: 'month',
|
|
35
|
+
features: ['All Basic features', 'Feature 4', 'Feature 5', 'Priority support'],
|
|
36
|
+
popular: true,
|
|
37
|
+
stripePriceId: 'price_pro_monthly'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: 'enterprise',
|
|
41
|
+
name: 'Enterprise Plan',
|
|
42
|
+
price: 4999, // in cents
|
|
43
|
+
interval: 'month',
|
|
44
|
+
features: ['All Pro features', 'Custom integrations', 'Dedicated support', 'SLA guarantee'],
|
|
45
|
+
stripePriceId: 'price_enterprise_monthly'
|
|
46
|
+
}
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<div className="min-h-screen bg-gray-100 py-8">
|
|
51
|
+
<div className="max-w-6xl mx-auto px-4">
|
|
52
|
+
<div className="text-center mb-12">
|
|
53
|
+
<h1 className="text-4xl font-bold text-gray-900 mb-4">Choose Your Plan</h1>
|
|
54
|
+
<p className="text-xl text-gray-600">Select the perfect plan for your needs</p>
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
{/* Subscription Plans */}
|
|
58
|
+
<div className="grid md:grid-cols-3 gap-6 mb-8">
|
|
59
|
+
{plans.map((plan) => (
|
|
60
|
+
<Card key={plan.id} className={`p-6 relative ${plan.popular ? 'ring-2 ring-blue-500' : ''}`}>
|
|
61
|
+
{plan.popular && (
|
|
62
|
+
<div className="absolute -top-3 left-1/2 transform -translate-x-1/2">
|
|
63
|
+
<span className="bg-blue-500 text-white px-3 py-1 rounded-full text-sm font-medium">
|
|
64
|
+
Most Popular
|
|
65
|
+
</span>
|
|
66
|
+
</div>
|
|
67
|
+
)}
|
|
68
|
+
<h3 className="text-xl font-bold mb-2">{plan.name}</h3>
|
|
69
|
+
<div className="text-3xl font-bold mb-4">
|
|
70
|
+
{formatCurrency(plan.price)}
|
|
71
|
+
<span className="text-sm font-normal">/{plan.interval}</span>
|
|
72
|
+
</div>
|
|
73
|
+
<ul className="mb-6 space-y-2">
|
|
74
|
+
{plan.features.map((feature, index) => (
|
|
75
|
+
<li key={index} className="flex items-center">
|
|
76
|
+
<span className="text-green-500 mr-2">✓</span>
|
|
77
|
+
{feature}
|
|
78
|
+
</li>
|
|
79
|
+
))}
|
|
80
|
+
</ul>
|
|
81
|
+
<Button
|
|
82
|
+
onClick={() => handlePlanSelect(plan.id)}
|
|
83
|
+
disabled={loading}
|
|
84
|
+
className="w-full"
|
|
85
|
+
variant={plan.popular ? "default" : "outline"}
|
|
86
|
+
>
|
|
87
|
+
{loading ? 'Processing...' : 'Select Plan'}
|
|
88
|
+
</Button>
|
|
89
|
+
</Card>
|
|
90
|
+
))}
|
|
91
|
+
</div>
|
|
92
|
+
|
|
93
|
+
{/* Payment Form */}
|
|
94
|
+
<Card className="p-6 max-w-md mx-auto">
|
|
95
|
+
<h2 className="text-2xl font-bold mb-6">Payment Details</h2>
|
|
96
|
+
<div className="space-y-4">
|
|
97
|
+
<div>
|
|
98
|
+
<label className="block text-sm font-medium mb-2">Card Number</label>
|
|
99
|
+
<input
|
|
100
|
+
type="text"
|
|
101
|
+
placeholder="1234 5678 9012 3456"
|
|
102
|
+
className="w-full p-3 border rounded-lg"
|
|
103
|
+
disabled
|
|
104
|
+
/>
|
|
105
|
+
</div>
|
|
106
|
+
<div className="grid grid-cols-2 gap-4">
|
|
107
|
+
<div>
|
|
108
|
+
<label className="block text-sm font-medium mb-2">Expiry Date</label>
|
|
109
|
+
<input
|
|
110
|
+
type="text"
|
|
111
|
+
placeholder="MM/YY"
|
|
112
|
+
className="w-full p-3 border rounded-lg"
|
|
113
|
+
disabled
|
|
114
|
+
/>
|
|
115
|
+
</div>
|
|
116
|
+
<div>
|
|
117
|
+
<label className="block text-sm font-medium mb-2">CVC</label>
|
|
118
|
+
<input
|
|
119
|
+
type="text"
|
|
120
|
+
placeholder="123"
|
|
121
|
+
className="w-full p-3 border rounded-lg"
|
|
122
|
+
disabled
|
|
123
|
+
/>
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
<Button
|
|
127
|
+
onClick={handlePayment}
|
|
128
|
+
disabled={loading}
|
|
129
|
+
className="w-full"
|
|
130
|
+
>
|
|
131
|
+
{loading ? 'Processing...' : 'Complete Payment'}
|
|
132
|
+
</Button>
|
|
133
|
+
<p className="text-sm text-gray-600 text-center">
|
|
134
|
+
This is a demo. Payment processing requires Stripe integration.
|
|
135
|
+
</p>
|
|
136
|
+
</div>
|
|
137
|
+
</Card>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
@tailwind base;
|
|
2
|
+
@tailwind components;
|
|
3
|
+
@tailwind utilities;
|
|
4
|
+
|
|
5
|
+
/* Import SaaS Factory UI styles */
|
|
6
|
+
@import '@digilogiclabs/saas-factory-ui/dist/index.css';
|
|
7
|
+
|
|
8
|
+
@layer base {
|
|
9
|
+
:root {
|
|
10
|
+
--background: 0 0% 100%;
|
|
11
|
+
--foreground: 222.2 84% 4.9%;
|
|
12
|
+
--card: 0 0% 100%;
|
|
13
|
+
--card-foreground: 222.2 84% 4.9%;
|
|
14
|
+
--primary: 221.2 83.2% 53.3%;
|
|
15
|
+
--primary-foreground: 210 40% 98%;
|
|
16
|
+
--secondary: 210 40% 96%;
|
|
17
|
+
--secondary-foreground: 222.2 84% 4.9%;
|
|
18
|
+
--border: 214.3 31.8% 91.4%;
|
|
19
|
+
--radius: 0.5rem;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.dark {
|
|
23
|
+
--background: 222.2 84% 4.9%;
|
|
24
|
+
--foreground: 210 40% 98%;
|
|
25
|
+
--card: 222.2 84% 4.9%;
|
|
26
|
+
--card-foreground: 210 40% 98%;
|
|
27
|
+
--primary: 217.2 91.2% 59.8%;
|
|
28
|
+
--primary-foreground: 222.2 84% 4.9%;
|
|
29
|
+
--secondary: 217.2 32.6% 17.5%;
|
|
30
|
+
--secondary-foreground: 210 40% 98%;
|
|
31
|
+
--border: 217.2 32.6% 17.5%;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@layer base {
|
|
36
|
+
* {
|
|
37
|
+
@apply border-border;
|
|
38
|
+
}
|
|
39
|
+
body {
|
|
40
|
+
@apply bg-background text-foreground;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Metadata } from 'next'
|
|
2
|
+
import { Inter } from 'next/font/google'
|
|
3
|
+
import './globals.css'
|
|
4
|
+
import { AppProviders } from '@/components/providers/app-providers'
|
|
5
|
+
import { Header } from '@/components/shared/header'
|
|
6
|
+
|
|
7
|
+
const inter = Inter({ subsets: ['latin'] })
|
|
8
|
+
|
|
9
|
+
export const metadata: Metadata = {
|
|
10
|
+
title: '{{titleCaseName}}',
|
|
11
|
+
description: '{{description}}',
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default function RootLayout({
|
|
15
|
+
children,
|
|
16
|
+
}: {
|
|
17
|
+
children: React.ReactNode
|
|
18
|
+
}) {
|
|
19
|
+
return (
|
|
20
|
+
<html lang="en" suppressHydrationWarning>
|
|
21
|
+
<body className={inter.className}>
|
|
22
|
+
<AppProviders>
|
|
23
|
+
<Header />
|
|
24
|
+
{children}
|
|
25
|
+
</AppProviders>
|
|
26
|
+
</body>
|
|
27
|
+
</html>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
import { Button, Card, Input, Label } from '@digilogiclabs/saas-factory-ui';
|
|
5
|
+
import { useAuth } from '@digilogiclabs/saas-factory-auth';
|
|
6
|
+
import { useRouter } from 'next/navigation';
|
|
7
|
+
|
|
8
|
+
export default function LoginPage() {
|
|
9
|
+
const [email, setEmail] = useState('');
|
|
10
|
+
const [password, setPassword] = useState('');
|
|
11
|
+
const { signIn, signInWithOAuth, loading, error, user } = useAuth();
|
|
12
|
+
const router = useRouter();
|
|
13
|
+
|
|
14
|
+
// Redirect if already logged in
|
|
15
|
+
React.useEffect(() => {
|
|
16
|
+
if (user) {
|
|
17
|
+
router.push('/');
|
|
18
|
+
}
|
|
19
|
+
}, [user, router]);
|
|
20
|
+
|
|
21
|
+
const handleLogin = async (e: React.FormEvent) => {
|
|
22
|
+
e.preventDefault();
|
|
23
|
+
try {
|
|
24
|
+
await signIn(email, password);
|
|
25
|
+
router.push('/');
|
|
26
|
+
} catch (err) {
|
|
27
|
+
console.error('Login error:', err);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const handleGoogleLogin = async () => {
|
|
32
|
+
try {
|
|
33
|
+
await signInWithOAuth('google', window.location.origin);
|
|
34
|
+
} catch (err) {
|
|
35
|
+
console.error('Google login error:', err);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
if (loading) {
|
|
40
|
+
return (
|
|
41
|
+
<div className="flex items-center justify-center min-h-screen bg-gray-100">
|
|
42
|
+
<div>Loading...</div>
|
|
43
|
+
</div>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<div className="flex items-center justify-center min-h-screen bg-gray-100">
|
|
49
|
+
<Card className="w-full max-w-md p-8">
|
|
50
|
+
<h1 className="text-2xl font-bold text-center mb-6">Sign In</h1>
|
|
51
|
+
|
|
52
|
+
{error && (
|
|
53
|
+
<div className="mb-4 p-3 bg-red-100 border border-red-400 text-red-700 rounded">
|
|
54
|
+
{error.message}
|
|
55
|
+
</div>
|
|
56
|
+
)}
|
|
57
|
+
|
|
58
|
+
<form onSubmit={handleLogin} className="space-y-4">
|
|
59
|
+
<div>
|
|
60
|
+
<Label htmlFor="email">Email</Label>
|
|
61
|
+
<Input
|
|
62
|
+
id="email"
|
|
63
|
+
type="email"
|
|
64
|
+
value={email}
|
|
65
|
+
onChange={(e) => setEmail(e.target.value)}
|
|
66
|
+
placeholder="Enter your email"
|
|
67
|
+
required
|
|
68
|
+
disabled={loading}
|
|
69
|
+
/>
|
|
70
|
+
</div>
|
|
71
|
+
<div>
|
|
72
|
+
<Label htmlFor="password">Password</Label>
|
|
73
|
+
<Input
|
|
74
|
+
id="password"
|
|
75
|
+
type="password"
|
|
76
|
+
value={password}
|
|
77
|
+
onChange={(e) => setPassword(e.target.value)}
|
|
78
|
+
placeholder="Enter your password"
|
|
79
|
+
required
|
|
80
|
+
disabled={loading}
|
|
81
|
+
/>
|
|
82
|
+
</div>
|
|
83
|
+
<Button type="submit" className="w-full" disabled={loading}>
|
|
84
|
+
{loading ? 'Signing In...' : 'Sign In'}
|
|
85
|
+
</Button>
|
|
86
|
+
<Button
|
|
87
|
+
type="button"
|
|
88
|
+
variant="outline"
|
|
89
|
+
className="w-full"
|
|
90
|
+
onClick={handleGoogleLogin}
|
|
91
|
+
disabled={loading}
|
|
92
|
+
>
|
|
93
|
+
Sign in with Google
|
|
94
|
+
</Button>
|
|
95
|
+
</form>
|
|
96
|
+
|
|
97
|
+
<div className="mt-4 text-center">
|
|
98
|
+
<p className="text-sm text-gray-600">
|
|
99
|
+
Don't have an account?{' '}
|
|
100
|
+
<a href="/signup" className="text-blue-600 hover:underline">
|
|
101
|
+
Sign up
|
|
102
|
+
</a>
|
|
103
|
+
</p>
|
|
104
|
+
</div>
|
|
105
|
+
</Card>
|
|
106
|
+
</div>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { Button, Card } from '@digilogiclabs/saas-factory-ui'
|
|
4
|
+
import { ArrowRight, Zap, Shield, Rocket, CheckCircle, LogOut, User } from 'lucide-react'
|
|
5
|
+
import { useAuth } from '@digilogiclabs/saas-factory-auth'
|
|
6
|
+
import Link from 'next/link'
|
|
7
|
+
|
|
8
|
+
export default function Home() {
|
|
9
|
+
const { user, signOut, loading } = useAuth()
|
|
10
|
+
|
|
11
|
+
const handleSignOut = async () => {
|
|
12
|
+
try {
|
|
13
|
+
await signOut()
|
|
14
|
+
} catch (err) {
|
|
15
|
+
console.error('Sign out error:', err)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<main className="min-h-screen bg-gradient-to-br from-blue-50 to-indigo-100 dark:from-gray-900 dark:to-gray-800">
|
|
21
|
+
<div className="container mx-auto px-4 py-16">
|
|
22
|
+
{/* Auth Status Bar */}
|
|
23
|
+
<div className="flex justify-end mb-8">
|
|
24
|
+
{loading ? (
|
|
25
|
+
<div className="text-sm text-gray-600">Loading...</div>
|
|
26
|
+
) : user ? (
|
|
27
|
+
<div className="flex items-center gap-4">
|
|
28
|
+
<div className="flex items-center gap-2 text-sm text-gray-600 dark:text-gray-300">
|
|
29
|
+
<User className="w-4 h-4" />
|
|
30
|
+
Welcome, {user.email}
|
|
31
|
+
</div>
|
|
32
|
+
<Button variant="outline" size="sm" onClick={handleSignOut}>
|
|
33
|
+
<LogOut className="w-4 h-4 mr-2" />
|
|
34
|
+
Sign Out
|
|
35
|
+
</Button>
|
|
36
|
+
</div>
|
|
37
|
+
) : (
|
|
38
|
+
<div className="flex gap-2">
|
|
39
|
+
<Link href="/login">
|
|
40
|
+
<Button variant="outline" size="sm">Sign In</Button>
|
|
41
|
+
</Link>
|
|
42
|
+
<Link href="/signup">
|
|
43
|
+
<Button size="sm">Sign Up</Button>
|
|
44
|
+
</Link>
|
|
45
|
+
</div>
|
|
46
|
+
)}
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
{/* Hero Section */}
|
|
50
|
+
<div className="text-center mb-16">
|
|
51
|
+
<div className="inline-flex items-center px-4 py-2 rounded-full text-sm font-medium bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200 mb-6">
|
|
52
|
+
<CheckCircle className="w-4 h-4 mr-2" />
|
|
53
|
+
UI Package v0.7.3 + Auth v0.4.4 + Payments Integrated Successfully
|
|
54
|
+
</div>
|
|
55
|
+
<h1 className="text-4xl md:text-6xl font-bold text-gray-900 dark:text-white mb-6">
|
|
56
|
+
Welcome to{' '}
|
|
57
|
+
<span className="text-blue-600 dark:text-blue-400">{{titleCaseName}}</span>
|
|
58
|
+
</h1>
|
|
59
|
+
<p className="text-xl text-gray-600 dark:text-gray-300 mb-8 max-w-2xl mx-auto">
|
|
60
|
+
{{description}}. This template uses the stable SaaS Factory UI package v0.7.3 with authentication v0.4.4 and payments integration.
|
|
61
|
+
</p>
|
|
62
|
+
<div className="flex flex-col sm:flex-row gap-4 justify-center">
|
|
63
|
+
<Link href="/checkout">
|
|
64
|
+
<Button size="lg" className="text-lg px-8">
|
|
65
|
+
View Pricing
|
|
66
|
+
<ArrowRight className="ml-2 h-5 w-5" />
|
|
67
|
+
</Button>
|
|
68
|
+
</Link>
|
|
69
|
+
<Button variant="outline" size="lg" className="text-lg px-8">
|
|
70
|
+
Learn More
|
|
71
|
+
</Button>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
{/* Component Showcase */}
|
|
76
|
+
<div className="grid md:grid-cols-4 gap-8 mb-16">
|
|
77
|
+
<Card className="text-center p-6">
|
|
78
|
+
<div className="mx-auto w-12 h-12 bg-blue-100 dark:bg-blue-900 rounded-lg flex items-center justify-center mb-4">
|
|
79
|
+
<Zap className="h-6 w-6 text-blue-600 dark:text-blue-400" />
|
|
80
|
+
</div>
|
|
81
|
+
<h3 className="text-xl font-semibold mb-2">UI Package Components</h3>
|
|
82
|
+
<p className="text-gray-600 dark:text-gray-300">
|
|
83
|
+
Button and Card components from @digilogiclabs/saas-factory-ui
|
|
84
|
+
</p>
|
|
85
|
+
</Card>
|
|
86
|
+
|
|
87
|
+
<Card className="text-center p-6">
|
|
88
|
+
<div className="mx-auto w-12 h-12 bg-green-100 dark:bg-green-900 rounded-lg flex items-center justify-center mb-4">
|
|
89
|
+
<Shield className="h-6 w-6 text-green-600 dark:text-green-400" />
|
|
90
|
+
</div>
|
|
91
|
+
<h3 className="text-xl font-semibold mb-2">Authentication</h3>
|
|
92
|
+
<p className="text-gray-600 dark:text-gray-300">
|
|
93
|
+
Secure user authentication with @digilogiclabs/saas-factory-auth
|
|
94
|
+
</p>
|
|
95
|
+
</Card>
|
|
96
|
+
|
|
97
|
+
<Card className="text-center p-6">
|
|
98
|
+
<div className="mx-auto w-12 h-12 bg-purple-100 dark:bg-purple-900 rounded-lg flex items-center justify-center mb-4">
|
|
99
|
+
<Rocket className="h-6 w-6 text-purple-600 dark:text-purple-400" />
|
|
100
|
+
</div>
|
|
101
|
+
<h3 className="text-xl font-semibold mb-2">TypeScript Ready</h3>
|
|
102
|
+
<p className="text-gray-600 dark:text-gray-300">
|
|
103
|
+
Full type safety with enhanced component definitions
|
|
104
|
+
</p>
|
|
105
|
+
</Card>
|
|
106
|
+
|
|
107
|
+
<Card className="text-center p-6">
|
|
108
|
+
<div className="mx-auto w-12 h-12 bg-orange-100 dark:bg-orange-900 rounded-lg flex items-center justify-center mb-4">
|
|
109
|
+
<svg className="h-6 w-6 text-orange-600 dark:text-orange-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
110
|
+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z" />
|
|
111
|
+
</svg>
|
|
112
|
+
</div>
|
|
113
|
+
<h3 className="text-xl font-semibold mb-2">Payments Integration</h3>
|
|
114
|
+
<p className="text-gray-600 dark:text-gray-300">
|
|
115
|
+
Complete payment processing with @digilogiclabs/saas-factory-payments
|
|
116
|
+
</p>
|
|
117
|
+
</Card>
|
|
118
|
+
</div>
|
|
119
|
+
|
|
120
|
+
{/* Button Variants Showcase */}
|
|
121
|
+
<Card className="max-w-4xl mx-auto p-8">
|
|
122
|
+
<div className="text-center mb-6">
|
|
123
|
+
<h2 className="text-2xl font-bold mb-2">Full SaaS Package Integration</h2>
|
|
124
|
+
<p className="text-gray-600 dark:text-gray-300">
|
|
125
|
+
Complete integration of UI, Auth, and Payments packages
|
|
126
|
+
</p>
|
|
127
|
+
</div>
|
|
128
|
+
<div className="flex flex-wrap justify-center gap-4 mb-6">
|
|
129
|
+
<Button>Default Button</Button>
|
|
130
|
+
<Button variant="secondary">Secondary Button</Button>
|
|
131
|
+
<Button variant="outline">Outline Button</Button>
|
|
132
|
+
<Button disabled>Disabled Button</Button>
|
|
133
|
+
</div>
|
|
134
|
+
<div className="text-center">
|
|
135
|
+
<p className="text-sm text-gray-500">
|
|
136
|
+
All components from @digilogiclabs/saas-factory-ui v0.7.3 + auth v0.4.4 + payments
|
|
137
|
+
</p>
|
|
138
|
+
</div>
|
|
139
|
+
</Card>
|
|
140
|
+
</div>
|
|
141
|
+
</main>
|
|
142
|
+
)
|
|
143
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
import { Button, Card, Input, Label } from '@digilogiclabs/saas-factory-ui';
|
|
5
|
+
import { useAuth } from '@digilogiclabs/saas-factory-auth';
|
|
6
|
+
import { useRouter } from 'next/navigation';
|
|
7
|
+
|
|
8
|
+
export default function SignupPage() {
|
|
9
|
+
const [email, setEmail] = useState('');
|
|
10
|
+
const [password, setPassword] = useState('');
|
|
11
|
+
const [confirmPassword, setConfirmPassword] = useState('');
|
|
12
|
+
const { signUp, signInWithOAuth, loading, error, user } = useAuth();
|
|
13
|
+
const router = useRouter();
|
|
14
|
+
|
|
15
|
+
// Redirect if already logged in
|
|
16
|
+
React.useEffect(() => {
|
|
17
|
+
if (user) {
|
|
18
|
+
router.push('/');
|
|
19
|
+
}
|
|
20
|
+
}, [user, router]);
|
|
21
|
+
|
|
22
|
+
const handleSignup = async (e: React.FormEvent) => {
|
|
23
|
+
e.preventDefault();
|
|
24
|
+
|
|
25
|
+
if (password !== confirmPassword) {
|
|
26
|
+
alert('Passwords do not match');
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
try {
|
|
31
|
+
await signUp(email, password);
|
|
32
|
+
router.push('/');
|
|
33
|
+
} catch (err) {
|
|
34
|
+
console.error('Signup error:', err);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const handleGoogleSignup = async () => {
|
|
39
|
+
try {
|
|
40
|
+
await signInWithOAuth('google', window.location.origin);
|
|
41
|
+
} catch (err) {
|
|
42
|
+
console.error('Google signup error:', err);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
if (loading) {
|
|
47
|
+
return (
|
|
48
|
+
<div className="flex items-center justify-center min-h-screen bg-gray-100">
|
|
49
|
+
<div>Loading...</div>
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<div className="flex items-center justify-center min-h-screen bg-gray-100">
|
|
56
|
+
<Card className="w-full max-w-md p-8">
|
|
57
|
+
<h1 className="text-2xl font-bold text-center mb-6">Sign Up</h1>
|
|
58
|
+
|
|
59
|
+
{error && (
|
|
60
|
+
<div className="mb-4 p-3 bg-red-100 border border-red-400 text-red-700 rounded">
|
|
61
|
+
{error.message}
|
|
62
|
+
</div>
|
|
63
|
+
)}
|
|
64
|
+
|
|
65
|
+
<form onSubmit={handleSignup} className="space-y-4">
|
|
66
|
+
<div>
|
|
67
|
+
<Label htmlFor="email">Email</Label>
|
|
68
|
+
<Input
|
|
69
|
+
id="email"
|
|
70
|
+
type="email"
|
|
71
|
+
value={email}
|
|
72
|
+
onChange={(e) => setEmail(e.target.value)}
|
|
73
|
+
placeholder="Enter your email"
|
|
74
|
+
required
|
|
75
|
+
disabled={loading}
|
|
76
|
+
/>
|
|
77
|
+
</div>
|
|
78
|
+
<div>
|
|
79
|
+
<Label htmlFor="password">Password</Label>
|
|
80
|
+
<Input
|
|
81
|
+
id="password"
|
|
82
|
+
type="password"
|
|
83
|
+
value={password}
|
|
84
|
+
onChange={(e) => setPassword(e.target.value)}
|
|
85
|
+
placeholder="Enter your password"
|
|
86
|
+
required
|
|
87
|
+
disabled={loading}
|
|
88
|
+
/>
|
|
89
|
+
</div>
|
|
90
|
+
<div>
|
|
91
|
+
<Label htmlFor="confirmPassword">Confirm Password</Label>
|
|
92
|
+
<Input
|
|
93
|
+
id="confirmPassword"
|
|
94
|
+
type="password"
|
|
95
|
+
value={confirmPassword}
|
|
96
|
+
onChange={(e) => setConfirmPassword(e.target.value)}
|
|
97
|
+
placeholder="Confirm your password"
|
|
98
|
+
required
|
|
99
|
+
disabled={loading}
|
|
100
|
+
/>
|
|
101
|
+
</div>
|
|
102
|
+
<Button type="submit" className="w-full" disabled={loading}>
|
|
103
|
+
{loading ? 'Signing Up...' : 'Sign Up'}
|
|
104
|
+
</Button>
|
|
105
|
+
<Button
|
|
106
|
+
type="button"
|
|
107
|
+
variant="outline"
|
|
108
|
+
className="w-full"
|
|
109
|
+
onClick={handleGoogleSignup}
|
|
110
|
+
disabled={loading}
|
|
111
|
+
>
|
|
112
|
+
Sign up with Google
|
|
113
|
+
</Button>
|
|
114
|
+
</form>
|
|
115
|
+
|
|
116
|
+
<div className="mt-4 text-center">
|
|
117
|
+
<p className="text-sm text-gray-600">
|
|
118
|
+
Already have an account?{' '}
|
|
119
|
+
<a href="/login" className="text-blue-600 hover:underline">
|
|
120
|
+
Sign in
|
|
121
|
+
</a>
|
|
122
|
+
</p>
|
|
123
|
+
</div>
|
|
124
|
+
</Card>
|
|
125
|
+
</div>
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
package/dist/templates/web/ui-auth-payments/template/src/components/providers/app-providers.tsx
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import React from 'react'
|
|
4
|
+
import { ThemeProvider } from 'next-themes'
|
|
5
|
+
import { AuthProvider } from '@digilogiclabs/saas-factory-auth'
|
|
6
|
+
import { PaymentsProvider } from '@digilogiclabs/saas-factory-payments'
|
|
7
|
+
|
|
8
|
+
interface AppProvidersProps {
|
|
9
|
+
children: React.ReactNode
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function AppProviders({ children }: AppProvidersProps) {
|
|
13
|
+
return (
|
|
14
|
+
<ThemeProvider
|
|
15
|
+
attribute="class"
|
|
16
|
+
defaultTheme="system"
|
|
17
|
+
enableSystem
|
|
18
|
+
disableTransitionOnChange
|
|
19
|
+
>
|
|
20
|
+
<AuthProvider>
|
|
21
|
+
<PaymentsProvider>
|
|
22
|
+
{children}
|
|
23
|
+
</PaymentsProvider>
|
|
24
|
+
</AuthProvider>
|
|
25
|
+
</ThemeProvider>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import Link from 'next/link';
|
|
5
|
+
import { LogOut, CreditCard } from 'lucide-react';
|
|
6
|
+
import { useAuth } from '@digilogiclabs/saas-factory-auth';
|
|
7
|
+
|
|
8
|
+
export function Header() {
|
|
9
|
+
const { user, signOut } = useAuth();
|
|
10
|
+
|
|
11
|
+
const handleSignOut = async () => {
|
|
12
|
+
try {
|
|
13
|
+
await signOut();
|
|
14
|
+
} catch (error) {
|
|
15
|
+
console.error('Sign out error:', error);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<header className="bg-white dark:bg-gray-800 shadow-md">
|
|
21
|
+
<div className="container mx-auto px-4 py-4 flex justify-between items-center">
|
|
22
|
+
<Link href="/" className="text-2xl font-bold text-gray-900 dark:text-white">
|
|
23
|
+
{{titleCaseName}}
|
|
24
|
+
</Link>
|
|
25
|
+
<nav className="flex items-center gap-4">
|
|
26
|
+
{user ? (
|
|
27
|
+
<>
|
|
28
|
+
<Link href="/dashboard" className="text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white">
|
|
29
|
+
Dashboard
|
|
30
|
+
</Link>
|
|
31
|
+
<Link href="/billing" className="flex items-center gap-2 text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white">
|
|
32
|
+
<CreditCard className="h-4 w-4" />
|
|
33
|
+
Billing
|
|
34
|
+
</Link>
|
|
35
|
+
<button
|
|
36
|
+
onClick={handleSignOut}
|
|
37
|
+
className="p-2 text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white"
|
|
38
|
+
>
|
|
39
|
+
<LogOut className="h-5 w-5" />
|
|
40
|
+
</button>
|
|
41
|
+
</>
|
|
42
|
+
) : (
|
|
43
|
+
<>
|
|
44
|
+
<Link href="/login" className="text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white">
|
|
45
|
+
Login
|
|
46
|
+
</Link>
|
|
47
|
+
<Link
|
|
48
|
+
href="/signup"
|
|
49
|
+
className="px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700"
|
|
50
|
+
>
|
|
51
|
+
Sign Up
|
|
52
|
+
</Link>
|
|
53
|
+
</>
|
|
54
|
+
)}
|
|
55
|
+
</nav>
|
|
56
|
+
</div>
|
|
57
|
+
</header>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|