better-ts-stack 2.1.1 → 2.2.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 (174) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +16 -8
  3. package/dist/args.js +7 -0
  4. package/dist/builder/buildPlanner.js +7 -1
  5. package/dist/builder/configGenerator.js +28 -3
  6. package/dist/builder/index.js +2 -1
  7. package/dist/builder/moduleSelector.js +6 -1
  8. package/dist/builder/readmeGenerator.js +8 -2
  9. package/dist/builder/templateContext.js +1 -0
  10. package/dist/output/nextSteps.js +2 -4
  11. package/dist/prompts/stack.js +6 -1
  12. package/dist/types/index.js +2 -0
  13. package/dist/ui/messages.js +2 -0
  14. package/package.json +71 -71
  15. package/templates/backend/express/.prettierignore +52 -52
  16. package/templates/backend/express/.prettierrc +16 -16
  17. package/templates/backend/express/gitignore +3 -1
  18. package/templates/backend/express/src/env.ts.hbs +13 -2
  19. package/templates/backend/express/src/index.ts.hbs +31 -2
  20. package/templates/backend/express/tsconfig.eslint.json +9 -9
  21. package/templates/backend/nestjs/.prettierignore +52 -52
  22. package/templates/backend/nestjs/gitignore +3 -1
  23. package/templates/backend/nestjs/src/app.module.ts.hbs +4 -1
  24. package/templates/backend/nestjs/src/env.ts.hbs +13 -2
  25. package/templates/backend/nestjs/src/health/health.controller.ts.hbs +7 -0
  26. package/templates/backend/nestjs/src/{main.ts → main.ts.hbs} +11 -0
  27. package/templates/backend/nestjs/tsconfig.eslint.json +9 -9
  28. package/templates/frontend/nextjs/app/globals.css +129 -89
  29. package/templates/frontend/nextjs/app/layout.tsx +36 -34
  30. package/templates/frontend/nextjs/app/page.tsx.hbs +63 -43
  31. package/templates/frontend/nextjs/components/ui/alert.tsx +75 -0
  32. package/templates/frontend/nextjs/components/ui/badge.tsx +51 -0
  33. package/templates/frontend/nextjs/components/ui/button.tsx +57 -51
  34. package/templates/frontend/nextjs/components/ui/card.tsx +102 -60
  35. package/templates/frontend/nextjs/components/ui/field.tsx +238 -67
  36. package/templates/frontend/nextjs/components/ui/input.tsx +19 -18
  37. package/templates/frontend/nextjs/components/ui/label.tsx +19 -0
  38. package/templates/frontend/nextjs/components/ui/separator.tsx +24 -0
  39. package/templates/frontend/nextjs/components/ui/skeleton.tsx +13 -0
  40. package/templates/frontend/nextjs/components/ui/spinner.tsx +10 -0
  41. package/templates/frontend/nextjs/components.json +11 -5
  42. package/templates/frontend/nextjs/config.json +36 -35
  43. package/templates/frontend/nextjs/eslint.config.mjs +11 -11
  44. package/templates/frontend/nextjs/lib/utils.ts +1 -6
  45. package/templates/frontend/nextjs/next.config.ts.hbs +12 -12
  46. package/templates/frontend/nextjs/postcss.config.mjs +7 -7
  47. package/templates/frontend/nextjs/public/file.svg +1 -1
  48. package/templates/frontend/nextjs/public/globe.svg +1 -1
  49. package/templates/frontend/nextjs/public/window.svg +1 -1
  50. package/templates/frontend/tanstack/components.json +25 -18
  51. package/templates/frontend/tanstack/config.json +5 -2
  52. package/templates/frontend/tanstack/eslint.config.mjs +23 -23
  53. package/templates/frontend/tanstack/gitignore +39 -39
  54. package/templates/frontend/tanstack/public/favicon.svg +7 -7
  55. package/templates/frontend/tanstack/src/components/ui/alert.tsx +75 -0
  56. package/templates/frontend/tanstack/src/components/ui/badge.tsx +51 -0
  57. package/templates/frontend/tanstack/src/components/ui/button.tsx +57 -51
  58. package/templates/frontend/tanstack/src/components/ui/card.tsx +102 -60
  59. package/templates/frontend/tanstack/src/components/ui/field.tsx +236 -67
  60. package/templates/frontend/tanstack/src/components/ui/input.tsx +19 -18
  61. package/templates/frontend/tanstack/src/components/ui/label.tsx +17 -0
  62. package/templates/frontend/tanstack/src/components/ui/separator.tsx +24 -0
  63. package/templates/frontend/tanstack/src/components/ui/skeleton.tsx +13 -0
  64. package/templates/frontend/tanstack/src/components/ui/spinner.tsx +10 -0
  65. package/templates/frontend/tanstack/src/lib/utils.ts +1 -6
  66. package/templates/frontend/tanstack/src/router.tsx +31 -31
  67. package/templates/frontend/tanstack/src/routes/__root.tsx +69 -69
  68. package/templates/frontend/tanstack/src/routes/index.tsx.hbs +64 -45
  69. package/templates/frontend/tanstack/src/styles/app.css +100 -55
  70. package/templates/frontend/tanstack/tsconfig.json +22 -22
  71. package/templates/modules/agents/AGENTS.md.hbs +245 -0
  72. package/templates/modules/agents/CLAUDE.md +1 -0
  73. package/templates/modules/agents/config.json +10 -0
  74. package/templates/modules/auth/express/config.json +12 -11
  75. package/templates/modules/auth/express/src/lib/auth.ts.hbs +143 -0
  76. package/templates/modules/auth/express/src/lib/email.ts +37 -0
  77. package/templates/modules/auth/express/src/middleware/requireAuth.ts +29 -0
  78. package/templates/modules/auth/express/src/routes/me.ts +13 -0
  79. package/templates/modules/auth/nestjs/config.json +13 -11
  80. package/templates/modules/auth/nestjs/src/auth/auth.module.ts.hbs +64 -14
  81. package/templates/modules/auth/nestjs/src/auth/auth.ts.hbs +152 -0
  82. package/templates/modules/auth/nestjs/src/auth/email.ts +37 -0
  83. package/templates/modules/auth/nestjs/src/me/me.controller.ts +15 -0
  84. package/templates/modules/auth/nextjs/app/api/auth/[...all]/route.ts +4 -4
  85. package/templates/modules/auth/nextjs/app/dashboard/page.tsx +101 -45
  86. package/templates/modules/auth/nextjs/app/forgot-password/page.tsx +11 -0
  87. package/templates/modules/auth/nextjs/app/reset-password/page.tsx +17 -0
  88. package/templates/modules/auth/nextjs/app/sign-in/page.tsx +23 -17
  89. package/templates/modules/auth/nextjs/app/sign-up/page.tsx +25 -19
  90. package/templates/modules/auth/nextjs/components/auth/change-password-form.tsx +125 -0
  91. package/templates/modules/auth/nextjs/components/auth/email-verification-card.tsx +91 -0
  92. package/templates/modules/auth/nextjs/components/auth/forgot-password-form.tsx +133 -0
  93. package/templates/modules/auth/nextjs/components/auth/reset-password-form.tsx +155 -0
  94. package/templates/modules/auth/nextjs/components/auth/sign-in-form.tsx +46 -32
  95. package/templates/modules/auth/nextjs/components/auth/sign-out-button.tsx +6 -5
  96. package/templates/modules/auth/nextjs/components/auth/sign-up-form.tsx +36 -30
  97. package/templates/modules/auth/nextjs/components/auth/social-buttons.tsx +73 -0
  98. package/templates/modules/auth/nextjs/config.json +24 -18
  99. package/templates/modules/auth/nextjs/lib/auth-client.ts +3 -3
  100. package/templates/modules/auth/nextjs/lib/auth-schema.ts +27 -2
  101. package/templates/modules/auth/nextjs/lib/auth.ts.hbs +65 -0
  102. package/templates/modules/auth/nextjs/lib/email.ts +43 -0
  103. package/templates/modules/auth/nextjs/lib/session.ts +12 -0
  104. package/templates/modules/auth/tanstack/config.json +25 -19
  105. package/templates/modules/auth/tanstack/src/components/auth/change-password-form.tsx +123 -0
  106. package/templates/modules/auth/tanstack/src/components/auth/email-verification-card.tsx +89 -0
  107. package/templates/modules/auth/tanstack/src/components/auth/forgot-password-form.tsx +131 -0
  108. package/templates/modules/auth/tanstack/src/components/auth/reset-password-form.tsx +149 -0
  109. package/templates/modules/auth/tanstack/src/components/auth/sign-in-form.tsx +44 -35
  110. package/templates/modules/auth/tanstack/src/components/auth/sign-out-button.tsx +7 -6
  111. package/templates/modules/auth/tanstack/src/components/auth/sign-up-form.tsx +37 -34
  112. package/templates/modules/auth/tanstack/src/components/auth/social-buttons.tsx +71 -0
  113. package/templates/modules/auth/tanstack/src/lib/auth-client.ts +2 -2
  114. package/templates/modules/auth/tanstack/src/lib/auth-functions.ts +14 -8
  115. package/templates/modules/auth/tanstack/src/lib/auth-schema.ts +27 -2
  116. package/templates/modules/auth/tanstack/src/lib/auth.ts.hbs +98 -38
  117. package/templates/modules/auth/tanstack/src/lib/email.ts +43 -0
  118. package/templates/modules/auth/tanstack/src/routeTree.gen.ts +61 -3
  119. package/templates/modules/auth/tanstack/src/routes/api/auth/$.ts +15 -15
  120. package/templates/modules/auth/tanstack/src/routes/dashboard.tsx +119 -111
  121. package/templates/modules/auth/tanstack/src/routes/forgot-password.tsx +17 -0
  122. package/templates/modules/auth/tanstack/src/routes/reset-password.tsx +25 -0
  123. package/templates/modules/auth/tanstack/src/routes/sign-in.tsx +44 -37
  124. package/templates/modules/auth/tanstack/src/routes/sign-up.tsx +44 -37
  125. package/templates/modules/docker/.dockerignore +2 -0
  126. package/templates/modules/docker/config.json +15 -15
  127. package/templates/modules/drizzle/express/config.json +26 -26
  128. package/templates/modules/drizzle/express/src/lib/schema.ts.hbs +90 -0
  129. package/templates/modules/drizzle/nestjs/config.json +26 -26
  130. package/templates/modules/drizzle/nestjs/src/database/schema.ts.hbs +90 -0
  131. package/templates/modules/drizzle/nextjs/config.json +26 -26
  132. package/templates/modules/drizzle/nextjs/drizzle.config.ts +13 -13
  133. package/templates/modules/drizzle/tanstack/config.json +26 -26
  134. package/templates/modules/drizzle/tanstack/drizzle.config.ts +12 -12
  135. package/templates/modules/drizzle/tanstack/src/lib/db.ts +13 -13
  136. package/templates/modules/mongoose/express/config.json +15 -15
  137. package/templates/modules/mongoose/express/src/lib/db.ts +43 -43
  138. package/templates/modules/mongoose/express/src/models/User.ts +48 -48
  139. package/templates/modules/mongoose/nestjs/config.json +16 -15
  140. package/templates/modules/mongoose/nextjs/config.json +15 -15
  141. package/templates/modules/mongoose/nextjs/models/User.ts +48 -48
  142. package/templates/modules/mongoose/tanstack/config.json +16 -16
  143. package/templates/modules/mongoose/tanstack/src/models/User.ts +48 -48
  144. package/templates/modules/prisma/express/config.json +27 -27
  145. package/templates/modules/prisma/express/prisma/schema.prisma.hbs +92 -0
  146. package/templates/modules/prisma/nestjs/config.json +27 -27
  147. package/templates/modules/prisma/nestjs/prisma/schema.prisma.hbs +91 -0
  148. package/templates/modules/prisma/nextjs/config.json +28 -28
  149. package/templates/modules/prisma/nextjs/lib/prisma.ts +18 -18
  150. package/templates/modules/prisma/nextjs/prisma.config.ts +14 -14
  151. package/templates/modules/prisma/tanstack/config.json +28 -28
  152. package/templates/modules/prisma/tanstack/prisma/schema.prisma.hbs +91 -91
  153. package/templates/modules/prisma/tanstack/prisma.config.ts +14 -14
  154. package/templates/modules/prisma/tanstack/src/lib/prisma.ts +17 -17
  155. package/templates/modules/rate-limit/express/src/middleware/rateLimit.ts +0 -8
  156. package/templates/modules/vscode/.vscode/extensions.json.hbs +29 -0
  157. package/templates/modules/vscode/.vscode/settings.json.hbs +22 -0
  158. package/templates/modules/vscode/config.json +10 -0
  159. package/templates/modules/auth/express/src/controllers/authController.ts.hbs +0 -116
  160. package/templates/modules/auth/express/src/lib/jwt.ts.hbs +0 -27
  161. package/templates/modules/auth/express/src/middleware/requireAuth.ts.hbs +0 -25
  162. package/templates/modules/auth/express/src/routes/auth.ts.hbs +0 -27
  163. package/templates/modules/auth/express/src/services/userStore.ts.hbs +0 -117
  164. package/templates/modules/auth/nestjs/src/auth/auth.controller.ts.hbs +0 -61
  165. package/templates/modules/auth/nestjs/src/auth/auth.guard.ts +0 -36
  166. package/templates/modules/auth/nestjs/src/auth/auth.schemas.ts +0 -35
  167. package/templates/modules/auth/nestjs/src/auth/auth.service.ts +0 -70
  168. package/templates/modules/auth/nestjs/src/auth/jwt.ts +0 -27
  169. package/templates/modules/auth/nestjs/src/auth/users.service.ts.hbs +0 -144
  170. package/templates/modules/auth/nestjs/src/auth/zod-validation.pipe.ts +0 -16
  171. package/templates/modules/drizzle/express/src/lib/schema.ts +0 -12
  172. package/templates/modules/drizzle/nestjs/src/database/schema.ts +0 -12
  173. package/templates/modules/prisma/express/prisma/schema.prisma +0 -24
  174. package/templates/modules/prisma/nestjs/prisma/schema.prisma +0 -23
@@ -1,27 +1,27 @@
1
- {
2
- "id": "prisma",
3
- "name": "Prisma ORM",
4
- "description": "Prisma ORM for NestJS with PostgreSQL",
5
- "type": "database",
6
- "dependencies": {
7
- "@prisma/adapter-pg": "^7.10.1",
8
- "@prisma/client": "^7.10.1"
9
- },
10
- "devDependencies": {
11
- "prisma": "^7.10.1"
12
- },
13
- "scripts": {
14
- "prisma:generate": "prisma generate",
15
- "prisma:migrate": "prisma migrate dev",
16
- "prisma:studio": "prisma studio",
17
- "pretype:check": "prisma generate",
18
- "prebuild": "prisma generate"
19
- },
20
- "envVars": {
21
- "DATABASE_URL": "postgresql://postgres:postgres@localhost:5432/postgres?schema=public"
22
- },
23
- "overrides": {
24
- "deepmerge-ts": "^8.0.2",
25
- "mysql2": "^3.24.6"
26
- }
27
- }
1
+ {
2
+ "id": "prisma",
3
+ "name": "Prisma ORM",
4
+ "description": "Prisma ORM for NestJS with PostgreSQL",
5
+ "type": "database",
6
+ "dependencies": {
7
+ "@prisma/adapter-pg": "^7.10.1",
8
+ "@prisma/client": "^7.10.1"
9
+ },
10
+ "devDependencies": {
11
+ "prisma": "^7.10.1"
12
+ },
13
+ "scripts": {
14
+ "prisma:generate": "prisma generate",
15
+ "prisma:migrate": "prisma migrate dev",
16
+ "prisma:studio": "prisma studio",
17
+ "pretype:check": "prisma generate",
18
+ "prebuild": "prisma generate"
19
+ },
20
+ "envVars": {
21
+ "DATABASE_URL": "postgresql://postgres:postgres@localhost:5432/postgres?schema=public"
22
+ },
23
+ "overrides": {
24
+ "deepmerge-ts": "^8.0.2",
25
+ "mysql2": "^3.24.6"
26
+ }
27
+ }
@@ -0,0 +1,91 @@
1
+ // Prisma schema file
2
+ // Learn more: https://pris.ly/d/prisma-schema
3
+
4
+ generator client {
5
+ provider = "prisma-client"
6
+ output = "../src/generated/prisma"
7
+ }
8
+
9
+ datasource db {
10
+ provider = "postgresql"
11
+ }
12
+
13
+ {{#if useAuth}}
14
+ // Better Auth tables
15
+ model User {
16
+ id String @id
17
+ name String
18
+ email String
19
+ emailVerified Boolean @default(false)
20
+ image String?
21
+ createdAt DateTime @default(now())
22
+ updatedAt DateTime @updatedAt
23
+ sessions Session[]
24
+ accounts Account[]
25
+
26
+ @@unique([email])
27
+ @@map("user")
28
+ }
29
+
30
+ model Session {
31
+ id String @id
32
+ expiresAt DateTime
33
+ token String
34
+ createdAt DateTime @default(now())
35
+ updatedAt DateTime @updatedAt
36
+ ipAddress String?
37
+ userAgent String?
38
+ userId String
39
+ user User @relation(fields: [userId], references: [id], onDelete: Cascade)
40
+
41
+ @@unique([token])
42
+ @@index([userId])
43
+ @@map("session")
44
+ }
45
+
46
+ model Account {
47
+ id String @id
48
+ accountId String
49
+ providerId String
50
+ userId String
51
+ user User @relation(fields: [userId], references: [id], onDelete: Cascade)
52
+ accessToken String?
53
+ refreshToken String?
54
+ idToken String?
55
+ accessTokenExpiresAt DateTime?
56
+ refreshTokenExpiresAt DateTime?
57
+ scope String?
58
+ password String?
59
+ createdAt DateTime @default(now())
60
+ updatedAt DateTime @updatedAt
61
+
62
+ @@index([userId])
63
+ @@unique([providerId, accountId])
64
+ @@map("account")
65
+ }
66
+
67
+ model Verification {
68
+ id String @id
69
+ identifier String
70
+ value String
71
+ expiresAt DateTime
72
+ createdAt DateTime @default(now())
73
+ updatedAt DateTime @updatedAt
74
+
75
+ @@index([identifier])
76
+ @@map("verification")
77
+ }
78
+
79
+ {{else}}
80
+ // Sample User model
81
+ model User {
82
+ id String @id @default(uuid())
83
+ email String @unique
84
+ name String?
85
+ password String
86
+ createdAt DateTime @default(now())
87
+ updatedAt DateTime @updatedAt
88
+
89
+ @@map("users")
90
+ }
91
+ {{/if}}
@@ -1,28 +1,28 @@
1
- {
2
- "id": "prisma",
3
- "name": "Prisma ORM",
4
- "description": "Prisma ORM for Next.js with PostgreSQL",
5
- "type": "database",
6
- "dependencies": {
7
- "@prisma/client": "^7.10.1",
8
- "@prisma/adapter-pg": "^7.10.1"
9
- },
10
- "devDependencies": {
11
- "prisma": "^7.10.1",
12
- "dotenv": "^17.4.2"
13
- },
14
- "scripts": {
15
- "prisma:generate": "prisma generate",
16
- "prisma:migrate": "prisma migrate dev",
17
- "prisma:studio": "prisma studio",
18
- "pretype:check": "prisma generate",
19
- "prebuild": "prisma generate"
20
- },
21
- "envVars": {
22
- "DATABASE_URL": "postgresql://postgres:postgres@localhost:5432/postgres?schema=public"
23
- },
24
- "overrides": {
25
- "deepmerge-ts": "^8.0.2",
26
- "mysql2": "^3.24.6"
27
- }
28
- }
1
+ {
2
+ "id": "prisma",
3
+ "name": "Prisma ORM",
4
+ "description": "Prisma ORM for Next.js with PostgreSQL",
5
+ "type": "database",
6
+ "dependencies": {
7
+ "@prisma/client": "^7.10.1",
8
+ "@prisma/adapter-pg": "^7.10.1"
9
+ },
10
+ "devDependencies": {
11
+ "prisma": "^7.10.1",
12
+ "dotenv": "^17.4.2"
13
+ },
14
+ "scripts": {
15
+ "prisma:generate": "prisma generate",
16
+ "prisma:migrate": "prisma migrate dev",
17
+ "prisma:studio": "prisma studio",
18
+ "pretype:check": "prisma generate",
19
+ "prebuild": "prisma generate"
20
+ },
21
+ "envVars": {
22
+ "DATABASE_URL": "postgresql://postgres:postgres@localhost:5432/postgres?schema=public"
23
+ },
24
+ "overrides": {
25
+ "deepmerge-ts": "^8.0.2",
26
+ "mysql2": "^3.24.6"
27
+ }
28
+ }
@@ -1,18 +1,18 @@
1
- import { PrismaPg } from "@prisma/adapter-pg";
2
-
3
- import { PrismaClient } from "../generated/client";
4
-
5
- const globalForPrisma = global as unknown as {
6
- prisma: PrismaClient;
7
- };
8
- const adapter = new PrismaPg({
9
- connectionString: process.env.DATABASE_URL,
10
- });
11
- const prisma =
12
- globalForPrisma.prisma ||
13
- new PrismaClient({
14
- adapter,
15
- });
16
- if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;
17
-
18
- export default prisma;
1
+ import { PrismaPg } from "@prisma/adapter-pg";
2
+
3
+ import { PrismaClient } from "../generated/client";
4
+
5
+ const globalForPrisma = global as unknown as {
6
+ prisma: PrismaClient;
7
+ };
8
+ const adapter = new PrismaPg({
9
+ connectionString: process.env.DATABASE_URL,
10
+ });
11
+ const prisma =
12
+ globalForPrisma.prisma ||
13
+ new PrismaClient({
14
+ adapter,
15
+ });
16
+ if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;
17
+
18
+ export default prisma;
@@ -1,14 +1,14 @@
1
- import "dotenv/config";
2
- import { defineConfig } from "prisma/config";
3
-
4
- export default defineConfig({
5
- schema: "prisma/schema.prisma",
6
- migrations: {
7
- path: "prisma/migrations",
8
- },
9
- datasource: {
10
- // prisma generate needs no URL, so a build without .env (CI, a host) works.
11
- // Commands that connect report the empty URL
12
- url: process.env.DATABASE_URL ?? "",
13
- },
14
- });
1
+ import "dotenv/config";
2
+ import { defineConfig } from "prisma/config";
3
+
4
+ export default defineConfig({
5
+ schema: "prisma/schema.prisma",
6
+ migrations: {
7
+ path: "prisma/migrations",
8
+ },
9
+ datasource: {
10
+ // prisma generate needs no URL, so a build without .env (CI, a host) works.
11
+ // Commands that connect report the empty URL
12
+ url: process.env.DATABASE_URL ?? "",
13
+ },
14
+ });
@@ -1,28 +1,28 @@
1
- {
2
- "id": "prisma",
3
- "name": "Prisma ORM",
4
- "description": "Prisma ORM for TanStack Start with PostgreSQL",
5
- "type": "database",
6
- "dependencies": {
7
- "@prisma/client": "^7.10.1",
8
- "@prisma/adapter-pg": "^7.10.1"
9
- },
10
- "devDependencies": {
11
- "prisma": "^7.10.1",
12
- "dotenv": "^17.4.2"
13
- },
14
- "scripts": {
15
- "prisma:generate": "prisma generate",
16
- "prisma:migrate": "prisma migrate dev",
17
- "prisma:studio": "prisma studio",
18
- "pretype:check": "prisma generate",
19
- "prebuild": "prisma generate"
20
- },
21
- "envVars": {
22
- "DATABASE_URL": "postgresql://postgres:postgres@localhost:5432/postgres?schema=public"
23
- },
24
- "overrides": {
25
- "deepmerge-ts": "^8.0.2",
26
- "mysql2": "^3.24.6"
27
- }
28
- }
1
+ {
2
+ "id": "prisma",
3
+ "name": "Prisma ORM",
4
+ "description": "Prisma ORM for TanStack Start with PostgreSQL",
5
+ "type": "database",
6
+ "dependencies": {
7
+ "@prisma/client": "^7.10.1",
8
+ "@prisma/adapter-pg": "^7.10.1"
9
+ },
10
+ "devDependencies": {
11
+ "prisma": "^7.10.1",
12
+ "dotenv": "^17.4.2"
13
+ },
14
+ "scripts": {
15
+ "prisma:generate": "prisma generate",
16
+ "prisma:migrate": "prisma migrate dev",
17
+ "prisma:studio": "prisma studio",
18
+ "pretype:check": "prisma generate",
19
+ "prebuild": "prisma generate"
20
+ },
21
+ "envVars": {
22
+ "DATABASE_URL": "postgresql://postgres:postgres@localhost:5432/postgres?schema=public"
23
+ },
24
+ "overrides": {
25
+ "deepmerge-ts": "^8.0.2",
26
+ "mysql2": "^3.24.6"
27
+ }
28
+ }
@@ -1,91 +1,91 @@
1
- // Prisma schema file
2
- // Learn more: https://pris.ly/d/prisma-schema
3
-
4
- generator client {
5
- provider = "prisma-client"
6
- output = "../generated"
7
- }
8
-
9
- datasource db {
10
- provider = "postgresql"
11
- }
12
-
13
- {{#if useAuth}}
14
-
15
- model User {
16
- id String @id
17
- name String
18
- email String
19
- emailVerified Boolean @default(false)
20
- image String?
21
- createdAt DateTime @default(now())
22
- updatedAt DateTime @updatedAt
23
- sessions Session[]
24
- accounts Account[]
25
-
26
- @@unique([email])
27
- @@map("user")
28
- }
29
-
30
- model Session {
31
- id String @id
32
- expiresAt DateTime
33
- token String
34
- createdAt DateTime @default(now())
35
- updatedAt DateTime @updatedAt
36
- ipAddress String?
37
- userAgent String?
38
- userId String
39
- user User @relation(fields: [userId], references: [id], onDelete: Cascade)
40
-
41
- @@unique([token])
42
- @@index([userId])
43
- @@map("session")
44
- }
45
-
46
- model Account {
47
- id String @id
48
- accountId String
49
- providerId String
50
- userId String
51
- user User @relation(fields: [userId], references: [id], onDelete: Cascade)
52
- accessToken String?
53
- refreshToken String?
54
- idToken String?
55
- accessTokenExpiresAt DateTime?
56
- refreshTokenExpiresAt DateTime?
57
- scope String?
58
- password String?
59
- createdAt DateTime @default(now())
60
- updatedAt DateTime @updatedAt
61
-
62
- @@index([userId])
63
- @@unique([providerId, accountId])
64
- @@map("account")
65
- }
66
-
67
- model Verification {
68
- id String @id
69
- identifier String
70
- value String
71
- expiresAt DateTime
72
- createdAt DateTime @default(now())
73
- updatedAt DateTime @updatedAt
74
-
75
- @@index([identifier])
76
- @@map("verification")
77
- }
78
-
79
- {{else}}
80
- // Sample User model
81
- model User {
82
- id String @id @default(uuid())
83
- email String @unique
84
- name String?
85
- password String
86
- createdAt DateTime @default(now())
87
- updatedAt DateTime @updatedAt
88
-
89
- @@map("users")
90
- }
91
- {{/if}}
1
+ // Prisma schema file
2
+ // Learn more: https://pris.ly/d/prisma-schema
3
+
4
+ generator client {
5
+ provider = "prisma-client"
6
+ output = "../generated"
7
+ }
8
+
9
+ datasource db {
10
+ provider = "postgresql"
11
+ }
12
+
13
+ {{#if useAuth}}
14
+
15
+ model User {
16
+ id String @id
17
+ name String
18
+ email String
19
+ emailVerified Boolean @default(false)
20
+ image String?
21
+ createdAt DateTime @default(now())
22
+ updatedAt DateTime @updatedAt
23
+ sessions Session[]
24
+ accounts Account[]
25
+
26
+ @@unique([email])
27
+ @@map("user")
28
+ }
29
+
30
+ model Session {
31
+ id String @id
32
+ expiresAt DateTime
33
+ token String
34
+ createdAt DateTime @default(now())
35
+ updatedAt DateTime @updatedAt
36
+ ipAddress String?
37
+ userAgent String?
38
+ userId String
39
+ user User @relation(fields: [userId], references: [id], onDelete: Cascade)
40
+
41
+ @@unique([token])
42
+ @@index([userId])
43
+ @@map("session")
44
+ }
45
+
46
+ model Account {
47
+ id String @id
48
+ accountId String
49
+ providerId String
50
+ userId String
51
+ user User @relation(fields: [userId], references: [id], onDelete: Cascade)
52
+ accessToken String?
53
+ refreshToken String?
54
+ idToken String?
55
+ accessTokenExpiresAt DateTime?
56
+ refreshTokenExpiresAt DateTime?
57
+ scope String?
58
+ password String?
59
+ createdAt DateTime @default(now())
60
+ updatedAt DateTime @updatedAt
61
+
62
+ @@index([userId])
63
+ @@unique([providerId, accountId])
64
+ @@map("account")
65
+ }
66
+
67
+ model Verification {
68
+ id String @id
69
+ identifier String
70
+ value String
71
+ expiresAt DateTime
72
+ createdAt DateTime @default(now())
73
+ updatedAt DateTime @updatedAt
74
+
75
+ @@index([identifier])
76
+ @@map("verification")
77
+ }
78
+
79
+ {{else}}
80
+ // Sample User model
81
+ model User {
82
+ id String @id @default(uuid())
83
+ email String @unique
84
+ name String?
85
+ password String
86
+ createdAt DateTime @default(now())
87
+ updatedAt DateTime @updatedAt
88
+
89
+ @@map("users")
90
+ }
91
+ {{/if}}
@@ -1,14 +1,14 @@
1
- import "dotenv/config";
2
- import { defineConfig } from "prisma/config";
3
-
4
- export default defineConfig({
5
- schema: "prisma/schema.prisma",
6
- migrations: {
7
- path: "prisma/migrations",
8
- },
9
- datasource: {
10
- // prisma generate needs no URL, so a build without .env (CI, a host) works.
11
- // Commands that connect report the empty URL
12
- url: process.env.DATABASE_URL ?? "",
13
- },
14
- });
1
+ import "dotenv/config";
2
+ import { defineConfig } from "prisma/config";
3
+
4
+ export default defineConfig({
5
+ schema: "prisma/schema.prisma",
6
+ migrations: {
7
+ path: "prisma/migrations",
8
+ },
9
+ datasource: {
10
+ // prisma generate needs no URL, so a build without .env (CI, a host) works.
11
+ // Commands that connect report the empty URL
12
+ url: process.env.DATABASE_URL ?? "",
13
+ },
14
+ });
@@ -1,18 +1,18 @@
1
- import { PrismaPg } from "@prisma/adapter-pg";
2
-
3
- import { PrismaClient } from "../../generated/client";
4
-
5
- const globalForPrisma = global as unknown as {
6
- prisma: PrismaClient;
7
- };
8
- const adapter = new PrismaPg({
9
- connectionString: process.env.DATABASE_URL,
10
- });
11
- const prisma =
12
- globalForPrisma.prisma ||
13
- new PrismaClient({
14
- adapter,
15
- });
16
- if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;
17
-
1
+ import { PrismaPg } from "@prisma/adapter-pg";
2
+
3
+ import { PrismaClient } from "../../generated/client";
4
+
5
+ const globalForPrisma = global as unknown as {
6
+ prisma: PrismaClient;
7
+ };
8
+ const adapter = new PrismaPg({
9
+ connectionString: process.env.DATABASE_URL,
10
+ });
11
+ const prisma =
12
+ globalForPrisma.prisma ||
13
+ new PrismaClient({
14
+ adapter,
15
+ });
16
+ if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;
17
+
18
18
  export default prisma;
@@ -13,11 +13,3 @@ export const apiLimiter = rateLimit({
13
13
  legacyHeaders: false,
14
14
  skip: (req) => req.path === "/health",
15
15
  });
16
-
17
- // Sign-up and login: 10 attempts per IP in 15 minutes, against password guessing
18
- export const authLimiter = rateLimit({
19
- windowMs: FIFTEEN_MINUTES,
20
- limit: 10,
21
- standardHeaders: "draft-8",
22
- legacyHeaders: false,
23
- });
@@ -0,0 +1,29 @@
1
+ {
2
+ "recommendations": [
3
+ {{#if (eq framework 'express')}}
4
+ "esbenp.prettier-vscode",
5
+ {{/if}}
6
+ {{#if (eq framework 'nestjs')}}
7
+ "esbenp.prettier-vscode",
8
+ {{/if}}
9
+ {{#if (eq framework 'nextjs')}}
10
+ "bradlc.vscode-tailwindcss",
11
+ {{/if}}
12
+ {{#if (eq framework 'tanstack')}}
13
+ "bradlc.vscode-tailwindcss",
14
+ {{/if}}
15
+ {{#if (eq database 'prisma')}}
16
+ "Prisma.prisma",
17
+ {{/if}}
18
+ {{#if (eq database 'mongoose')}}
19
+ "mongodb.mongodb-vscode",
20
+ {{/if}}
21
+ {{#if useDocker}}
22
+ "ms-azuretools.vscode-containers",
23
+ {{/if}}
24
+ {{#if useCi}}
25
+ "github.vscode-github-actions",
26
+ {{/if}}
27
+ "dbaeumer.vscode-eslint"
28
+ ]
29
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ {{#if (eq framework 'express')}}
3
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
4
+ "editor.formatOnSave": true,
5
+ {{/if}}
6
+ {{#if (eq framework 'nestjs')}}
7
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
8
+ "editor.formatOnSave": true,
9
+ {{/if}}
10
+ {{#if (eq framework 'nextjs')}}
11
+ "files.associations": { "*.css": "tailwindcss" },
12
+ {{/if}}
13
+ {{#if (eq framework 'tanstack')}}
14
+ "files.associations": { "*.css": "tailwindcss" },
15
+ "files.readonlyInclude": { "**/routeTree.gen.ts": true },
16
+ "files.watcherExclude": { "**/routeTree.gen.ts": true },
17
+ "search.exclude": { "**/routeTree.gen.ts": true },
18
+ {{/if}}
19
+ "editor.codeActionsOnSave": { "source.fixAll.eslint": "explicit" },
20
+ "typescript.tsdk": "node_modules/typescript/lib",
21
+ "typescript.enablePromptUseWorkspaceTsdk": true
22
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "id": "vscode",
3
+ "name": "VS Code settings",
4
+ "description": "Workspace settings that fix lint problems on save, and the recommended extensions for the stack",
5
+ "type": "feature",
6
+ "dependencies": {},
7
+ "devDependencies": {},
8
+ "scripts": {},
9
+ "envVars": {}
10
+ }