better-ts-stack 0.1.0 → 1.0.8

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 (79) hide show
  1. package/README.md +12 -6
  2. package/dist/builder/configGenerator.d.ts.map +1 -1
  3. package/dist/builder/configGenerator.js +26 -23
  4. package/dist/builder/configGenerator.js.map +1 -1
  5. package/dist/builder/dependencyInstaller.d.ts.map +1 -1
  6. package/dist/builder/dependencyInstaller.js +1 -10
  7. package/dist/builder/dependencyInstaller.js.map +1 -1
  8. package/dist/builder/index.d.ts.map +1 -1
  9. package/dist/builder/index.js +3 -7
  10. package/dist/builder/index.js.map +1 -1
  11. package/dist/builder/templateContext.d.ts +1 -1
  12. package/dist/builder/templateContext.d.ts.map +1 -1
  13. package/dist/builder/templateContext.js +0 -2
  14. package/dist/builder/templateContext.js.map +1 -1
  15. package/dist/modules/registry.d.ts.map +1 -1
  16. package/dist/modules/registry.js +2 -5
  17. package/dist/modules/registry.js.map +1 -1
  18. package/dist/output/nextSteps.d.ts.map +1 -1
  19. package/dist/output/nextSteps.js +7 -34
  20. package/dist/output/nextSteps.js.map +1 -1
  21. package/dist/prompts/index.d.ts.map +1 -1
  22. package/dist/prompts/index.js +3 -14
  23. package/dist/prompts/index.js.map +1 -1
  24. package/dist/prompts/stack.d.ts +3 -0
  25. package/dist/prompts/stack.d.ts.map +1 -0
  26. package/dist/prompts/stack.js +72 -0
  27. package/dist/prompts/stack.js.map +1 -0
  28. package/dist/types/index.d.ts +4 -7
  29. package/dist/types/index.d.ts.map +1 -1
  30. package/dist/types/index.js +0 -9
  31. package/dist/types/index.js.map +1 -1
  32. package/dist/validators/index.d.ts +1 -1
  33. package/dist/validators/index.d.ts.map +1 -1
  34. package/dist/validators/index.js +1 -1
  35. package/package.json +12 -12
  36. package/templates/backend/express/config.json +44 -42
  37. package/templates/backend/express/eslint.config.mjs +40 -31
  38. package/templates/backend/express/src/index.ts +61 -46
  39. package/templates/backend/express/src/routes/health.ts +12 -12
  40. package/templates/backend/express/tsconfig.json +25 -23
  41. package/templates/frontend/nextjs/app/globals.css +89 -99
  42. package/templates/frontend/nextjs/app/page.tsx.hbs +9 -10
  43. package/templates/frontend/nextjs/config.json +33 -27
  44. package/templates/frontend/nextjs/eslint.config.mjs +11 -11
  45. package/templates/frontend/nextjs/proxy.ts.hbs +9 -8
  46. package/templates/frontend/nextjs/tsconfig.json +34 -21
  47. package/templates/modules/auth/express/config.json +26 -1
  48. package/templates/modules/auth/express/src/routes/auth.ts.hbs +1 -1
  49. package/templates/modules/auth/express/src/services/userStore.ts.hbs +95 -107
  50. package/templates/modules/auth/nextjs/config.json +6 -6
  51. package/templates/modules/auth/nextjs/lib/auth.ts.hbs +34 -32
  52. package/templates/modules/docker/.dockerignore +14 -13
  53. package/templates/modules/docker/Dockerfile.hbs +80 -70
  54. package/templates/modules/docker/config.json +19 -16
  55. package/templates/modules/docker/docker-compose.yml.hbs +9 -9
  56. package/templates/modules/drizzle/express/config.json +27 -0
  57. package/templates/modules/drizzle/express/drizzle.config.ts +13 -0
  58. package/templates/modules/drizzle/express/src/lib/db.ts +13 -0
  59. package/templates/modules/drizzle/express/src/lib/schema.ts +10 -0
  60. package/templates/modules/drizzle/nextjs/config.json +27 -19
  61. package/templates/modules/drizzle/nextjs/lib/db.ts +3 -1
  62. package/templates/modules/drizzle/nextjs/lib/schema.ts.hbs +84 -84
  63. package/templates/modules/mongoose/config.json +16 -16
  64. package/templates/modules/mongoose/src/lib/db.ts.hbs +0 -13
  65. package/templates/modules/mongoose/src/models/User.ts +48 -47
  66. package/templates/modules/prisma/express/config.json +27 -21
  67. package/templates/modules/prisma/express/prisma/schema.prisma +3 -2
  68. package/templates/modules/prisma/express/prisma.config.ts +12 -13
  69. package/templates/modules/prisma/express/src/lib/prisma.ts +24 -37
  70. package/templates/modules/prisma/nextjs/config.json +28 -23
  71. package/templates/modules/prisma/nextjs/prisma/schema.prisma.hbs +91 -90
  72. package/dist/prompts/backend/index.d.ts +0 -3
  73. package/dist/prompts/backend/index.d.ts.map +0 -1
  74. package/dist/prompts/backend/index.js +0 -128
  75. package/dist/prompts/backend/index.js.map +0 -1
  76. package/dist/prompts/frontend/index.d.ts +0 -3
  77. package/dist/prompts/frontend/index.d.ts.map +0 -1
  78. package/dist/prompts/frontend/index.js +0 -111
  79. package/dist/prompts/frontend/index.js.map +0 -1
@@ -1,99 +1,89 @@
1
- @import "tailwindcss";
2
-
3
- :root {
4
- --background: oklch(0.98 0.004 255);
5
- --foreground: oklch(0.2 0.03 255);
6
- --card: oklch(1 0 0);
7
- --card-foreground: oklch(0.2 0.03 255);
8
- --popover: oklch(1 0 0);
9
- --popover-foreground: oklch(0.2 0.03 255);
10
- --primary: oklch(0.27 0.04 260);
11
- --primary-foreground: oklch(0.99 0.004 255);
12
- --secondary: oklch(0.94 0.008 255);
13
- --secondary-foreground: oklch(0.3 0.03 255);
14
- --muted: oklch(0.95 0.006 255);
15
- --muted-foreground: oklch(0.48 0.02 255);
16
- --accent: oklch(0.93 0.02 233);
17
- --accent-foreground: oklch(0.27 0.04 260);
18
- --destructive: oklch(0.63 0.24 25);
19
- --destructive-foreground: oklch(0.99 0.004 255);
20
- --border: oklch(0.89 0.01 255);
21
- --input: oklch(0.89 0.01 255);
22
- --ring: oklch(0.64 0.13 240);
23
- --radius: 1rem;
24
- }
25
-
26
- @theme inline {
27
- --color-background: var(--background);
28
- --color-foreground: var(--foreground);
29
- --color-card: var(--card);
30
- --color-card-foreground: var(--card-foreground);
31
- --color-popover: var(--popover);
32
- --color-popover-foreground: var(--popover-foreground);
33
- --color-primary: var(--primary);
34
- --color-primary-foreground: var(--primary-foreground);
35
- --color-secondary: var(--secondary);
36
- --color-secondary-foreground: var(--secondary-foreground);
37
- --color-muted: var(--muted);
38
- --color-muted-foreground: var(--muted-foreground);
39
- --color-accent: var(--accent);
40
- --color-accent-foreground: var(--accent-foreground);
41
- --color-destructive: var(--destructive);
42
- --color-destructive-foreground: var(--destructive-foreground);
43
- --color-border: var(--border);
44
- --color-input: var(--input);
45
- --color-ring: var(--ring);
46
- --radius-sm: calc(var(--radius) - 0.25rem);
47
- --radius-md: calc(var(--radius) - 0.125rem);
48
- --radius-lg: var(--radius);
49
- --radius-xl: calc(var(--radius) + 0.25rem);
50
- --font-sans: var(--font-geist-sans);
51
- --font-mono: var(--font-geist-mono);
52
- }
53
-
54
- @media (prefers-color-scheme: dark) {
55
- :root {
56
- --background: oklch(0.16 0.02 255);
57
- --foreground: oklch(0.95 0.005 255);
58
- --card: oklch(0.2 0.02 255);
59
- --card-foreground: oklch(0.95 0.005 255);
60
- --popover: oklch(0.2 0.02 255);
61
- --popover-foreground: oklch(0.95 0.005 255);
62
- --primary: oklch(0.93 0.01 255);
63
- --primary-foreground: oklch(0.22 0.03 255);
64
- --secondary: oklch(0.24 0.02 255);
65
- --secondary-foreground: oklch(0.95 0.005 255);
66
- --muted: oklch(0.24 0.02 255);
67
- --muted-foreground: oklch(0.72 0.015 255);
68
- --accent: oklch(0.28 0.03 238);
69
- --accent-foreground: oklch(0.95 0.005 255);
70
- --destructive: oklch(0.68 0.2 22);
71
- --destructive-foreground: oklch(0.98 0.004 255);
72
- --border: oklch(0.28 0.02 255);
73
- --input: oklch(0.28 0.02 255);
74
- --ring: oklch(0.71 0.11 240);
75
- }
76
- }
77
-
78
- * {
79
- border-color: var(--border);
80
- }
81
-
82
- html {
83
- scroll-behavior: smooth;
84
- }
85
-
86
- body {
87
- background: var(--background);
88
- color: var(--foreground);
89
- font-family: var(--font-geist-sans), sans-serif;
90
- }
91
-
92
- a {
93
- text-underline-offset: 0.2rem;
94
- }
95
-
96
- ::selection {
97
- background: color-mix(in oklab, var(--accent) 65%, white);
98
- color: var(--foreground);
99
- }
1
+ @import "tailwindcss";
2
+
3
+ :root {
4
+ --radius: 0.65rem;
5
+ --background: oklch(1 0 0);
6
+ --foreground: oklch(0.145 0 0);
7
+ --card: oklch(1 0 0);
8
+ --card-foreground: oklch(0.145 0 0);
9
+ --popover: oklch(1 0 0);
10
+ --popover-foreground: oklch(0.145 0 0);
11
+ --primary: oklch(0.205 0 0);
12
+ --primary-foreground: oklch(0.985 0 0);
13
+ --secondary: oklch(0.97 0 0);
14
+ --secondary-foreground: oklch(0.205 0 0);
15
+ --muted: oklch(0.97 0 0);
16
+ --muted-foreground: oklch(0.556 0 0);
17
+ --accent: oklch(0.97 0 0);
18
+ --accent-foreground: oklch(0.205 0 0);
19
+ --destructive: oklch(0.577 0.245 27.325);
20
+ --border: oklch(0.922 0 0);
21
+ --input: oklch(0.922 0 0);
22
+ --ring: oklch(0.708 0 0);
23
+ --chart-1: oklch(0.646 0.222 41.116);
24
+ --chart-2: oklch(0.6 0.118 184.704);
25
+ --chart-3: oklch(0.398 0.07 227.392);
26
+ --chart-4: oklch(0.828 0.189 84.429);
27
+ --chart-5: oklch(0.769 0.188 70.08);
28
+ --radius: 0.625rem;
29
+ --sidebar: oklch(0.985 0 0);
30
+ --sidebar-foreground: oklch(0.145 0 0);
31
+ --sidebar-primary: oklch(0.205 0 0);
32
+ --sidebar-primary-foreground: oklch(0.985 0 0);
33
+ --sidebar-accent: oklch(0.97 0 0);
34
+ --sidebar-accent-foreground: oklch(0.205 0 0);
35
+ --sidebar-border: oklch(0.922 0 0);
36
+ --sidebar-ring: oklch(0.708 0 0);
37
+ }
38
+
39
+ .dark {
40
+ --background: oklch(0.145 0 0);
41
+ --foreground: oklch(0.985 0 0);
42
+ --card: oklch(0.205 0 0);
43
+ --card-foreground: oklch(0.985 0 0);
44
+ --popover: oklch(0.205 0 0);
45
+ --popover-foreground: oklch(0.985 0 0);
46
+ --primary: oklch(0.922 0 0);
47
+ --primary-foreground: oklch(0.205 0 0);
48
+ --secondary: oklch(0.269 0 0);
49
+ --secondary-foreground: oklch(0.985 0 0);
50
+ --muted: oklch(0.269 0 0);
51
+ --muted-foreground: oklch(0.708 0 0);
52
+ --accent: oklch(0.269 0 0);
53
+ --accent-foreground: oklch(0.985 0 0);
54
+ --destructive: oklch(0.704 0.191 22.216);
55
+ --border: oklch(1 0 0 / 10%);
56
+ --input: oklch(1 0 0 / 15%);
57
+ --ring: oklch(0.556 0 0);
58
+ --chart-1: oklch(0.488 0.243 264.376);
59
+ --chart-2: oklch(0.696 0.17 162.48);
60
+ --chart-3: oklch(0.769 0.188 70.08);
61
+ --chart-4: oklch(0.627 0.265 303.9);
62
+ --chart-5: oklch(0.645 0.246 16.439);
63
+ --sidebar: oklch(0.205 0 0);
64
+ --sidebar-foreground: oklch(0.985 0 0);
65
+ --sidebar-primary: oklch(0.488 0.243 264.376);
66
+ --sidebar-primary-foreground: oklch(0.985 0 0);
67
+ --sidebar-accent: oklch(0.269 0 0);
68
+ --sidebar-accent-foreground: oklch(0.985 0 0);
69
+ --sidebar-border: oklch(1 0 0 / 10%);
70
+ --sidebar-ring: oklch(0.556 0 0);
71
+ }
72
+ * {
73
+ border-color: var(--border);
74
+ }
75
+
76
+ body {
77
+ background: var(--background);
78
+ color: var(--foreground);
79
+ font-family: var(--font-geist-sans), sans-serif;
80
+ }
81
+
82
+ a {
83
+ text-underline-offset: 0.2rem;
84
+ }
85
+
86
+ ::selection {
87
+ background: color-mix(in oklab, var(--accent) 65%, white);
88
+ color: var(--foreground);
89
+ }
@@ -17,19 +17,18 @@ const featureList = [
17
17
 
18
18
  export default function Home() {
19
19
  return (
20
- <main className="relative min-h-screen overflow-hidden bg-[radial-gradient(circle_at_top,_rgba(14,165,233,0.14),_transparent_30%),linear-gradient(180deg,_#fcfcfd_0%,_#f8fafc_45%,_#eef2ff_100%)] text-slate-950">
21
- <div className="absolute inset-x-0 top-0 h-72 bg-[radial-gradient(circle_at_top,_rgba(59,130,246,0.18),_transparent_55%)]" />
22
- <div className="relative mx-auto flex min-h-screen max-w-6xl flex-col justify-center gap-12 px-6 py-16 sm:px-10 lg:px-12">
20
+ <main className="min-h-screen bg-background text-foreground">
21
+ <div className="mx-auto flex min-h-screen max-w-6xl flex-col justify-center gap-12 px-6 py-16 sm:px-10 lg:px-12">
23
22
  <section className="grid gap-10 lg:grid-cols-[1.2fr_0.8fr] lg:items-center">
24
23
  <div className="space-y-6">
25
- <span className="inline-flex w-fit items-center rounded-full border border-sky-200 bg-white/80 px-3 py-1 text-xs font-medium uppercase tracking-[0.24em] text-sky-700 shadow-sm backdrop-blur">
24
+ <span className="inline-flex w-fit items-center rounded-full border border-border bg-card px-3 py-1 text-xs font-medium uppercase tracking-[0.24em] text-muted-foreground shadow-sm">
26
25
  Created with better-ts-stack
27
26
  </span>
28
27
  <div className="space-y-4">
29
- <h1 className="max-w-3xl text-4xl font-semibold tracking-tight text-slate-950 sm:text-5xl">
28
+ <h1 className="max-w-3xl text-4xl font-semibold tracking-tight sm:text-5xl">
30
29
  Ship your stack faster with a polished TypeScript foundation.
31
30
  </h1>
32
- <p className="max-w-2xl text-base leading-7 text-slate-600 sm:text-lg">
31
+ <p className="max-w-2xl text-base leading-7 text-muted-foreground sm:text-lg">
33
32
  Your project already includes the core app shell, database wiring,
34
33
  and a shadcn-compatible UI foundation so you can keep building
35
34
  instead of setting up boilerplate.
@@ -72,20 +71,20 @@ export default function Home() {
72
71
  </div>
73
72
  </div>
74
73
 
75
- <Card className="border-white/70 bg-white/80 shadow-xl shadow-slate-200/70 backdrop-blur">
74
+ <Card className="border-border bg-card shadow-sm">
76
75
  <CardHeader>
77
76
  <CardTitle>Included in this starter</CardTitle>
78
77
  </CardHeader>
79
78
  <CardContent className="space-y-4">
80
- <ul className="space-y-3 text-sm text-slate-600">
79
+ <ul className="space-y-3 text-sm text-muted-foreground">
81
80
  {featureList.map((feature) => (
82
81
  <li key={feature} className="flex items-center gap-3">
83
- <span className="size-2 rounded-full bg-sky-500" />
82
+ <span className="size-2 rounded-full bg-primary" />
84
83
  <span>{feature}</span>
85
84
  </li>
86
85
  ))}
87
86
  </ul>
88
- <div className="rounded-2xl border border-slate-200 bg-slate-950 px-4 py-3 text-sm text-slate-100">
87
+ <div className="rounded-2xl border border-border bg-muted px-4 py-3 text-sm text-muted-foreground">
89
88
  Start editing <code className="font-mono">app/page.tsx</code> and
90
89
  shape the project around your product instead of setup chores.
91
90
  </div>
@@ -1,33 +1,39 @@
1
- {
2
- "id": "nextjs",
3
- "name": "Next.js",
4
- "description": "Next.js 16 App Router with TypeScript and Tailwind CSS",
5
- "type": "base",
6
- "scripts": {
7
- "dev": "next dev",
8
- "build": "next build",
9
- "start": "next start",
10
- "lint": "eslint"
11
- },
1
+ {
2
+ "id": "nextjs",
3
+ "name": "Next.js",
4
+ "description": "Next.js 16 App Router with TypeScript and Tailwind CSS",
5
+ "type": "base",
6
+ "scripts": {
7
+ "dev": "next dev",
8
+ "build": "next build",
9
+ "start": "next start",
10
+ "lint": "eslint",
11
+ "type:check": "tsc --noEmit"
12
+ },
12
13
  "dependencies": {
13
14
  "class-variance-authority": "^0.7.1",
14
15
  "clsx": "^2.1.1",
15
- "lucide-react": "^0.542.0",
16
- "next": "^16.2.0",
17
- "react": "19.2.3",
18
- "react-dom": "19.2.3",
19
- "tailwind-merge": "^3.3.1"
16
+ "lucide-react": "^1.41.0",
17
+ "next": "^16.3.4",
18
+ "react": "^19.2.8",
19
+ "react-dom": "^19.2.8",
20
+ "tailwind-merge": "^3.6.0",
21
+ "@radix-ui/react-slot": "^1.3.3"
22
+ },
23
+ "devDependencies": {
24
+ "@tailwindcss/postcss": "^4.3.3",
25
+ "@types/node": "^24.13.3",
26
+ "@types/react": "^19.2.18",
27
+ "@types/react-dom": "^19.2.7",
28
+ "eslint": "^10.10.0",
29
+ "eslint-config-next": "^16.3.4",
30
+ "tailwindcss": "^4.3.3",
31
+ "typescript": "^6.0.3",
32
+ "@eslint/compat": "^2.1.1"
33
+ },
34
+ "envVars": {
35
+ "NODE_ENV": "development",
36
+ "PORT": "3000"
20
37
  },
21
- "devDependencies": {
22
- "@tailwindcss/postcss": "^4",
23
- "@types/node": "^20",
24
- "@types/react": "^19",
25
- "@types/react-dom": "^19",
26
- "eslint": "^9",
27
- "eslint-config-next": "16.1.6",
28
- "tailwindcss": "^4",
29
- "typescript": "^5"
30
- },
31
- "envVars": { "NODE_ENV": "development", "PORT": "3000" },
32
38
  "templateFiles": ["app/page.tsx.hbs", "proxy.ts.hbs"]
33
39
  }
@@ -1,11 +1,11 @@
1
- import nextVitals from "eslint-config-next/core-web-vitals";
2
- import nextTs from "eslint-config-next/typescript";
3
- import { defineConfig, globalIgnores } from "eslint/config";
4
-
5
- const eslintConfig = defineConfig([
6
- ...nextVitals,
7
- ...nextTs,
8
- globalIgnores([".next/**", "out/**", "build/**", "next-env.d.ts"]),
9
- ]);
10
-
11
- export default eslintConfig;
1
+ import { fixupConfigRules } from "@eslint/compat";
2
+ import nextVitals from "eslint-config-next/core-web-vitals";
3
+ import nextTs from "eslint-config-next/typescript";
4
+ import { defineConfig, globalIgnores } from "eslint/config";
5
+
6
+ const eslintConfig = defineConfig([
7
+ ...fixupConfigRules([...nextVitals, ...nextTs]),
8
+ globalIgnores([".next/**", "out/**", "build/**", "next-env.d.ts"]),
9
+ ]);
10
+
11
+ export default eslintConfig;
@@ -1,23 +1,24 @@
1
- import { NextResponse, type NextRequest } from "next/server";
1
+ import { NextResponse } from "next/server";
2
2
 
3
3
  {{#if useAuth}}
4
+ import type { NextRequest } from "next/server";
4
5
  import { getSessionCookie } from "better-auth/cookies";
5
6
 
6
- export async function proxy(request: NextRequest) {
7
+ export function proxy(request: NextRequest) {
7
8
  const sessionCookie = getSessionCookie(request);
8
-
9
+
9
10
  if (!sessionCookie) {
10
11
  return NextResponse.redirect(new URL("/sign-in", request.url));
11
12
  }
12
-
13
- return NextResponse.next();
14
- }
15
-
13
+
14
+ return NextResponse.next();
15
+ }
16
+
16
17
  export const config = {
17
18
  matcher: ["/dashboard/:path*"],
18
19
  };
19
20
  {{else}}
20
- export function proxy(_request: NextRequest) {
21
+ export function proxy() {
21
22
  return NextResponse.next();
22
23
  }
23
24
  {{/if}}
@@ -1,21 +1,34 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2017",
4
- "lib": ["dom", "dom.iterable", "esnext"],
5
- "allowJs": true,
6
- "skipLibCheck": true,
7
- "strict": true,
8
- "noEmit": true,
9
- "esModuleInterop": true,
10
- "module": "esnext",
11
- "moduleResolution": "bundler",
12
- "resolveJsonModule": true,
13
- "isolatedModules": true,
14
- "jsx": "react-jsx",
15
- "incremental": true,
16
- "plugins": [{ "name": "next" }],
17
- "paths": { "@/*": ["./*"] }
18
- },
19
- "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", ".next/dev/types/**/*.ts", "**/*.mts"],
20
- "exclude": ["node_modules"]
21
- }
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2017",
4
+ "lib": ["dom", "dom.iterable", "esnext"],
5
+ "allowJs": true,
6
+ "skipLibCheck": true,
7
+ "strict": true,
8
+ "noEmit": true,
9
+ "esModuleInterop": true,
10
+ "module": "esnext",
11
+ "moduleResolution": "bundler",
12
+ "resolveJsonModule": true,
13
+ "isolatedModules": true,
14
+ "jsx": "react-jsx",
15
+ "incremental": true,
16
+ "plugins": [
17
+ {
18
+ "name": "next"
19
+ }
20
+ ],
21
+ "paths": {
22
+ "@/*": ["./*"]
23
+ }
24
+ },
25
+ "include": [
26
+ "next-env.d.ts",
27
+ "**/*.ts",
28
+ "**/*.tsx",
29
+ ".next/types/**/*.ts",
30
+ ".next/dev/types/**/*.ts",
31
+ "**/*.mts"
32
+ ],
33
+ "exclude": ["node_modules"]
34
+ }
@@ -1 +1,26 @@
1
- {"id":"auth","name":"JWT Auth","description":"JWT authentication with bcrypt password hashing","type":"feature","dependencies":{"bcrypt":"^5.1.1","jsonwebtoken":"^9.0.2"},"devDependencies":{"@types/bcrypt":"^5.0.0","@types/jsonwebtoken":"^9.0.5"},"scripts":{},"envVars":{"JWT_SECRET":"please-change-me","JWT_EXPIRES_IN":"1h"},"templateFiles":["src/lib/jwt.ts.hbs","src/middleware/requireAuth.ts.hbs","src/services/userStore.ts.hbs","src/routes/auth.ts.hbs","src/controllers/authController.ts.hbs"]}
1
+ {
2
+ "id": "auth",
3
+ "name": "JWT Auth",
4
+ "description": "JWT authentication with bcrypt password hashing",
5
+ "type": "feature",
6
+ "dependencies": {
7
+ "bcrypt": "^6.0.0",
8
+ "jsonwebtoken": "^9.0.3"
9
+ },
10
+ "devDependencies": {
11
+ "@types/bcrypt": "^6.0.0",
12
+ "@types/jsonwebtoken": "^9.0.10"
13
+ },
14
+ "scripts": {},
15
+ "envVars": {
16
+ "JWT_SECRET": "please-change-me",
17
+ "JWT_EXPIRES_IN": "1h"
18
+ },
19
+ "templateFiles": [
20
+ "src/lib/jwt.ts.hbs",
21
+ "src/middleware/requireAuth.ts.hbs",
22
+ "src/services/userStore.ts.hbs",
23
+ "src/routes/auth.ts.hbs",
24
+ "src/controllers/authController.ts.hbs"
25
+ ]
26
+ }
@@ -2,7 +2,7 @@ import { Request, Response, NextFunction, Router } from 'express';
2
2
  import { login, me, register } from '../controllers/authController';
3
3
  import { requireAuth } from '../middleware/requireAuth';
4
4
 
5
- const router = Router();
5
+ const router: Router = Router();
6
6
 
7
7
  function asyncHandler(
8
8
  fn: (req: Request, res: Response, next: NextFunction) => Promise<void>