@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,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{packageName}}",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "{{description}} - Full-Stack AI Platform (with UI v0.18.2 + Auth v1.0.0 + Payments + AI v1.0.0)",
|
|
5
|
+
"private": true,
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "next dev",
|
|
8
|
+
"build": "next build",
|
|
9
|
+
"start": "next start",
|
|
10
|
+
"lint": "next lint",
|
|
11
|
+
"type-check": "tsc --noEmit",
|
|
12
|
+
"test": "vitest",
|
|
13
|
+
"test:ui": "vitest --ui",
|
|
14
|
+
"test:run": "vitest run"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"next": "^15.0.0",
|
|
18
|
+
"react": "^19.0.0",
|
|
19
|
+
"react-dom": "^19.0.0",
|
|
20
|
+
"@digilogiclabs/saas-factory-ui": "^0.18.2",
|
|
21
|
+
"@digilogiclabs/saas-factory-auth": "^1.0.0",
|
|
22
|
+
"@digilogiclabs/saas-factory-payments": "^1.0.0",
|
|
23
|
+
"@digilogiclabs/saas-factory-ai": "^1.0.0",
|
|
24
|
+
"@digilogiclabs/saas-factory-ai-types": "^1.0.0",
|
|
25
|
+
"stripe": "^14.0.0",
|
|
26
|
+
"tailwindcss": "^3.3.0",
|
|
27
|
+
"autoprefixer": "^10.4.16",
|
|
28
|
+
"postcss": "^8.4.31",
|
|
29
|
+
"clsx": "^2.0.0",
|
|
30
|
+
"class-variance-authority": "^0.7.0",
|
|
31
|
+
"tailwind-merge": "^2.0.0",
|
|
32
|
+
"next-themes": "^0.2.1",
|
|
33
|
+
"lucide-react": "^0.542.0",
|
|
34
|
+
"zod": "^3.22.4",
|
|
35
|
+
"@supabase/supabase-js": "^2.0.0"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"typescript": "^5.0.0",
|
|
39
|
+
"@types/node": "^20.0.0",
|
|
40
|
+
"@types/react": "^19.0.0",
|
|
41
|
+
"@types/react-dom": "^19.0.0",
|
|
42
|
+
"eslint": "^8.0.0",
|
|
43
|
+
"eslint-config-next": "^15.0.0",
|
|
44
|
+
"prettier": "^3.0.0",
|
|
45
|
+
"vitest": "^1.0.0",
|
|
46
|
+
"@vitejs/plugin-react": "^4.0.0",
|
|
47
|
+
"@testing-library/react": "^16.0.0",
|
|
48
|
+
"@testing-library/jest-dom": "^6.0.0",
|
|
49
|
+
"@testing-library/user-event": "^14.0.0",
|
|
50
|
+
"jsdom": "^24.0.0"
|
|
51
|
+
},
|
|
52
|
+
"engines": {
|
|
53
|
+
"node": ">=18.0.0"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
Card,
|
|
5
|
+
PageTransition,
|
|
6
|
+
MobileContainer,
|
|
7
|
+
ResponsiveGrid,
|
|
8
|
+
useAnimationTokens,
|
|
9
|
+
useGlassmorphism
|
|
10
|
+
} from '@digilogiclabs/saas-factory-ui'
|
|
11
|
+
import {
|
|
12
|
+
ArrowLeft,
|
|
13
|
+
MessageSquare,
|
|
14
|
+
FileText,
|
|
15
|
+
Headphones,
|
|
16
|
+
Monitor,
|
|
17
|
+
Clock,
|
|
18
|
+
TrendingUp,
|
|
19
|
+
Zap,
|
|
20
|
+
Download,
|
|
21
|
+
Share2,
|
|
22
|
+
Heart,
|
|
23
|
+
MoreHorizontal
|
|
24
|
+
} from 'lucide-react'
|
|
25
|
+
import { useAuth } from '@digilogiclabs/saas-factory-auth'
|
|
26
|
+
import Link from 'next/link'
|
|
27
|
+
import { useState, useEffect } from 'react'
|
|
28
|
+
|
|
29
|
+
interface AIGeneration {
|
|
30
|
+
id: string
|
|
31
|
+
type: 'chat' | 'text' | 'audio' | 'video'
|
|
32
|
+
title: string
|
|
33
|
+
prompt: string
|
|
34
|
+
content: string
|
|
35
|
+
createdAt: string
|
|
36
|
+
status: 'completed' | 'processing' | 'failed'
|
|
37
|
+
metadata?: any
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export default function AIPage() {
|
|
41
|
+
const { user, loading } = useAuth()
|
|
42
|
+
const [generations, setGenerations] = useState<AIGeneration[]>([])
|
|
43
|
+
const [selectedType, setSelectedType] = useState<'all' | 'chat' | 'text' | 'audio' | 'video'>('all')
|
|
44
|
+
|
|
45
|
+
const animations = useAnimationTokens()
|
|
46
|
+
const glass = useGlassmorphism()
|
|
47
|
+
|
|
48
|
+
// Mock data for demonstration
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
const mockGenerations: AIGeneration[] = [
|
|
51
|
+
{
|
|
52
|
+
id: '1',
|
|
53
|
+
type: 'text',
|
|
54
|
+
title: 'Blog Post: AI in Healthcare',
|
|
55
|
+
prompt: 'Write a blog post about AI applications in healthcare',
|
|
56
|
+
content: 'Artificial Intelligence is revolutionizing healthcare by enabling faster diagnoses...',
|
|
57
|
+
createdAt: '2024-01-15T10:30:00Z',
|
|
58
|
+
status: 'completed',
|
|
59
|
+
metadata: { wordCount: 847, template: 'Blog post' }
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: '2',
|
|
63
|
+
type: 'audio',
|
|
64
|
+
title: 'Meditation Music',
|
|
65
|
+
prompt: 'Create calming meditation music with nature sounds',
|
|
66
|
+
content: 'Audio file: meditation-music-v1.mp3',
|
|
67
|
+
createdAt: '2024-01-15T09:15:00Z',
|
|
68
|
+
status: 'completed',
|
|
69
|
+
metadata: { duration: 300, format: 'mp3' }
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: '3',
|
|
73
|
+
type: 'video',
|
|
74
|
+
title: 'Product Demo',
|
|
75
|
+
prompt: 'Create a product demonstration video for a mobile app',
|
|
76
|
+
content: 'Video file: product-demo-v1.mp4',
|
|
77
|
+
createdAt: '2024-01-14T16:45:00Z',
|
|
78
|
+
status: 'completed',
|
|
79
|
+
metadata: { duration: 60, resolution: '1080p' }
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: '4',
|
|
83
|
+
type: 'chat',
|
|
84
|
+
title: 'Technical Discussion',
|
|
85
|
+
prompt: 'How do I optimize React performance?',
|
|
86
|
+
content: 'Here are the best practices for optimizing React performance...',
|
|
87
|
+
createdAt: '2024-01-14T14:20:00Z',
|
|
88
|
+
status: 'completed',
|
|
89
|
+
metadata: { messageCount: 8 }
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
setGenerations(mockGenerations)
|
|
93
|
+
}, [])
|
|
94
|
+
|
|
95
|
+
const filteredGenerations = selectedType === 'all'
|
|
96
|
+
? generations
|
|
97
|
+
: generations.filter(gen => gen.type === selectedType)
|
|
98
|
+
|
|
99
|
+
const stats = {
|
|
100
|
+
totalGenerations: generations.length,
|
|
101
|
+
textGenerated: generations.filter(g => g.type === 'text').length,
|
|
102
|
+
audioCreated: generations.filter(g => g.type === 'audio').length,
|
|
103
|
+
videosProduced: generations.filter(g => g.type === 'video').length,
|
|
104
|
+
chatSessions: generations.filter(g => g.type === 'chat').length
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const getTypeIcon = (type: AIGeneration['type']) => {
|
|
108
|
+
switch (type) {
|
|
109
|
+
case 'text': return FileText
|
|
110
|
+
case 'audio': return Headphones
|
|
111
|
+
case 'video': return Monitor
|
|
112
|
+
case 'chat': return MessageSquare
|
|
113
|
+
default: return FileText
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const getTypeColor = (type: AIGeneration['type']) => {
|
|
118
|
+
switch (type) {
|
|
119
|
+
case 'text': return 'purple'
|
|
120
|
+
case 'audio': return 'green'
|
|
121
|
+
case 'video': return 'orange'
|
|
122
|
+
case 'chat': return 'blue'
|
|
123
|
+
default: return 'gray'
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const formatDate = (dateString: string) => {
|
|
128
|
+
return new Date(dateString).toLocaleDateString('en-US', {
|
|
129
|
+
month: 'short',
|
|
130
|
+
day: 'numeric',
|
|
131
|
+
hour: '2-digit',
|
|
132
|
+
minute: '2-digit'
|
|
133
|
+
})
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (loading) {
|
|
137
|
+
return (
|
|
138
|
+
<div className="min-h-screen flex items-center justify-center">
|
|
139
|
+
<div className="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-500"></div>
|
|
140
|
+
</div>
|
|
141
|
+
)
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if (!user) {
|
|
145
|
+
return (
|
|
146
|
+
<div className="min-h-screen flex items-center justify-center">
|
|
147
|
+
<div className="text-center">
|
|
148
|
+
<h2 className="text-2xl font-bold mb-4">Access Denied</h2>
|
|
149
|
+
<p className="mb-4">You need to sign in to access the AI dashboard.</p>
|
|
150
|
+
<Link href="/login" className="text-blue-500 hover:underline">
|
|
151
|
+
Sign In
|
|
152
|
+
</Link>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
)
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return (
|
|
159
|
+
<PageTransition type="slide" direction="up" duration={300}>
|
|
160
|
+
<main className={`min-h-screen ${glass.background.primary} relative overflow-hidden`}>
|
|
161
|
+
<div className={`absolute inset-0 ${glass.background.accent} opacity-30`} />
|
|
162
|
+
<div className="relative z-10">
|
|
163
|
+
<MobileContainer className="py-8">
|
|
164
|
+
{/* Header */}
|
|
165
|
+
<div className="flex items-center justify-between mb-8">
|
|
166
|
+
<div className="flex items-center gap-4">
|
|
167
|
+
<Link href="/" className={`${glass.card} ${glass.border} p-2 rounded-xl ${animations.hover.scale}`}>
|
|
168
|
+
<ArrowLeft className="w-5 h-5" />
|
|
169
|
+
</Link>
|
|
170
|
+
<div>
|
|
171
|
+
<h1 className="text-2xl font-bold">AI Dashboard</h1>
|
|
172
|
+
<p className="text-gray-600 dark:text-gray-300">Manage your AI generations</p>
|
|
173
|
+
</div>
|
|
174
|
+
</div>
|
|
175
|
+
</div>
|
|
176
|
+
|
|
177
|
+
{/* Stats Overview */}
|
|
178
|
+
<div className="grid grid-cols-2 lg:grid-cols-5 gap-4 mb-8">
|
|
179
|
+
<div className={`${glass.card} ${glass.border} rounded-2xl p-4 text-center ${animations.hover.lift}`}>
|
|
180
|
+
<div className="text-2xl font-bold text-blue-400 mb-1">{stats.totalGenerations}</div>
|
|
181
|
+
<div className="text-xs text-gray-600 dark:text-gray-300">Total</div>
|
|
182
|
+
</div>
|
|
183
|
+
<div className={`${glass.card} ${glass.border} rounded-2xl p-4 text-center ${animations.hover.lift}`}>
|
|
184
|
+
<div className="text-2xl font-bold text-purple-400 mb-1">{stats.textGenerated}</div>
|
|
185
|
+
<div className="text-xs text-gray-600 dark:text-gray-300">Text</div>
|
|
186
|
+
</div>
|
|
187
|
+
<div className={`${glass.card} ${glass.border} rounded-2xl p-4 text-center ${animations.hover.lift}`}>
|
|
188
|
+
<div className="text-2xl font-bold text-green-400 mb-1">{stats.audioCreated}</div>
|
|
189
|
+
<div className="text-xs text-gray-600 dark:text-gray-300">Audio</div>
|
|
190
|
+
</div>
|
|
191
|
+
<div className={`${glass.card} ${glass.border} rounded-2xl p-4 text-center ${animations.hover.lift}`}>
|
|
192
|
+
<div className="text-2xl font-bold text-orange-400 mb-1">{stats.videosProduced}</div>
|
|
193
|
+
<div className="text-xs text-gray-600 dark:text-gray-300">Video</div>
|
|
194
|
+
</div>
|
|
195
|
+
<div className={`${glass.card} ${glass.border} rounded-2xl p-4 text-center ${animations.hover.lift}`}>
|
|
196
|
+
<div className="text-2xl font-bold text-blue-400 mb-1">{stats.chatSessions}</div>
|
|
197
|
+
<div className="text-xs text-gray-600 dark:text-gray-300">Chat</div>
|
|
198
|
+
</div>
|
|
199
|
+
</div>
|
|
200
|
+
|
|
201
|
+
{/* Filter Tabs */}
|
|
202
|
+
<div className={`${glass.card} ${glass.border} rounded-2xl p-1 mb-8 inline-flex`}>
|
|
203
|
+
{['all', 'chat', 'text', 'audio', 'video'].map((type) => (
|
|
204
|
+
<button
|
|
205
|
+
key={type}
|
|
206
|
+
onClick={() => setSelectedType(type as any)}
|
|
207
|
+
className={`px-4 py-2 rounded-xl text-sm font-medium transition-all duration-200 ${
|
|
208
|
+
selectedType === type
|
|
209
|
+
? 'bg-blue-500 text-white shadow-lg'
|
|
210
|
+
: 'text-gray-600 dark:text-gray-300 hover:bg-white/10'
|
|
211
|
+
}`}
|
|
212
|
+
>
|
|
213
|
+
{type.charAt(0).toUpperCase() + type.slice(1)}
|
|
214
|
+
</button>
|
|
215
|
+
))}
|
|
216
|
+
</div>
|
|
217
|
+
|
|
218
|
+
{/* Generations Grid */}
|
|
219
|
+
<div className="grid gap-6">
|
|
220
|
+
{filteredGenerations.map((generation) => {
|
|
221
|
+
const Icon = getTypeIcon(generation.type)
|
|
222
|
+
const color = getTypeColor(generation.type)
|
|
223
|
+
|
|
224
|
+
return (
|
|
225
|
+
<div
|
|
226
|
+
key={generation.id}
|
|
227
|
+
className={`${glass.card} ${glass.border} rounded-2xl p-6 ${animations.hover.lift} ${animations.transition.smooth}`}
|
|
228
|
+
>
|
|
229
|
+
<div className="flex items-start justify-between mb-4">
|
|
230
|
+
<div className="flex items-start gap-4">
|
|
231
|
+
<div className={`w-12 h-12 rounded-xl bg-${color}-500/20 flex items-center justify-center`}>
|
|
232
|
+
<Icon className={`w-6 h-6 text-${color}-400`} />
|
|
233
|
+
</div>
|
|
234
|
+
<div className="flex-1">
|
|
235
|
+
<h3 className="font-semibold text-lg mb-1">{generation.title}</h3>
|
|
236
|
+
<p className="text-sm text-gray-600 dark:text-gray-300 mb-2">
|
|
237
|
+
{generation.prompt}
|
|
238
|
+
</p>
|
|
239
|
+
<div className="flex items-center gap-4 text-xs text-gray-500">
|
|
240
|
+
<div className="flex items-center gap-1">
|
|
241
|
+
<Clock className="w-3 h-3" />
|
|
242
|
+
{formatDate(generation.createdAt)}
|
|
243
|
+
</div>
|
|
244
|
+
{generation.metadata && (
|
|
245
|
+
<div className="flex items-center gap-2">
|
|
246
|
+
{generation.metadata.wordCount && (
|
|
247
|
+
<span>{generation.metadata.wordCount} words</span>
|
|
248
|
+
)}
|
|
249
|
+
{generation.metadata.duration && (
|
|
250
|
+
<span>{generation.metadata.duration}s</span>
|
|
251
|
+
)}
|
|
252
|
+
{generation.metadata.resolution && (
|
|
253
|
+
<span>{generation.metadata.resolution}</span>
|
|
254
|
+
)}
|
|
255
|
+
{generation.metadata.messageCount && (
|
|
256
|
+
<span>{generation.metadata.messageCount} messages</span>
|
|
257
|
+
)}
|
|
258
|
+
</div>
|
|
259
|
+
)}
|
|
260
|
+
</div>
|
|
261
|
+
</div>
|
|
262
|
+
</div>
|
|
263
|
+
<div className="flex items-center gap-2">
|
|
264
|
+
<button className={`p-2 rounded-xl ${glass.card} ${glass.border} ${animations.hover.scale}`}>
|
|
265
|
+
<Download className="w-4 h-4" />
|
|
266
|
+
</button>
|
|
267
|
+
<button className={`p-2 rounded-xl ${glass.card} ${glass.border} ${animations.hover.scale}`}>
|
|
268
|
+
<Share2 className="w-4 h-4" />
|
|
269
|
+
</button>
|
|
270
|
+
<button className={`p-2 rounded-xl ${glass.card} ${glass.border} ${animations.hover.scale}`}>
|
|
271
|
+
<MoreHorizontal className="w-4 h-4" />
|
|
272
|
+
</button>
|
|
273
|
+
</div>
|
|
274
|
+
</div>
|
|
275
|
+
|
|
276
|
+
<div className={`p-4 rounded-xl bg-gray-50 dark:bg-gray-800/50`}>
|
|
277
|
+
<p className="text-sm line-clamp-3">{generation.content}</p>
|
|
278
|
+
</div>
|
|
279
|
+
</div>
|
|
280
|
+
)
|
|
281
|
+
})}
|
|
282
|
+
</div>
|
|
283
|
+
|
|
284
|
+
{filteredGenerations.length === 0 && (
|
|
285
|
+
<div className={`${glass.card} ${glass.border} rounded-2xl p-12 text-center`}>
|
|
286
|
+
<div className="text-gray-400 mb-4">
|
|
287
|
+
<FileText className="w-16 h-16 mx-auto" />
|
|
288
|
+
</div>
|
|
289
|
+
<h3 className="text-xl font-semibold mb-2">No generations found</h3>
|
|
290
|
+
<p className="text-gray-600 dark:text-gray-300 mb-6">
|
|
291
|
+
{selectedType === 'all'
|
|
292
|
+
? "You haven't created any AI content yet."
|
|
293
|
+
: `No ${selectedType} generations found.`
|
|
294
|
+
}
|
|
295
|
+
</p>
|
|
296
|
+
<Link
|
|
297
|
+
href="/"
|
|
298
|
+
className="inline-flex items-center gap-2 px-6 py-3 bg-blue-500 text-white rounded-xl hover:bg-blue-600 transition-colors"
|
|
299
|
+
>
|
|
300
|
+
<Zap className="w-4 h-4" />
|
|
301
|
+
Start Creating
|
|
302
|
+
</Link>
|
|
303
|
+
</div>
|
|
304
|
+
)}
|
|
305
|
+
</MobileContainer>
|
|
306
|
+
</div>
|
|
307
|
+
</main>
|
|
308
|
+
</PageTransition>
|
|
309
|
+
)
|
|
310
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { NextRequest, NextResponse } from 'next/server'
|
|
2
|
+
import { createClient } from '@/lib/supabase/server'
|
|
3
|
+
|
|
4
|
+
export async function POST(request: NextRequest) {
|
|
5
|
+
try {
|
|
6
|
+
// Check authentication
|
|
7
|
+
const supabase = await createClient()
|
|
8
|
+
const { data: { session } } = await supabase.auth.getSession()
|
|
9
|
+
|
|
10
|
+
if (!session) {
|
|
11
|
+
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const { prompt, duration = 30, format = 'mp3', voice = 'default' } = await request.json()
|
|
15
|
+
|
|
16
|
+
if (!prompt) {
|
|
17
|
+
return NextResponse.json({ error: 'Audio prompt is required' }, { status: 400 })
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Mock audio generation response
|
|
21
|
+
// In a real implementation, this would generate actual audio files
|
|
22
|
+
const mockAudioUrl = `data:audio/wav;base64,UklGRnoGAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YQoGAACBhYqFbF1fdJivrJBhNjVgodDbq2EcBj+a2/LDciUFLIHO8tiJNwgZaLvt559NEAxQp+PwtmMcBjiR1/LMeSwFJHfH8N2QQAoUXrTp66hVFApGn+D2vm4eBiuZ2/LCdSMHMoXO8te`
|
|
23
|
+
|
|
24
|
+
const response = {
|
|
25
|
+
id: `audio_${Date.now()}`,
|
|
26
|
+
prompt,
|
|
27
|
+
audioUrl: mockAudioUrl,
|
|
28
|
+
duration: duration,
|
|
29
|
+
format: format,
|
|
30
|
+
voice: voice,
|
|
31
|
+
status: 'completed',
|
|
32
|
+
timestamp: new Date().toISOString(),
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Log the generation
|
|
36
|
+
await supabase
|
|
37
|
+
.from('ai_conversations')
|
|
38
|
+
.insert({
|
|
39
|
+
user_id: session.user.id,
|
|
40
|
+
message_type: 'audio_generation',
|
|
41
|
+
user_message: prompt,
|
|
42
|
+
ai_response: `Audio generated: ${duration}s, ${format}, ${voice} voice`,
|
|
43
|
+
metadata: { duration, format, voice, audioUrl: mockAudioUrl },
|
|
44
|
+
created_at: new Date().toISOString()
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
return NextResponse.json(response)
|
|
48
|
+
|
|
49
|
+
} catch (error) {
|
|
50
|
+
console.error('AI Audio Generation API Error:', error)
|
|
51
|
+
return NextResponse.json(
|
|
52
|
+
{ error: 'Internal server error' },
|
|
53
|
+
{ status: 500 }
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { NextRequest, NextResponse } from 'next/server'
|
|
2
|
+
import { createClient } from '@/lib/supabase/server'
|
|
3
|
+
|
|
4
|
+
export async function POST(request: NextRequest) {
|
|
5
|
+
try {
|
|
6
|
+
// Check authentication
|
|
7
|
+
const supabase = await createClient()
|
|
8
|
+
const { data: { session } } = await supabase.auth.getSession()
|
|
9
|
+
|
|
10
|
+
if (!session) {
|
|
11
|
+
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const { message, history = [] } = await request.json()
|
|
15
|
+
|
|
16
|
+
if (!message) {
|
|
17
|
+
return NextResponse.json({ error: 'Message is required' }, { status: 400 })
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Here you would integrate with your AI service
|
|
21
|
+
// For now, we'll return a mock response
|
|
22
|
+
const mockResponse = {
|
|
23
|
+
id: `msg_${Date.now()}`,
|
|
24
|
+
role: 'assistant',
|
|
25
|
+
content: `I received your message: "${message}". This is a mock AI response. In a real implementation, this would connect to OpenAI, Anthropic, or your preferred AI service.`,
|
|
26
|
+
timestamp: new Date().toISOString(),
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Log the conversation (optional)
|
|
30
|
+
await supabase
|
|
31
|
+
.from('ai_conversations')
|
|
32
|
+
.insert({
|
|
33
|
+
user_id: session.user.id,
|
|
34
|
+
message_type: 'chat',
|
|
35
|
+
user_message: message,
|
|
36
|
+
ai_response: mockResponse.content,
|
|
37
|
+
created_at: new Date().toISOString()
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
return NextResponse.json(mockResponse)
|
|
41
|
+
|
|
42
|
+
} catch (error) {
|
|
43
|
+
console.error('AI Chat API Error:', error)
|
|
44
|
+
return NextResponse.json(
|
|
45
|
+
{ error: 'Internal server error' },
|
|
46
|
+
{ status: 500 }
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { NextRequest, NextResponse } from 'next/server'
|
|
2
|
+
import { createClient } from '@/lib/supabase/server'
|
|
3
|
+
|
|
4
|
+
export async function POST(request: NextRequest) {
|
|
5
|
+
try {
|
|
6
|
+
// Check authentication
|
|
7
|
+
const supabase = await createClient()
|
|
8
|
+
const { data: { session } } = await supabase.auth.getSession()
|
|
9
|
+
|
|
10
|
+
if (!session) {
|
|
11
|
+
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const { prompt, template, maxLength = 1000 } = await request.json()
|
|
15
|
+
|
|
16
|
+
if (!prompt) {
|
|
17
|
+
return NextResponse.json({ error: 'Prompt is required' }, { status: 400 })
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Mock text generation response
|
|
21
|
+
const mockGeneratedText = `Generated content based on: "${prompt}"
|
|
22
|
+
|
|
23
|
+
This is a mock text generation response. In a real implementation, this would:
|
|
24
|
+
- Connect to OpenAI's GPT models
|
|
25
|
+
- Use Anthropic's Claude
|
|
26
|
+
- Integrate with Google's PaLM
|
|
27
|
+
- Or your preferred text generation service
|
|
28
|
+
|
|
29
|
+
Template: ${template || 'General'}
|
|
30
|
+
Max Length: ${maxLength} characters
|
|
31
|
+
|
|
32
|
+
The generated content would be contextually relevant, well-structured, and match the requested template style.`
|
|
33
|
+
|
|
34
|
+
const response = {
|
|
35
|
+
id: `text_${Date.now()}`,
|
|
36
|
+
content: mockGeneratedText,
|
|
37
|
+
wordCount: mockGeneratedText.split(' ').length,
|
|
38
|
+
characterCount: mockGeneratedText.length,
|
|
39
|
+
template: template || 'General',
|
|
40
|
+
timestamp: new Date().toISOString(),
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Log the generation
|
|
44
|
+
await supabase
|
|
45
|
+
.from('ai_conversations')
|
|
46
|
+
.insert({
|
|
47
|
+
user_id: session.user.id,
|
|
48
|
+
message_type: 'text_generation',
|
|
49
|
+
user_message: prompt,
|
|
50
|
+
ai_response: response.content,
|
|
51
|
+
metadata: { template, maxLength },
|
|
52
|
+
created_at: new Date().toISOString()
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
return NextResponse.json(response)
|
|
56
|
+
|
|
57
|
+
} catch (error) {
|
|
58
|
+
console.error('AI Text Generation API Error:', error)
|
|
59
|
+
return NextResponse.json(
|
|
60
|
+
{ error: 'Internal server error' },
|
|
61
|
+
{ status: 500 }
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { NextRequest, NextResponse } from 'next/server'
|
|
2
|
+
import { createClient } from '@/lib/supabase/server'
|
|
3
|
+
|
|
4
|
+
export async function POST(request: NextRequest) {
|
|
5
|
+
try {
|
|
6
|
+
// Check authentication
|
|
7
|
+
const supabase = await createClient()
|
|
8
|
+
const { data: { session } } = await supabase.auth.getSession()
|
|
9
|
+
|
|
10
|
+
if (!session) {
|
|
11
|
+
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const {
|
|
15
|
+
prompt,
|
|
16
|
+
duration = 10,
|
|
17
|
+
format = 'mp4',
|
|
18
|
+
resolution = '1080p',
|
|
19
|
+
style = 'realistic'
|
|
20
|
+
} = await request.json()
|
|
21
|
+
|
|
22
|
+
if (!prompt) {
|
|
23
|
+
return NextResponse.json({ error: 'Video prompt is required' }, { status: 400 })
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Mock video generation response
|
|
27
|
+
// In a real implementation, this would generate actual video files
|
|
28
|
+
const mockVideoUrl = `data:video/mp4;base64,AAAAHGZ0eXBtcDQyAAAAAAAcZnR5cG1wNDIAAAAAAG1wNDJpc29tYXZjMQAAAiRtb29`
|
|
29
|
+
const mockThumbnailUrl = `data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj`
|
|
30
|
+
|
|
31
|
+
const response = {
|
|
32
|
+
id: `video_${Date.now()}`,
|
|
33
|
+
prompt,
|
|
34
|
+
videoUrl: mockVideoUrl,
|
|
35
|
+
thumbnailUrl: mockThumbnailUrl,
|
|
36
|
+
duration: duration,
|
|
37
|
+
format: format,
|
|
38
|
+
resolution: resolution,
|
|
39
|
+
style: style,
|
|
40
|
+
status: 'completed',
|
|
41
|
+
processingTime: 15, // Mock processing time in seconds
|
|
42
|
+
timestamp: new Date().toISOString(),
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Log the generation
|
|
46
|
+
await supabase
|
|
47
|
+
.from('ai_conversations')
|
|
48
|
+
.insert({
|
|
49
|
+
user_id: session.user.id,
|
|
50
|
+
message_type: 'video_generation',
|
|
51
|
+
user_message: prompt,
|
|
52
|
+
ai_response: `Video generated: ${duration}s, ${resolution}, ${style} style`,
|
|
53
|
+
metadata: {
|
|
54
|
+
duration,
|
|
55
|
+
format,
|
|
56
|
+
resolution,
|
|
57
|
+
style,
|
|
58
|
+
videoUrl: mockVideoUrl,
|
|
59
|
+
thumbnailUrl: mockThumbnailUrl
|
|
60
|
+
},
|
|
61
|
+
created_at: new Date().toISOString()
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
return NextResponse.json(response)
|
|
65
|
+
|
|
66
|
+
} catch (error) {
|
|
67
|
+
console.error('AI Video Generation API Error:', error)
|
|
68
|
+
return NextResponse.json(
|
|
69
|
+
{ error: 'Internal server error' },
|
|
70
|
+
{ status: 500 }
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NextResponse } from 'next/server';
|
|
2
|
+
import type { NextRequest } from 'next/server';
|
|
3
|
+
|
|
4
|
+
export async function GET(request: NextRequest) {
|
|
5
|
+
const requestUrl = new URL(request.url);
|
|
6
|
+
|
|
7
|
+
// Placeholder auth callback - requires @digilogiclabs/saas-factory-auth package
|
|
8
|
+
console.log('Auth callback triggered - requires auth package for full functionality');
|
|
9
|
+
|
|
10
|
+
// URL to redirect to after sign in process completes
|
|
11
|
+
return NextResponse.redirect(requestUrl.origin);
|
|
12
|
+
}
|