better-ts-stack 0.1.1 → 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 (77) 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/config.json +33 -27
  42. package/templates/frontend/nextjs/eslint.config.mjs +11 -11
  43. package/templates/frontend/nextjs/proxy.ts.hbs +9 -8
  44. package/templates/frontend/nextjs/tsconfig.json +34 -21
  45. package/templates/modules/auth/express/config.json +26 -1
  46. package/templates/modules/auth/express/src/routes/auth.ts.hbs +1 -1
  47. package/templates/modules/auth/express/src/services/userStore.ts.hbs +95 -107
  48. package/templates/modules/auth/nextjs/config.json +6 -6
  49. package/templates/modules/auth/nextjs/lib/auth.ts.hbs +34 -32
  50. package/templates/modules/docker/.dockerignore +14 -13
  51. package/templates/modules/docker/Dockerfile.hbs +80 -70
  52. package/templates/modules/docker/config.json +19 -16
  53. package/templates/modules/docker/docker-compose.yml.hbs +9 -9
  54. package/templates/modules/drizzle/express/config.json +27 -0
  55. package/templates/modules/drizzle/express/drizzle.config.ts +13 -0
  56. package/templates/modules/drizzle/express/src/lib/db.ts +13 -0
  57. package/templates/modules/drizzle/express/src/lib/schema.ts +10 -0
  58. package/templates/modules/drizzle/nextjs/config.json +27 -19
  59. package/templates/modules/drizzle/nextjs/lib/db.ts +3 -1
  60. package/templates/modules/drizzle/nextjs/lib/schema.ts.hbs +84 -84
  61. package/templates/modules/mongoose/config.json +16 -16
  62. package/templates/modules/mongoose/src/lib/db.ts.hbs +0 -13
  63. package/templates/modules/mongoose/src/models/User.ts +48 -47
  64. package/templates/modules/prisma/express/config.json +27 -21
  65. package/templates/modules/prisma/express/prisma/schema.prisma +3 -2
  66. package/templates/modules/prisma/express/prisma.config.ts +12 -13
  67. package/templates/modules/prisma/express/src/lib/prisma.ts +24 -37
  68. package/templates/modules/prisma/nextjs/config.json +28 -23
  69. package/templates/modules/prisma/nextjs/prisma/schema.prisma.hbs +91 -90
  70. package/dist/prompts/backend/index.d.ts +0 -3
  71. package/dist/prompts/backend/index.d.ts.map +0 -1
  72. package/dist/prompts/backend/index.js +0 -128
  73. package/dist/prompts/backend/index.js.map +0 -1
  74. package/dist/prompts/frontend/index.d.ts +0 -3
  75. package/dist/prompts/frontend/index.d.ts.map +0 -1
  76. package/dist/prompts/frontend/index.js +0 -111
  77. package/dist/prompts/frontend/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,CAAC;AAGpD,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,MAAM,CAAC;AAG7D,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC;AAGnE,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;AAExE,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,WAAW,CAAC;AAGtD,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;AAGzD,MAAM,WAAW,YAAY;IAC3B,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;CAC/B;AAGD,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,QAAQ,CAAC;AAGpD,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;AAGzC,MAAM,WAAW,aAAa;IAE5B,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,eAAe,CAAC;IACjC,SAAS,EAAE,gBAAgB,GAAG,iBAAiB,CAAC;IAGhD,YAAY,EAAE,YAAY,CAAC;IAC3B,GAAG,EAAE,SAAS,CAAC;IACf,QAAQ,EAAE,cAAc,CAAC;IAEzB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IAGjB,cAAc,EAAE,cAAc,CAAC;IAG/B,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;C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AS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;QACnC,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;KACpC,CAAC;CACH;AAGD,eAAO,MAAM,sBAAsB;;;;;;IAGlC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;IAGnC,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;GAEpC,CAAC;AAGF,eAAO,MAAM,mBAAmB;;;;;;;;;IAI/B,CAAC;AAGF,eAAO,MAAM,iBAAiB;;;GAE7B,CAAC;AAGF,eAAO,MAAM,oBAAoB;;;;;;IAGhC,CAAC;AAGF,eAAO,MAAM,eAAe;;;;;;;;;;;;IAK3B,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;IAIjC,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;IAGvB,CAAC"}
@@ -2,16 +2,8 @@
2
2
  // Core type definitions for the CLI builder
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.authOptions = exports.packageManagerOptions = exports.databaseOptions = exports.postgresqlOrmOptions = exports.mongodbOrmOptions = exports.databaseTypeOptions = exports.frontendFrameworkOptions = exports.backendFrameworkOptions = exports.applicationTypeOptions = void 0;
5
- exports.isValidOrmOption = isValidOrmOption;
6
5
  exports.deriveDatabase = deriveDatabase;
7
6
  exports.buildError = buildError;
8
- /** Type guard to validate OrmOption values */
9
- function isValidOrmOption(value) {
10
- return (value === "prisma" ||
11
- value === "mongoose" ||
12
- value === "drizzle" ||
13
- value === "none");
14
- }
15
7
  /**
16
8
  * Derives the database option from database type and ORM selection.
17
9
  * Returns "none" if either is "none", otherwise returns the ORM which
@@ -54,7 +46,6 @@ exports.databaseTypeOptions = [
54
46
  ];
55
47
  // ORM options for MongoDB
56
48
  exports.mongodbOrmOptions = [
57
- { value: "prisma", label: "Prisma (Type-safe ORM)" },
58
49
  { value: "mongoose", label: "Mongoose (MongoDB ODM)" },
59
50
  ];
60
51
  // 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AAkB,EAAE,KAAK,EAAE,2BAA2B,EAAE;CAClE,CAAC;AAEW,QAAA,qBAAqB,GAAG;IACnC,EAAE,KAAK,EAAE,KAAc,EAAE,KAAK,EAAE,KAAK,EAAE;IACvC,EAAE,KAAK,EAAE,MAAe,EAAE,KAAK,EAAE,MAAM,EAAE;IACzC,EAAE,KAAK,EAAE,KAAc,EAAE,KAAK,EAAE,KAAK,EAAE;CACxC,CAAC;AAEW,QAAA,WAAW,GAAG;IACzB,EAAE,KAAK,EAAE,KAAc,EAAE,KAAK,EAAE,IAAI,EAAE;IACtC,EAAE,KAAK,EAAE,IAAa,EAAE,KAAK,EAAE,KAAK,EAAE;CACvC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- export declare const projectNameSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
2
+ export declare const projectNameSchema: z.ZodString;
3
3
  export declare function validateProjectName(name: string): string | undefined;
4
4
  export declare function validateDirectoryEmpty(dirPath: string): Promise<string | null>;
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validators/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,iBAAiB,uGAc3B,CAAC;AAGJ,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAUpE;AAGD,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,MAAM,0BAgB3D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validators/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,iBAAiB,aAc3B,CAAC;AAGJ,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAUpE;AAGD,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,MAAM,0BAgB3D"}
@@ -53,7 +53,7 @@ function validateProjectName(name) {
53
53
  return undefined;
54
54
  }
55
55
  // Return the first error message
56
- const firstError = result.error.errors[0];
56
+ const firstError = result.error.issues[0];
57
57
  return firstError.message;
58
58
  }
59
59
  // Ensures a directory is empty or does not exist before starting build
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "better-ts-stack",
3
- "version": "0.1.1",
3
+ "version": "1.0.8",
4
4
  "description": "A powerful CLI tool that generates fully configured TypeScript projects with backend, frontend, database integration, Docker support, and more--all through an interactive setup.",
5
5
  "keywords": [
6
6
  "cli",
@@ -43,24 +43,24 @@
43
43
  "type:check": "tsc --noEmit"
44
44
  },
45
45
  "dependencies": {
46
- "@clack/prompts": "^0.11.0",
47
- "consola": "^3.2.3",
48
- "fs-extra": "^11.1.1",
49
- "handlebars": "^4.7.8",
50
- "zod": "^3.22.4"
46
+ "@clack/prompts": "^1.7.0",
47
+ "consola": "^3.4.2",
48
+ "fs-extra": "^11.4.0",
49
+ "handlebars": "^4.7.9",
50
+ "zod": "^4.5.4"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@better-ts-stack/eslint-config": "*",
54
54
  "@better-ts-stack/prettier-config": "*",
55
55
  "@types/fs-extra": "^11.0.4",
56
- "@types/node": "^20.10.5",
57
- "eslint": "^9.17.0",
58
- "prettier": "^3.1.1",
59
- "tsx": "^4.7.0",
60
- "typescript": "^5.3.3"
56
+ "@types/node": "^24.13.3",
57
+ "eslint": "^10.10.0",
58
+ "prettier": "^3.9.6",
59
+ "tsx": "^4.23.13",
60
+ "typescript": "^6.0.3"
61
61
  },
62
62
  "engines": {
63
- "node": ">=18.0.0"
63
+ "node": ">=24.0.0"
64
64
  },
65
65
  "prettier": "@better-ts-stack/prettier-config"
66
66
  }
@@ -1,42 +1,44 @@
1
- {
2
- "id": "express",
3
- "name": "Express Base",
4
- "description": "Base Express server with TypeScript, middleware, and best practices",
5
- "type": "base",
6
- "scripts": {
7
- "dev": "{{#if (eq packageManager 'bun')}}bun --watch src/index.ts{{else}}tsx watch src/index.ts{{/if}}",
8
- "build": "tsc",
9
- "start": "{{runner}} dist/index.js",
10
- "lint": "eslint src",
11
- "lint:fix": "eslint src --fix",
12
- "format": "prettier --write \"src/**/*.ts\"",
13
- "type:check": "tsc --noEmit"
14
- },
15
- "dependencies": {
16
- "express": "^4.18.2",
17
- "dotenv": "^16.3.1",
18
- "cors": "^2.8.5",
19
- "helmet": "^7.1.0",
20
- "morgan": "^1.10.0"
21
- },
22
- "devDependencies": {
23
- "@eslint/js": "^9.39.2",
24
- "@trivago/prettier-plugin-sort-imports": "^6.0.2",
25
- "@types/cors": "^2.8.17",
26
- "@types/express": "^4.17.21",
27
- "@types/morgan": "^1.9.9",
28
- "@types/node": "^20.10.6",
29
- "eslint": "^9.39.2",
30
- "eslint-config-prettier": "^10.1.8",
31
- "prettier": "^3.8.1",
32
- "prettier-plugin-tailwindcss": "^0.7.2",
33
- "tsx": "^4.7.0",
34
- "typescript": "^5.3.3",
35
- "typescript-eslint": "^8.54.0"
36
- },
37
- "envVars": {
38
- "NODE_ENV": "development",
39
- "PORT": "3000"
40
- },
41
- "templateFiles": ["src/index.ts"]
42
- }
1
+ {
2
+ "id": "express",
3
+ "name": "Express Base",
4
+ "description": "Base Express server with TypeScript, middleware, and best practices",
5
+ "type": "base",
6
+ "scripts": {
7
+ "dev": "{{#if (eq packageManager 'bun')}}bun --watch src/index.ts{{else}}tsx watch src/index.ts{{/if}}",
8
+ "build": "tsc",
9
+ "start": "{{runner}} dist/index.js",
10
+ "lint": "eslint src",
11
+ "lint:fix": "eslint src --fix",
12
+ "format": "prettier --write \"src/**/*.ts\"",
13
+ "type:check": "tsc --noEmit"
14
+ },
15
+ "dependencies": {
16
+ "express": "^5.2.1",
17
+ "dotenv": "^17.4.2",
18
+ "cors": "^2.8.6",
19
+ "helmet": "^8.3.0",
20
+ "morgan": "^1.12.0"
21
+ },
22
+ "devDependencies": {
23
+ "@eslint/js": "^10.0.1",
24
+ "@trivago/prettier-plugin-sort-imports": "^6.0.2",
25
+ "@types/cors": "^2.8.19",
26
+ "@types/express": "^5.0.6",
27
+ "@types/morgan": "^1.9.10",
28
+ "@types/node": "^24.13.3",
29
+ "eslint": "^10.10.0",
30
+ "eslint-config-prettier": "^10.1.8",
31
+ "prettier": "^3.9.6",
32
+ "prettier-plugin-tailwindcss": "^0.8.1",
33
+ "tsx": "^4.23.13",
34
+ "typescript": "^6.0.3",
35
+ "typescript-eslint": "^8.69.0"
36
+ },
37
+ "envVars": {
38
+ "NODE_ENV": "development",
39
+ "PORT": "3000"
40
+ },
41
+ "templateFiles": [
42
+ "src/index.ts"
43
+ ]
44
+ }
@@ -1,31 +1,40 @@
1
- import path from 'node:path';
2
- import { fileURLToPath } from 'node:url';
3
- import eslint from '@eslint/js';
4
- import tseslint from 'typescript-eslint';
5
-
6
- const __filename = fileURLToPath(import.meta.url);
7
- const __dirname = path.dirname(__filename);
8
-
9
- export default tseslint.config(
10
- {
11
- ignores: ['dist', 'node_modules', 'templates/**/*', 'bin/**/*'],
12
- },
13
- eslint.configs.recommended,
14
- ...tseslint.configs.recommended,
15
- ...tseslint.configs.recommendedTypeChecked,
16
- {
17
- languageOptions: {
18
- parserOptions: {
19
- project: './tsconfig.eslint.json',
20
- tsconfigRootDir: __dirname,
21
- },
22
- },
23
- rules: {
24
- '@typescript-eslint/explicit-function-return-type': 'off',
25
- '@typescript-eslint/no-explicit-any': 'warn',
26
- '@typescript-eslint/no-unused-vars': ['error'],
27
- '@typescript-eslint/no-floating-promises': 'error',
28
- 'no-console': 'off',
29
- },
30
- }
31
- );
1
+ import eslint from "@eslint/js";
2
+ import path from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import tseslint from "typescript-eslint";
5
+
6
+ const __filename = fileURLToPath(import.meta.url);
7
+ const __dirname = path.dirname(__filename);
8
+
9
+ export default tseslint.config(
10
+ {
11
+ ignores: [
12
+ "dist",
13
+ "node_modules",
14
+ "templates/**/*",
15
+ "bin/**/*",
16
+ "src/generated/**",
17
+ ],
18
+ },
19
+ eslint.configs.recommended,
20
+ ...tseslint.configs.recommended,
21
+ ...tseslint.configs.recommendedTypeChecked,
22
+ {
23
+ languageOptions: {
24
+ parserOptions: {
25
+ project: "./tsconfig.eslint.json",
26
+ tsconfigRootDir: __dirname,
27
+ },
28
+ },
29
+ rules: {
30
+ "@typescript-eslint/explicit-function-return-type": "off",
31
+ "@typescript-eslint/no-explicit-any": "warn",
32
+ "@typescript-eslint/no-unused-vars": [
33
+ "error",
34
+ { argsIgnorePattern: "^_" },
35
+ ],
36
+ "@typescript-eslint/no-floating-promises": "error",
37
+ "no-console": "off",
38
+ },
39
+ }
40
+ );
@@ -1,46 +1,61 @@
1
- import express, { Express, Request, Response } from 'express';
2
- import cors from 'cors';
3
- import helmet from 'helmet';
4
- import morgan from 'morgan';
5
- import dotenv from 'dotenv';
6
- import healthRouter from './routes/health';
7
- {{#if useAuth}}
8
- import authRouter from './routes/auth';
9
- {{/if}}
10
-
11
- dotenv.config();
12
-
13
- const app: Express = express();
14
- const port = process.env.PORT || 3000;
15
-
16
- // Middleware
17
- app.use(helmet());
18
- app.use(cors());
19
- app.use(morgan('dev'));
20
- app.use(express.json());
21
- app.use(express.urlencoded({ extended: true }));
22
-
23
- // Routes
24
- app.use('/health', healthRouter);
25
- {{#if useAuth}}
26
- app.use('/auth', authRouter);
27
- {{/if}}
28
-
29
- // 404 handler
30
- app.use((_req: Request, res: Response) => {
31
- res.status(404).json({ error: 'Not Found' });
32
- });
33
-
34
- // Error handler
35
- app.use((err: Error, _req: Request, res: Response) => {
36
- console.error(err.stack);
37
- res.status(500).json({ error: 'Internal Server Error' });
38
- });
39
-
40
- app.listen(port, () => {
41
- console.log(`Server is running on http://localhost:${port}
42
- Health: http://localhost:${port}/health
43
- `);
44
- });
45
-
46
- export default app;
1
+ import 'dotenv/config';
2
+ import express, { Express, Request, Response, NextFunction } from 'express';
3
+ import cors from 'cors';
4
+ import helmet from 'helmet';
5
+ import morgan from 'morgan';
6
+ {{#if (eq database 'mongoose')}}
7
+ import { connectDB } from './lib/db';
8
+ {{/if}}
9
+ import healthRouter from './routes/health';
10
+ {{#if useAuth}}
11
+ import authRouter from './routes/auth';
12
+ {{/if}}
13
+
14
+
15
+
16
+ const app: Express = express();
17
+ const port = process.env.PORT || 3000;
18
+
19
+ // Middleware
20
+ app.use(helmet());
21
+ app.use(cors());
22
+ app.use(morgan('dev'));
23
+ app.use(express.json());
24
+ app.use(express.urlencoded({ extended: true }));
25
+
26
+ // Routes
27
+ app.use('/health', healthRouter);
28
+ {{#if useAuth}}
29
+ app.use('/auth', authRouter);
30
+ {{/if}}
31
+
32
+ // 404 handler
33
+ app.use((_req: Request, res: Response) => {
34
+ res.status(404).json({ error: 'Not Found' });
35
+ });
36
+
37
+ // Error handler
38
+ app.use((err: Error, _req: Request, res: Response, _next: NextFunction) => {
39
+ console.error(err.stack);
40
+ res.status(500).json({ error: 'Internal Server Error' });
41
+ });
42
+
43
+ {{#if (eq database 'mongoose')}}
44
+ void awaitDatabase().catch((error: unknown) => {
45
+ console.error(error);
46
+ process.exitCode = 1;
47
+ });
48
+ async function awaitDatabase(): Promise<void> {
49
+ await connectDB();
50
+ app.listen(port);
51
+ }
52
+ {{else}}
53
+ app.listen(port, () => {
54
+ console.log(`Server is running on http://localhost:${port}
55
+ Health: http://localhost:${port}/health
56
+ `);
57
+ });
58
+
59
+ {{/if}}
60
+
61
+ export default app;
@@ -1,12 +1,12 @@
1
- import { Router, Request, Response } from 'express';
2
-
3
- const router = Router();
4
-
5
- router.get('/', (_req: Request, res: Response) => {
6
- res.status(200).json({
7
- status: 'ok',
8
- timestamp: new Date().toISOString(),
9
- });
10
- });
11
-
12
- export default router;
1
+ import { Request, Response, Router } from "express";
2
+
3
+ const router: Router = Router();
4
+
5
+ router.get("/", (_req: Request, res: Response) => {
6
+ res.status(200).json({
7
+ status: "ok",
8
+ timestamp: new Date().toISOString(),
9
+ });
10
+ });
11
+
12
+ export default router;
@@ -1,23 +1,25 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2020",
4
- "module": "commonjs",
5
- "lib": ["ES2020"],
6
- "outDir": "./dist",
7
- "rootDir": "./src",
8
- "strict": true,
9
- "esModuleInterop": true,
10
- "skipLibCheck": true,
11
- "forceConsistentCasingInFileNames": true,
12
- "resolveJsonModule": true,
13
- "declaration": true,
14
- "declarationMap": true,
15
- "sourceMap": true,
16
- "noUnusedLocals": true,
17
- "noUnusedParameters": true,
18
- "noImplicitReturns": true,
19
- "noFallthroughCasesInSwitch": true
20
- },
21
- "include": ["src/**/*"],
22
- "exclude": ["node_modules", "dist"]
23
- }
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "NodeNext",
5
+ "lib": ["ES2020"],
6
+ "outDir": "./dist",
7
+ "rootDir": "./src",
8
+ "strict": true,
9
+ "esModuleInterop": true,
10
+ "skipLibCheck": true,
11
+ "forceConsistentCasingInFileNames": true,
12
+ "resolveJsonModule": true,
13
+ "declaration": true,
14
+ "declarationMap": true,
15
+ "sourceMap": true,
16
+ "noUnusedLocals": true,
17
+ "noUnusedParameters": true,
18
+ "noImplicitReturns": true,
19
+ "noFallthroughCasesInSwitch": true,
20
+ "moduleResolution": "NodeNext",
21
+ "types": ["node"]
22
+ },
23
+ "include": ["src/**/*"],
24
+ "exclude": ["node_modules", "dist"]
25
+ }
@@ -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}}