@digilogiclabs/create-saas-app 1.10.6 → 1.12.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/README.md +331 -350
- package/dist/.tsbuildinfo +1 -1
- package/dist/cli/commands/create.js +2 -2
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/generators/template-generator.d.ts.map +1 -1
- package/dist/generators/template-generator.js +14 -2
- package/dist/generators/template-generator.js.map +1 -1
- package/dist/templates/web/ui-auth/template/.claude +21 -0
- package/dist/templates/web/ui-auth/template/context.md +105 -0
- package/dist/templates/web/ui-auth/template/src/app/dev-setup/page.tsx +801 -0
- package/dist/templates/web/ui-auth/template/src/app/setup/page.tsx +403 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/dev-setup/page.tsx +801 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/setup/page.tsx +507 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/shared/header.tsx +127 -32
- package/dist/templates/web/ui-auth-payments-ai/template/.claude +21 -0
- package/dist/templates/web/ui-auth-payments-ai/template/.env.example +15 -0
- package/dist/templates/web/ui-auth-payments-ai/template/README.md +207 -0
- package/dist/templates/web/ui-auth-payments-ai/template/context.md +169 -0
- package/dist/templates/web/ui-auth-payments-ai/template/middleware.ts +68 -0
- package/dist/templates/web/ui-auth-payments-ai/template/next.config.js +12 -0
- package/dist/templates/web/ui-auth-payments-ai/template/package-lock.json +12241 -0
- package/dist/templates/web/ui-auth-payments-ai/template/package.json +55 -0
- package/dist/templates/web/ui-auth-payments-ai/template/postcss.config.js +7 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/ai/page.tsx +310 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/api/ai/audio/route.ts +56 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/api/ai/chat/route.ts +49 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/api/ai/text/route.ts +64 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/api/ai/video/route.ts +73 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/auth/callback/route.ts +12 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/billing/page.tsx +211 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/checkout/page.tsx +142 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/dashboard/layout.tsx +22 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/dashboard/page.tsx +183 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/dev-setup/page.tsx +801 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/error.tsx +67 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/globals.css +43 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/layout.tsx +35 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/loading.tsx +20 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/login/page.tsx +6 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/page.tsx +380 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/page.tsx.backup +391 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/page.tsx.bak +391 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/setup/page.tsx +640 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/signup/page.tsx +6 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/__tests__/example.test.tsx +49 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/auth-status.tsx +52 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/login-form.tsx +144 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/signup-form.tsx +185 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/providers/app-providers.tsx +36 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/providers/theme-provider.tsx +96 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/shared/footer.tsx +36 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/shared/header.tsx +246 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/ui/badge.tsx +36 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/ui/theme-toggle.tsx +34 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/lib/actions/auth.ts +246 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/lib/actions/index.ts +14 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/lib/auth-server.ts +177 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/lib/env.ts +49 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/lib/utils.ts +140 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/test/setup.ts +79 -0
- package/dist/templates/web/ui-auth-payments-ai/template/tailwind.config.js +77 -0
- package/dist/templates/web/ui-auth-payments-ai/template/tsconfig.json +33 -0
- package/dist/templates/web/ui-auth-payments-ai/template/tsconfig.tsbuildinfo +1 -0
- package/dist/templates/web/ui-auth-payments-ai/template/vitest.config.ts +17 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/page.tsx +28 -20
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/page.tsx.backup +391 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/page.tsx.bak +391 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/setup/page.tsx +345 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/shared/header.tsx +122 -37
- package/dist/templates/web/ui-auth-payments-video/template/src/app/setup/page.tsx +351 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/components/shared/header.tsx +122 -37
- package/package.json +1 -1
- package/src/templates/web/ui-auth/template/.claude +21 -0
- package/src/templates/web/ui-auth/template/context.md +105 -0
- package/src/templates/web/ui-auth/template/src/app/dev-setup/page.tsx +801 -0
- package/src/templates/web/ui-auth/template/src/app/setup/page.tsx +403 -0
- package/src/templates/web/ui-auth-payments/template/src/app/dev-setup/page.tsx +801 -0
- package/src/templates/web/ui-auth-payments/template/src/app/setup/page.tsx +507 -0
- package/src/templates/web/ui-auth-payments/template/src/components/shared/header.tsx +127 -32
- package/src/templates/web/ui-auth-payments-ai/template/.claude +21 -0
- package/src/templates/web/ui-auth-payments-ai/template/.env.example +15 -0
- package/src/templates/web/ui-auth-payments-ai/template/README.md +207 -0
- package/src/templates/web/ui-auth-payments-ai/template/context.md +169 -0
- package/src/templates/web/ui-auth-payments-ai/template/middleware.ts +68 -0
- package/src/templates/web/ui-auth-payments-ai/template/next.config.js +12 -0
- package/src/templates/web/ui-auth-payments-ai/template/package-lock.json +12241 -0
- package/src/templates/web/ui-auth-payments-ai/template/package.json +55 -0
- package/src/templates/web/ui-auth-payments-ai/template/postcss.config.js +7 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/ai/page.tsx +310 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/api/ai/audio/route.ts +56 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/api/ai/chat/route.ts +49 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/api/ai/text/route.ts +64 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/api/ai/video/route.ts +73 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/auth/callback/route.ts +12 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/billing/page.tsx +211 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/checkout/page.tsx +142 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/dashboard/layout.tsx +22 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/dashboard/page.tsx +183 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/dev-setup/page.tsx +801 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/error.tsx +67 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/globals.css +43 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/layout.tsx +35 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/loading.tsx +20 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/login/page.tsx +6 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/page.tsx +380 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/page.tsx.backup +391 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/page.tsx.bak +391 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/setup/page.tsx +640 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/signup/page.tsx +6 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/components/__tests__/example.test.tsx +49 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/components/client/auth-status.tsx +52 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/components/client/login-form.tsx +144 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/components/client/signup-form.tsx +185 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/components/providers/app-providers.tsx +36 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/components/providers/theme-provider.tsx +96 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/components/shared/footer.tsx +36 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/components/shared/header.tsx +246 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/components/ui/badge.tsx +36 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/components/ui/theme-toggle.tsx +34 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/lib/actions/auth.ts +246 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/lib/actions/index.ts +14 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/lib/auth-server.ts +177 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/lib/env.ts +49 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/lib/utils.ts +140 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/test/setup.ts +79 -0
- package/src/templates/web/ui-auth-payments-ai/template/tailwind.config.js +77 -0
- package/src/templates/web/ui-auth-payments-ai/template/tsconfig.json +33 -0
- package/src/templates/web/ui-auth-payments-ai/template/tsconfig.tsbuildinfo +1 -0
- package/src/templates/web/ui-auth-payments-ai/template/vitest.config.ts +17 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/app/page.tsx +28 -20
- package/src/templates/web/ui-auth-payments-audio/template/src/app/page.tsx.backup +391 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/app/page.tsx.bak +391 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/app/setup/page.tsx +345 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/components/shared/header.tsx +122 -37
- package/src/templates/web/ui-auth-payments-video/template/src/app/setup/page.tsx +351 -0
- package/src/templates/web/ui-auth-payments-video/template/src/components/shared/header.tsx +122 -37
- package/dist/cli/commands/add.d.ts +0 -6
- package/dist/cli/commands/add.d.ts.map +0 -1
- package/dist/cli/commands/add.js +0 -39
- package/dist/cli/commands/add.js.map +0 -1
- package/dist/cli/commands/index.d.ts +0 -4
- package/dist/cli/commands/index.d.ts.map +0 -1
- package/dist/cli/commands/index.js +0 -20
- package/dist/cli/commands/index.js.map +0 -1
- package/dist/cli/commands/update.d.ts +0 -6
- package/dist/cli/commands/update.d.ts.map +0 -1
- package/dist/cli/commands/update.js +0 -68
- package/dist/cli/commands/update.js.map +0 -1
- package/dist/cli/index.d.ts +0 -4
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js +0 -61
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/prompts/index.d.ts +0 -2
- package/dist/cli/prompts/index.d.ts.map +0 -1
- package/dist/cli/prompts/index.js +0 -18
- package/dist/cli/prompts/index.js.map +0 -1
- package/dist/cli/prompts/project-setup.d.ts +0 -5
- package/dist/cli/prompts/project-setup.d.ts.map +0 -1
- package/dist/cli/prompts/project-setup.js +0 -251
- package/dist/cli/prompts/project-setup.js.map +0 -1
- package/dist/cli/utils/git.d.ts +0 -9
- package/dist/cli/utils/git.d.ts.map +0 -1
- package/dist/cli/utils/git.js +0 -77
- package/dist/cli/utils/git.js.map +0 -1
- package/dist/cli/utils/index.d.ts +0 -5
- package/dist/cli/utils/index.d.ts.map +0 -1
- package/dist/cli/utils/index.js +0 -21
- package/dist/cli/utils/index.js.map +0 -1
- package/dist/cli/utils/logger.d.ts +0 -16
- package/dist/cli/utils/logger.d.ts.map +0 -1
- package/dist/cli/utils/logger.js +0 -55
- package/dist/cli/utils/logger.js.map +0 -1
- package/dist/cli/utils/package-manager.d.ts +0 -8
- package/dist/cli/utils/package-manager.d.ts.map +0 -1
- package/dist/cli/utils/package-manager.js +0 -92
- package/dist/cli/utils/package-manager.js.map +0 -1
- package/dist/cli/utils/spinner.d.ts +0 -7
- package/dist/cli/utils/spinner.d.ts.map +0 -1
- package/dist/cli/utils/spinner.js +0 -48
- package/dist/cli/utils/spinner.js.map +0 -1
- package/dist/cli/validators/dependencies.d.ts +0 -15
- package/dist/cli/validators/dependencies.d.ts.map +0 -1
- package/dist/cli/validators/dependencies.js +0 -108
- package/dist/cli/validators/dependencies.js.map +0 -1
- package/dist/cli/validators/index.d.ts +0 -3
- package/dist/cli/validators/index.d.ts.map +0 -1
- package/dist/cli/validators/index.js +0 -19
- package/dist/cli/validators/index.js.map +0 -1
- package/dist/cli/validators/project-name.d.ts +0 -5
- package/dist/cli/validators/project-name.d.ts.map +0 -1
- package/dist/cli/validators/project-name.js +0 -151
- package/dist/cli/validators/project-name.js.map +0 -1
- package/dist/generators/file-processor.d.ts +0 -28
- package/dist/generators/file-processor.d.ts.map +0 -1
- package/dist/generators/file-processor.js +0 -224
- package/dist/generators/file-processor.js.map +0 -1
- package/dist/generators/index.d.ts +0 -4
- package/dist/generators/index.d.ts.map +0 -1
- package/dist/generators/index.js +0 -20
- package/dist/generators/index.js.map +0 -1
- package/dist/generators/package-installer.d.ts +0 -29
- package/dist/generators/package-installer.d.ts.map +0 -1
- package/dist/generators/package-installer.js +0 -167
- package/dist/generators/package-installer.js.map +0 -1
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { useEffect } from 'react'
|
|
4
|
+
import { Button, Card } from '@digilogiclabs/saas-factory-ui'
|
|
5
|
+
import { RefreshCw, Home, AlertCircle } from 'lucide-react'
|
|
6
|
+
|
|
7
|
+
interface ErrorProps {
|
|
8
|
+
error: Error & { digest?: string }
|
|
9
|
+
reset: () => void
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default function Error({ error, reset }: ErrorProps) {
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
// Log the error to an error reporting service
|
|
15
|
+
console.error('Application error:', error)
|
|
16
|
+
}, [error])
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div className="min-h-screen bg-gray-50 dark:bg-gray-900 flex items-center justify-center p-4">
|
|
20
|
+
<Card className="w-full max-w-md p-8 text-center">
|
|
21
|
+
<div className="mb-6">
|
|
22
|
+
<div className="mx-auto w-16 h-16 bg-red-100 dark:bg-red-900 rounded-full flex items-center justify-center mb-4">
|
|
23
|
+
<AlertCircle className="h-8 w-8 text-red-600 dark:text-red-400" />
|
|
24
|
+
</div>
|
|
25
|
+
<h1 className="text-2xl font-bold text-gray-900 dark:text-white mb-2">
|
|
26
|
+
Something went wrong
|
|
27
|
+
</h1>
|
|
28
|
+
<p className="text-gray-600 dark:text-gray-300 mb-6">
|
|
29
|
+
We apologize for the inconvenience. Please try again or return to the home page.
|
|
30
|
+
</p>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<div className="space-y-3">
|
|
34
|
+
<Button
|
|
35
|
+
onClick={reset}
|
|
36
|
+
className="w-full"
|
|
37
|
+
variant="default"
|
|
38
|
+
>
|
|
39
|
+
<RefreshCw className="w-4 h-4 mr-2" />
|
|
40
|
+
Try Again
|
|
41
|
+
</Button>
|
|
42
|
+
|
|
43
|
+
<Button
|
|
44
|
+
onClick={() => window.location.href = '/'}
|
|
45
|
+
variant="outline"
|
|
46
|
+
className="w-full"
|
|
47
|
+
>
|
|
48
|
+
<Home className="w-4 h-4 mr-2" />
|
|
49
|
+
Go Home
|
|
50
|
+
</Button>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
{process.env.NODE_ENV === 'development' && (
|
|
54
|
+
<details className="mt-6 text-left">
|
|
55
|
+
<summary className="text-sm font-medium text-gray-500 cursor-pointer hover:text-gray-700 dark:hover:text-gray-300">
|
|
56
|
+
Error Details (Development)
|
|
57
|
+
</summary>
|
|
58
|
+
<pre className="mt-2 text-xs bg-gray-100 dark:bg-gray-800 p-3 rounded-md overflow-auto">
|
|
59
|
+
{error.message}
|
|
60
|
+
{error.stack}
|
|
61
|
+
</pre>
|
|
62
|
+
</details>
|
|
63
|
+
)}
|
|
64
|
+
</Card>
|
|
65
|
+
</div>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
}
|
|
43
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
import { Footer } from '@/components/shared/footer'
|
|
7
|
+
|
|
8
|
+
const inter = Inter({ subsets: ['latin'] })
|
|
9
|
+
|
|
10
|
+
export const metadata: Metadata = {
|
|
11
|
+
title: '{{titleCaseName}}',
|
|
12
|
+
description: '{{description}}',
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default function RootLayout({
|
|
16
|
+
children,
|
|
17
|
+
}: {
|
|
18
|
+
children: React.ReactNode
|
|
19
|
+
}) {
|
|
20
|
+
return (
|
|
21
|
+
<html lang="en" suppressHydrationWarning>
|
|
22
|
+
<body className={inter.className}>
|
|
23
|
+
<AppProviders>
|
|
24
|
+
<div className="min-h-screen flex flex-col">
|
|
25
|
+
<Header />
|
|
26
|
+
<main className="flex-1">
|
|
27
|
+
{children}
|
|
28
|
+
</main>
|
|
29
|
+
<Footer />
|
|
30
|
+
</div>
|
|
31
|
+
</AppProviders>
|
|
32
|
+
</body>
|
|
33
|
+
</html>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Card } from '@digilogiclabs/saas-factory-ui'
|
|
2
|
+
import { Loader2 } from 'lucide-react'
|
|
3
|
+
|
|
4
|
+
export default function Loading() {
|
|
5
|
+
return (
|
|
6
|
+
<div className="min-h-screen bg-gray-50 dark:bg-gray-900 flex items-center justify-center p-4">
|
|
7
|
+
<Card className="w-full max-w-md p-8 text-center">
|
|
8
|
+
<div className="flex flex-col items-center">
|
|
9
|
+
<Loader2 className="h-8 w-8 animate-spin text-blue-600 dark:text-blue-400 mb-4" />
|
|
10
|
+
<h2 className="text-lg font-medium text-gray-900 dark:text-white mb-2">
|
|
11
|
+
Loading
|
|
12
|
+
</h2>
|
|
13
|
+
<p className="text-sm text-gray-600 dark:text-gray-300">
|
|
14
|
+
Please wait while we load your content...
|
|
15
|
+
</p>
|
|
16
|
+
</div>
|
|
17
|
+
</Card>
|
|
18
|
+
</div>
|
|
19
|
+
)
|
|
20
|
+
}
|
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
Button,
|
|
5
|
+
Card,
|
|
6
|
+
PageTransition,
|
|
7
|
+
MobileContainer,
|
|
8
|
+
MobileHero,
|
|
9
|
+
ResponsiveGrid,
|
|
10
|
+
NetworkAwareContent,
|
|
11
|
+
OfflineWrapper,
|
|
12
|
+
SwipeableCard,
|
|
13
|
+
PullToRefresh,
|
|
14
|
+
useNetworkInfo,
|
|
15
|
+
useOfflineState,
|
|
16
|
+
useAnimationTokens,
|
|
17
|
+
useGlassmorphism
|
|
18
|
+
} from '@digilogiclabs/saas-factory-ui'
|
|
19
|
+
import {
|
|
20
|
+
ArrowRight,
|
|
21
|
+
Zap,
|
|
22
|
+
Shield,
|
|
23
|
+
Rocket,
|
|
24
|
+
CheckCircle,
|
|
25
|
+
LogOut,
|
|
26
|
+
User,
|
|
27
|
+
MessageSquare,
|
|
28
|
+
Mic,
|
|
29
|
+
Video,
|
|
30
|
+
Image as ImageIcon,
|
|
31
|
+
Brain,
|
|
32
|
+
Sparkles,
|
|
33
|
+
Wand2,
|
|
34
|
+
Headphones,
|
|
35
|
+
Monitor,
|
|
36
|
+
FileText
|
|
37
|
+
} from 'lucide-react'
|
|
38
|
+
import { useAuth } from '@digilogiclabs/saas-factory-auth'
|
|
39
|
+
import { AITextGenerator, AIAudioGenerator, AIVideoGenerator, AIChat, AIProvider } from '@digilogiclabs/saas-factory-ai'
|
|
40
|
+
import Link from 'next/link'
|
|
41
|
+
import { useState } from 'react'
|
|
42
|
+
|
|
43
|
+
export default function Home() {
|
|
44
|
+
const { user, signOut, loading } = useAuth()
|
|
45
|
+
const networkInfo = useNetworkInfo()
|
|
46
|
+
const isOnline = useOfflineState()
|
|
47
|
+
const [isRefreshing, setIsRefreshing] = useState(false)
|
|
48
|
+
const [activeAITool, setActiveAITool] = useState<'text' | 'audio' | 'video' | 'chat'>('chat')
|
|
49
|
+
|
|
50
|
+
// Modern design tokens
|
|
51
|
+
const animations = useAnimationTokens()
|
|
52
|
+
const glass = useGlassmorphism()
|
|
53
|
+
|
|
54
|
+
const projectName = "{{projectName}}"
|
|
55
|
+
const projectDescription = "{{description}}"
|
|
56
|
+
|
|
57
|
+
const heroConfig = {
|
|
58
|
+
badge: {
|
|
59
|
+
text: "🤖 AI-Powered Platform",
|
|
60
|
+
variant: "secondary" as const,
|
|
61
|
+
icon: Brain
|
|
62
|
+
},
|
|
63
|
+
title: {
|
|
64
|
+
text: "Welcome to " + projectName,
|
|
65
|
+
highlight: projectName,
|
|
66
|
+
size: "xl" as const
|
|
67
|
+
},
|
|
68
|
+
description: projectDescription + ". Harness the power of AI for text generation, audio creation, video production, and intelligent conversations."
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const handleSignOut = async () => {
|
|
72
|
+
try {
|
|
73
|
+
await signOut()
|
|
74
|
+
} catch (err) {
|
|
75
|
+
console.error('Sign out error:', err)
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const handleRefresh = async () => {
|
|
80
|
+
setIsRefreshing(true)
|
|
81
|
+
// Simulate refresh
|
|
82
|
+
await new Promise(resolve => setTimeout(resolve, 1500))
|
|
83
|
+
setIsRefreshing(false)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const aiTools = [
|
|
87
|
+
{
|
|
88
|
+
id: 'chat' as const,
|
|
89
|
+
title: 'AI Chat',
|
|
90
|
+
description: 'Intelligent conversations and assistance',
|
|
91
|
+
icon: MessageSquare,
|
|
92
|
+
color: 'blue',
|
|
93
|
+
gradient: 'from-blue-500 to-cyan-500'
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
id: 'text' as const,
|
|
97
|
+
title: 'Text Generation',
|
|
98
|
+
description: 'Create content, articles, and copy',
|
|
99
|
+
icon: FileText,
|
|
100
|
+
color: 'purple',
|
|
101
|
+
gradient: 'from-purple-500 to-pink-500'
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
id: 'audio' as const,
|
|
105
|
+
title: 'Audio Generation',
|
|
106
|
+
description: 'Generate music, voices, and sound effects',
|
|
107
|
+
icon: Headphones,
|
|
108
|
+
color: 'green',
|
|
109
|
+
gradient: 'from-green-500 to-emerald-500'
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
id: 'video' as const,
|
|
113
|
+
title: 'Video Generation',
|
|
114
|
+
description: 'Create videos, animations, and visual content',
|
|
115
|
+
icon: Monitor,
|
|
116
|
+
color: 'orange',
|
|
117
|
+
gradient: 'from-orange-500 to-red-500'
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
|
|
121
|
+
const renderAITool = () => {
|
|
122
|
+
const aiConfig = {
|
|
123
|
+
apiKey: process.env.NEXT_PUBLIC_AI_API_KEY || '',
|
|
124
|
+
provider: 'openai' as const,
|
|
125
|
+
model: 'gpt-4'
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
switch (activeAITool) {
|
|
129
|
+
case 'chat':
|
|
130
|
+
return (
|
|
131
|
+
<div className={`${glass.card} ${glass.border} rounded-2xl p-6 h-96`}>
|
|
132
|
+
<AIProvider config={aiConfig}>
|
|
133
|
+
<AIChat
|
|
134
|
+
placeholder="Ask me anything..."
|
|
135
|
+
showTypingIndicator={true}
|
|
136
|
+
enableFileUpload={true}
|
|
137
|
+
maxMessages={50}
|
|
138
|
+
className="h-full"
|
|
139
|
+
/>
|
|
140
|
+
</AIProvider>
|
|
141
|
+
</div>
|
|
142
|
+
)
|
|
143
|
+
case 'text':
|
|
144
|
+
return (
|
|
145
|
+
<div className={`${glass.card} ${glass.border} rounded-2xl p-6`}>
|
|
146
|
+
<AIProvider config={aiConfig}>
|
|
147
|
+
<AITextGenerator
|
|
148
|
+
placeholder="Describe what you want to generate..."
|
|
149
|
+
maxLength={2000}
|
|
150
|
+
showWordCount={true}
|
|
151
|
+
templates={[
|
|
152
|
+
'Blog post',
|
|
153
|
+
'Product description',
|
|
154
|
+
'Email',
|
|
155
|
+
'Social media post',
|
|
156
|
+
'Technical documentation'
|
|
157
|
+
]}
|
|
158
|
+
className="min-h-64"
|
|
159
|
+
/>
|
|
160
|
+
</AIProvider>
|
|
161
|
+
</div>
|
|
162
|
+
)
|
|
163
|
+
case 'audio':
|
|
164
|
+
return (
|
|
165
|
+
<div className={`${glass.card} ${glass.border} rounded-2xl p-6`}>
|
|
166
|
+
<AIProvider config={aiConfig}>
|
|
167
|
+
<AIAudioGenerator
|
|
168
|
+
placeholder="Describe the audio you want to create..."
|
|
169
|
+
supportedFormats={['mp3', 'wav', 'ogg']}
|
|
170
|
+
maxDuration={300}
|
|
171
|
+
showWaveform={true}
|
|
172
|
+
className="min-h-64"
|
|
173
|
+
/>
|
|
174
|
+
</AIProvider>
|
|
175
|
+
</div>
|
|
176
|
+
)
|
|
177
|
+
case 'video':
|
|
178
|
+
return (
|
|
179
|
+
<div className={`${glass.card} ${glass.border} rounded-2xl p-6`}>
|
|
180
|
+
<AIProvider config={aiConfig}>
|
|
181
|
+
<AIVideoGenerator
|
|
182
|
+
placeholder="Describe the video you want to create..."
|
|
183
|
+
supportedFormats={['mp4', 'webm']}
|
|
184
|
+
maxDuration={60}
|
|
185
|
+
resolution="1080p"
|
|
186
|
+
showPreview={true}
|
|
187
|
+
className="min-h-64"
|
|
188
|
+
/>
|
|
189
|
+
</AIProvider>
|
|
190
|
+
</div>
|
|
191
|
+
)
|
|
192
|
+
default:
|
|
193
|
+
return null
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
return (
|
|
198
|
+
<PageTransition type="fade" duration={300}>
|
|
199
|
+
<OfflineWrapper
|
|
200
|
+
cacheStrategy="stale-while-revalidate"
|
|
201
|
+
showOfflineIndicator={true}
|
|
202
|
+
backgroundSync={true}
|
|
203
|
+
>
|
|
204
|
+
<PullToRefresh
|
|
205
|
+
onRefresh={handleRefresh}
|
|
206
|
+
threshold={80}
|
|
207
|
+
loadingIndicator="spinner"
|
|
208
|
+
hapticOnTrigger={true}
|
|
209
|
+
networkAware={true}
|
|
210
|
+
>
|
|
211
|
+
<main className={`min-h-screen ${glass.background.primary} relative overflow-hidden`}>
|
|
212
|
+
{/* Glassmorphism background overlay */}
|
|
213
|
+
<div className={`absolute inset-0 ${glass.background.accent} opacity-30`} />
|
|
214
|
+
<div className="relative z-10">
|
|
215
|
+
<MobileContainer className="py-8">
|
|
216
|
+
{/* Simple Auth Status */}
|
|
217
|
+
{user && (
|
|
218
|
+
<div className="flex justify-end mb-8">
|
|
219
|
+
<div className="flex items-center gap-4">
|
|
220
|
+
<span className="text-sm text-gray-600 dark:text-gray-300">
|
|
221
|
+
Welcome, {user.email?.split('@')[0]}
|
|
222
|
+
</span>
|
|
223
|
+
<Button variant="outline" size="sm" onClick={handleSignOut}>
|
|
224
|
+
<LogOut className="w-4 h-4 mr-2" />
|
|
225
|
+
Sign Out
|
|
226
|
+
</Button>
|
|
227
|
+
</div>
|
|
228
|
+
</div>
|
|
229
|
+
)}
|
|
230
|
+
|
|
231
|
+
{!user && !loading && (
|
|
232
|
+
<div className="flex justify-end mb-8">
|
|
233
|
+
<div className="flex gap-2">
|
|
234
|
+
<Link href="/login">
|
|
235
|
+
<Button variant="outline" size="sm">Sign In</Button>
|
|
236
|
+
</Link>
|
|
237
|
+
<Link href="/signup">
|
|
238
|
+
<Button size="sm">Sign Up</Button>
|
|
239
|
+
</Link>
|
|
240
|
+
</div>
|
|
241
|
+
</div>
|
|
242
|
+
)}
|
|
243
|
+
|
|
244
|
+
{/* Hero Section */}
|
|
245
|
+
<MobileHero
|
|
246
|
+
badge={heroConfig.badge}
|
|
247
|
+
title={heroConfig.title}
|
|
248
|
+
description={heroConfig.description}
|
|
249
|
+
actions={[
|
|
250
|
+
{
|
|
251
|
+
label: "View Pricing",
|
|
252
|
+
href: "/checkout",
|
|
253
|
+
icon: ArrowRight,
|
|
254
|
+
variant: "default",
|
|
255
|
+
size: "lg"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
label: "Learn More",
|
|
259
|
+
variant: "outline",
|
|
260
|
+
size: "lg"
|
|
261
|
+
}
|
|
262
|
+
]}
|
|
263
|
+
className="text-center mb-12"
|
|
264
|
+
/>
|
|
265
|
+
|
|
266
|
+
{/* AI Tool Selector */}
|
|
267
|
+
<div className="mb-8">
|
|
268
|
+
<h2 className="text-2xl font-bold text-center mb-6 bg-gradient-to-r from-purple-400 to-pink-400 bg-clip-text text-transparent">
|
|
269
|
+
Choose Your AI Tool
|
|
270
|
+
</h2>
|
|
271
|
+
<div className="grid grid-cols-2 lg:grid-cols-4 gap-4 mb-8">
|
|
272
|
+
{aiTools.map((tool) => {
|
|
273
|
+
const Icon = tool.icon
|
|
274
|
+
const isActive = activeAITool === tool.id
|
|
275
|
+
return (
|
|
276
|
+
<button
|
|
277
|
+
key={tool.id}
|
|
278
|
+
onClick={() => setActiveAITool(tool.id)}
|
|
279
|
+
className={`
|
|
280
|
+
${glass.card} ${glass.border}
|
|
281
|
+
rounded-2xl p-4 text-center transition-all duration-300
|
|
282
|
+
${isActive
|
|
283
|
+
? `bg-gradient-to-r ${tool.gradient} text-white shadow-lg scale-105`
|
|
284
|
+
: `${animations.hover.scale} hover:shadow-lg`
|
|
285
|
+
}
|
|
286
|
+
`}
|
|
287
|
+
>
|
|
288
|
+
<div className={`mx-auto w-12 h-12 rounded-xl flex items-center justify-center mb-3 ${
|
|
289
|
+
isActive ? 'bg-white/20' : `${glass.accent}`
|
|
290
|
+
}`}>
|
|
291
|
+
<Icon className={`h-6 w-6 ${isActive ? 'text-white' : `text-${tool.color}-400`}`} />
|
|
292
|
+
</div>
|
|
293
|
+
<h3 className="font-semibold text-sm mb-1">{tool.title}</h3>
|
|
294
|
+
<p className={`text-xs ${isActive ? 'text-white/80' : 'text-gray-600 dark:text-gray-300'}`}>
|
|
295
|
+
{tool.description}
|
|
296
|
+
</p>
|
|
297
|
+
</button>
|
|
298
|
+
)
|
|
299
|
+
})}
|
|
300
|
+
</div>
|
|
301
|
+
</div>
|
|
302
|
+
|
|
303
|
+
{/* AI Tool Interface */}
|
|
304
|
+
<div className="mb-12">
|
|
305
|
+
{renderAITool()}
|
|
306
|
+
</div>
|
|
307
|
+
|
|
308
|
+
{/* Features Overview */}
|
|
309
|
+
<ResponsiveGrid columns={{ base: 1, sm: 2, md: 4 }} gap="lg" className="mb-16">
|
|
310
|
+
<div className={`${glass.card} ${glass.border} text-center p-6 rounded-2xl ${animations.hover.scale} ${animations.transition.smooth}`}>
|
|
311
|
+
<div className={`mx-auto w-12 h-12 ${glass.accent} rounded-xl flex items-center justify-center mb-4 ${animations.hover.glow}`}>
|
|
312
|
+
<Brain className="h-6 w-6 text-purple-400" />
|
|
313
|
+
</div>
|
|
314
|
+
<h3 className="text-lg font-semibold mb-2">Advanced AI Models</h3>
|
|
315
|
+
<p className="text-sm text-gray-600 dark:text-gray-300">
|
|
316
|
+
Powered by the latest AI technology for superior results
|
|
317
|
+
</p>
|
|
318
|
+
</div>
|
|
319
|
+
|
|
320
|
+
<div className={`${glass.card} ${glass.border} text-center p-6 rounded-2xl ${animations.hover.scale} ${animations.transition.smooth}`}>
|
|
321
|
+
<div className={`mx-auto w-12 h-12 ${glass.accent} rounded-xl flex items-center justify-center mb-4 ${animations.hover.glow}`}>
|
|
322
|
+
<Zap className="h-6 w-6 text-yellow-400" />
|
|
323
|
+
</div>
|
|
324
|
+
<h3 className="text-lg font-semibold mb-2">Lightning Fast</h3>
|
|
325
|
+
<p className="text-sm text-gray-600 dark:text-gray-300">
|
|
326
|
+
Generate content in seconds with optimized processing
|
|
327
|
+
</p>
|
|
328
|
+
</div>
|
|
329
|
+
|
|
330
|
+
<div className={`${glass.card} ${glass.border} text-center p-6 rounded-2xl ${animations.hover.scale} ${animations.transition.smooth}`}>
|
|
331
|
+
<div className={`mx-auto w-12 h-12 ${glass.accent} rounded-xl flex items-center justify-center mb-4 ${animations.hover.glow}`}>
|
|
332
|
+
<Shield className="h-6 w-6 text-green-400" />
|
|
333
|
+
</div>
|
|
334
|
+
<h3 className="text-lg font-semibold mb-2">Secure & Private</h3>
|
|
335
|
+
<p className="text-sm text-gray-600 dark:text-gray-300">
|
|
336
|
+
Your data and creations are always protected and private
|
|
337
|
+
</p>
|
|
338
|
+
</div>
|
|
339
|
+
|
|
340
|
+
<div className={`${glass.card} ${glass.border} text-center p-6 rounded-2xl ${animations.hover.scale} ${animations.transition.smooth}`}>
|
|
341
|
+
<div className={`mx-auto w-12 h-12 ${glass.accent} rounded-xl flex items-center justify-center mb-4 ${animations.hover.glow}`}>
|
|
342
|
+
<Sparkles className="h-6 w-6 text-pink-400" />
|
|
343
|
+
</div>
|
|
344
|
+
<h3 className="text-lg font-semibold mb-2">Creative Freedom</h3>
|
|
345
|
+
<p className="text-sm text-gray-600 dark:text-gray-300">
|
|
346
|
+
Unlimited possibilities for your creative projects
|
|
347
|
+
</p>
|
|
348
|
+
</div>
|
|
349
|
+
</ResponsiveGrid>
|
|
350
|
+
|
|
351
|
+
{/* Usage Stats */}
|
|
352
|
+
<div className={`${glass.card} ${glass.border} rounded-2xl p-6 mb-16`}>
|
|
353
|
+
<h2 className="text-xl font-bold text-center mb-6">Your AI Usage</h2>
|
|
354
|
+
<div className="grid grid-cols-2 lg:grid-cols-4 gap-6">
|
|
355
|
+
<div className="text-center">
|
|
356
|
+
<div className="text-3xl font-bold text-purple-400 mb-2">1,247</div>
|
|
357
|
+
<div className="text-sm text-gray-600 dark:text-gray-300">Text Generated</div>
|
|
358
|
+
</div>
|
|
359
|
+
<div className="text-center">
|
|
360
|
+
<div className="text-3xl font-bold text-green-400 mb-2">23</div>
|
|
361
|
+
<div className="text-sm text-gray-600 dark:text-gray-300">Audio Created</div>
|
|
362
|
+
</div>
|
|
363
|
+
<div className="text-center">
|
|
364
|
+
<div className="text-3xl font-bold text-orange-400 mb-2">8</div>
|
|
365
|
+
<div className="text-sm text-gray-600 dark:text-gray-300">Videos Made</div>
|
|
366
|
+
</div>
|
|
367
|
+
<div className="text-center">
|
|
368
|
+
<div className="text-3xl font-bold text-blue-400 mb-2">5.2k</div>
|
|
369
|
+
<div className="text-sm text-gray-600 dark:text-gray-300">Chat Messages</div>
|
|
370
|
+
</div>
|
|
371
|
+
</div>
|
|
372
|
+
</div>
|
|
373
|
+
</MobileContainer>
|
|
374
|
+
</div>
|
|
375
|
+
</main>
|
|
376
|
+
</PullToRefresh>
|
|
377
|
+
</OfflineWrapper>
|
|
378
|
+
</PageTransition>
|
|
379
|
+
)
|
|
380
|
+
}
|