create-velox-app 0.6.29 → 0.6.51

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 (223) hide show
  1. package/CHANGELOG.md +132 -0
  2. package/GUIDE.md +230 -0
  3. package/dist/cli.d.ts +0 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/index.d.ts +0 -1
  6. package/dist/index.js +14 -5
  7. package/dist/templates/auth.d.ts +0 -1
  8. package/dist/templates/auth.js +10 -1
  9. package/dist/templates/compiler.d.ts +0 -1
  10. package/dist/templates/compiler.js +0 -1
  11. package/dist/templates/index.d.ts +0 -1
  12. package/dist/templates/index.js +30 -2
  13. package/dist/templates/placeholders.d.ts +6 -1
  14. package/dist/templates/placeholders.js +55 -1
  15. package/dist/templates/rsc-auth.d.ts +12 -0
  16. package/dist/templates/rsc-auth.js +208 -0
  17. package/dist/templates/rsc.d.ts +0 -1
  18. package/dist/templates/rsc.js +40 -2
  19. package/dist/templates/shared/css-generator.d.ts +26 -0
  20. package/dist/templates/shared/css-generator.js +553 -0
  21. package/dist/templates/shared/index.d.ts +3 -1
  22. package/dist/templates/shared/index.js +3 -1
  23. package/dist/templates/shared/root.d.ts +0 -1
  24. package/dist/templates/shared/root.js +11 -2
  25. package/dist/templates/shared/rsc-styles.d.ts +54 -0
  26. package/dist/templates/shared/rsc-styles.js +68 -0
  27. package/dist/templates/shared/theme.d.ts +133 -0
  28. package/dist/templates/shared/theme.js +141 -0
  29. package/dist/templates/shared/web-base.d.ts +0 -1
  30. package/dist/templates/shared/web-base.js +0 -1
  31. package/dist/templates/shared/web-styles.d.ts +0 -1
  32. package/dist/templates/shared/web-styles.js +0 -1
  33. package/dist/templates/shared.d.ts +0 -1
  34. package/dist/templates/shared.js +0 -1
  35. package/dist/templates/spa.d.ts +0 -1
  36. package/dist/templates/spa.js +10 -1
  37. package/dist/templates/trpc.d.ts +0 -1
  38. package/dist/templates/trpc.js +10 -1
  39. package/dist/templates/types.d.ts +2 -2
  40. package/dist/templates/types.js +6 -1
  41. package/package.json +6 -3
  42. package/src/templates/source/api/config/database.ts +13 -32
  43. package/src/templates/source/api/docker-compose.yml +21 -0
  44. package/src/templates/source/root/CLAUDE.auth.md +6 -0
  45. package/src/templates/source/root/CLAUDE.default.md +6 -0
  46. package/src/templates/source/root/package.json +6 -6
  47. package/src/templates/source/rsc/CLAUDE.md +56 -2
  48. package/src/templates/source/rsc/app/actions/posts.ts +1 -1
  49. package/src/templates/source/rsc/app/actions/users.ts +111 -20
  50. package/src/templates/source/rsc/app/layouts/dashboard.tsx +21 -16
  51. package/src/templates/source/rsc/app/layouts/marketing.tsx +34 -0
  52. package/src/templates/source/rsc/app/layouts/minimal-content.tsx +21 -0
  53. package/src/templates/source/rsc/app/layouts/minimal.tsx +86 -5
  54. package/src/templates/source/rsc/app/layouts/root.tsx +148 -44
  55. package/src/templates/source/rsc/docker-compose.yml +21 -0
  56. package/src/templates/source/rsc/package.json +3 -3
  57. package/src/templates/source/rsc/src/api/database.ts +13 -32
  58. package/src/templates/source/rsc/src/api/handler.ts +1 -1
  59. package/src/templates/source/rsc/src/entry.client.tsx +65 -18
  60. package/src/templates/source/rsc-auth/CLAUDE.md +230 -0
  61. package/src/templates/source/rsc-auth/app/actions/auth.ts +112 -0
  62. package/src/templates/source/rsc-auth/app/actions/users.ts +289 -0
  63. package/src/templates/source/rsc-auth/app/layouts/dashboard.tsx +132 -0
  64. package/src/templates/source/rsc-auth/app/layouts/marketing.tsx +59 -0
  65. package/src/templates/source/rsc-auth/app/layouts/minimal-content.tsx +21 -0
  66. package/src/templates/source/rsc-auth/app/layouts/minimal.tsx +111 -0
  67. package/src/templates/source/rsc-auth/app/layouts/root.tsx +355 -0
  68. package/src/templates/source/rsc-auth/app/pages/_not-found.tsx +15 -0
  69. package/src/templates/source/rsc-auth/app/pages/auth/login.tsx +198 -0
  70. package/src/templates/source/rsc-auth/app/pages/auth/register.tsx +225 -0
  71. package/src/templates/source/rsc-auth/app/pages/dashboard/index.tsx +267 -0
  72. package/src/templates/source/rsc-auth/app/pages/index.tsx +83 -0
  73. package/src/templates/source/rsc-auth/app/pages/users.tsx +47 -0
  74. package/src/templates/source/rsc-auth/app.config.ts +12 -0
  75. package/src/templates/source/rsc-auth/docker-compose.yml +21 -0
  76. package/src/templates/source/rsc-auth/env.example +11 -0
  77. package/src/templates/source/rsc-auth/gitignore +34 -0
  78. package/src/templates/source/rsc-auth/package.json +44 -0
  79. package/src/templates/source/rsc-auth/prisma/schema.prisma +23 -0
  80. package/src/templates/source/rsc-auth/prisma.config.ts +22 -0
  81. package/src/templates/source/rsc-auth/public/favicon.svg +4 -0
  82. package/src/templates/source/rsc-auth/src/api/database.ts +129 -0
  83. package/src/templates/source/rsc-auth/src/api/handler.ts +85 -0
  84. package/src/templates/source/rsc-auth/src/api/procedures/auth.ts +262 -0
  85. package/src/templates/source/rsc-auth/src/api/procedures/health.ts +48 -0
  86. package/src/templates/source/rsc-auth/src/api/procedures/users.ts +87 -0
  87. package/src/templates/source/rsc-auth/src/api/schemas/auth.ts +79 -0
  88. package/src/templates/source/rsc-auth/src/api/schemas/user.ts +38 -0
  89. package/src/templates/source/rsc-auth/src/api/utils/auth.ts +157 -0
  90. package/src/templates/source/rsc-auth/src/entry.client.tsx +63 -0
  91. package/src/templates/source/rsc-auth/src/entry.server.tsx +262 -0
  92. package/src/templates/source/rsc-auth/tsconfig.json +24 -0
  93. package/src/templates/source/shared/scripts/check-client-imports.sh +75 -0
  94. package/dist/cli.d.ts.map +0 -1
  95. package/dist/cli.js.map +0 -1
  96. package/dist/index.d.ts.map +0 -1
  97. package/dist/index.js.map +0 -1
  98. package/dist/templates/auth.d.ts.map +0 -1
  99. package/dist/templates/auth.js.map +0 -1
  100. package/dist/templates/compiler.d.ts.map +0 -1
  101. package/dist/templates/compiler.js.map +0 -1
  102. package/dist/templates/default.d.ts +0 -12
  103. package/dist/templates/default.d.ts.map +0 -1
  104. package/dist/templates/default.js +0 -85
  105. package/dist/templates/default.js.map +0 -1
  106. package/dist/templates/fullstack.d.ts +0 -15
  107. package/dist/templates/fullstack.d.ts.map +0 -1
  108. package/dist/templates/fullstack.js +0 -110
  109. package/dist/templates/fullstack.js.map +0 -1
  110. package/dist/templates/index.d.ts.map +0 -1
  111. package/dist/templates/index.js.map +0 -1
  112. package/dist/templates/placeholders.d.ts.map +0 -1
  113. package/dist/templates/placeholders.js.map +0 -1
  114. package/dist/templates/rsc.d.ts.map +0 -1
  115. package/dist/templates/rsc.js.map +0 -1
  116. package/dist/templates/shared/index.d.ts.map +0 -1
  117. package/dist/templates/shared/index.js.map +0 -1
  118. package/dist/templates/shared/root.d.ts.map +0 -1
  119. package/dist/templates/shared/root.js.map +0 -1
  120. package/dist/templates/shared/web-base.d.ts.map +0 -1
  121. package/dist/templates/shared/web-base.js.map +0 -1
  122. package/dist/templates/shared/web-styles.d.ts.map +0 -1
  123. package/dist/templates/shared/web-styles.js.map +0 -1
  124. package/dist/templates/shared.d.ts.map +0 -1
  125. package/dist/templates/shared.js.map +0 -1
  126. package/dist/templates/source/api/config/app.d.ts +0 -13
  127. package/dist/templates/source/api/config/app.d.ts.map +0 -1
  128. package/dist/templates/source/api/config/app.js +0 -14
  129. package/dist/templates/source/api/config/app.js.map +0 -1
  130. package/dist/templates/source/api/config/auth.d.ts +0 -34
  131. package/dist/templates/source/api/config/auth.d.ts.map +0 -1
  132. package/dist/templates/source/api/config/auth.js +0 -165
  133. package/dist/templates/source/api/config/auth.js.map +0 -1
  134. package/dist/templates/source/api/config/index.auth.d.ts +0 -6
  135. package/dist/templates/source/api/config/index.auth.d.ts.map +0 -1
  136. package/dist/templates/source/api/config/index.auth.js +0 -6
  137. package/dist/templates/source/api/config/index.auth.js.map +0 -1
  138. package/dist/templates/source/api/config/index.default.d.ts +0 -5
  139. package/dist/templates/source/api/config/index.default.d.ts.map +0 -1
  140. package/dist/templates/source/api/config/index.default.js +0 -5
  141. package/dist/templates/source/api/config/index.default.js.map +0 -1
  142. package/dist/templates/source/api/database/index.d.ts +0 -9
  143. package/dist/templates/source/api/database/index.d.ts.map +0 -1
  144. package/dist/templates/source/api/database/index.js +0 -18
  145. package/dist/templates/source/api/database/index.js.map +0 -1
  146. package/dist/templates/source/api/index.auth.d.ts +0 -5
  147. package/dist/templates/source/api/index.auth.d.ts.map +0 -1
  148. package/dist/templates/source/api/index.auth.js +0 -59
  149. package/dist/templates/source/api/index.auth.js.map +0 -1
  150. package/dist/templates/source/api/index.default.d.ts +0 -5
  151. package/dist/templates/source/api/index.default.d.ts.map +0 -1
  152. package/dist/templates/source/api/index.default.js +0 -56
  153. package/dist/templates/source/api/index.default.js.map +0 -1
  154. package/dist/templates/source/api/prisma.config.d.ts +0 -9
  155. package/dist/templates/source/api/prisma.config.d.ts.map +0 -1
  156. package/dist/templates/source/api/prisma.config.js +0 -15
  157. package/dist/templates/source/api/prisma.config.js.map +0 -1
  158. package/dist/templates/source/api/procedures/auth.d.ts +0 -14
  159. package/dist/templates/source/api/procedures/auth.d.ts.map +0 -1
  160. package/dist/templates/source/api/procedures/auth.js +0 -221
  161. package/dist/templates/source/api/procedures/auth.js.map +0 -1
  162. package/dist/templates/source/api/procedures/health.d.ts +0 -5
  163. package/dist/templates/source/api/procedures/health.d.ts.map +0 -1
  164. package/dist/templates/source/api/procedures/health.js +0 -21
  165. package/dist/templates/source/api/procedures/health.js.map +0 -1
  166. package/dist/templates/source/api/procedures/index.auth.d.ts +0 -7
  167. package/dist/templates/source/api/procedures/index.auth.d.ts.map +0 -1
  168. package/dist/templates/source/api/procedures/index.auth.js +0 -7
  169. package/dist/templates/source/api/procedures/index.auth.js.map +0 -1
  170. package/dist/templates/source/api/procedures/index.default.d.ts +0 -6
  171. package/dist/templates/source/api/procedures/index.default.d.ts.map +0 -1
  172. package/dist/templates/source/api/procedures/index.default.js +0 -6
  173. package/dist/templates/source/api/procedures/index.default.js.map +0 -1
  174. package/dist/templates/source/api/procedures/users.auth.d.ts +0 -7
  175. package/dist/templates/source/api/procedures/users.auth.d.ts.map +0 -1
  176. package/dist/templates/source/api/procedures/users.auth.js +0 -111
  177. package/dist/templates/source/api/procedures/users.auth.js.map +0 -1
  178. package/dist/templates/source/api/procedures/users.default.d.ts +0 -5
  179. package/dist/templates/source/api/procedures/users.default.d.ts.map +0 -1
  180. package/dist/templates/source/api/procedures/users.default.js +0 -86
  181. package/dist/templates/source/api/procedures/users.default.js.map +0 -1
  182. package/dist/templates/source/api/schemas/index.d.ts +0 -5
  183. package/dist/templates/source/api/schemas/index.d.ts.map +0 -1
  184. package/dist/templates/source/api/schemas/index.js +0 -5
  185. package/dist/templates/source/api/schemas/index.js.map +0 -1
  186. package/dist/templates/source/api/schemas/user.d.ts +0 -11
  187. package/dist/templates/source/api/schemas/user.d.ts.map +0 -1
  188. package/dist/templates/source/api/schemas/user.js +0 -20
  189. package/dist/templates/source/api/schemas/user.js.map +0 -1
  190. package/dist/templates/source/api/tsup.config.d.ts +0 -3
  191. package/dist/templates/source/api/tsup.config.d.ts.map +0 -1
  192. package/dist/templates/source/api/tsup.config.js +0 -10
  193. package/dist/templates/source/api/tsup.config.js.map +0 -1
  194. package/dist/templates/source/web/main.d.ts +0 -9
  195. package/dist/templates/source/web/main.d.ts.map +0 -1
  196. package/dist/templates/source/web/main.js +0 -27
  197. package/dist/templates/source/web/main.js.map +0 -1
  198. package/dist/templates/source/web/routes/__root.d.ts +0 -2
  199. package/dist/templates/source/web/routes/__root.d.ts.map +0 -1
  200. package/dist/templates/source/web/routes/__root.js +0 -28
  201. package/dist/templates/source/web/routes/__root.js.map +0 -1
  202. package/dist/templates/source/web/routes/about.d.ts +0 -2
  203. package/dist/templates/source/web/routes/about.d.ts.map +0 -1
  204. package/dist/templates/source/web/routes/about.js +0 -33
  205. package/dist/templates/source/web/routes/about.js.map +0 -1
  206. package/dist/templates/source/web/routes/index.auth.d.ts +0 -2
  207. package/dist/templates/source/web/routes/index.auth.d.ts.map +0 -1
  208. package/dist/templates/source/web/routes/index.auth.js +0 -159
  209. package/dist/templates/source/web/routes/index.auth.js.map +0 -1
  210. package/dist/templates/source/web/routes/index.default.d.ts +0 -2
  211. package/dist/templates/source/web/routes/index.default.d.ts.map +0 -1
  212. package/dist/templates/source/web/routes/index.default.js +0 -60
  213. package/dist/templates/source/web/routes/index.default.js.map +0 -1
  214. package/dist/templates/source/web/vite.config.d.ts +0 -3
  215. package/dist/templates/source/web/vite.config.d.ts.map +0 -1
  216. package/dist/templates/source/web/vite.config.js +0 -22
  217. package/dist/templates/source/web/vite.config.js.map +0 -1
  218. package/dist/templates/spa.d.ts.map +0 -1
  219. package/dist/templates/spa.js.map +0 -1
  220. package/dist/templates/trpc.d.ts.map +0 -1
  221. package/dist/templates/trpc.js.map +0 -1
  222. package/dist/templates/types.d.ts.map +0 -1
  223. package/dist/templates/types.js.map +0 -1
@@ -0,0 +1,68 @@
1
+ /**
2
+ * RSC Navigation Configurations
3
+ *
4
+ * Provides navigation item configs for RSC templates.
5
+ * Separates basic RSC nav from auth-aware RSC nav.
6
+ */
7
+ /**
8
+ * Navigation items for basic RSC template (no auth)
9
+ *
10
+ * Routes:
11
+ * - / (Home)
12
+ * - /users (Users list)
13
+ * - /about (About page)
14
+ * - /docs/getting-started (Documentation)
15
+ */
16
+ export const RSC_NAV_ITEMS = [
17
+ { href: '/', label: 'Home' },
18
+ { href: '/users', label: 'Users' },
19
+ { href: '/about', label: 'About' },
20
+ { href: '/docs/getting-started', label: 'Docs' },
21
+ ];
22
+ /**
23
+ * Navigation items for RSC-Auth template (with authentication)
24
+ *
25
+ * Routes:
26
+ * - / (Home)
27
+ * - /users (Users list)
28
+ * - /dashboard (Dashboard - auth required)
29
+ * - /auth/login (Login - guest only)
30
+ * - /auth/register (Register - guest only)
31
+ */
32
+ export const RSC_AUTH_NAV_ITEMS = [
33
+ { href: '/', label: 'Home' },
34
+ { href: '/users', label: 'Users' },
35
+ { href: '/dashboard', label: 'Dashboard', authRequired: true },
36
+ { href: '/auth/login', label: 'Login', guestOnly: true },
37
+ { href: '/auth/register', label: 'Register', guestOnly: true },
38
+ ];
39
+ /**
40
+ * Filter navigation items based on authentication status
41
+ *
42
+ * @param items - Full navigation items list
43
+ * @param isAuthenticated - Whether the user is authenticated
44
+ * @returns Filtered navigation items
45
+ */
46
+ export function filterNavByAuth(items, isAuthenticated) {
47
+ return items.filter((item) => {
48
+ if (item.authRequired && !isAuthenticated)
49
+ return false;
50
+ if (item.guestOnly && isAuthenticated)
51
+ return false;
52
+ return true;
53
+ });
54
+ }
55
+ /**
56
+ * Detect authentication from cookie header (server-side)
57
+ *
58
+ * This is a simple cookie-based auth detection for navigation purposes.
59
+ * The actual auth validation happens in the API layer.
60
+ *
61
+ * @param cookieHeader - Cookie header string from request
62
+ * @returns Whether an access token cookie exists
63
+ */
64
+ export function hasAuthToken(cookieHeader) {
65
+ if (!cookieHeader)
66
+ return false;
67
+ return cookieHeader.includes('accessToken=');
68
+ }
@@ -0,0 +1,133 @@
1
+ /**
2
+ * VeloxTS Design System
3
+ *
4
+ * Dark mode theme constants extracted from the SPA template.
5
+ * This is the single source of truth for all RSC template styling.
6
+ */
7
+ /**
8
+ * Color palette - Dark mode with cyan accents
9
+ */
10
+ export declare const colors: {
11
+ readonly background: "#0a0a0a";
12
+ readonly backgroundAlt: "#111";
13
+ readonly surface: "#111";
14
+ readonly surfaceHover: "#1a1a1a";
15
+ readonly surfaceAlt: "#1a1a1a";
16
+ readonly border: "#222";
17
+ readonly borderHover: "#333";
18
+ readonly borderFocus: "#00d9ff";
19
+ readonly text: "#ededed";
20
+ readonly textMuted: "#888";
21
+ readonly textDimmed: "#666";
22
+ readonly textInverse: "#000";
23
+ readonly accent: "#00d9ff";
24
+ readonly accentHover: "rgba(0, 217, 255, 0.8)";
25
+ readonly accentDimmed: "rgba(0, 217, 255, 0.6)";
26
+ readonly success: "#00d9ff";
27
+ readonly error: "#ff4444";
28
+ readonly errorBg: "#2a1111";
29
+ readonly errorText: "#ff6666";
30
+ readonly warning: "#ffaa00";
31
+ readonly warningBg: "#2a2211";
32
+ readonly info: "#00d9ff";
33
+ readonly selection: "#00d9ff";
34
+ readonly selectionText: "#000";
35
+ readonly scrollbarTrack: "#111";
36
+ readonly scrollbarThumb: "#333";
37
+ readonly scrollbarThumbHover: "#444";
38
+ readonly codeBg: "#1a1a1a";
39
+ };
40
+ /**
41
+ * Typography
42
+ */
43
+ export declare const typography: {
44
+ readonly fontFamily: {
45
+ readonly sans: "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen, Ubuntu, Cantarell, \"Open Sans\", \"Helvetica Neue\", sans-serif";
46
+ readonly mono: "\"SF Mono\", \"Fira Code\", \"Fira Mono\", Menlo, Monaco, \"Courier New\", monospace";
47
+ };
48
+ readonly fontSize: {
49
+ readonly xs: "0.625rem";
50
+ readonly sm: "0.75rem";
51
+ readonly base: "0.875rem";
52
+ readonly md: "0.9rem";
53
+ readonly lg: "1rem";
54
+ readonly xl: "1.25rem";
55
+ readonly '2xl': "1.5rem";
56
+ readonly '3xl': "2rem";
57
+ readonly '4xl': "2.5rem";
58
+ readonly '5xl': "3rem";
59
+ };
60
+ readonly fontWeight: {
61
+ readonly normal: "400";
62
+ readonly medium: "500";
63
+ readonly semibold: "600";
64
+ readonly bold: "700";
65
+ };
66
+ readonly lineHeight: {
67
+ readonly tight: "1.2";
68
+ readonly normal: "1.6";
69
+ readonly relaxed: "1.8";
70
+ };
71
+ };
72
+ /**
73
+ * Spacing scale (based on 0.25rem = 4px)
74
+ */
75
+ export declare const spacing: {
76
+ readonly 0: "0";
77
+ readonly 1: "0.25rem";
78
+ readonly 2: "0.5rem";
79
+ readonly 3: "0.75rem";
80
+ readonly 4: "1rem";
81
+ readonly 5: "1.25rem";
82
+ readonly 6: "1.5rem";
83
+ readonly 8: "2rem";
84
+ readonly 10: "2.5rem";
85
+ readonly 12: "3rem";
86
+ readonly 16: "4rem";
87
+ readonly 20: "5rem";
88
+ };
89
+ /**
90
+ * Layout constants
91
+ */
92
+ export declare const layout: {
93
+ readonly maxWidth: "1200px";
94
+ readonly maxWidthNarrow: "1000px";
95
+ readonly maxWidthWide: "1400px";
96
+ readonly navHeight: "64px";
97
+ readonly sidebarWidth: "240px";
98
+ readonly borderRadius: {
99
+ readonly sm: "4px";
100
+ readonly md: "6px";
101
+ readonly lg: "8px";
102
+ readonly xl: "12px";
103
+ };
104
+ readonly boxShadow: {
105
+ readonly sm: "0 1px 2px rgba(0, 0, 0, 0.3)";
106
+ readonly md: "0 2px 8px rgba(0, 0, 0, 0.4)";
107
+ readonly lg: "0 4px 16px rgba(0, 0, 0, 0.5)";
108
+ };
109
+ };
110
+ /**
111
+ * Transitions
112
+ */
113
+ export declare const transitions: {
114
+ readonly fast: "0.1s";
115
+ readonly normal: "0.2s";
116
+ readonly slow: "0.3s";
117
+ readonly ease: "ease";
118
+ readonly easeIn: "ease-in";
119
+ readonly easeOut: "ease-out";
120
+ readonly easeInOut: "ease-in-out";
121
+ };
122
+ /**
123
+ * Z-index layers
124
+ */
125
+ export declare const zIndex: {
126
+ readonly base: 0;
127
+ readonly dropdown: 10;
128
+ readonly sticky: 100;
129
+ readonly fixed: 200;
130
+ readonly modal: 300;
131
+ readonly popover: 400;
132
+ readonly tooltip: 500;
133
+ };
@@ -0,0 +1,141 @@
1
+ /**
2
+ * VeloxTS Design System
3
+ *
4
+ * Dark mode theme constants extracted from the SPA template.
5
+ * This is the single source of truth for all RSC template styling.
6
+ */
7
+ /**
8
+ * Color palette - Dark mode with cyan accents
9
+ */
10
+ export const colors = {
11
+ // Backgrounds
12
+ background: '#0a0a0a',
13
+ backgroundAlt: '#111',
14
+ surface: '#111',
15
+ surfaceHover: '#1a1a1a',
16
+ surfaceAlt: '#1a1a1a',
17
+ // Borders
18
+ border: '#222',
19
+ borderHover: '#333',
20
+ borderFocus: '#00d9ff',
21
+ // Text
22
+ text: '#ededed',
23
+ textMuted: '#888',
24
+ textDimmed: '#666',
25
+ textInverse: '#000',
26
+ // Accent & Brand
27
+ accent: '#00d9ff',
28
+ accentHover: 'rgba(0, 217, 255, 0.8)',
29
+ accentDimmed: 'rgba(0, 217, 255, 0.6)',
30
+ // Semantic Colors
31
+ success: '#00d9ff',
32
+ error: '#ff4444',
33
+ errorBg: '#2a1111',
34
+ errorText: '#ff6666',
35
+ warning: '#ffaa00',
36
+ warningBg: '#2a2211',
37
+ info: '#00d9ff',
38
+ // Selection
39
+ selection: '#00d9ff',
40
+ selectionText: '#000',
41
+ // Scrollbar
42
+ scrollbarTrack: '#111',
43
+ scrollbarThumb: '#333',
44
+ scrollbarThumbHover: '#444',
45
+ // Code blocks
46
+ codeBg: '#1a1a1a',
47
+ };
48
+ /**
49
+ * Typography
50
+ */
51
+ export const typography = {
52
+ fontFamily: {
53
+ sans: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
54
+ mono: '"SF Mono", "Fira Code", "Fira Mono", Menlo, Monaco, "Courier New", monospace',
55
+ },
56
+ fontSize: {
57
+ xs: '0.625rem', // 10px
58
+ sm: '0.75rem', // 12px
59
+ base: '0.875rem', // 14px
60
+ md: '0.9rem', // 14.4px
61
+ lg: '1rem', // 16px
62
+ xl: '1.25rem', // 20px
63
+ '2xl': '1.5rem', // 24px
64
+ '3xl': '2rem', // 32px
65
+ '4xl': '2.5rem', // 40px
66
+ '5xl': '3rem', // 48px
67
+ },
68
+ fontWeight: {
69
+ normal: '400',
70
+ medium: '500',
71
+ semibold: '600',
72
+ bold: '700',
73
+ },
74
+ lineHeight: {
75
+ tight: '1.2',
76
+ normal: '1.6',
77
+ relaxed: '1.8',
78
+ },
79
+ };
80
+ /**
81
+ * Spacing scale (based on 0.25rem = 4px)
82
+ */
83
+ export const spacing = {
84
+ 0: '0',
85
+ 1: '0.25rem', // 4px
86
+ 2: '0.5rem', // 8px
87
+ 3: '0.75rem', // 12px
88
+ 4: '1rem', // 16px
89
+ 5: '1.25rem', // 20px
90
+ 6: '1.5rem', // 24px
91
+ 8: '2rem', // 32px
92
+ 10: '2.5rem', // 40px
93
+ 12: '3rem', // 48px
94
+ 16: '4rem', // 64px
95
+ 20: '5rem', // 80px
96
+ };
97
+ /**
98
+ * Layout constants
99
+ */
100
+ export const layout = {
101
+ maxWidth: '1200px',
102
+ maxWidthNarrow: '1000px',
103
+ maxWidthWide: '1400px',
104
+ navHeight: '64px',
105
+ sidebarWidth: '240px',
106
+ borderRadius: {
107
+ sm: '4px',
108
+ md: '6px',
109
+ lg: '8px',
110
+ xl: '12px',
111
+ },
112
+ boxShadow: {
113
+ sm: '0 1px 2px rgba(0, 0, 0, 0.3)',
114
+ md: '0 2px 8px rgba(0, 0, 0, 0.4)',
115
+ lg: '0 4px 16px rgba(0, 0, 0, 0.5)',
116
+ },
117
+ };
118
+ /**
119
+ * Transitions
120
+ */
121
+ export const transitions = {
122
+ fast: '0.1s',
123
+ normal: '0.2s',
124
+ slow: '0.3s',
125
+ ease: 'ease',
126
+ easeIn: 'ease-in',
127
+ easeOut: 'ease-out',
128
+ easeInOut: 'ease-in-out',
129
+ };
130
+ /**
131
+ * Z-index layers
132
+ */
133
+ export const zIndex = {
134
+ base: 0,
135
+ dropdown: 10,
136
+ sticky: 100,
137
+ fixed: 200,
138
+ modal: 300,
139
+ popover: 400,
140
+ tooltip: 500,
141
+ };
@@ -18,4 +18,3 @@ export declare function generateUsersRoute(config: TemplateConfig): string;
18
18
  export declare function generateApiHooks(): string;
19
19
  export declare function generateViteEnvDts(): string;
20
20
  export declare function generateWebBaseFiles(config: TemplateConfig, isAuthTemplate: boolean): TemplateFile[];
21
- //# sourceMappingURL=web-base.d.ts.map
@@ -74,4 +74,3 @@ export function generateWebBaseFiles(config, isAuthTemplate) {
74
74
  { path: 'apps/web/src/routes/about.tsx', content: generateAboutRoute() },
75
75
  ];
76
76
  }
77
- //# sourceMappingURL=web-base.js.map
@@ -7,4 +7,3 @@ import type { TemplateFile } from '../types.js';
7
7
  export declare function generateGlobalCss(): string;
8
8
  export declare function generateAppModuleCss(): string;
9
9
  export declare function generateWebStyleFiles(): TemplateFile[];
10
- //# sourceMappingURL=web-styles.d.ts.map
@@ -23,4 +23,3 @@ export function generateWebStyleFiles() {
23
23
  { path: 'apps/web/src/App.module.css', content: generateAppModuleCss() },
24
24
  ];
25
25
  }
26
- //# sourceMappingURL=web-styles.js.map
@@ -8,4 +8,3 @@
8
8
  * This is automatically updated during releases via changesets.
9
9
  */
10
10
  export declare const VELOXTS_VERSION: string;
11
- //# sourceMappingURL=shared.d.ts.map
@@ -15,4 +15,3 @@ const packageJson = require('../../package.json');
15
15
  * This is automatically updated during releases via changesets.
16
16
  */
17
17
  export const VELOXTS_VERSION = packageJson.version ?? '0.0.0-unknown';
18
- //# sourceMappingURL=shared.js.map
@@ -9,4 +9,3 @@
9
9
  */
10
10
  import type { TemplateConfig, TemplateFile } from './types.js';
11
11
  export declare function generateSpaTemplate(config: TemplateConfig): TemplateFile[];
12
- //# sourceMappingURL=spa.d.ts.map
@@ -65,6 +65,9 @@ function generateRoutes() {
65
65
  function generateApiTypesDts() {
66
66
  return compileTemplate('api/types.d.ts', DEFAULT_CONFIG);
67
67
  }
68
+ function generateDockerCompose(config) {
69
+ return compileTemplate('api/docker-compose.yml', config);
70
+ }
68
71
  // ============================================================================
69
72
  // SPA Template Generator
70
73
  // ============================================================================
@@ -92,6 +95,13 @@ export function generateSpaTemplate(config) {
92
95
  { path: 'apps/api/src/routes.ts', content: generateRoutes() },
93
96
  { path: 'apps/api/src/types.d.ts', content: generateApiTypesDts() },
94
97
  ];
98
+ // Add docker-compose for PostgreSQL
99
+ if (config.database === 'postgresql') {
100
+ files.push({
101
+ path: 'apps/api/docker-compose.yml',
102
+ content: generateDockerCompose(config),
103
+ });
104
+ }
95
105
  // Add root workspace files
96
106
  const rootFiles = generateRootFiles(config, false);
97
107
  // Add web package files
@@ -99,4 +109,3 @@ export function generateSpaTemplate(config) {
99
109
  const webStyleFiles = generateWebStyleFiles();
100
110
  return [...files, ...rootFiles, ...webBaseFiles, ...webStyleFiles];
101
111
  }
102
- //# sourceMappingURL=spa.js.map
@@ -12,4 +12,3 @@
12
12
  */
13
13
  import type { TemplateConfig, TemplateFile } from './types.js';
14
14
  export declare function generateTrpcTemplate(config: TemplateConfig): TemplateFile[];
15
- //# sourceMappingURL=trpc.d.ts.map
@@ -73,6 +73,9 @@ function generateRoutes() {
73
73
  function generateApiTypesDts() {
74
74
  return compileTemplate('api/types.d.ts', DEFAULT_CONFIG);
75
75
  }
76
+ function generateDockerCompose(config) {
77
+ return compileTemplate('api/docker-compose.yml', config);
78
+ }
76
79
  // ============================================================================
77
80
  // tRPC Template Generator
78
81
  // ============================================================================
@@ -100,6 +103,13 @@ export function generateTrpcTemplate(config) {
100
103
  { path: 'apps/api/src/routes.ts', content: generateRoutes() },
101
104
  { path: 'apps/api/src/types.d.ts', content: generateApiTypesDts() },
102
105
  ];
106
+ // Add docker-compose for PostgreSQL
107
+ if (config.database === 'postgresql') {
108
+ files.push({
109
+ path: 'apps/api/docker-compose.yml',
110
+ content: generateDockerCompose(config),
111
+ });
112
+ }
103
113
  // Add root workspace files (use false for isAuthTemplate)
104
114
  const rootFiles = generateRootFiles(config, false);
105
115
  // Add web package files (use false for isAuthTemplate)
@@ -107,4 +117,3 @@ export function generateTrpcTemplate(config) {
107
117
  const webStyleFiles = generateWebStyleFiles();
108
118
  return [...files, ...rootFiles, ...webBaseFiles, ...webStyleFiles];
109
119
  }
110
- //# sourceMappingURL=trpc.js.map
@@ -10,8 +10,9 @@
10
10
  * - `auth` - SPA + API with JWT authentication
11
11
  * - `trpc` - SPA + API with tRPC integration
12
12
  * - `rsc` (alias: `fullstack`) - React Server Components with Vinxi
13
+ * - `rsc-auth` - RSC with JWT authentication and validated() server actions
13
14
  */
14
- export type TemplateType = 'spa' | 'auth' | 'trpc' | 'rsc';
15
+ export type TemplateType = 'spa' | 'auth' | 'trpc' | 'rsc' | 'rsc-auth';
15
16
  /**
16
17
  * Template aliases for backward compatibility
17
18
  */
@@ -101,4 +102,3 @@ export declare function getAvailableTemplates(): TemplateMetadata[];
101
102
  * Check if a template type is valid
102
103
  */
103
104
  export declare function isValidTemplate(template: string): template is TemplateType;
104
- //# sourceMappingURL=types.d.ts.map
@@ -92,6 +92,12 @@ export const TEMPLATE_METADATA = {
92
92
  description: 'React Server Components with Vinxi + embedded Fastify',
93
93
  hint: 'Unified server/client with file-based routing and streaming',
94
94
  },
95
+ 'rsc-auth': {
96
+ type: 'rsc-auth',
97
+ label: 'RSC + Auth',
98
+ description: 'RSC with JWT authentication and validated() server actions',
99
+ hint: 'Full-stack auth with rate limiting, CSRF, and role-based access',
100
+ },
95
101
  };
96
102
  /**
97
103
  * Get all available template types
@@ -105,4 +111,3 @@ export function getAvailableTemplates() {
105
111
  export function isValidTemplate(template) {
106
112
  return template in TEMPLATE_METADATA;
107
113
  }
108
- //# sourceMappingURL=types.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-velox-app",
3
- "version": "0.6.29",
3
+ "version": "0.6.51",
4
4
  "description": "Project scaffolder for VeloxTS framework",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -29,8 +29,9 @@
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/node": "25.0.3",
32
+ "@vitest/coverage-v8": "4.0.16",
32
33
  "typescript": "5.9.3",
33
- "vitest": "4.0.15"
34
+ "vitest": "4.0.16"
34
35
  },
35
36
  "keywords": [
36
37
  "velox",
@@ -59,6 +60,8 @@
59
60
  "clean": "rm -rf dist tsconfig.tsbuildinfo",
60
61
  "test": "vitest run",
61
62
  "test:watch": "vitest",
62
- "smoke-test": "./scripts/smoke-test.sh"
63
+ "test:coverage": "vitest run --coverage",
64
+ "smoke-test": "./scripts/smoke-test.sh",
65
+ "verify-publish": "./scripts/verify-publish.sh"
63
66
  }
64
67
  }
@@ -20,7 +20,6 @@ import type { PrismaBetterSqlite3 as PrismaBetterSqlite3Type } from '@prisma/ada
20
20
  import type { PrismaPg as PrismaPgType } from '@prisma/adapter-pg';
21
21
  /* @endif postgresql */
22
22
  import type { PrismaClient as PrismaClientType } from '@prisma/client';
23
- import type { Pool as PoolType } from 'pg';
24
23
 
25
24
  const require = createRequire(import.meta.url);
26
25
  /* @if sqlite */
@@ -32,9 +31,6 @@ const { PrismaBetterSqlite3 } = require('@prisma/adapter-better-sqlite3') as {
32
31
  const { PrismaPg } = require('@prisma/adapter-pg') as {
33
32
  PrismaPg: typeof PrismaPgType;
34
33
  };
35
- const { Pool } = require('pg') as {
36
- Pool: typeof PoolType;
37
- };
38
34
  /* @endif postgresql */
39
35
  const { PrismaClient } = require('@prisma/client') as {
40
36
  PrismaClient: typeof PrismaClientType;
@@ -44,10 +40,6 @@ declare global {
44
40
  // Allow global `var` declarations for hot reload in development
45
41
  // eslint-disable-next-line no-var
46
42
  var __db: PrismaClient | undefined;
47
- /* @if postgresql */
48
- // eslint-disable-next-line no-var
49
- var __pool: InstanceType<typeof PoolType> | undefined;
50
- /* @endif postgresql */
51
43
  }
52
44
 
53
45
  /* @if sqlite */
@@ -72,32 +64,24 @@ function createPrismaClient(): PrismaClient {
72
64
  /* @endif sqlite */
73
65
  /* @if postgresql */
74
66
  /**
75
- * Create a PostgreSQL connection pool.
76
- * Uses connection pooling for better performance in production.
67
+ * Create a Prisma client instance using the PostgreSQL adapter.
68
+ *
69
+ * Prisma 7 Breaking Change:
70
+ * - PrismaPg now takes connectionString directly (not a Pool instance)
71
+ * - Pool management is handled internally by the adapter
77
72
  */
78
- function createPool(): InstanceType<typeof PoolType> {
79
- const databaseUrl = process.env.DATABASE_URL;
73
+ function createPrismaClient(): PrismaClient {
74
+ const connectionString = process.env.DATABASE_URL;
80
75
 
81
- if (!databaseUrl) {
76
+ if (!connectionString) {
82
77
  throw new Error(
83
78
  '[VeloxTS] DATABASE_URL environment variable is not set. ' +
84
79
  'Ensure .env file exists with DATABASE_URL defined.'
85
80
  );
86
81
  }
87
82
 
88
- return new Pool({
89
- connectionString: databaseUrl,
90
- max: 10, // Maximum connections in pool
91
- });
92
- }
93
-
94
- /**
95
- * Create a Prisma client instance using the PostgreSQL adapter.
96
- * Uses connection pooling for efficient database access.
97
- */
98
- function createPrismaClient(pool: InstanceType<typeof PoolType>): PrismaClient {
99
- // Prisma 7 requires driver adapters for direct connections
100
- const adapter = new PrismaPg(pool);
83
+ // Prisma 7: Pass connectionString directly to PrismaPg (not a Pool)
84
+ const adapter = new PrismaPg({ connectionString });
101
85
  return new PrismaClient({ adapter });
102
86
  }
103
87
  /* @endif postgresql */
@@ -111,19 +95,16 @@ if (process.env.NODE_ENV !== 'production') {
111
95
  }
112
96
  /* @endif sqlite */
113
97
  /* @if postgresql */
114
- // Use global singletons for hot reload in development
115
- const pool = globalThis.__pool ?? createPool();
116
- export const db = globalThis.__db ?? createPrismaClient(pool);
98
+ // Use global singleton for hot reload in development
99
+ export const db = globalThis.__db ?? createPrismaClient();
117
100
 
118
101
  if (process.env.NODE_ENV !== 'production') {
119
- globalThis.__pool = pool;
120
102
  globalThis.__db = db;
121
103
  }
122
104
 
123
- // Graceful shutdown - close pool on process exit
105
+ // Graceful shutdown - disconnect Prisma on process exit
124
106
  const shutdown = async () => {
125
107
  await db.$disconnect();
126
- await pool.end();
127
108
  process.exit(0);
128
109
  };
129
110
 
@@ -0,0 +1,21 @@
1
+ services:
2
+ postgres:
3
+ image: postgres:16-alpine
4
+ container_name: __PROJECT_NAME__-postgres
5
+ restart: unless-stopped
6
+ environment:
7
+ POSTGRES_USER: ${DATABASE_USER:-user}
8
+ POSTGRES_PASSWORD: ${DATABASE_PASSWORD:-password}
9
+ POSTGRES_DB: ${DATABASE_NAME:-__PROJECT_NAME__}
10
+ ports:
11
+ - "${DATABASE_PORT:-5432}:5432"
12
+ volumes:
13
+ - postgres_data:/var/lib/postgresql/data
14
+ healthcheck:
15
+ test: ["CMD-SHELL", "pg_isready -U ${DATABASE_USER:-user} -d ${DATABASE_NAME:-__PROJECT_NAME__}"]
16
+ interval: 10s
17
+ timeout: 5s
18
+ retries: 5
19
+
20
+ volumes:
21
+ postgres_data:
@@ -69,6 +69,12 @@ export const postProcedures = procedures('posts', {
69
69
 
70
70
  Then register in `src/procedures/index.ts` and add to collections in `src/index.ts`.
71
71
 
72
+ ## Prisma 7 Configuration
73
+
74
+ This project uses Prisma 7 which has breaking changes:
75
+ - Database URL is configured in `prisma.config.ts`, NOT in `schema.prisma`
76
+ - NEVER add `url` property to the datasource block in `schema.prisma`
77
+
72
78
  ### Frontend Development (apps/web)
73
79
 
74
80
  **Creating a new route:**
@@ -68,6 +68,12 @@ export const postProcedures = procedures('posts', {
68
68
 
69
69
  Then register in `src/procedures/index.ts` and add to collections in `src/index.ts`.
70
70
 
71
+ ## Prisma 7 Configuration
72
+
73
+ This project uses Prisma 7 which has breaking changes:
74
+ - Database URL is configured in `prisma.config.ts`, NOT in `schema.prisma`
75
+ - NEVER add `url` property to the datasource block in `schema.prisma`
76
+
71
77
  ### Frontend Development (apps/web)
72
78
 
73
79
  **Creating a new route:**
@@ -7,12 +7,12 @@
7
7
  "apps/*"
8
8
  ],
9
9
  "scripts": {
10
- "dev": "__RUN_CMD__ --parallel -r dev",
11
- "build": "__RUN_CMD__ -r build",
12
- "type-check": "__RUN_CMD__ -r type-check",
13
- "db:push": "__RUN_CMD__ -F api db:push",
14
- "db:generate": "__RUN_CMD__ -F api db:generate",
15
- "db:studio": "__RUN_CMD__ -F api db:studio"
10
+ "dev": "__DEV_CMD__",
11
+ "build": "__WS_ALL__ build",
12
+ "type-check": "__WS_ALL__ type-check",
13
+ "db:push": "__WS_API__ db:push",
14
+ "db:generate": "__WS_API__ db:generate",
15
+ "db:studio": "__WS_API__ db:studio"
16
16
  },
17
17
  "dependencies": {
18
18
  "@prisma/client-runtime-utils": "7.2.0"