ar-saas 0.3.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/generator.js +2 -6
  2. package/package.json +1 -1
  3. package/templates/backend/.env.example +1 -1
  4. package/templates/backend/package.json +5 -2
  5. package/templates/backend/src/app.module.ts +68 -40
  6. package/templates/backend/src/common/interceptors/workspace-tenant.interceptor.ts +27 -45
  7. package/templates/backend/src/main.ts +50 -51
  8. package/templates/backend/src/modules/auth/auth.controller.ts +162 -158
  9. package/templates/backend/src/modules/auth/auth.service.ts +236 -257
  10. package/templates/backend/src/modules/auth/strategies/jwt.strategy.ts +45 -43
  11. package/templates/backend/src/modules/users/users.controller.ts +28 -0
  12. package/templates/backend/src/modules/users/users.module.ts +16 -14
  13. package/templates/backend/src/modules/users/users.repository.ts +57 -51
  14. package/templates/backend/src/modules/users/users.service.ts +130 -104
  15. package/templates/backend/src/modules/workspaces/workspaces.repository.ts +38 -34
  16. package/templates/backend/src/modules/workspaces/workspaces.service.ts +51 -42
  17. package/templates/frontend/package.json +2 -5
  18. package/templates/frontend/pnpm-workspace.yaml +2 -2
  19. package/templates/frontend/src/app/(auth)/layout.tsx +29 -28
  20. package/templates/frontend/src/app/(dashboard)/billing/page.tsx +111 -111
  21. package/templates/frontend/src/app/(dashboard)/profile/page.tsx +241 -226
  22. package/templates/frontend/src/app/(dashboard)/settings/page.tsx +155 -156
  23. package/templates/frontend/src/app/(dashboard)/team/page.tsx +179 -178
  24. package/templates/frontend/src/app/layout.tsx +29 -26
  25. package/templates/frontend/src/app/page.tsx +1 -1
  26. package/templates/frontend/src/app/setup/page.tsx +1 -1
  27. package/templates/frontend/src/components/dashboard/header.tsx +5 -3
  28. package/templates/frontend/src/config/site.ts +1 -1
@@ -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, 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: Array<{ id: string; date: string; amount: string; status: string; plan: string }> = []
13
+
14
+ export default function BillingPage() {
15
+ return (
16
+ <div className="max-w-2xl space-y-6">
17
+ {/* Current plan */}
18
+ <Card>
19
+ <CardHeader>
20
+ <div className="flex items-start justify-between">
21
+ <div>
22
+ <CardTitle>Plan actual</CardTitle>
23
+ <CardDescription>Tus beneficios y límites vigentes.</CardDescription>
24
+ </div>
25
+ <Badge variant="secondary">{currentPlan.name}</Badge>
26
+ </div>
27
+ </CardHeader>
28
+ <CardContent className="space-y-4">
29
+ <div className="flex items-end gap-1">
30
+ <span className="text-3xl font-bold">{currentPlan.price}</span>
31
+ {currentPlan.period && (
32
+ <span className="mb-1 text-sm text-muted-foreground">{currentPlan.period}</span>
33
+ )}
34
+ </div>
35
+
36
+ <ul className="space-y-2">
37
+ {currentPlan.features.map((f) => (
38
+ <li key={f} className="flex items-center gap-2 text-sm">
39
+ <span className="size-4 text-primary flex items-center justify-center">&#x2713;</span>
40
+ {f}
41
+ </li>
42
+ ))}
43
+ </ul>
44
+
45
+ <Separator />
46
+
47
+ <div className="flex flex-col gap-2 sm:flex-row">
48
+ <Button className="gap-2">
49
+ <ArrowUpRight className="size-4" />
50
+ Actualizar a Pro
51
+ </Button>
52
+ <Button variant="outline" disabled>
53
+ Cancelar suscripción
54
+ </Button>
55
+ </div>
56
+ </CardContent>
57
+ </Card>
58
+
59
+ {/* Payment method */}
60
+ <Card>
61
+ <CardHeader>
62
+ <CardTitle>Método de pago</CardTitle>
63
+ <CardDescription>Administrá tus tarjetas guardadas.</CardDescription>
64
+ </CardHeader>
65
+ <CardContent>
66
+ <div className="flex items-center justify-between rounded-lg border p-4">
67
+ <div className="flex items-center gap-3">
68
+ <CreditCard className="size-5 text-muted-foreground" />
69
+ <div>
70
+ <p className="text-sm font-medium">Sin método de pago</p>
71
+ <p className="text-xs text-muted-foreground">Agregá una tarjeta para actualizar tu plan</p>
72
+ </div>
73
+ </div>
74
+ <Button variant="outline" size="sm" disabled>
75
+ Agregar tarjeta
76
+ </Button>
77
+ </div>
78
+ </CardContent>
79
+ </Card>
80
+
81
+ {/* History */}
82
+ <Card>
83
+ <CardHeader>
84
+ <CardTitle>Historial de facturación</CardTitle>
85
+ <CardDescription>Tus últimas facturas generadas.</CardDescription>
86
+ </CardHeader>
87
+ <CardContent>
88
+ {invoiceHistory.length === 0 ? (
89
+ <p className="text-sm text-muted-foreground">No hay facturas todavía.</p>
90
+ ) : (
91
+ <div className="space-y-2">
92
+ {invoiceHistory.map((inv) => (
93
+ <div key={inv.id} className="flex items-center justify-between rounded-md border p-3 text-sm">
94
+ <div className="flex items-center gap-4">
95
+ <span className="font-mono text-xs text-muted-foreground">{inv.id}</span>
96
+ <span>{inv.date}</span>
97
+ <Badge variant="outline">{inv.plan}</Badge>
98
+ </div>
99
+ <div className="flex items-center gap-4">
100
+ <span className="font-medium">{inv.amount}</span>
101
+ <Badge variant="secondary" className="text-xs">{inv.status}</Badge>
102
+ </div>
103
+ </div>
104
+ ))}
105
+ </div>
106
+ )}
107
+ </CardContent>
108
+ </Card>
109
+ </div>
110
+ )
111
+ }