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,140 +1,140 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
|
|
3
|
-
// @ts-nocheck
|
|
4
|
-
|
|
5
|
-
// noinspection JSUnusedGlobalSymbols
|
|
6
|
-
|
|
7
|
-
// This file was automatically generated by TanStack Router.
|
|
8
|
-
// You should NOT make any changes in this file as it will be overwritten.
|
|
9
|
-
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
|
|
10
|
-
|
|
11
|
-
import { Route as rootRouteImport } from './routes/__root'
|
|
12
|
-
import { Route as IndexRouteImport } from './routes/index'
|
|
13
|
-
import { Route as DashboardRouteImport } from './routes/dashboard'
|
|
14
|
-
import { Route as SignInRouteImport } from './routes/sign-in'
|
|
15
|
-
import { Route as SignUpRouteImport } from './routes/sign-up'
|
|
16
|
-
import { Route as ApiAuthSplatRouteImport } from './routes/api/auth/$'
|
|
17
|
-
|
|
18
|
-
const IndexRoute = IndexRouteImport.update({
|
|
19
|
-
id: '/',
|
|
20
|
-
path: '/',
|
|
21
|
-
getParentRoute: () => rootRouteImport,
|
|
22
|
-
} as any)
|
|
23
|
-
const DashboardRoute = DashboardRouteImport.update({
|
|
24
|
-
id: '/dashboard',
|
|
25
|
-
path: '/dashboard',
|
|
26
|
-
getParentRoute: () => rootRouteImport,
|
|
27
|
-
} as any)
|
|
28
|
-
const SignInRoute = SignInRouteImport.update({
|
|
29
|
-
id: '/sign-in',
|
|
30
|
-
path: '/sign-in',
|
|
31
|
-
getParentRoute: () => rootRouteImport,
|
|
32
|
-
} as any)
|
|
33
|
-
const SignUpRoute = SignUpRouteImport.update({
|
|
34
|
-
id: '/sign-up',
|
|
35
|
-
path: '/sign-up',
|
|
36
|
-
getParentRoute: () => rootRouteImport,
|
|
37
|
-
} as any)
|
|
38
|
-
const ApiAuthSplatRoute = ApiAuthSplatRouteImport.update({
|
|
39
|
-
id: '/api/auth/$',
|
|
40
|
-
path: '/api/auth/$',
|
|
41
|
-
getParentRoute: () => rootRouteImport,
|
|
42
|
-
} as any)
|
|
43
|
-
|
|
44
|
-
export interface FileRoutesByFullPath {
|
|
45
|
-
'/': typeof IndexRoute
|
|
46
|
-
'/dashboard': typeof DashboardRoute
|
|
47
|
-
'/sign-in': typeof SignInRoute
|
|
48
|
-
'/sign-up': typeof SignUpRoute
|
|
49
|
-
'/api/auth/$': typeof ApiAuthSplatRoute
|
|
50
|
-
}
|
|
51
|
-
export interface FileRoutesByTo {
|
|
52
|
-
'/': typeof IndexRoute
|
|
53
|
-
'/dashboard': typeof DashboardRoute
|
|
54
|
-
'/sign-in': typeof SignInRoute
|
|
55
|
-
'/sign-up': typeof SignUpRoute
|
|
56
|
-
'/api/auth/$': typeof ApiAuthSplatRoute
|
|
57
|
-
}
|
|
58
|
-
export interface FileRoutesById {
|
|
59
|
-
__root__: typeof rootRouteImport
|
|
60
|
-
'/': typeof IndexRoute
|
|
61
|
-
'/dashboard': typeof DashboardRoute
|
|
62
|
-
'/sign-in': typeof SignInRoute
|
|
63
|
-
'/sign-up': typeof SignUpRoute
|
|
64
|
-
'/api/auth/$': typeof ApiAuthSplatRoute
|
|
65
|
-
}
|
|
66
|
-
export interface FileRouteTypes {
|
|
67
|
-
fileRoutesByFullPath: FileRoutesByFullPath
|
|
68
|
-
fullPaths: '/' | '/dashboard' | '/sign-in' | '/sign-up' | '/api/auth/$'
|
|
69
|
-
fileRoutesByTo: FileRoutesByTo
|
|
70
|
-
to: '/' | '/dashboard' | '/sign-in' | '/sign-up' | '/api/auth/$'
|
|
71
|
-
id: '__root__' | '/' | '/dashboard' | '/sign-in' | '/sign-up' | '/api/auth/$'
|
|
72
|
-
fileRoutesById: FileRoutesById
|
|
73
|
-
}
|
|
74
|
-
export interface RootRouteChildren {
|
|
75
|
-
IndexRoute: typeof IndexRoute
|
|
76
|
-
DashboardRoute: typeof DashboardRoute
|
|
77
|
-
SignInRoute: typeof SignInRoute
|
|
78
|
-
SignUpRoute: typeof SignUpRoute
|
|
79
|
-
ApiAuthSplatRoute: typeof ApiAuthSplatRoute
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
declare module '@tanstack/react-router' {
|
|
83
|
-
interface FileRoutesByPath {
|
|
84
|
-
'/': {
|
|
85
|
-
id: '/'
|
|
86
|
-
path: '/'
|
|
87
|
-
fullPath: '/'
|
|
88
|
-
preLoaderRoute: typeof IndexRouteImport
|
|
89
|
-
parentRoute: typeof rootRouteImport
|
|
90
|
-
}
|
|
91
|
-
'/dashboard': {
|
|
92
|
-
id: '/dashboard'
|
|
93
|
-
path: '/dashboard'
|
|
94
|
-
fullPath: '/dashboard'
|
|
95
|
-
preLoaderRoute: typeof DashboardRouteImport
|
|
96
|
-
parentRoute: typeof rootRouteImport
|
|
97
|
-
}
|
|
98
|
-
'/sign-in': {
|
|
99
|
-
id: '/sign-in'
|
|
100
|
-
path: '/sign-in'
|
|
101
|
-
fullPath: '/sign-in'
|
|
102
|
-
preLoaderRoute: typeof SignInRouteImport
|
|
103
|
-
parentRoute: typeof rootRouteImport
|
|
104
|
-
}
|
|
105
|
-
'/sign-up': {
|
|
106
|
-
id: '/sign-up'
|
|
107
|
-
path: '/sign-up'
|
|
108
|
-
fullPath: '/sign-up'
|
|
109
|
-
preLoaderRoute: typeof SignUpRouteImport
|
|
110
|
-
parentRoute: typeof rootRouteImport
|
|
111
|
-
}
|
|
112
|
-
'/api/auth/$': {
|
|
113
|
-
id: '/api/auth/$'
|
|
114
|
-
path: '/api/auth/$'
|
|
115
|
-
fullPath: '/api/auth/$'
|
|
116
|
-
preLoaderRoute: typeof ApiAuthSplatRouteImport
|
|
117
|
-
parentRoute: typeof rootRouteImport
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
const rootRouteChildren: RootRouteChildren = {
|
|
123
|
-
IndexRoute: IndexRoute,
|
|
124
|
-
DashboardRoute: DashboardRoute,
|
|
125
|
-
SignInRoute: SignInRoute,
|
|
126
|
-
SignUpRoute: SignUpRoute,
|
|
127
|
-
ApiAuthSplatRoute: ApiAuthSplatRoute,
|
|
128
|
-
}
|
|
129
|
-
export const routeTree = rootRouteImport
|
|
130
|
-
._addFileChildren(rootRouteChildren)
|
|
131
|
-
._addFileTypes<FileRouteTypes>()
|
|
132
|
-
|
|
133
|
-
import type { getRouter } from './router.tsx'
|
|
134
|
-
import type { createStart } from '@tanstack/react-start'
|
|
135
|
-
declare module '@tanstack/react-start' {
|
|
136
|
-
interface Register {
|
|
137
|
-
ssr: true
|
|
138
|
-
router: Awaited<ReturnType<typeof getRouter>>
|
|
139
|
-
}
|
|
140
|
-
}
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
|
|
5
|
+
// noinspection JSUnusedGlobalSymbols
|
|
6
|
+
|
|
7
|
+
// This file was automatically generated by TanStack Router.
|
|
8
|
+
// You should NOT make any changes in this file as it will be overwritten.
|
|
9
|
+
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
|
|
10
|
+
|
|
11
|
+
import { Route as rootRouteImport } from './routes/__root'
|
|
12
|
+
import { Route as IndexRouteImport } from './routes/index'
|
|
13
|
+
import { Route as DashboardRouteImport } from './routes/dashboard'
|
|
14
|
+
import { Route as SignInRouteImport } from './routes/sign-in'
|
|
15
|
+
import { Route as SignUpRouteImport } from './routes/sign-up'
|
|
16
|
+
import { Route as ApiAuthSplatRouteImport } from './routes/api/auth/$'
|
|
17
|
+
|
|
18
|
+
const IndexRoute = IndexRouteImport.update({
|
|
19
|
+
id: '/',
|
|
20
|
+
path: '/',
|
|
21
|
+
getParentRoute: () => rootRouteImport,
|
|
22
|
+
} as any)
|
|
23
|
+
const DashboardRoute = DashboardRouteImport.update({
|
|
24
|
+
id: '/dashboard',
|
|
25
|
+
path: '/dashboard',
|
|
26
|
+
getParentRoute: () => rootRouteImport,
|
|
27
|
+
} as any)
|
|
28
|
+
const SignInRoute = SignInRouteImport.update({
|
|
29
|
+
id: '/sign-in',
|
|
30
|
+
path: '/sign-in',
|
|
31
|
+
getParentRoute: () => rootRouteImport,
|
|
32
|
+
} as any)
|
|
33
|
+
const SignUpRoute = SignUpRouteImport.update({
|
|
34
|
+
id: '/sign-up',
|
|
35
|
+
path: '/sign-up',
|
|
36
|
+
getParentRoute: () => rootRouteImport,
|
|
37
|
+
} as any)
|
|
38
|
+
const ApiAuthSplatRoute = ApiAuthSplatRouteImport.update({
|
|
39
|
+
id: '/api/auth/$',
|
|
40
|
+
path: '/api/auth/$',
|
|
41
|
+
getParentRoute: () => rootRouteImport,
|
|
42
|
+
} as any)
|
|
43
|
+
|
|
44
|
+
export interface FileRoutesByFullPath {
|
|
45
|
+
'/': typeof IndexRoute
|
|
46
|
+
'/dashboard': typeof DashboardRoute
|
|
47
|
+
'/sign-in': typeof SignInRoute
|
|
48
|
+
'/sign-up': typeof SignUpRoute
|
|
49
|
+
'/api/auth/$': typeof ApiAuthSplatRoute
|
|
50
|
+
}
|
|
51
|
+
export interface FileRoutesByTo {
|
|
52
|
+
'/': typeof IndexRoute
|
|
53
|
+
'/dashboard': typeof DashboardRoute
|
|
54
|
+
'/sign-in': typeof SignInRoute
|
|
55
|
+
'/sign-up': typeof SignUpRoute
|
|
56
|
+
'/api/auth/$': typeof ApiAuthSplatRoute
|
|
57
|
+
}
|
|
58
|
+
export interface FileRoutesById {
|
|
59
|
+
__root__: typeof rootRouteImport
|
|
60
|
+
'/': typeof IndexRoute
|
|
61
|
+
'/dashboard': typeof DashboardRoute
|
|
62
|
+
'/sign-in': typeof SignInRoute
|
|
63
|
+
'/sign-up': typeof SignUpRoute
|
|
64
|
+
'/api/auth/$': typeof ApiAuthSplatRoute
|
|
65
|
+
}
|
|
66
|
+
export interface FileRouteTypes {
|
|
67
|
+
fileRoutesByFullPath: FileRoutesByFullPath
|
|
68
|
+
fullPaths: '/' | '/dashboard' | '/sign-in' | '/sign-up' | '/api/auth/$'
|
|
69
|
+
fileRoutesByTo: FileRoutesByTo
|
|
70
|
+
to: '/' | '/dashboard' | '/sign-in' | '/sign-up' | '/api/auth/$'
|
|
71
|
+
id: '__root__' | '/' | '/dashboard' | '/sign-in' | '/sign-up' | '/api/auth/$'
|
|
72
|
+
fileRoutesById: FileRoutesById
|
|
73
|
+
}
|
|
74
|
+
export interface RootRouteChildren {
|
|
75
|
+
IndexRoute: typeof IndexRoute
|
|
76
|
+
DashboardRoute: typeof DashboardRoute
|
|
77
|
+
SignInRoute: typeof SignInRoute
|
|
78
|
+
SignUpRoute: typeof SignUpRoute
|
|
79
|
+
ApiAuthSplatRoute: typeof ApiAuthSplatRoute
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
declare module '@tanstack/react-router' {
|
|
83
|
+
interface FileRoutesByPath {
|
|
84
|
+
'/': {
|
|
85
|
+
id: '/'
|
|
86
|
+
path: '/'
|
|
87
|
+
fullPath: '/'
|
|
88
|
+
preLoaderRoute: typeof IndexRouteImport
|
|
89
|
+
parentRoute: typeof rootRouteImport
|
|
90
|
+
}
|
|
91
|
+
'/dashboard': {
|
|
92
|
+
id: '/dashboard'
|
|
93
|
+
path: '/dashboard'
|
|
94
|
+
fullPath: '/dashboard'
|
|
95
|
+
preLoaderRoute: typeof DashboardRouteImport
|
|
96
|
+
parentRoute: typeof rootRouteImport
|
|
97
|
+
}
|
|
98
|
+
'/sign-in': {
|
|
99
|
+
id: '/sign-in'
|
|
100
|
+
path: '/sign-in'
|
|
101
|
+
fullPath: '/sign-in'
|
|
102
|
+
preLoaderRoute: typeof SignInRouteImport
|
|
103
|
+
parentRoute: typeof rootRouteImport
|
|
104
|
+
}
|
|
105
|
+
'/sign-up': {
|
|
106
|
+
id: '/sign-up'
|
|
107
|
+
path: '/sign-up'
|
|
108
|
+
fullPath: '/sign-up'
|
|
109
|
+
preLoaderRoute: typeof SignUpRouteImport
|
|
110
|
+
parentRoute: typeof rootRouteImport
|
|
111
|
+
}
|
|
112
|
+
'/api/auth/$': {
|
|
113
|
+
id: '/api/auth/$'
|
|
114
|
+
path: '/api/auth/$'
|
|
115
|
+
fullPath: '/api/auth/$'
|
|
116
|
+
preLoaderRoute: typeof ApiAuthSplatRouteImport
|
|
117
|
+
parentRoute: typeof rootRouteImport
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const rootRouteChildren: RootRouteChildren = {
|
|
123
|
+
IndexRoute: IndexRoute,
|
|
124
|
+
DashboardRoute: DashboardRoute,
|
|
125
|
+
SignInRoute: SignInRoute,
|
|
126
|
+
SignUpRoute: SignUpRoute,
|
|
127
|
+
ApiAuthSplatRoute: ApiAuthSplatRoute,
|
|
128
|
+
}
|
|
129
|
+
export const routeTree = rootRouteImport
|
|
130
|
+
._addFileChildren(rootRouteChildren)
|
|
131
|
+
._addFileTypes<FileRouteTypes>()
|
|
132
|
+
|
|
133
|
+
import type { getRouter } from './router.tsx'
|
|
134
|
+
import type { createStart } from '@tanstack/react-start'
|
|
135
|
+
declare module '@tanstack/react-start' {
|
|
136
|
+
interface Register {
|
|
137
|
+
ssr: true
|
|
138
|
+
router: Awaited<ReturnType<typeof getRouter>>
|
|
139
|
+
}
|
|
140
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
node_modules
|
|
2
|
-
npm-debug.log
|
|
3
|
-
.env*
|
|
4
|
-
.git
|
|
5
|
-
.gitignore
|
|
6
|
-
README.md
|
|
7
|
-
.vscode
|
|
8
|
-
.idea
|
|
9
|
-
dist
|
|
10
|
-
coverage
|
|
11
|
-
.DS_Store
|
|
12
|
-
*.log
|
|
13
|
-
|
|
14
|
-
.next
|
|
1
|
+
node_modules
|
|
2
|
+
npm-debug.log
|
|
3
|
+
.env*
|
|
4
|
+
.git
|
|
5
|
+
.gitignore
|
|
6
|
+
README.md
|
|
7
|
+
.vscode
|
|
8
|
+
.idea
|
|
9
|
+
dist
|
|
10
|
+
coverage
|
|
11
|
+
.DS_Store
|
|
12
|
+
*.log
|
|
13
|
+
|
|
14
|
+
.next
|
|
@@ -53,7 +53,6 @@ RUN if [ -f package-lock.json ]; then npm ci; else npm install; fi
|
|
|
53
53
|
|
|
54
54
|
COPY . .
|
|
55
55
|
|
|
56
|
-
# Only build if package.json has a build script
|
|
57
56
|
{{#if (eq database 'prisma')}}
|
|
58
57
|
RUN DATABASE_URL="postgresql://postgres:postgres@localhost:5432/postgres" npm run build
|
|
59
58
|
{{else if (eq database 'mongoose')}}
|
|
@@ -100,7 +99,6 @@ RUN if [ -f package-lock.json ]; then npm ci; else npm install; fi
|
|
|
100
99
|
|
|
101
100
|
COPY . .
|
|
102
101
|
|
|
103
|
-
# Only build if package.json has a build script
|
|
104
102
|
{{#if (eq database 'prisma')}}
|
|
105
103
|
RUN DATABASE_URL="postgresql://postgres:postgres@localhost:5432/postgres" npm run build
|
|
106
104
|
{{else if (eq database 'mongoose')}}
|
|
@@ -123,7 +121,7 @@ COPY package*.json ./
|
|
|
123
121
|
RUN if [ -f package-lock.json ]; then npm ci --omit=dev; else npm install --omit=dev; fi \
|
|
124
122
|
&& npm cache clean --force
|
|
125
123
|
|
|
126
|
-
# Copy
|
|
124
|
+
# Copy the compiled output
|
|
127
125
|
COPY --from=builder --chown=appuser:nodejs /app/dist ./dist
|
|
128
126
|
|
|
129
127
|
USER appuser
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
services:
|
|
2
|
-
{{projectName}}:
|
|
3
|
-
build: .
|
|
4
|
-
ports:
|
|
5
|
-
- "{{port}}:{{port}}"
|
|
6
|
-
env_file:
|
|
7
|
-
- .env
|
|
8
|
-
environment:
|
|
9
|
-
- NODE_ENV=production
|
|
1
|
+
services:
|
|
2
|
+
{{projectName}}:
|
|
3
|
+
build: .
|
|
4
|
+
ports:
|
|
5
|
+
- "{{port}}:{{port}}"
|
|
6
|
+
env_file:
|
|
7
|
+
- .env
|
|
8
|
+
environment:
|
|
9
|
+
- NODE_ENV=production
|
|
10
10
|
restart: unless-stopped
|
|
@@ -18,9 +18,8 @@
|
|
|
18
18
|
"db:studio": "drizzle-kit studio"
|
|
19
19
|
},
|
|
20
20
|
"envVars": {
|
|
21
|
-
"DATABASE_URL": "postgresql://
|
|
21
|
+
"DATABASE_URL": "postgresql://postgres:postgres@localhost:5432/postgres"
|
|
22
22
|
},
|
|
23
|
-
"templateFiles": [],
|
|
24
23
|
"overrides": {
|
|
25
24
|
"esbuild": "^0.28.2"
|
|
26
25
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { config } from "dotenv";
|
|
2
|
-
import { defineConfig } from "drizzle-kit";
|
|
3
|
-
|
|
4
|
-
config({ path: ".env" });
|
|
5
|
-
|
|
6
|
-
export default defineConfig({
|
|
7
|
-
schema: "./src/lib/schema.ts",
|
|
8
|
-
out: "./migrations",
|
|
9
|
-
dialect: "postgresql",
|
|
10
|
-
dbCredentials: {
|
|
11
|
-
url: process.env.DATABASE_URL!,
|
|
12
|
-
},
|
|
13
|
-
});
|
|
1
|
+
import { config } from "dotenv";
|
|
2
|
+
import { defineConfig } from "drizzle-kit";
|
|
3
|
+
|
|
4
|
+
config({ path: ".env" });
|
|
5
|
+
|
|
6
|
+
export default defineConfig({
|
|
7
|
+
schema: "./src/lib/schema.ts",
|
|
8
|
+
out: "./migrations",
|
|
9
|
+
dialect: "postgresql",
|
|
10
|
+
dbCredentials: {
|
|
11
|
+
url: process.env.DATABASE_URL!,
|
|
12
|
+
},
|
|
13
|
+
});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { config } from "dotenv";
|
|
2
|
-
import { drizzle } from "drizzle-orm/node-postgres";
|
|
3
|
-
import { Pool } from "pg";
|
|
4
|
-
|
|
5
|
-
import * as schema from "./schema";
|
|
6
|
-
|
|
7
|
-
config({ path: ".env" }); // or .env.local
|
|
8
|
-
|
|
9
|
-
const pool = new Pool({
|
|
10
|
-
connectionString: process.env.DATABASE_URL,
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
export const db = drizzle(pool, { schema });
|
|
1
|
+
import { config } from "dotenv";
|
|
2
|
+
import { drizzle } from "drizzle-orm/node-postgres";
|
|
3
|
+
import { Pool } from "pg";
|
|
4
|
+
|
|
5
|
+
import * as schema from "./schema";
|
|
6
|
+
|
|
7
|
+
config({ path: ".env" }); // or .env.local
|
|
8
|
+
|
|
9
|
+
const pool = new Pool({
|
|
10
|
+
connectionString: process.env.DATABASE_URL,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export const db = drizzle(pool, { schema });
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { pgTable, text, timestamp, uuid } from "drizzle-orm/pg-core";
|
|
2
|
-
|
|
3
|
-
export const users = pgTable("users", {
|
|
4
|
-
id: uuid("id").primaryKey().defaultRandom(),
|
|
5
|
-
email: text("email").notNull().unique(),
|
|
6
|
-
name: text("name"),
|
|
7
|
-
password: text("password").notNull(),
|
|
8
|
-
createdAt: timestamp("created_at", { withTimezone: true }).defaultNow(),
|
|
9
|
-
updatedAt: timestamp("updated_at", { withTimezone: true }).defaultNow(),
|
|
10
|
-
});
|
|
1
|
+
import { pgTable, text, timestamp, uuid } from "drizzle-orm/pg-core";
|
|
2
|
+
|
|
3
|
+
export const users = pgTable("users", {
|
|
4
|
+
id: uuid("id").primaryKey().defaultRandom(),
|
|
5
|
+
email: text("email").notNull().unique(),
|
|
6
|
+
name: text("name"),
|
|
7
|
+
password: text("password").notNull(),
|
|
8
|
+
createdAt: timestamp("created_at", { withTimezone: true }).defaultNow(),
|
|
9
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).defaultNow(),
|
|
10
|
+
});
|
|
@@ -18,9 +18,8 @@
|
|
|
18
18
|
"db:studio": "drizzle-kit studio"
|
|
19
19
|
},
|
|
20
20
|
"envVars": {
|
|
21
|
-
"DATABASE_URL": "postgresql://
|
|
21
|
+
"DATABASE_URL": "postgresql://postgres:postgres@localhost:5432/postgres"
|
|
22
22
|
},
|
|
23
|
-
"templateFiles": [],
|
|
24
23
|
"overrides": {
|
|
25
24
|
"esbuild": "^0.28.2"
|
|
26
25
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { config } from "dotenv";
|
|
2
|
-
import { defineConfig } from "drizzle-kit";
|
|
3
|
-
|
|
4
|
-
config({ path: ".env" });
|
|
5
|
-
|
|
6
|
-
export default defineConfig({
|
|
7
|
-
schema: "./src/database/schema.ts",
|
|
8
|
-
out: "./migrations",
|
|
9
|
-
dialect: "postgresql",
|
|
10
|
-
dbCredentials: {
|
|
11
|
-
url: process.env.DATABASE_URL!,
|
|
12
|
-
},
|
|
13
|
-
});
|
|
1
|
+
import { config } from "dotenv";
|
|
2
|
+
import { defineConfig } from "drizzle-kit";
|
|
3
|
+
|
|
4
|
+
config({ path: ".env" });
|
|
5
|
+
|
|
6
|
+
export default defineConfig({
|
|
7
|
+
schema: "./src/database/schema.ts",
|
|
8
|
+
out: "./migrations",
|
|
9
|
+
dialect: "postgresql",
|
|
10
|
+
dbCredentials: {
|
|
11
|
+
url: process.env.DATABASE_URL!,
|
|
12
|
+
},
|
|
13
|
+
});
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { Global, Inject, Module, type OnModuleDestroy } from "@nestjs/common";
|
|
2
|
-
import { drizzle, type NodePgDatabase } from "drizzle-orm/node-postgres";
|
|
3
|
-
import type { Pool } from "pg";
|
|
4
|
-
|
|
5
|
-
import * as schema from "./schema.js";
|
|
6
|
-
|
|
7
|
-
// Injection token for the Drizzle client: @Inject(DRIZZLE) private readonly db: Database
|
|
8
|
-
export const DRIZZLE = Symbol("DRIZZLE");
|
|
9
|
-
|
|
10
|
-
// $client is the connection pool that drizzle() creates from the URL
|
|
11
|
-
export type Database = NodePgDatabase<typeof schema> & { $client: Pool };
|
|
12
|
-
|
|
13
|
-
// Global so any module can inject the client without importing this one
|
|
14
|
-
@Global()
|
|
15
|
-
@Module({
|
|
16
|
-
providers: [
|
|
17
|
-
{
|
|
18
|
-
provide: DRIZZLE,
|
|
19
|
-
useFactory: () => drizzle(process.env.DATABASE_URL!, { schema }),
|
|
20
|
-
},
|
|
21
|
-
],
|
|
22
|
-
exports: [DRIZZLE],
|
|
23
|
-
})
|
|
24
|
-
export class DatabaseModule implements OnModuleDestroy {
|
|
25
|
-
constructor(@Inject(DRIZZLE) private readonly db: Database) {}
|
|
26
|
-
|
|
27
|
-
async onModuleDestroy(): Promise<void> {
|
|
28
|
-
await this.db.$client.end();
|
|
29
|
-
}
|
|
30
|
-
}
|
|
1
|
+
import { Global, Inject, Module, type OnModuleDestroy } from "@nestjs/common";
|
|
2
|
+
import { drizzle, type NodePgDatabase } from "drizzle-orm/node-postgres";
|
|
3
|
+
import type { Pool } from "pg";
|
|
4
|
+
|
|
5
|
+
import * as schema from "./schema.js";
|
|
6
|
+
|
|
7
|
+
// Injection token for the Drizzle client: @Inject(DRIZZLE) private readonly db: Database
|
|
8
|
+
export const DRIZZLE = Symbol("DRIZZLE");
|
|
9
|
+
|
|
10
|
+
// $client is the connection pool that drizzle() creates from the URL
|
|
11
|
+
export type Database = NodePgDatabase<typeof schema> & { $client: Pool };
|
|
12
|
+
|
|
13
|
+
// Global so any module can inject the client without importing this one
|
|
14
|
+
@Global()
|
|
15
|
+
@Module({
|
|
16
|
+
providers: [
|
|
17
|
+
{
|
|
18
|
+
provide: DRIZZLE,
|
|
19
|
+
useFactory: () => drizzle(process.env.DATABASE_URL!, { schema }),
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
exports: [DRIZZLE],
|
|
23
|
+
})
|
|
24
|
+
export class DatabaseModule implements OnModuleDestroy {
|
|
25
|
+
constructor(@Inject(DRIZZLE) private readonly db: Database) {}
|
|
26
|
+
|
|
27
|
+
async onModuleDestroy(): Promise<void> {
|
|
28
|
+
await this.db.$client.end();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { pgTable, text, timestamp, uuid } from "drizzle-orm/pg-core";
|
|
2
|
-
|
|
3
|
-
export const users = pgTable("users", {
|
|
4
|
-
id: uuid("id").primaryKey().defaultRandom(),
|
|
5
|
-
email: text("email").notNull().unique(),
|
|
6
|
-
name: text("name"),
|
|
7
|
-
password: text("password").notNull(),
|
|
8
|
-
createdAt: timestamp("created_at", { withTimezone: true }).defaultNow(),
|
|
9
|
-
updatedAt: timestamp("updated_at", { withTimezone: true }).defaultNow(),
|
|
10
|
-
});
|
|
1
|
+
import { pgTable, text, timestamp, uuid } from "drizzle-orm/pg-core";
|
|
2
|
+
|
|
3
|
+
export const users = pgTable("users", {
|
|
4
|
+
id: uuid("id").primaryKey().defaultRandom(),
|
|
5
|
+
email: text("email").notNull().unique(),
|
|
6
|
+
name: text("name"),
|
|
7
|
+
password: text("password").notNull(),
|
|
8
|
+
createdAt: timestamp("created_at", { withTimezone: true }).defaultNow(),
|
|
9
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).defaultNow(),
|
|
10
|
+
});
|
|
@@ -18,11 +18,8 @@
|
|
|
18
18
|
"db:studio": "drizzle-kit studio"
|
|
19
19
|
},
|
|
20
20
|
"envVars": {
|
|
21
|
-
"DATABASE_URL": "postgresql://
|
|
21
|
+
"DATABASE_URL": "postgresql://postgres:postgres@localhost:5432/postgres"
|
|
22
22
|
},
|
|
23
|
-
"templateFiles": [
|
|
24
|
-
"lib/schema.ts.hbs"
|
|
25
|
-
],
|
|
26
23
|
"overrides": {
|
|
27
24
|
"esbuild": "^0.28.2"
|
|
28
25
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { config } from "dotenv";
|
|
2
|
-
import { drizzle } from "drizzle-orm/node-postgres";
|
|
3
|
-
import { Pool } from "pg";
|
|
4
|
-
|
|
5
|
-
import * as schema from "./schema";
|
|
6
|
-
|
|
7
|
-
config({ path: ".env" }); // or .env.local
|
|
8
|
-
|
|
9
|
-
const pool = new Pool({
|
|
10
|
-
connectionString: process.env.DATABASE_URL,
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
export const db = drizzle(pool, { schema });
|
|
1
|
+
import { config } from "dotenv";
|
|
2
|
+
import { drizzle } from "drizzle-orm/node-postgres";
|
|
3
|
+
import { Pool } from "pg";
|
|
4
|
+
|
|
5
|
+
import * as schema from "./schema";
|
|
6
|
+
|
|
7
|
+
config({ path: ".env" }); // or .env.local
|
|
8
|
+
|
|
9
|
+
const pool = new Pool({
|
|
10
|
+
connectionString: process.env.DATABASE_URL,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export const db = drizzle(pool, { schema });
|