create-tigra 2.6.5 → 2.7.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 (59) hide show
  1. package/bin/create-tigra.js +144 -0
  2. package/lib/patchers/email-verification.patcher.js +576 -0
  3. package/modules/email-verification/client/hooks/useVerification.ts +70 -0
  4. package/modules/email-verification/client/services/verification.service.ts +25 -0
  5. package/modules/email-verification/server/verification.controller.ts +28 -0
  6. package/modules/email-verification/server/verification.service.ts +190 -0
  7. package/package.json +5 -2
  8. package/template/_claude/rules/client/01-project-structure.md +2 -5
  9. package/template/_claude/rules/client/04-design-system.md +48 -43
  10. package/template/_claude/rules/client/core.md +2 -2
  11. package/template/client/src/app/globals.css +12 -12
  12. package/template/client/src/app/layout.tsx +1 -1
  13. package/template/client/src/app/page.tsx +5 -5
  14. package/template/client/src/app/providers.tsx +1 -1
  15. package/template/client/src/components/common/ThemeToggle.tsx +59 -0
  16. package/template/client/src/features/admin/hooks/useAdminSessions.ts +68 -0
  17. package/template/client/src/features/admin/hooks/useAdminStats.ts +27 -0
  18. package/template/client/src/features/admin/hooks/useAdminUsers.ts +132 -0
  19. package/template/client/src/features/admin/services/admin.service.ts +94 -0
  20. package/template/client/src/features/admin/types/admin.types.ts +65 -0
  21. package/template/client/src/features/auth/components/AuthInitializer.tsx +24 -1
  22. package/template/client/src/features/auth/hooks/useAuth.ts +10 -1
  23. package/template/client/src/features/auth/hooks/usePasswordReset.ts +57 -0
  24. package/template/client/src/features/auth/services/auth.service.ts +2 -2
  25. package/template/client/src/lib/api/axios.config.ts +20 -1
  26. package/template/client/src/lib/constants/api-endpoints.ts +10 -1
  27. package/template/client/src/lib/constants/app.constants.ts +3 -1
  28. package/template/client/src/lib/constants/routes.ts +7 -1
  29. package/template/client/src/lib/env.ts +35 -0
  30. package/template/client/src/lib/utils/error.ts +4 -0
  31. package/template/client/src/styles/themes/default.css +92 -0
  32. package/template/server/.env.example +29 -0
  33. package/template/server/.env.example.production +22 -0
  34. package/template/server/package-lock.json +6823 -0
  35. package/template/server/package.json +2 -0
  36. package/template/server/postman/collection.json +168 -50
  37. package/template/server/prisma/schema.prisma +2 -0
  38. package/template/server/src/config/env.ts +18 -1
  39. package/template/server/src/config/rate-limit.config.ts +8 -0
  40. package/template/server/src/jobs/cleanup-deleted-accounts.job.ts +14 -4
  41. package/template/server/src/libs/auth.ts +4 -1
  42. package/template/server/src/libs/email.ts +40 -0
  43. package/template/server/src/libs/prisma.ts +13 -0
  44. package/template/server/src/modules/admin/admin.controller.ts +130 -1
  45. package/template/server/src/modules/admin/admin.repo.ts +289 -0
  46. package/template/server/src/modules/admin/admin.routes.ts +113 -7
  47. package/template/server/src/modules/admin/admin.schemas.ts +49 -0
  48. package/template/server/src/modules/admin/admin.service.ts +154 -0
  49. package/template/server/src/modules/auth/auth.controller.ts +27 -1
  50. package/template/server/src/modules/auth/auth.repo.ts +6 -18
  51. package/template/server/src/modules/auth/auth.routes.ts +24 -0
  52. package/template/server/src/modules/auth/auth.schemas.ts +18 -0
  53. package/template/server/src/modules/auth/auth.service.ts +156 -32
  54. package/template/server/src/modules/auth/session.repo.ts +10 -5
  55. package/template/client/src/components/common/ThemeSwitcher.tsx +0 -112
  56. package/template/client/src/styles/themes/electric-indigo.css +0 -90
  57. package/template/client/src/styles/themes/ocean-teal.css +0 -90
  58. package/template/client/src/styles/themes/rose-pink.css +0 -90
  59. package/template/client/src/styles/themes/warm-orange.css +0 -90
@@ -0,0 +1,92 @@
1
+ /*
2
+ * Default Theme — Claude-inspired warm palette
3
+ * Accent: Terracotta orange
4
+ * Vibe: Earthy, warm, approachable
5
+ *
6
+ * This is the single theme file. Colors use HEX values.
7
+ * Light mode: :root selectors. Dark mode: .dark selectors.
8
+ * To customize: edit the HEX values below.
9
+ */
10
+
11
+ :root {
12
+ --radius: 0.625rem;
13
+ /* Warm cream background with terracotta orange accent */
14
+ --background: #f4f3ee;
15
+ --foreground: #1a170f;
16
+ --card: #ffffff;
17
+ --card-foreground: #1a170f;
18
+ --popover: #ffffff;
19
+ --popover-foreground: #1a170f;
20
+ --primary: #c15f3c;
21
+ --primary-foreground: #ffffff;
22
+ --secondary: #ebeae3;
23
+ --secondary-foreground: #302e25;
24
+ --muted: #ebeae3;
25
+ --muted-foreground: #b1ada1;
26
+ --accent: #ebeae3;
27
+ --accent-foreground: #302e25;
28
+ --destructive: #e7000b;
29
+ --border: #deddd4;
30
+ --input: #deddd4;
31
+ --ring: #c15f3c;
32
+ --success: #008339;
33
+ --success-foreground: #ffffff;
34
+ --warning: #e99b2a;
35
+ --warning-foreground: #242119;
36
+ --info: #0079bf;
37
+ --info-foreground: #ffffff;
38
+ --chart-1: #c15f3c;
39
+ --chart-2: #009689;
40
+ --chart-3: #104e64;
41
+ --chart-4: #ebc065;
42
+ --chart-5: #b1ada1;
43
+ --sidebar: #f0efe9;
44
+ --sidebar-foreground: #1a170f;
45
+ --sidebar-primary: #302e25;
46
+ --sidebar-primary-foreground: #f4f3ee;
47
+ --sidebar-accent: #ebeae3;
48
+ --sidebar-accent-foreground: #302e25;
49
+ --sidebar-border: #deddd4;
50
+ --sidebar-ring: #c15f3c;
51
+ }
52
+
53
+ .dark {
54
+ /* Dark mode: inverted with same warm undertone */
55
+ --background: #15130d;
56
+ --foreground: #e9e8e3;
57
+ --card: #201e18;
58
+ --card-foreground: #e9e8e3;
59
+ --popover: #201e18;
60
+ --popover-foreground: #e9e8e3;
61
+ --primary: #d6724f;
62
+ --primary-foreground: #15130d;
63
+ --secondary: #2b2922;
64
+ --secondary-foreground: #e9e8e3;
65
+ --muted: #2b2922;
66
+ --muted-foreground: #928f85;
67
+ --accent: #2b2922;
68
+ --accent-foreground: #e9e8e3;
69
+ --destructive: #ff6467;
70
+ --border: rgba(255, 255, 250, 0.12);
71
+ --input: rgba(255, 255, 250, 0.15);
72
+ --ring: #d6724f;
73
+ --success: #009c50;
74
+ --success-foreground: #ffffff;
75
+ --warning: #faab3f;
76
+ --warning-foreground: #242119;
77
+ --info: #0099e0;
78
+ --info-foreground: #ffffff;
79
+ --chart-1: #d6724f;
80
+ --chart-2: #00bc7d;
81
+ --chart-3: #e5a658;
82
+ --chart-4: #a066df;
83
+ --chart-5: #e25969;
84
+ --sidebar: #201e18;
85
+ --sidebar-foreground: #e9e8e3;
86
+ --sidebar-primary: #d6724f;
87
+ --sidebar-primary-foreground: #e9e8e3;
88
+ --sidebar-accent: #2b2922;
89
+ --sidebar-accent-foreground: #e9e8e3;
90
+ --sidebar-border: rgba(255, 255, 250, 0.12);
91
+ --sidebar-ring: #d6724f;
92
+ }
@@ -67,6 +67,17 @@ RATE_LIMIT_MULTIPLIER=1
67
67
  # RATE_LIMIT_AUTH_LOGIN_MAX=10
68
68
  # RATE_LIMIT_AUTH_REGISTER_MAX=5
69
69
 
70
+ # ===================================================================
71
+ # ACCOUNT ACTIVATION
72
+ # ===================================================================
73
+
74
+ # When true (default), new users are created as inactive and must
75
+ # verify their account before they can log in.
76
+ # When false, users are active immediately after registration.
77
+ # NOTE: When this variable is not provided, users are NOT activated
78
+ # by default — you must explicitly set it to false to skip verification.
79
+ REQUIRE_USER_VERIFICATION=true
80
+
70
81
  # ===================================================================
71
82
  # FILE UPLOAD
72
83
  # ===================================================================
@@ -138,6 +149,24 @@ JWT_REFRESH_EXPIRY="7d"
138
149
  # Local dev: CORS_ORIGIN="http://localhost:3001"
139
150
  # CORS_ORIGIN="http://localhost:3001"
140
151
 
152
+ # ===================================================================
153
+ # EMAIL (Resend)
154
+ # ===================================================================
155
+
156
+ # Resend API key for transactional emails (password reset, verification, etc.)
157
+ # Get your API key from: https://resend.com/api-keys
158
+ # COOLIFY: Runtime only. Do NOT check "Available at Buildtime" — this is a secret!
159
+ RESEND_API_KEY="re_xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
160
+
161
+ # Sender email address
162
+ # Development: Use Resend's test address (onboarding@resend.dev) — delivers to your Resend dashboard
163
+ # Production: Use a verified domain email (e.g., noreply@yourdomain.com)
164
+ RESEND_FROM_EMAIL="onboarding@resend.dev"
165
+
166
+ # Frontend URL used to build links in emails (e.g., password reset links)
167
+ # Must match the URL where your Next.js client is running
168
+ CLIENT_URL="http://localhost:3000"
169
+
141
170
  # ===================================================================
142
171
  # LOGGING
143
172
  # ===================================================================
@@ -65,6 +65,14 @@ RATE_LIMIT_MULTIPLIER=1
65
65
  RATE_LIMIT_AUTH_LOGIN_MAX=10
66
66
  RATE_LIMIT_AUTH_REGISTER_MAX=5
67
67
 
68
+ # ===================================================================
69
+ # ACCOUNT ACTIVATION
70
+ # ===================================================================
71
+
72
+ # Require account verification before users can log in
73
+ # Set to true in production for security
74
+ REQUIRE_USER_VERIFICATION=true
75
+
68
76
  # ===================================================================
69
77
  # FILE UPLOAD
70
78
  # ===================================================================
@@ -112,6 +120,20 @@ CORS_ORIGIN="https://yourdomain.com,https://app.yourdomain.com"
112
120
  # Without it, login will silently fail (server returns 200 but browser drops cookies).
113
121
  COOKIE_DOMAIN=".yourdomain.com"
114
122
 
123
+ # ===================================================================
124
+ # EMAIL (Resend)
125
+ # ===================================================================
126
+
127
+ # Resend API key for transactional emails
128
+ # COOLIFY: Runtime only. Do NOT check "Available at Buildtime" — this is a secret!
129
+ RESEND_API_KEY="re_xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
130
+
131
+ # Sender email — must be from a verified domain in Resend
132
+ RESEND_FROM_EMAIL="noreply@yourdomain.com"
133
+
134
+ # Frontend URL for email links (password reset, verification, etc.)
135
+ CLIENT_URL="https://yourdomain.com"
136
+
115
137
  # ===================================================================
116
138
  # LOGGING
117
139
  # ===================================================================