ar-saas 0.3.0 → 0.3.2
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/LICENSE +21 -21
- package/README.md +338 -314
- package/dist/cli.js +19 -0
- package/dist/generator.js +166 -55
- package/package.json +52 -50
- package/templates/backend/.env.example +67 -67
- package/templates/backend/.prettierrc +4 -4
- package/templates/backend/README.md +249 -168
- package/templates/backend/eslint.config.mjs +35 -35
- package/templates/backend/nest-cli.json +8 -8
- package/templates/backend/package-lock.json +10979 -10979
- package/templates/backend/package.json +88 -88
- package/templates/backend/src/app.controller.spec.ts +24 -24
- package/templates/backend/src/app.controller.ts +15 -15
- package/templates/backend/src/app.module.ts +40 -40
- package/templates/backend/src/app.service.ts +11 -11
- package/templates/backend/src/common/base/base.repository.ts +221 -221
- package/templates/backend/src/common/base/base.schema.ts +24 -24
- package/templates/backend/src/common/decorators/cookie.decorator.ts +9 -9
- package/templates/backend/src/common/decorators/current-user.decorator.ts +20 -20
- package/templates/backend/src/common/decorators/workspace-id.decorator.ts +14 -14
- package/templates/backend/src/common/filters/global-exception.filter.ts +61 -61
- package/templates/backend/src/common/guards/jwt-auth.guard.ts +5 -5
- package/templates/backend/src/common/interceptors/workspace-tenant.interceptor.ts +45 -45
- package/templates/backend/src/main.ts +51 -51
- package/templates/backend/src/modules/auth/auth.controller.ts +158 -158
- package/templates/backend/src/modules/auth/auth.module.ts +20 -20
- package/templates/backend/src/modules/auth/auth.service.ts +257 -257
- package/templates/backend/src/modules/auth/dto/forgot-password.dto.ts +9 -9
- package/templates/backend/src/modules/auth/dto/login.dto.ts +14 -14
- package/templates/backend/src/modules/auth/dto/refresh-token.dto.ts +12 -12
- package/templates/backend/src/modules/auth/dto/register.dto.ts +26 -26
- package/templates/backend/src/modules/auth/dto/reset-password.dto.ts +16 -16
- package/templates/backend/src/modules/auth/dto/verify-email.dto.ts +9 -9
- package/templates/backend/src/modules/auth/strategies/jwt.strategy.ts +43 -43
- package/templates/backend/src/modules/mail/mail.module.ts +9 -9
- package/templates/backend/src/modules/mail/mail.service.ts +141 -141
- package/templates/backend/src/modules/users/schemas/user.schema.ts +54 -54
- package/templates/backend/src/modules/users/users.module.ts +14 -14
- package/templates/backend/src/modules/users/users.repository.ts +51 -51
- package/templates/backend/src/modules/users/users.service.ts +104 -104
- package/templates/backend/src/modules/workspaces/schemas/workspace.schema.ts +26 -26
- package/templates/backend/src/modules/workspaces/workspaces.module.ts +16 -16
- package/templates/backend/src/modules/workspaces/workspaces.repository.ts +34 -34
- package/templates/backend/src/modules/workspaces/workspaces.service.ts +42 -42
- package/templates/backend/test/app.e2e-spec.ts +25 -25
- package/templates/backend/test/jest-e2e.json +9 -9
- package/templates/backend/tsconfig.build.json +4 -4
- package/templates/backend/tsconfig.json +26 -26
- package/templates/frontend/.env.local.example +1 -1
- package/templates/frontend/README.md +152 -0
- package/templates/frontend/components.json +20 -20
- package/templates/frontend/eslint.config.mjs +14 -14
- package/templates/frontend/next.config.ts +5 -5
- package/templates/frontend/package-lock.json +6722 -6722
- package/templates/frontend/package.json +48 -48
- package/templates/frontend/pnpm-lock.yaml +5012 -5012
- package/templates/frontend/pnpm-workspace.yaml +3 -3
- package/templates/frontend/postcss.config.mjs +7 -7
- package/templates/frontend/src/app/(auth)/forgot-password/page.tsx +84 -84
- package/templates/frontend/src/app/(auth)/layout.tsx +28 -28
- package/templates/frontend/src/app/(auth)/login/page.tsx +111 -111
- package/templates/frontend/src/app/(auth)/register/page.tsx +161 -161
- package/templates/frontend/src/app/(auth)/reset-password/page.tsx +120 -120
- package/templates/frontend/src/app/(auth)/verify-email/page.tsx +78 -78
- package/templates/frontend/src/app/(dashboard)/billing/page.tsx +111 -111
- package/templates/frontend/src/app/(dashboard)/dashboard/page.tsx +105 -105
- package/templates/frontend/src/app/(dashboard)/layout.tsx +38 -38
- package/templates/frontend/src/app/(dashboard)/profile/page.tsx +226 -226
- package/templates/frontend/src/app/(dashboard)/settings/page.tsx +156 -156
- package/templates/frontend/src/app/(dashboard)/team/page.tsx +178 -178
- package/templates/frontend/src/app/(legal)/privacy/page.tsx +127 -127
- package/templates/frontend/src/app/(legal)/terms/page.tsx +118 -118
- package/templates/frontend/src/app/globals.css +81 -81
- package/templates/frontend/src/app/layout.tsx +26 -26
- package/templates/frontend/src/app/page.tsx +5 -45
- package/templates/frontend/src/app/setup/page.tsx +371 -275
- package/templates/frontend/src/components/dashboard/header.tsx +89 -89
- package/templates/frontend/src/components/dashboard/sidebar.tsx +71 -71
- package/templates/frontend/src/components/dashboard/stat-card.tsx +34 -34
- package/templates/frontend/src/components/landing/faq.tsx +39 -39
- package/templates/frontend/src/components/landing/features.tsx +54 -54
- package/templates/frontend/src/components/landing/footer.tsx +76 -76
- package/templates/frontend/src/components/landing/hero.tsx +72 -72
- package/templates/frontend/src/components/landing/navbar.tsx +78 -78
- package/templates/frontend/src/components/landing/pricing.tsx +90 -90
- package/templates/frontend/src/components/ui/accordion.tsx +52 -52
- package/templates/frontend/src/components/ui/avatar.tsx +46 -46
- package/templates/frontend/src/components/ui/badge.tsx +30 -30
- package/templates/frontend/src/components/ui/button.tsx +52 -52
- package/templates/frontend/src/components/ui/card.tsx +50 -50
- package/templates/frontend/src/components/ui/checkbox.tsx +27 -27
- package/templates/frontend/src/components/ui/dialog.tsx +100 -100
- package/templates/frontend/src/components/ui/dropdown-menu.tsx +173 -173
- package/templates/frontend/src/components/ui/form.tsx +158 -158
- package/templates/frontend/src/components/ui/input.tsx +21 -21
- package/templates/frontend/src/components/ui/label.tsx +22 -22
- package/templates/frontend/src/components/ui/separator.tsx +25 -25
- package/templates/frontend/src/components/ui/skeleton.tsx +7 -7
- package/templates/frontend/src/components/ui/switch.tsx +28 -28
- package/templates/frontend/src/components/ui/tabs.tsx +54 -54
- package/templates/frontend/src/components/ui/textarea.tsx +20 -20
- package/templates/frontend/src/components/ui/toast.tsx +109 -109
- package/templates/frontend/src/components/ui/toaster.tsx +30 -30
- package/templates/frontend/src/config/site.ts +197 -197
- package/templates/frontend/src/hooks/use-toast.ts +116 -116
- package/templates/frontend/src/lib/api/auth.ts +39 -39
- package/templates/frontend/src/lib/api/client.ts +66 -66
- package/templates/frontend/src/lib/hooks/use-auth.ts +1 -1
- package/templates/frontend/src/lib/utils.ts +6 -6
- package/templates/frontend/src/providers/auth-provider.tsx +60 -60
- package/templates/frontend/src/types/api.ts +12 -12
- package/templates/frontend/src/types/auth.ts +27 -27
- package/templates/frontend/tsconfig.json +23 -23
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import { Suspense, useEffect, useState } from 'react'
|
|
4
|
-
import Link from 'next/link'
|
|
5
|
-
import { useSearchParams } from 'next/navigation'
|
|
6
|
-
import { authApi } from '@/lib/api/auth'
|
|
7
|
-
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'
|
|
8
|
-
import { Button } from '@/components/ui/button'
|
|
9
|
-
|
|
10
|
-
type Status = 'loading' | 'success' | 'error' | 'no-token'
|
|
11
|
-
|
|
12
|
-
function VerifyEmailContent() {
|
|
13
|
-
const searchParams = useSearchParams()
|
|
14
|
-
const token = searchParams.get('token')
|
|
15
|
-
const [status, setStatus] = useState<Status>(token ? 'loading' : 'no-token')
|
|
16
|
-
const [error, setError] = useState('')
|
|
17
|
-
|
|
18
|
-
useEffect(() => {
|
|
19
|
-
if (!token) return
|
|
20
|
-
authApi
|
|
21
|
-
.verifyEmail(token)
|
|
22
|
-
.then(() => setStatus('success'))
|
|
23
|
-
.catch((err: unknown) => {
|
|
24
|
-
const msg = (err as { message?: string })?.message ?? 'Error al verificar el email'
|
|
25
|
-
setError(msg)
|
|
26
|
-
setStatus('error')
|
|
27
|
-
})
|
|
28
|
-
}, [token])
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<Card>
|
|
32
|
-
<CardHeader>
|
|
33
|
-
<CardTitle>Verificación de email</CardTitle>
|
|
34
|
-
</CardHeader>
|
|
35
|
-
<CardContent className="space-y-4">
|
|
36
|
-
{status === 'loading' && (
|
|
37
|
-
<CardDescription>Verificando tu email...</CardDescription>
|
|
38
|
-
)}
|
|
39
|
-
{status === 'success' && (
|
|
40
|
-
<>
|
|
41
|
-
<CardDescription>
|
|
42
|
-
✓ Email verificado correctamente. Ya podés iniciar sesión.
|
|
43
|
-
</CardDescription>
|
|
44
|
-
<Button asChild className="w-full">
|
|
45
|
-
<Link href="/login">Ir al inicio de sesión</Link>
|
|
46
|
-
</Button>
|
|
47
|
-
</>
|
|
48
|
-
)}
|
|
49
|
-
{status === 'error' && (
|
|
50
|
-
<>
|
|
51
|
-
<CardDescription className="text-destructive">{error}</CardDescription>
|
|
52
|
-
<Button asChild variant="outline" className="w-full">
|
|
53
|
-
<Link href="/login">Volver al inicio de sesión</Link>
|
|
54
|
-
</Button>
|
|
55
|
-
</>
|
|
56
|
-
)}
|
|
57
|
-
{status === 'no-token' && (
|
|
58
|
-
<>
|
|
59
|
-
<CardDescription className="text-destructive">
|
|
60
|
-
Link de verificación inválido o faltante.
|
|
61
|
-
</CardDescription>
|
|
62
|
-
<Button asChild variant="outline" className="w-full">
|
|
63
|
-
<Link href="/login">Volver al inicio de sesión</Link>
|
|
64
|
-
</Button>
|
|
65
|
-
</>
|
|
66
|
-
)}
|
|
67
|
-
</CardContent>
|
|
68
|
-
</Card>
|
|
69
|
-
)
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export default function VerifyEmailPage() {
|
|
73
|
-
return (
|
|
74
|
-
<Suspense fallback={<Card><CardHeader><CardTitle>Verificando...</CardTitle></CardHeader></Card>}>
|
|
75
|
-
<VerifyEmailContent />
|
|
76
|
-
</Suspense>
|
|
77
|
-
)
|
|
78
|
-
}
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { Suspense, useEffect, useState } from 'react'
|
|
4
|
+
import Link from 'next/link'
|
|
5
|
+
import { useSearchParams } from 'next/navigation'
|
|
6
|
+
import { authApi } from '@/lib/api/auth'
|
|
7
|
+
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'
|
|
8
|
+
import { Button } from '@/components/ui/button'
|
|
9
|
+
|
|
10
|
+
type Status = 'loading' | 'success' | 'error' | 'no-token'
|
|
11
|
+
|
|
12
|
+
function VerifyEmailContent() {
|
|
13
|
+
const searchParams = useSearchParams()
|
|
14
|
+
const token = searchParams.get('token')
|
|
15
|
+
const [status, setStatus] = useState<Status>(token ? 'loading' : 'no-token')
|
|
16
|
+
const [error, setError] = useState('')
|
|
17
|
+
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (!token) return
|
|
20
|
+
authApi
|
|
21
|
+
.verifyEmail(token)
|
|
22
|
+
.then(() => setStatus('success'))
|
|
23
|
+
.catch((err: unknown) => {
|
|
24
|
+
const msg = (err as { message?: string })?.message ?? 'Error al verificar el email'
|
|
25
|
+
setError(msg)
|
|
26
|
+
setStatus('error')
|
|
27
|
+
})
|
|
28
|
+
}, [token])
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<Card>
|
|
32
|
+
<CardHeader>
|
|
33
|
+
<CardTitle>Verificación de email</CardTitle>
|
|
34
|
+
</CardHeader>
|
|
35
|
+
<CardContent className="space-y-4">
|
|
36
|
+
{status === 'loading' && (
|
|
37
|
+
<CardDescription>Verificando tu email...</CardDescription>
|
|
38
|
+
)}
|
|
39
|
+
{status === 'success' && (
|
|
40
|
+
<>
|
|
41
|
+
<CardDescription>
|
|
42
|
+
✓ Email verificado correctamente. Ya podés iniciar sesión.
|
|
43
|
+
</CardDescription>
|
|
44
|
+
<Button asChild className="w-full">
|
|
45
|
+
<Link href="/login">Ir al inicio de sesión</Link>
|
|
46
|
+
</Button>
|
|
47
|
+
</>
|
|
48
|
+
)}
|
|
49
|
+
{status === 'error' && (
|
|
50
|
+
<>
|
|
51
|
+
<CardDescription className="text-destructive">{error}</CardDescription>
|
|
52
|
+
<Button asChild variant="outline" className="w-full">
|
|
53
|
+
<Link href="/login">Volver al inicio de sesión</Link>
|
|
54
|
+
</Button>
|
|
55
|
+
</>
|
|
56
|
+
)}
|
|
57
|
+
{status === 'no-token' && (
|
|
58
|
+
<>
|
|
59
|
+
<CardDescription className="text-destructive">
|
|
60
|
+
Link de verificación inválido o faltante.
|
|
61
|
+
</CardDescription>
|
|
62
|
+
<Button asChild variant="outline" className="w-full">
|
|
63
|
+
<Link href="/login">Volver al inicio de sesión</Link>
|
|
64
|
+
</Button>
|
|
65
|
+
</>
|
|
66
|
+
)}
|
|
67
|
+
</CardContent>
|
|
68
|
+
</Card>
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export default function VerifyEmailPage() {
|
|
73
|
+
return (
|
|
74
|
+
<Suspense fallback={<Card><CardHeader><CardTitle>Verificando...</CardTitle></CardHeader></Card>}>
|
|
75
|
+
<VerifyEmailContent />
|
|
76
|
+
</Suspense>
|
|
77
|
+
)
|
|
78
|
+
}
|
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import { CreditCard, CheckCircle2, ArrowUpRight } from 'lucide-react'
|
|
4
|
-
import { siteConfig } from '@/config/site'
|
|
5
|
-
import { Button } from '@/components/ui/button'
|
|
6
|
-
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'
|
|
7
|
-
import { Badge } from '@/components/ui/badge'
|
|
8
|
-
import { Separator } from '@/components/ui/separator'
|
|
9
|
-
|
|
10
|
-
const currentPlan = siteConfig.pricing[0]
|
|
11
|
-
|
|
12
|
-
const invoiceHistory = [
|
|
13
|
-
{ id: 'INV-001', date: '01/06/2024', amount: '$0', status: 'Pagado', plan: 'Free' },
|
|
14
|
-
{ id: 'INV-002', date: '01/05/2024', amount: '$0', status: 'Pagado', plan: 'Free' },
|
|
15
|
-
{ id: 'INV-003', date: '01/04/2024', amount: '$0', status: 'Pagado', plan: 'Free' },
|
|
16
|
-
]
|
|
17
|
-
|
|
18
|
-
export default function BillingPage() {
|
|
19
|
-
return (
|
|
20
|
-
<div className="max-w-2xl space-y-6">
|
|
21
|
-
{/* Current plan */}
|
|
22
|
-
<Card>
|
|
23
|
-
<CardHeader>
|
|
24
|
-
<div className="flex items-start justify-between">
|
|
25
|
-
<div>
|
|
26
|
-
<CardTitle>Plan actual</CardTitle>
|
|
27
|
-
<CardDescription>Tus beneficios y límites vigentes.</CardDescription>
|
|
28
|
-
</div>
|
|
29
|
-
<Badge variant="secondary">{currentPlan.name}</Badge>
|
|
30
|
-
</div>
|
|
31
|
-
</CardHeader>
|
|
32
|
-
<CardContent className="space-y-4">
|
|
33
|
-
<div className="flex items-end gap-1">
|
|
34
|
-
<span className="text-3xl font-bold">{currentPlan.price}</span>
|
|
35
|
-
{currentPlan.period && (
|
|
36
|
-
<span className="mb-1 text-sm text-muted-foreground">{currentPlan.period}</span>
|
|
37
|
-
)}
|
|
38
|
-
</div>
|
|
39
|
-
|
|
40
|
-
<ul className="space-y-2">
|
|
41
|
-
{currentPlan.features.map((f) => (
|
|
42
|
-
<li key={f} className="flex items-center gap-2 text-sm">
|
|
43
|
-
<CheckCircle2 className="size-4 text-primary" />
|
|
44
|
-
{f}
|
|
45
|
-
</li>
|
|
46
|
-
))}
|
|
47
|
-
</ul>
|
|
48
|
-
|
|
49
|
-
<Separator />
|
|
50
|
-
|
|
51
|
-
<div className="flex flex-col gap-2 sm:flex-row">
|
|
52
|
-
<Button className="gap-2">
|
|
53
|
-
<ArrowUpRight className="size-4" />
|
|
54
|
-
Actualizar a Pro
|
|
55
|
-
</Button>
|
|
56
|
-
<Button variant="outline" disabled>
|
|
57
|
-
Cancelar suscripción
|
|
58
|
-
</Button>
|
|
59
|
-
</div>
|
|
60
|
-
</CardContent>
|
|
61
|
-
</Card>
|
|
62
|
-
|
|
63
|
-
{/* Payment method */}
|
|
64
|
-
<Card>
|
|
65
|
-
<CardHeader>
|
|
66
|
-
<CardTitle>Método de pago</CardTitle>
|
|
67
|
-
<CardDescription>Administrá tus tarjetas guardadas.</CardDescription>
|
|
68
|
-
</CardHeader>
|
|
69
|
-
<CardContent>
|
|
70
|
-
<div className="flex items-center justify-between rounded-lg border p-4">
|
|
71
|
-
<div className="flex items-center gap-3">
|
|
72
|
-
<CreditCard className="size-5 text-muted-foreground" />
|
|
73
|
-
<div>
|
|
74
|
-
<p className="text-sm font-medium">Sin método de pago</p>
|
|
75
|
-
<p className="text-xs text-muted-foreground">Agregá una tarjeta para actualizar tu plan</p>
|
|
76
|
-
</div>
|
|
77
|
-
</div>
|
|
78
|
-
<Button variant="outline" size="sm" disabled>
|
|
79
|
-
Agregar tarjeta
|
|
80
|
-
</Button>
|
|
81
|
-
</div>
|
|
82
|
-
</CardContent>
|
|
83
|
-
</Card>
|
|
84
|
-
|
|
85
|
-
{/* History */}
|
|
86
|
-
<Card>
|
|
87
|
-
<CardHeader>
|
|
88
|
-
<CardTitle>Historial de facturación</CardTitle>
|
|
89
|
-
<CardDescription>Tus últimas facturas generadas.</CardDescription>
|
|
90
|
-
</CardHeader>
|
|
91
|
-
<CardContent>
|
|
92
|
-
<div className="space-y-2">
|
|
93
|
-
{invoiceHistory.map((inv) => (
|
|
94
|
-
<div key={inv.id} className="flex items-center justify-between rounded-md border p-3 text-sm">
|
|
95
|
-
<div className="flex items-center gap-4">
|
|
96
|
-
<span className="font-mono text-xs text-muted-foreground">{inv.id}</span>
|
|
97
|
-
<span>{inv.date}</span>
|
|
98
|
-
<Badge variant="outline">{inv.plan}</Badge>
|
|
99
|
-
</div>
|
|
100
|
-
<div className="flex items-center gap-4">
|
|
101
|
-
<span className="font-medium">{inv.amount}</span>
|
|
102
|
-
<Badge variant="secondary" className="text-xs">{inv.status}</Badge>
|
|
103
|
-
</div>
|
|
104
|
-
</div>
|
|
105
|
-
))}
|
|
106
|
-
</div>
|
|
107
|
-
</CardContent>
|
|
108
|
-
</Card>
|
|
109
|
-
</div>
|
|
110
|
-
)
|
|
111
|
-
}
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { CreditCard, CheckCircle2, ArrowUpRight } from 'lucide-react'
|
|
4
|
+
import { siteConfig } from '@/config/site'
|
|
5
|
+
import { Button } from '@/components/ui/button'
|
|
6
|
+
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'
|
|
7
|
+
import { Badge } from '@/components/ui/badge'
|
|
8
|
+
import { Separator } from '@/components/ui/separator'
|
|
9
|
+
|
|
10
|
+
const currentPlan = siteConfig.pricing[0]
|
|
11
|
+
|
|
12
|
+
const invoiceHistory = [
|
|
13
|
+
{ id: 'INV-001', date: '01/06/2024', amount: '$0', status: 'Pagado', plan: 'Free' },
|
|
14
|
+
{ id: 'INV-002', date: '01/05/2024', amount: '$0', status: 'Pagado', plan: 'Free' },
|
|
15
|
+
{ id: 'INV-003', date: '01/04/2024', amount: '$0', status: 'Pagado', plan: 'Free' },
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
export default function BillingPage() {
|
|
19
|
+
return (
|
|
20
|
+
<div className="max-w-2xl space-y-6">
|
|
21
|
+
{/* Current plan */}
|
|
22
|
+
<Card>
|
|
23
|
+
<CardHeader>
|
|
24
|
+
<div className="flex items-start justify-between">
|
|
25
|
+
<div>
|
|
26
|
+
<CardTitle>Plan actual</CardTitle>
|
|
27
|
+
<CardDescription>Tus beneficios y límites vigentes.</CardDescription>
|
|
28
|
+
</div>
|
|
29
|
+
<Badge variant="secondary">{currentPlan.name}</Badge>
|
|
30
|
+
</div>
|
|
31
|
+
</CardHeader>
|
|
32
|
+
<CardContent className="space-y-4">
|
|
33
|
+
<div className="flex items-end gap-1">
|
|
34
|
+
<span className="text-3xl font-bold">{currentPlan.price}</span>
|
|
35
|
+
{currentPlan.period && (
|
|
36
|
+
<span className="mb-1 text-sm text-muted-foreground">{currentPlan.period}</span>
|
|
37
|
+
)}
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<ul className="space-y-2">
|
|
41
|
+
{currentPlan.features.map((f) => (
|
|
42
|
+
<li key={f} className="flex items-center gap-2 text-sm">
|
|
43
|
+
<CheckCircle2 className="size-4 text-primary" />
|
|
44
|
+
{f}
|
|
45
|
+
</li>
|
|
46
|
+
))}
|
|
47
|
+
</ul>
|
|
48
|
+
|
|
49
|
+
<Separator />
|
|
50
|
+
|
|
51
|
+
<div className="flex flex-col gap-2 sm:flex-row">
|
|
52
|
+
<Button className="gap-2">
|
|
53
|
+
<ArrowUpRight className="size-4" />
|
|
54
|
+
Actualizar a Pro
|
|
55
|
+
</Button>
|
|
56
|
+
<Button variant="outline" disabled>
|
|
57
|
+
Cancelar suscripción
|
|
58
|
+
</Button>
|
|
59
|
+
</div>
|
|
60
|
+
</CardContent>
|
|
61
|
+
</Card>
|
|
62
|
+
|
|
63
|
+
{/* Payment method */}
|
|
64
|
+
<Card>
|
|
65
|
+
<CardHeader>
|
|
66
|
+
<CardTitle>Método de pago</CardTitle>
|
|
67
|
+
<CardDescription>Administrá tus tarjetas guardadas.</CardDescription>
|
|
68
|
+
</CardHeader>
|
|
69
|
+
<CardContent>
|
|
70
|
+
<div className="flex items-center justify-between rounded-lg border p-4">
|
|
71
|
+
<div className="flex items-center gap-3">
|
|
72
|
+
<CreditCard className="size-5 text-muted-foreground" />
|
|
73
|
+
<div>
|
|
74
|
+
<p className="text-sm font-medium">Sin método de pago</p>
|
|
75
|
+
<p className="text-xs text-muted-foreground">Agregá una tarjeta para actualizar tu plan</p>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
<Button variant="outline" size="sm" disabled>
|
|
79
|
+
Agregar tarjeta
|
|
80
|
+
</Button>
|
|
81
|
+
</div>
|
|
82
|
+
</CardContent>
|
|
83
|
+
</Card>
|
|
84
|
+
|
|
85
|
+
{/* History */}
|
|
86
|
+
<Card>
|
|
87
|
+
<CardHeader>
|
|
88
|
+
<CardTitle>Historial de facturación</CardTitle>
|
|
89
|
+
<CardDescription>Tus últimas facturas generadas.</CardDescription>
|
|
90
|
+
</CardHeader>
|
|
91
|
+
<CardContent>
|
|
92
|
+
<div className="space-y-2">
|
|
93
|
+
{invoiceHistory.map((inv) => (
|
|
94
|
+
<div key={inv.id} className="flex items-center justify-between rounded-md border p-3 text-sm">
|
|
95
|
+
<div className="flex items-center gap-4">
|
|
96
|
+
<span className="font-mono text-xs text-muted-foreground">{inv.id}</span>
|
|
97
|
+
<span>{inv.date}</span>
|
|
98
|
+
<Badge variant="outline">{inv.plan}</Badge>
|
|
99
|
+
</div>
|
|
100
|
+
<div className="flex items-center gap-4">
|
|
101
|
+
<span className="font-medium">{inv.amount}</span>
|
|
102
|
+
<Badge variant="secondary" className="text-xs">{inv.status}</Badge>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
))}
|
|
106
|
+
</div>
|
|
107
|
+
</CardContent>
|
|
108
|
+
</Card>
|
|
109
|
+
</div>
|
|
110
|
+
)
|
|
111
|
+
}
|
|
@@ -1,105 +1,105 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import { Users, BarChart3, TrendingUp, Activity } from 'lucide-react'
|
|
4
|
-
import { useAuth } from '@/lib/hooks/use-auth'
|
|
5
|
-
import { StatCard } from '@/components/dashboard/stat-card'
|
|
6
|
-
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'
|
|
7
|
-
import { Badge } from '@/components/ui/badge'
|
|
8
|
-
import { Skeleton } from '@/components/ui/skeleton'
|
|
9
|
-
|
|
10
|
-
const stats = [
|
|
11
|
-
{
|
|
12
|
-
title: 'Usuarios activos',
|
|
13
|
-
value: '—',
|
|
14
|
-
description: 'Total de cuentas registradas',
|
|
15
|
-
icon: Users,
|
|
16
|
-
trend: { value: '0%', positive: true },
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
title: 'Ingresos del mes',
|
|
20
|
-
value: '$—',
|
|
21
|
-
description: 'Facturación del período actual',
|
|
22
|
-
icon: TrendingUp,
|
|
23
|
-
trend: { value: '0%', positive: true },
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
title: 'Eventos totales',
|
|
27
|
-
value: '—',
|
|
28
|
-
description: 'Acciones registradas hoy',
|
|
29
|
-
icon: Activity,
|
|
30
|
-
trend: { value: '0%', positive: true },
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
title: 'Conversión',
|
|
34
|
-
value: '—%',
|
|
35
|
-
description: 'Free → plan de pago',
|
|
36
|
-
icon: BarChart3,
|
|
37
|
-
trend: { value: '0 pts', positive: true },
|
|
38
|
-
},
|
|
39
|
-
]
|
|
40
|
-
|
|
41
|
-
const quickStart = [
|
|
42
|
-
{ step: '1', title: 'Configurá el backend', description: 'Completá las variables en /backend/.env con tu cadena de MongoDB y las keys de JWT.' },
|
|
43
|
-
{ step: '2', title: 'Personalizá la landing', description: 'Editá src/config/site.ts para cambiar nombre, tagline, precios y contenido.' },
|
|
44
|
-
{ step: '3', title: 'Conectá tu dominio', description: 'Apuntá tu DNS al servidor y configurá SSL. Consultá la guía de deploy.' },
|
|
45
|
-
{ step: '4', title: 'Activá los pagos', description: 'Integrá Stripe u otro procesador en el módulo de facturación.' },
|
|
46
|
-
]
|
|
47
|
-
|
|
48
|
-
export default function DashboardPage() {
|
|
49
|
-
const { user } = useAuth()
|
|
50
|
-
|
|
51
|
-
if (!user) {
|
|
52
|
-
return (
|
|
53
|
-
<div className="space-y-6">
|
|
54
|
-
<Skeleton className="h-8 w-48" />
|
|
55
|
-
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
|
|
56
|
-
{[...Array(4)].map((_, i) => <Skeleton key={i} className="h-28" />)}
|
|
57
|
-
</div>
|
|
58
|
-
</div>
|
|
59
|
-
)
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return (
|
|
63
|
-
<div className="space-y-6">
|
|
64
|
-
<div>
|
|
65
|
-
<h2 className="text-2xl font-bold">Bienvenido, {user.name}</h2>
|
|
66
|
-
<p className="text-sm text-muted-foreground">{user.email}</p>
|
|
67
|
-
</div>
|
|
68
|
-
|
|
69
|
-
{/* Stats */}
|
|
70
|
-
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
|
|
71
|
-
{stats.map((stat) => (
|
|
72
|
-
<StatCard key={stat.title} {...stat} />
|
|
73
|
-
))}
|
|
74
|
-
</div>
|
|
75
|
-
|
|
76
|
-
{/* Quick start */}
|
|
77
|
-
<Card>
|
|
78
|
-
<CardHeader>
|
|
79
|
-
<div className="flex items-center gap-2">
|
|
80
|
-
<CardTitle className="text-base">Primeros pasos</CardTitle>
|
|
81
|
-
<Badge variant="secondary" className="text-xs">Checklist</Badge>
|
|
82
|
-
</div>
|
|
83
|
-
<CardDescription>
|
|
84
|
-
Seguí estos pasos para tener tu SaaS listo para producción.
|
|
85
|
-
</CardDescription>
|
|
86
|
-
</CardHeader>
|
|
87
|
-
<CardContent>
|
|
88
|
-
<ol className="space-y-4">
|
|
89
|
-
{quickStart.map((item) => (
|
|
90
|
-
<li key={item.step} className="flex gap-4">
|
|
91
|
-
<span className="flex size-6 shrink-0 items-center justify-center rounded-full bg-primary/10 text-xs font-bold text-primary">
|
|
92
|
-
{item.step}
|
|
93
|
-
</span>
|
|
94
|
-
<div>
|
|
95
|
-
<p className="text-sm font-medium">{item.title}</p>
|
|
96
|
-
<p className="mt-0.5 text-xs text-muted-foreground">{item.description}</p>
|
|
97
|
-
</div>
|
|
98
|
-
</li>
|
|
99
|
-
))}
|
|
100
|
-
</ol>
|
|
101
|
-
</CardContent>
|
|
102
|
-
</Card>
|
|
103
|
-
</div>
|
|
104
|
-
)
|
|
105
|
-
}
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { Users, BarChart3, TrendingUp, Activity } from 'lucide-react'
|
|
4
|
+
import { useAuth } from '@/lib/hooks/use-auth'
|
|
5
|
+
import { StatCard } from '@/components/dashboard/stat-card'
|
|
6
|
+
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'
|
|
7
|
+
import { Badge } from '@/components/ui/badge'
|
|
8
|
+
import { Skeleton } from '@/components/ui/skeleton'
|
|
9
|
+
|
|
10
|
+
const stats = [
|
|
11
|
+
{
|
|
12
|
+
title: 'Usuarios activos',
|
|
13
|
+
value: '—',
|
|
14
|
+
description: 'Total de cuentas registradas',
|
|
15
|
+
icon: Users,
|
|
16
|
+
trend: { value: '0%', positive: true },
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
title: 'Ingresos del mes',
|
|
20
|
+
value: '$—',
|
|
21
|
+
description: 'Facturación del período actual',
|
|
22
|
+
icon: TrendingUp,
|
|
23
|
+
trend: { value: '0%', positive: true },
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
title: 'Eventos totales',
|
|
27
|
+
value: '—',
|
|
28
|
+
description: 'Acciones registradas hoy',
|
|
29
|
+
icon: Activity,
|
|
30
|
+
trend: { value: '0%', positive: true },
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
title: 'Conversión',
|
|
34
|
+
value: '—%',
|
|
35
|
+
description: 'Free → plan de pago',
|
|
36
|
+
icon: BarChart3,
|
|
37
|
+
trend: { value: '0 pts', positive: true },
|
|
38
|
+
},
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
const quickStart = [
|
|
42
|
+
{ step: '1', title: 'Configurá el backend', description: 'Completá las variables en /backend/.env con tu cadena de MongoDB y las keys de JWT.' },
|
|
43
|
+
{ step: '2', title: 'Personalizá la landing', description: 'Editá src/config/site.ts para cambiar nombre, tagline, precios y contenido.' },
|
|
44
|
+
{ step: '3', title: 'Conectá tu dominio', description: 'Apuntá tu DNS al servidor y configurá SSL. Consultá la guía de deploy.' },
|
|
45
|
+
{ step: '4', title: 'Activá los pagos', description: 'Integrá Stripe u otro procesador en el módulo de facturación.' },
|
|
46
|
+
]
|
|
47
|
+
|
|
48
|
+
export default function DashboardPage() {
|
|
49
|
+
const { user } = useAuth()
|
|
50
|
+
|
|
51
|
+
if (!user) {
|
|
52
|
+
return (
|
|
53
|
+
<div className="space-y-6">
|
|
54
|
+
<Skeleton className="h-8 w-48" />
|
|
55
|
+
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
|
|
56
|
+
{[...Array(4)].map((_, i) => <Skeleton key={i} className="h-28" />)}
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<div className="space-y-6">
|
|
64
|
+
<div>
|
|
65
|
+
<h2 className="text-2xl font-bold">Bienvenido, {user.name}</h2>
|
|
66
|
+
<p className="text-sm text-muted-foreground">{user.email}</p>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
{/* Stats */}
|
|
70
|
+
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
|
|
71
|
+
{stats.map((stat) => (
|
|
72
|
+
<StatCard key={stat.title} {...stat} />
|
|
73
|
+
))}
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
{/* Quick start */}
|
|
77
|
+
<Card>
|
|
78
|
+
<CardHeader>
|
|
79
|
+
<div className="flex items-center gap-2">
|
|
80
|
+
<CardTitle className="text-base">Primeros pasos</CardTitle>
|
|
81
|
+
<Badge variant="secondary" className="text-xs">Checklist</Badge>
|
|
82
|
+
</div>
|
|
83
|
+
<CardDescription>
|
|
84
|
+
Seguí estos pasos para tener tu SaaS listo para producción.
|
|
85
|
+
</CardDescription>
|
|
86
|
+
</CardHeader>
|
|
87
|
+
<CardContent>
|
|
88
|
+
<ol className="space-y-4">
|
|
89
|
+
{quickStart.map((item) => (
|
|
90
|
+
<li key={item.step} className="flex gap-4">
|
|
91
|
+
<span className="flex size-6 shrink-0 items-center justify-center rounded-full bg-primary/10 text-xs font-bold text-primary">
|
|
92
|
+
{item.step}
|
|
93
|
+
</span>
|
|
94
|
+
<div>
|
|
95
|
+
<p className="text-sm font-medium">{item.title}</p>
|
|
96
|
+
<p className="mt-0.5 text-xs text-muted-foreground">{item.description}</p>
|
|
97
|
+
</div>
|
|
98
|
+
</li>
|
|
99
|
+
))}
|
|
100
|
+
</ol>
|
|
101
|
+
</CardContent>
|
|
102
|
+
</Card>
|
|
103
|
+
</div>
|
|
104
|
+
)
|
|
105
|
+
}
|