better-ts-stack 2.0.0 → 2.0.1
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.
- package/LICENSE +21 -0
- package/README.md +1 -1
- package/dist/args.js +2 -2
- package/dist/builder/buildPlanner.js +71 -0
- package/dist/builder/configGenerator.js +9 -7
- package/dist/builder/dependencyInstaller.js +0 -1
- package/dist/builder/fileProcessor.js +47 -44
- package/dist/builder/gitInitializer.js +20 -1
- package/dist/builder/index.js +19 -38
- package/dist/builder/moduleSelector.js +0 -1
- package/dist/builder/templateContext.js +0 -22
- package/dist/index.js +4 -3
- package/dist/modules/registry.js +4 -6
- package/dist/output/nextSteps.js +0 -1
- package/dist/prompts/index.js +0 -1
- package/dist/prompts/stack.js +4 -1
- package/dist/types/index.js +7 -3
- package/dist/ui/index.js +0 -1
- package/dist/ui/messages.js +25 -1
- package/dist/ui/prompts.js +0 -1
- package/dist/ui/theme.js +0 -1
- package/dist/validators/index.js +10 -41
- package/package.json +2 -1
- package/templates/backend/express/.prettierrc +2 -2
- package/templates/backend/express/config.json +1 -5
- package/templates/backend/express/eslint.config.mjs +40 -40
- package/templates/backend/express/gitignore +36 -36
- package/templates/backend/express/src/{index.ts → index.ts.hbs} +28 -29
- package/templates/backend/express/src/routes/health.ts +12 -12
- package/templates/backend/express/tsconfig.json +25 -25
- package/templates/backend/nestjs/.prettierrc +16 -16
- package/templates/backend/nestjs/config.json +1 -4
- package/templates/backend/nestjs/eslint.config.mjs +40 -40
- package/templates/backend/nestjs/gitignore +36 -36
- package/templates/backend/nestjs/nest-cli.json +9 -9
- package/templates/backend/nestjs/src/app.module.ts.hbs +34 -34
- package/templates/backend/nestjs/src/health/health.controller.ts +12 -12
- package/templates/backend/nestjs/src/main.ts +23 -23
- package/templates/backend/nestjs/tsconfig.json +25 -25
- package/templates/frontend/nextjs/components.json +19 -19
- package/templates/frontend/nextjs/config.json +1 -2
- package/templates/frontend/nextjs/gitignore +42 -42
- package/templates/frontend/nextjs/lib/utils.ts +6 -6
- package/templates/frontend/nextjs/proxy.ts.hbs +24 -24
- package/templates/frontend/nextjs/tsconfig.json +34 -34
- package/templates/frontend/tanstack/config.json +1 -4
- package/templates/frontend/tanstack/src/routeTree.gen.ts +68 -68
- package/templates/frontend/tanstack/src/styles/app.css +85 -85
- package/templates/modules/auth/express/config.json +1 -8
- package/templates/modules/auth/express/src/controllers/authController.ts.hbs +116 -116
- package/templates/modules/auth/express/src/middleware/requireAuth.ts.hbs +26 -26
- package/templates/modules/auth/express/src/services/userStore.ts.hbs +117 -117
- package/templates/modules/auth/nestjs/config.json +1 -5
- package/templates/modules/auth/nestjs/src/auth/auth.controller.ts +46 -46
- package/templates/modules/auth/nestjs/src/auth/auth.guard.ts +36 -36
- package/templates/modules/auth/nestjs/src/auth/auth.module.ts.hbs +22 -22
- package/templates/modules/auth/nestjs/src/auth/auth.schemas.ts +35 -35
- package/templates/modules/auth/nestjs/src/auth/auth.service.ts +70 -70
- package/templates/modules/auth/nestjs/src/auth/jwt.ts +27 -27
- package/templates/modules/auth/nestjs/src/auth/users.service.ts.hbs +144 -144
- package/templates/modules/auth/nestjs/src/auth/zod-validation.pipe.ts +16 -16
- package/templates/modules/auth/nextjs/app/dashboard/page.tsx +96 -96
- package/templates/modules/auth/nextjs/app/sign-in/page.tsx +35 -35
- package/templates/modules/auth/nextjs/app/sign-up/page.tsx +35 -35
- package/templates/modules/auth/nextjs/components/auth/sign-in-form.tsx +132 -132
- package/templates/modules/auth/nextjs/components/auth/sign-out-button.tsx +50 -50
- package/templates/modules/auth/nextjs/components/auth/sign-up-form.tsx +152 -152
- package/templates/modules/auth/nextjs/config.json +2 -15
- package/templates/modules/auth/nextjs/lib/auth-schema.ts +39 -39
- package/templates/modules/auth/nextjs/lib/auth.ts.hbs +37 -37
- package/templates/modules/auth/tanstack/config.json +2 -16
- package/templates/modules/auth/tanstack/src/lib/auth-functions.ts +4 -4
- package/templates/modules/auth/tanstack/src/routeTree.gen.ts +140 -140
- package/templates/modules/docker/.dockerignore +14 -14
- package/templates/modules/docker/Dockerfile.hbs +1 -3
- package/templates/modules/docker/config.json +1 -5
- package/templates/modules/docker/docker-compose.yml.hbs +9 -9
- package/templates/modules/drizzle/express/config.json +1 -2
- package/templates/modules/drizzle/express/drizzle.config.ts +13 -13
- package/templates/modules/drizzle/express/src/lib/db.ts +13 -13
- package/templates/modules/drizzle/express/src/lib/schema.ts +10 -10
- package/templates/modules/drizzle/nestjs/config.json +1 -2
- package/templates/modules/drizzle/nestjs/drizzle.config.ts +13 -13
- package/templates/modules/drizzle/nestjs/src/database/database.module.ts +30 -30
- package/templates/modules/drizzle/nestjs/src/database/schema.ts +10 -10
- package/templates/modules/drizzle/nextjs/config.json +1 -4
- package/templates/modules/drizzle/nextjs/lib/db.ts +13 -13
- package/templates/modules/drizzle/nextjs/lib/schema.ts.hbs +84 -84
- package/templates/modules/drizzle/tanstack/config.json +5 -5
- package/templates/modules/mongoose/express/config.json +1 -2
- package/templates/modules/mongoose/nestjs/config.json +1 -2
- package/templates/modules/mongoose/nestjs/src/users/user.schema.ts +21 -21
- package/templates/modules/mongoose/nextjs/config.json +1 -2
- package/templates/modules/mongoose/nextjs/lib/db.ts +36 -36
- package/templates/modules/mongoose/tanstack/config.json +1 -2
- package/templates/modules/mongoose/tanstack/src/lib/db.ts +37 -37
- package/templates/modules/prisma/express/config.json +0 -1
- package/templates/modules/prisma/express/prisma/schema.prisma +1 -1
- package/templates/modules/prisma/express/prisma.config.ts +12 -12
- package/templates/modules/prisma/express/src/lib/prisma.ts +24 -24
- package/templates/modules/prisma/nestjs/config.json +0 -1
- package/templates/modules/prisma/nestjs/prisma/schema.prisma +23 -23
- package/templates/modules/prisma/nestjs/prisma.config.ts +12 -12
- package/templates/modules/prisma/nestjs/src/prisma/prisma.module.ts +11 -11
- package/templates/modules/prisma/nestjs/src/prisma/prisma.service.ts +17 -17
- package/templates/modules/prisma/nextjs/config.json +0 -1
- package/templates/modules/prisma/nextjs/prisma/schema.prisma.hbs +91 -91
- package/templates/modules/prisma/tanstack/config.json +0 -1
- package/dist/args.d.ts +0 -12
- package/dist/args.d.ts.map +0 -1
- package/dist/args.js.map +0 -1
- package/dist/builder/configGenerator.d.ts +0 -7
- package/dist/builder/configGenerator.d.ts.map +0 -1
- package/dist/builder/configGenerator.js.map +0 -1
- package/dist/builder/dependencyInstaller.d.ts +0 -3
- package/dist/builder/dependencyInstaller.d.ts.map +0 -1
- package/dist/builder/dependencyInstaller.js.map +0 -1
- package/dist/builder/fileProcessor.d.ts +0 -6
- package/dist/builder/fileProcessor.d.ts.map +0 -1
- package/dist/builder/fileProcessor.js.map +0 -1
- package/dist/builder/gitInitializer.d.ts +0 -2
- package/dist/builder/gitInitializer.d.ts.map +0 -1
- package/dist/builder/gitInitializer.js.map +0 -1
- package/dist/builder/index.d.ts +0 -3
- package/dist/builder/index.d.ts.map +0 -1
- package/dist/builder/index.js.map +0 -1
- package/dist/builder/moduleSelector.d.ts +0 -6
- package/dist/builder/moduleSelector.d.ts.map +0 -1
- package/dist/builder/moduleSelector.js.map +0 -1
- package/dist/builder/templateContext.d.ts +0 -6
- package/dist/builder/templateContext.d.ts.map +0 -1
- package/dist/builder/templateContext.js.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/modules/registry.d.ts +0 -6
- package/dist/modules/registry.d.ts.map +0 -1
- package/dist/modules/registry.js.map +0 -1
- package/dist/output/nextSteps.d.ts +0 -3
- package/dist/output/nextSteps.d.ts.map +0 -1
- package/dist/output/nextSteps.js.map +0 -1
- package/dist/prompts/index.d.ts +0 -4
- package/dist/prompts/index.d.ts.map +0 -1
- package/dist/prompts/index.js.map +0 -1
- package/dist/prompts/stack.d.ts +0 -4
- package/dist/prompts/stack.d.ts.map +0 -1
- package/dist/prompts/stack.js.map +0 -1
- package/dist/types/index.d.ts +0 -137
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/ui/index.d.ts +0 -3
- package/dist/ui/index.d.ts.map +0 -1
- package/dist/ui/index.js.map +0 -1
- package/dist/ui/messages.d.ts +0 -9
- package/dist/ui/messages.d.ts.map +0 -1
- package/dist/ui/messages.js.map +0 -1
- package/dist/ui/prompts.d.ts +0 -20
- package/dist/ui/prompts.d.ts.map +0 -1
- package/dist/ui/prompts.js.map +0 -1
- package/dist/ui/theme.d.ts +0 -9
- package/dist/ui/theme.d.ts.map +0 -1
- package/dist/ui/theme.js.map +0 -1
- package/dist/validators/index.d.ts +0 -6
- package/dist/validators/index.d.ts.map +0 -1
- package/dist/validators/index.js.map +0 -1
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
# Dependencies
|
|
2
|
-
node_modules/
|
|
3
|
-
|
|
4
|
-
# Build output
|
|
5
|
-
dist/
|
|
6
|
-
build/
|
|
7
|
-
|
|
8
|
-
# Environment variables
|
|
9
|
-
.env
|
|
10
|
-
.env.local
|
|
11
|
-
.env.*.local
|
|
12
|
-
|
|
13
|
-
# Logs
|
|
14
|
-
logs/
|
|
15
|
-
*.log
|
|
16
|
-
npm-debug.log*
|
|
17
|
-
yarn-debug.log*
|
|
18
|
-
yarn-error.log*
|
|
19
|
-
|
|
20
|
-
# IDE
|
|
21
|
-
.vscode/
|
|
22
|
-
.idea/
|
|
23
|
-
*.swp
|
|
24
|
-
*.swo
|
|
25
|
-
*~
|
|
26
|
-
|
|
27
|
-
# OS
|
|
28
|
-
.DS_Store
|
|
29
|
-
Thumbs.db
|
|
30
|
-
|
|
31
|
-
# Testing
|
|
32
|
-
coverage/
|
|
33
|
-
.nyc_output/
|
|
34
|
-
|
|
35
|
-
# Misc
|
|
36
|
-
*.tsbuildinfo
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules/
|
|
3
|
+
|
|
4
|
+
# Build output
|
|
5
|
+
dist/
|
|
6
|
+
build/
|
|
7
|
+
|
|
8
|
+
# Environment variables
|
|
9
|
+
.env
|
|
10
|
+
.env.local
|
|
11
|
+
.env.*.local
|
|
12
|
+
|
|
13
|
+
# Logs
|
|
14
|
+
logs/
|
|
15
|
+
*.log
|
|
16
|
+
npm-debug.log*
|
|
17
|
+
yarn-debug.log*
|
|
18
|
+
yarn-error.log*
|
|
19
|
+
|
|
20
|
+
# IDE
|
|
21
|
+
.vscode/
|
|
22
|
+
.idea/
|
|
23
|
+
*.swp
|
|
24
|
+
*.swo
|
|
25
|
+
*~
|
|
26
|
+
|
|
27
|
+
# OS
|
|
28
|
+
.DS_Store
|
|
29
|
+
Thumbs.db
|
|
30
|
+
|
|
31
|
+
# Testing
|
|
32
|
+
coverage/
|
|
33
|
+
.nyc_output/
|
|
34
|
+
|
|
35
|
+
# Misc
|
|
36
|
+
*.tsbuildinfo
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/nest-cli",
|
|
3
|
-
"collection": "@nestjs/schematics",
|
|
4
|
-
"sourceRoot": "src",
|
|
5
|
-
"compilerOptions": {
|
|
6
|
-
"deleteOutDir": true,
|
|
7
|
-
"tsConfigPath": "tsconfig.json"
|
|
8
|
-
}
|
|
9
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/nest-cli",
|
|
3
|
+
"collection": "@nestjs/schematics",
|
|
4
|
+
"sourceRoot": "src",
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"deleteOutDir": true,
|
|
7
|
+
"tsConfigPath": "tsconfig.json"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { Module } from "@nestjs/common";
|
|
2
|
-
{{#if (eq database 'mongoose')}}
|
|
3
|
-
import { MongooseModule } from "@nestjs/mongoose";
|
|
4
|
-
{{/if}}
|
|
5
|
-
|
|
6
|
-
{{#if useAuth}}
|
|
7
|
-
import { AuthModule } from "./auth/auth.module.js";
|
|
8
|
-
{{/if}}
|
|
9
|
-
{{#if (eq database 'drizzle')}}
|
|
10
|
-
import { DatabaseModule } from "./database/database.module.js";
|
|
11
|
-
{{/if}}
|
|
12
|
-
import { HealthController } from "./health/health.controller.js";
|
|
13
|
-
{{#if (eq database 'prisma')}}
|
|
14
|
-
import { PrismaModule } from "./prisma/prisma.module.js";
|
|
15
|
-
{{/if}}
|
|
16
|
-
|
|
17
|
-
@Module({
|
|
18
|
-
imports: [
|
|
19
|
-
{{#if (eq database 'prisma')}}
|
|
20
|
-
PrismaModule,
|
|
21
|
-
{{/if}}
|
|
22
|
-
{{#if (eq database 'drizzle')}}
|
|
23
|
-
DatabaseModule,
|
|
24
|
-
{{/if}}
|
|
25
|
-
{{#if (eq database 'mongoose')}}
|
|
26
|
-
MongooseModule.forRoot(process.env.MONGODB_URI!),
|
|
27
|
-
{{/if}}
|
|
28
|
-
{{#if useAuth}}
|
|
29
|
-
AuthModule,
|
|
30
|
-
{{/if}}
|
|
31
|
-
],
|
|
32
|
-
controllers: [HealthController],
|
|
33
|
-
})
|
|
34
|
-
export class AppModule {}
|
|
1
|
+
import { Module } from "@nestjs/common";
|
|
2
|
+
{{#if (eq database 'mongoose')}}
|
|
3
|
+
import { MongooseModule } from "@nestjs/mongoose";
|
|
4
|
+
{{/if}}
|
|
5
|
+
|
|
6
|
+
{{#if useAuth}}
|
|
7
|
+
import { AuthModule } from "./auth/auth.module.js";
|
|
8
|
+
{{/if}}
|
|
9
|
+
{{#if (eq database 'drizzle')}}
|
|
10
|
+
import { DatabaseModule } from "./database/database.module.js";
|
|
11
|
+
{{/if}}
|
|
12
|
+
import { HealthController } from "./health/health.controller.js";
|
|
13
|
+
{{#if (eq database 'prisma')}}
|
|
14
|
+
import { PrismaModule } from "./prisma/prisma.module.js";
|
|
15
|
+
{{/if}}
|
|
16
|
+
|
|
17
|
+
@Module({
|
|
18
|
+
imports: [
|
|
19
|
+
{{#if (eq database 'prisma')}}
|
|
20
|
+
PrismaModule,
|
|
21
|
+
{{/if}}
|
|
22
|
+
{{#if (eq database 'drizzle')}}
|
|
23
|
+
DatabaseModule,
|
|
24
|
+
{{/if}}
|
|
25
|
+
{{#if (eq database 'mongoose')}}
|
|
26
|
+
MongooseModule.forRoot(process.env.MONGODB_URI!),
|
|
27
|
+
{{/if}}
|
|
28
|
+
{{#if useAuth}}
|
|
29
|
+
AuthModule,
|
|
30
|
+
{{/if}}
|
|
31
|
+
],
|
|
32
|
+
controllers: [HealthController],
|
|
33
|
+
})
|
|
34
|
+
export class AppModule {}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Controller, Get } from "@nestjs/common";
|
|
2
|
-
|
|
3
|
-
@Controller("health")
|
|
4
|
-
export class HealthController {
|
|
5
|
-
@Get()
|
|
6
|
-
check(): { status: string; timestamp: string } {
|
|
7
|
-
return {
|
|
8
|
-
status: "ok",
|
|
9
|
-
timestamp: new Date().toISOString(),
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
}
|
|
1
|
+
import { Controller, Get } from "@nestjs/common";
|
|
2
|
+
|
|
3
|
+
@Controller("health")
|
|
4
|
+
export class HealthController {
|
|
5
|
+
@Get()
|
|
6
|
+
check(): { status: string; timestamp: string } {
|
|
7
|
+
return {
|
|
8
|
+
status: "ok",
|
|
9
|
+
timestamp: new Date().toISOString(),
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { NestFactory } from "@nestjs/core";
|
|
2
|
-
// Loads .env before app.module.js reads process.env
|
|
3
|
-
import "dotenv/config";
|
|
4
|
-
import helmet from "helmet";
|
|
5
|
-
|
|
6
|
-
import { AppModule } from "./app.module.js";
|
|
7
|
-
|
|
8
|
-
async function bootstrap(): Promise<void> {
|
|
9
|
-
const app = await NestFactory.create(AppModule);
|
|
10
|
-
const port = process.env.PORT ?? 3000;
|
|
11
|
-
|
|
12
|
-
app.use(helmet());
|
|
13
|
-
app.enableCors();
|
|
14
|
-
// Lets modules close database connections when the process is stopped
|
|
15
|
-
app.enableShutdownHooks();
|
|
16
|
-
|
|
17
|
-
await app.listen(port);
|
|
18
|
-
console.log(`Server is running on http://localhost:${port}
|
|
19
|
-
Health: http://localhost:${port}/health
|
|
20
|
-
`);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
void bootstrap();
|
|
1
|
+
import { NestFactory } from "@nestjs/core";
|
|
2
|
+
// Loads .env before app.module.js reads process.env
|
|
3
|
+
import "dotenv/config";
|
|
4
|
+
import helmet from "helmet";
|
|
5
|
+
|
|
6
|
+
import { AppModule } from "./app.module.js";
|
|
7
|
+
|
|
8
|
+
async function bootstrap(): Promise<void> {
|
|
9
|
+
const app = await NestFactory.create(AppModule);
|
|
10
|
+
const port = process.env.PORT ?? 3000;
|
|
11
|
+
|
|
12
|
+
app.use(helmet());
|
|
13
|
+
app.enableCors();
|
|
14
|
+
// Lets modules close database connections when the process is stopped
|
|
15
|
+
app.enableShutdownHooks();
|
|
16
|
+
|
|
17
|
+
await app.listen(port);
|
|
18
|
+
console.log(`Server is running on http://localhost:${port}
|
|
19
|
+
Health: http://localhost:${port}/health
|
|
20
|
+
`);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
void bootstrap();
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2023",
|
|
4
|
-
"module": "NodeNext",
|
|
5
|
-
"moduleResolution": "NodeNext",
|
|
6
|
-
"outDir": "./dist",
|
|
7
|
-
"rootDir": "./src",
|
|
8
|
-
"strict": true,
|
|
9
|
-
"strictPropertyInitialization": false,
|
|
10
|
-
"esModuleInterop": true,
|
|
11
|
-
"isolatedModules": true,
|
|
12
|
-
"experimentalDecorators": true,
|
|
13
|
-
"emitDecoratorMetadata": true,
|
|
14
|
-
"skipLibCheck": true,
|
|
15
|
-
"forceConsistentCasingInFileNames": true,
|
|
16
|
-
"sourceMap": true,
|
|
17
|
-
"noUnusedLocals": true,
|
|
18
|
-
"noUnusedParameters": true,
|
|
19
|
-
"noImplicitReturns": true,
|
|
20
|
-
"noFallthroughCasesInSwitch": true,
|
|
21
|
-
"types": ["node"]
|
|
22
|
-
},
|
|
23
|
-
"include": ["src/**/*"],
|
|
24
|
-
"exclude": ["node_modules", "dist"]
|
|
25
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2023",
|
|
4
|
+
"module": "NodeNext",
|
|
5
|
+
"moduleResolution": "NodeNext",
|
|
6
|
+
"outDir": "./dist",
|
|
7
|
+
"rootDir": "./src",
|
|
8
|
+
"strict": true,
|
|
9
|
+
"strictPropertyInitialization": false,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"isolatedModules": true,
|
|
12
|
+
"experimentalDecorators": true,
|
|
13
|
+
"emitDecoratorMetadata": true,
|
|
14
|
+
"skipLibCheck": true,
|
|
15
|
+
"forceConsistentCasingInFileNames": true,
|
|
16
|
+
"sourceMap": true,
|
|
17
|
+
"noUnusedLocals": true,
|
|
18
|
+
"noUnusedParameters": true,
|
|
19
|
+
"noImplicitReturns": true,
|
|
20
|
+
"noFallthroughCasesInSwitch": true,
|
|
21
|
+
"types": ["node"]
|
|
22
|
+
},
|
|
23
|
+
"include": ["src/**/*"],
|
|
24
|
+
"exclude": ["node_modules", "dist"]
|
|
25
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
-
"style": "new-york",
|
|
4
|
-
"rsc": true,
|
|
5
|
-
"tsx": true,
|
|
6
|
-
"tailwind": {
|
|
7
|
-
"config": "",
|
|
8
|
-
"css": "app/globals.css",
|
|
9
|
-
"baseColor": "neutral",
|
|
10
|
-
"cssVariables": true
|
|
11
|
-
},
|
|
12
|
-
"iconLibrary": "lucide",
|
|
13
|
-
"aliases": {
|
|
14
|
-
"components": "@/components",
|
|
15
|
-
"lib": "@/lib",
|
|
16
|
-
"ui": "@/components/ui",
|
|
17
|
-
"utils": "@/lib/utils"
|
|
18
|
-
}
|
|
19
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
+
"style": "new-york",
|
|
4
|
+
"rsc": true,
|
|
5
|
+
"tsx": true,
|
|
6
|
+
"tailwind": {
|
|
7
|
+
"config": "",
|
|
8
|
+
"css": "app/globals.css",
|
|
9
|
+
"baseColor": "neutral",
|
|
10
|
+
"cssVariables": true
|
|
11
|
+
},
|
|
12
|
+
"iconLibrary": "lucide",
|
|
13
|
+
"aliases": {
|
|
14
|
+
"components": "@/components",
|
|
15
|
+
"lib": "@/lib",
|
|
16
|
+
"ui": "@/components/ui",
|
|
17
|
+
"utils": "@/lib/utils"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
2
|
-
|
|
3
|
-
# dependencies
|
|
4
|
-
/node_modules
|
|
5
|
-
/.pnp
|
|
6
|
-
.pnp.*
|
|
7
|
-
.yarn/*
|
|
8
|
-
!.yarn/patches
|
|
9
|
-
!.yarn/plugins
|
|
10
|
-
!.yarn/releases
|
|
11
|
-
!.yarn/versions
|
|
12
|
-
|
|
13
|
-
# testing
|
|
14
|
-
/coverage
|
|
15
|
-
|
|
16
|
-
# next.js
|
|
17
|
-
/.next/
|
|
18
|
-
/out/
|
|
19
|
-
|
|
20
|
-
# production
|
|
21
|
-
/build
|
|
22
|
-
|
|
23
|
-
# misc
|
|
24
|
-
.DS_Store
|
|
25
|
-
*.pem
|
|
26
|
-
|
|
27
|
-
# debug
|
|
28
|
-
npm-debug.log*
|
|
29
|
-
yarn-debug.log*
|
|
30
|
-
yarn-error.log*
|
|
31
|
-
.pnpm-debug.log*
|
|
32
|
-
|
|
33
|
-
# env files (can opt-in for committing if needed)
|
|
34
|
-
.env*
|
|
35
|
-
!.env.example
|
|
36
|
-
|
|
37
|
-
# vercel
|
|
38
|
-
.vercel
|
|
39
|
-
|
|
40
|
-
# typescript
|
|
41
|
-
*.tsbuildinfo
|
|
42
|
-
next-env.d.ts
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
2
|
+
|
|
3
|
+
# dependencies
|
|
4
|
+
/node_modules
|
|
5
|
+
/.pnp
|
|
6
|
+
.pnp.*
|
|
7
|
+
.yarn/*
|
|
8
|
+
!.yarn/patches
|
|
9
|
+
!.yarn/plugins
|
|
10
|
+
!.yarn/releases
|
|
11
|
+
!.yarn/versions
|
|
12
|
+
|
|
13
|
+
# testing
|
|
14
|
+
/coverage
|
|
15
|
+
|
|
16
|
+
# next.js
|
|
17
|
+
/.next/
|
|
18
|
+
/out/
|
|
19
|
+
|
|
20
|
+
# production
|
|
21
|
+
/build
|
|
22
|
+
|
|
23
|
+
# misc
|
|
24
|
+
.DS_Store
|
|
25
|
+
*.pem
|
|
26
|
+
|
|
27
|
+
# debug
|
|
28
|
+
npm-debug.log*
|
|
29
|
+
yarn-debug.log*
|
|
30
|
+
yarn-error.log*
|
|
31
|
+
.pnpm-debug.log*
|
|
32
|
+
|
|
33
|
+
# env files (can opt-in for committing if needed)
|
|
34
|
+
.env*
|
|
35
|
+
!.env.example
|
|
36
|
+
|
|
37
|
+
# vercel
|
|
38
|
+
.vercel
|
|
39
|
+
|
|
40
|
+
# typescript
|
|
41
|
+
*.tsbuildinfo
|
|
42
|
+
next-env.d.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { clsx, type ClassValue } from "clsx";
|
|
2
|
-
import { twMerge } from "tailwind-merge";
|
|
3
|
-
|
|
4
|
-
export function cn(...inputs: ClassValue[]) {
|
|
5
|
-
return twMerge(clsx(inputs));
|
|
6
|
-
}
|
|
1
|
+
import { clsx, type ClassValue } from "clsx";
|
|
2
|
+
import { twMerge } from "tailwind-merge";
|
|
3
|
+
|
|
4
|
+
export function cn(...inputs: ClassValue[]) {
|
|
5
|
+
return twMerge(clsx(inputs));
|
|
6
|
+
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { NextResponse } from "next/server";
|
|
2
|
-
|
|
3
|
-
{{#if useAuth}}
|
|
4
|
-
import type { NextRequest } from "next/server";
|
|
5
|
-
import { getSessionCookie } from "better-auth/cookies";
|
|
6
|
-
|
|
7
|
-
export function proxy(request: NextRequest) {
|
|
8
|
-
const sessionCookie = getSessionCookie(request);
|
|
9
|
-
|
|
10
|
-
if (!sessionCookie) {
|
|
11
|
-
return NextResponse.redirect(new URL("/sign-in", request.url));
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
return NextResponse.next();
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const config = {
|
|
18
|
-
matcher: ["/dashboard/:path*"],
|
|
19
|
-
};
|
|
20
|
-
{{else}}
|
|
21
|
-
export function proxy() {
|
|
22
|
-
return NextResponse.next();
|
|
23
|
-
}
|
|
24
|
-
{{/if}}
|
|
1
|
+
import { NextResponse } from "next/server";
|
|
2
|
+
|
|
3
|
+
{{#if useAuth}}
|
|
4
|
+
import type { NextRequest } from "next/server";
|
|
5
|
+
import { getSessionCookie } from "better-auth/cookies";
|
|
6
|
+
|
|
7
|
+
export function proxy(request: NextRequest) {
|
|
8
|
+
const sessionCookie = getSessionCookie(request);
|
|
9
|
+
|
|
10
|
+
if (!sessionCookie) {
|
|
11
|
+
return NextResponse.redirect(new URL("/sign-in", request.url));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return NextResponse.next();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const config = {
|
|
18
|
+
matcher: ["/dashboard/:path*"],
|
|
19
|
+
};
|
|
20
|
+
{{else}}
|
|
21
|
+
export function proxy() {
|
|
22
|
+
return NextResponse.next();
|
|
23
|
+
}
|
|
24
|
+
{{/if}}
|
|
@@ -1,34 +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": [
|
|
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
|
+
{
|
|
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
|
+
}
|