better-ts-stack 2.1.0 → 2.1.2
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 -21
- package/dist/args.js +9 -0
- package/dist/builder/configGenerator.js +3 -1
- package/dist/builder/moduleSelector.js +8 -1
- package/dist/builder/readmeGenerator.js +12 -0
- package/dist/builder/templateContext.js +24 -0
- package/dist/output/nextSteps.js +4 -0
- package/dist/prompts/index.js +3 -1
- package/dist/prompts/stack.js +9 -0
- package/dist/types/index.js +3 -0
- package/dist/ui/messages.js +3 -0
- package/package.json +71 -71
- package/templates/backend/express/.prettierignore +52 -52
- package/templates/backend/express/.prettierrc +16 -16
- package/templates/backend/express/config.json +8 -8
- package/templates/backend/express/gitignore +6 -1
- package/templates/backend/express/tsconfig.eslint.json +9 -9
- package/templates/backend/nestjs/.prettierignore +52 -52
- package/templates/backend/nestjs/config.json +10 -10
- package/templates/backend/nestjs/gitignore +6 -1
- package/templates/backend/nestjs/src/app.module.ts.hbs +1 -1
- package/templates/backend/nestjs/src/health/{health.controller.ts → health.controller.ts.hbs} +8 -0
- package/templates/backend/nestjs/tsconfig.eslint.json +9 -9
- package/templates/frontend/nextjs/app/globals.css +89 -89
- package/templates/frontend/nextjs/app/layout.tsx +34 -34
- package/templates/frontend/nextjs/components/ui/button.tsx +51 -51
- package/templates/frontend/nextjs/components/ui/card.tsx +60 -60
- package/templates/frontend/nextjs/components/ui/field.tsx +67 -67
- package/templates/frontend/nextjs/components/ui/input.tsx +18 -18
- package/templates/frontend/nextjs/config.json +35 -37
- package/templates/frontend/nextjs/eslint.config.mjs +11 -11
- package/templates/frontend/nextjs/gitignore +3 -0
- package/templates/frontend/nextjs/next.config.ts.hbs +12 -12
- package/templates/frontend/nextjs/postcss.config.mjs +7 -7
- package/templates/frontend/nextjs/public/file.svg +1 -1
- package/templates/frontend/nextjs/public/globe.svg +1 -1
- package/templates/frontend/nextjs/public/window.svg +1 -1
- package/templates/frontend/tanstack/components.json +18 -18
- package/templates/frontend/tanstack/config.json +15 -15
- package/templates/frontend/tanstack/eslint.config.mjs +23 -23
- package/templates/frontend/tanstack/gitignore +42 -39
- package/templates/frontend/tanstack/public/favicon.svg +7 -7
- package/templates/frontend/tanstack/src/components/ui/button.tsx +51 -51
- package/templates/frontend/tanstack/src/components/ui/card.tsx +60 -60
- package/templates/frontend/tanstack/src/components/ui/field.tsx +67 -67
- package/templates/frontend/tanstack/src/components/ui/input.tsx +18 -18
- package/templates/frontend/tanstack/src/lib/utils.ts +6 -6
- package/templates/frontend/tanstack/src/router.tsx +31 -31
- package/templates/frontend/tanstack/src/routes/__root.tsx +69 -69
- package/templates/frontend/tanstack/tsconfig.json +22 -22
- package/templates/frontend/tanstack/vite.config.ts +5 -4
- package/templates/modules/agents/AGENTS.md.hbs +237 -0
- package/templates/modules/agents/CLAUDE.md +1 -0
- package/templates/modules/agents/config.json +10 -0
- package/templates/modules/auth/express/config.json +1 -1
- package/templates/modules/auth/express/src/lib/jwt.ts.hbs +27 -27
- package/templates/modules/auth/express/src/middleware/requireAuth.ts.hbs +1 -2
- package/templates/modules/auth/nestjs/config.json +1 -1
- package/templates/modules/auth/nextjs/app/api/auth/[...all]/route.ts +4 -4
- package/templates/modules/auth/nextjs/config.json +18 -18
- package/templates/modules/auth/nextjs/lib/auth-client.ts +3 -3
- package/templates/{frontend/nextjs/proxy.ts.hbs → modules/auth/nextjs/proxy.ts} +1 -8
- package/templates/modules/auth/tanstack/config.json +18 -18
- package/templates/modules/auth/tanstack/src/lib/auth-client.ts +2 -2
- package/templates/modules/auth/tanstack/src/lib/auth-functions.ts +8 -8
- package/templates/modules/auth/tanstack/src/lib/auth.ts.hbs +37 -37
- package/templates/modules/auth/tanstack/src/routes/api/auth/$.ts +15 -15
- package/templates/modules/auth/tanstack/src/routes/dashboard.tsx +110 -110
- package/templates/modules/auth/tanstack/src/routes/sign-in.tsx +36 -36
- package/templates/modules/auth/tanstack/src/routes/sign-up.tsx +36 -36
- package/templates/modules/ci/.github/workflows/ci.yml.hbs +43 -0
- package/templates/modules/ci/config.json +10 -0
- package/templates/modules/docker/.dockerignore +3 -0
- package/templates/modules/docker/config.json +15 -15
- package/templates/modules/docker/docker-compose.yml.hbs +1 -1
- package/templates/modules/drizzle/express/config.json +26 -26
- package/templates/modules/drizzle/nestjs/config.json +26 -26
- package/templates/modules/drizzle/nextjs/config.json +26 -26
- package/templates/modules/drizzle/nextjs/drizzle.config.ts +13 -13
- package/templates/modules/drizzle/tanstack/config.json +26 -26
- package/templates/modules/drizzle/tanstack/drizzle.config.ts +12 -12
- package/templates/modules/drizzle/tanstack/src/lib/db.ts +13 -13
- package/templates/modules/mongoose/express/config.json +15 -15
- package/templates/modules/mongoose/express/src/lib/db.ts +43 -43
- package/templates/modules/mongoose/express/src/models/User.ts +48 -48
- package/templates/modules/mongoose/nestjs/config.json +15 -15
- package/templates/modules/mongoose/nextjs/config.json +15 -15
- package/templates/modules/mongoose/nextjs/models/User.ts +48 -48
- package/templates/modules/mongoose/tanstack/config.json +16 -16
- package/templates/modules/mongoose/tanstack/src/models/User.ts +48 -48
- package/templates/modules/prisma/express/config.json +27 -27
- package/templates/modules/prisma/express/prisma/schema.prisma +23 -23
- package/templates/modules/prisma/express/prisma.config.ts +4 -2
- package/templates/modules/prisma/nestjs/config.json +27 -27
- package/templates/modules/prisma/nestjs/prisma.config.ts +4 -2
- package/templates/modules/prisma/nextjs/config.json +28 -28
- package/templates/modules/prisma/nextjs/lib/prisma.ts +18 -18
- package/templates/modules/prisma/nextjs/prisma.config.ts +14 -12
- package/templates/modules/prisma/tanstack/config.json +28 -28
- package/templates/modules/prisma/tanstack/prisma/schema.prisma.hbs +91 -91
- package/templates/modules/prisma/tanstack/prisma.config.ts +14 -12
- package/templates/modules/prisma/tanstack/src/lib/prisma.ts +17 -17
- package/templates/modules/rate-limit/express/config.json +1 -1
- package/templates/modules/rate-limit/express/src/middleware/rateLimit.ts +3 -1
- package/templates/modules/vscode/.vscode/extensions.json.hbs +29 -0
- package/templates/modules/vscode/.vscode/settings.json.hbs +22 -0
- package/templates/modules/vscode/config.json +10 -0
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
import { createFileRoute, redirect } from "@tanstack/react-router";
|
|
2
|
-
import { Link } from "@tanstack/react-router";
|
|
3
|
-
import { ArrowRight, ShieldCheck } from "lucide-react";
|
|
4
|
-
|
|
5
|
-
import { SignOutButton } from "~/components/auth/sign-out-button";
|
|
6
|
-
import { buttonVariants } from "~/components/ui/button";
|
|
7
|
-
import {
|
|
8
|
-
Card,
|
|
9
|
-
CardContent,
|
|
10
|
-
CardDescription,
|
|
11
|
-
CardHeader,
|
|
12
|
-
CardTitle,
|
|
13
|
-
} from "~/components/ui/card";
|
|
14
|
-
import { getSession } from "~/lib/auth-functions";
|
|
15
|
-
import { cn } from "~/lib/utils";
|
|
16
|
-
|
|
17
|
-
export const Route = createFileRoute("/dashboard")({
|
|
18
|
-
beforeLoad: async () => {
|
|
19
|
-
const session = await getSession();
|
|
20
|
-
|
|
21
|
-
if (!session) {
|
|
22
|
-
throw redirect({ to: "/sign-in" });
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return { user: session.user };
|
|
26
|
-
},
|
|
27
|
-
component: Dashboard,
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
function Dashboard() {
|
|
31
|
-
const user = Route.useRouteContext({ select: (ctx) => ctx.user });
|
|
32
|
-
|
|
33
|
-
return (
|
|
34
|
-
<main className="min-h-screen bg-[linear-gradient(180deg,_#f8fafc_0%,_#eef2ff_100%)] px-6 py-16 sm:px-10">
|
|
35
|
-
<div className="mx-auto max-w-5xl space-y-8">
|
|
36
|
-
<header className="flex flex-col gap-6 rounded-[2rem] border border-white/70 bg-white/85 p-8 shadow-xl shadow-slate-200/60 backdrop-blur md:flex-row md:items-end md:justify-between">
|
|
37
|
-
<div className="space-y-3">
|
|
38
|
-
<span className="inline-flex items-center gap-2 rounded-full bg-emerald-50 px-3 py-1 text-xs font-medium uppercase tracking-[0.24em] text-emerald-700">
|
|
39
|
-
<ShieldCheck className="size-4" />
|
|
40
|
-
Authenticated session
|
|
41
|
-
</span>
|
|
42
|
-
<div className="space-y-1">
|
|
43
|
-
<h1 className="text-3xl font-semibold tracking-tight text-slate-950">
|
|
44
|
-
Welcome {user.name}
|
|
45
|
-
</h1>
|
|
46
|
-
<p className="text-sm text-slate-600">{user.email}</p>
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
<SignOutButton />
|
|
50
|
-
</header>
|
|
51
|
-
|
|
52
|
-
<section className="grid gap-5 md:grid-cols-2">
|
|
53
|
-
<Card>
|
|
54
|
-
<CardHeader>
|
|
55
|
-
<CardTitle>Protected route example</CardTitle>
|
|
56
|
-
<CardDescription>
|
|
57
|
-
This page verifies the session on the server before rendering any
|
|
58
|
-
content.
|
|
59
|
-
</CardDescription>
|
|
60
|
-
</CardHeader>
|
|
61
|
-
<CardContent className="space-y-4 text-sm text-slate-600">
|
|
62
|
-
<p>
|
|
63
|
-
The route guard calls{" "}
|
|
64
|
-
<code className="font-mono text-slate-900">getSession()</code> in
|
|
65
|
-
<code className="font-mono text-slate-900"> beforeLoad</code>,
|
|
66
|
-
which reads the cookie headers server-side via{" "}
|
|
67
|
-
<code className="font-mono text-slate-900">
|
|
68
|
-
auth.api.getSession
|
|
69
|
-
</code>{" "}
|
|
70
|
-
on every render and navigation.
|
|
71
|
-
</p>
|
|
72
|
-
<p>
|
|
73
|
-
That keeps route protection aligned with Better Auth's
|
|
74
|
-
TanStack Start guidance while staying easy to extend.
|
|
75
|
-
</p>
|
|
76
|
-
</CardContent>
|
|
77
|
-
</Card>
|
|
78
|
-
|
|
79
|
-
<Card>
|
|
80
|
-
<CardHeader>
|
|
81
|
-
<CardTitle>Suggested next steps</CardTitle>
|
|
82
|
-
<CardDescription>
|
|
83
|
-
Keep the generated auth flow, then customize the app around your
|
|
84
|
-
product.
|
|
85
|
-
</CardDescription>
|
|
86
|
-
</CardHeader>
|
|
87
|
-
<CardContent className="space-y-3 text-sm text-slate-600">
|
|
88
|
-
<p>
|
|
89
|
-
Replace the demo dashboard with your first authenticated page.
|
|
90
|
-
</p>
|
|
91
|
-
<p>Extend the schema with profile or onboarding fields.</p>
|
|
92
|
-
<p>
|
|
93
|
-
Add provider-based auth or email verification later if needed.
|
|
94
|
-
</p>
|
|
95
|
-
<Link
|
|
96
|
-
to="/"
|
|
97
|
-
className={cn(
|
|
98
|
-
buttonVariants({ variant: "outline" }),
|
|
99
|
-
"w-fit gap-2"
|
|
100
|
-
)}
|
|
101
|
-
>
|
|
102
|
-
Back to home
|
|
103
|
-
<ArrowRight className="size-4" />
|
|
104
|
-
</Link>
|
|
105
|
-
</CardContent>
|
|
106
|
-
</Card>
|
|
107
|
-
</section>
|
|
108
|
-
</div>
|
|
109
|
-
</main>
|
|
110
|
-
);
|
|
1
|
+
import { createFileRoute, redirect } from "@tanstack/react-router";
|
|
2
|
+
import { Link } from "@tanstack/react-router";
|
|
3
|
+
import { ArrowRight, ShieldCheck } from "lucide-react";
|
|
4
|
+
|
|
5
|
+
import { SignOutButton } from "~/components/auth/sign-out-button";
|
|
6
|
+
import { buttonVariants } from "~/components/ui/button";
|
|
7
|
+
import {
|
|
8
|
+
Card,
|
|
9
|
+
CardContent,
|
|
10
|
+
CardDescription,
|
|
11
|
+
CardHeader,
|
|
12
|
+
CardTitle,
|
|
13
|
+
} from "~/components/ui/card";
|
|
14
|
+
import { getSession } from "~/lib/auth-functions";
|
|
15
|
+
import { cn } from "~/lib/utils";
|
|
16
|
+
|
|
17
|
+
export const Route = createFileRoute("/dashboard")({
|
|
18
|
+
beforeLoad: async () => {
|
|
19
|
+
const session = await getSession();
|
|
20
|
+
|
|
21
|
+
if (!session) {
|
|
22
|
+
throw redirect({ to: "/sign-in" });
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return { user: session.user };
|
|
26
|
+
},
|
|
27
|
+
component: Dashboard,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
function Dashboard() {
|
|
31
|
+
const user = Route.useRouteContext({ select: (ctx) => ctx.user });
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<main className="min-h-screen bg-[linear-gradient(180deg,_#f8fafc_0%,_#eef2ff_100%)] px-6 py-16 sm:px-10">
|
|
35
|
+
<div className="mx-auto max-w-5xl space-y-8">
|
|
36
|
+
<header className="flex flex-col gap-6 rounded-[2rem] border border-white/70 bg-white/85 p-8 shadow-xl shadow-slate-200/60 backdrop-blur md:flex-row md:items-end md:justify-between">
|
|
37
|
+
<div className="space-y-3">
|
|
38
|
+
<span className="inline-flex items-center gap-2 rounded-full bg-emerald-50 px-3 py-1 text-xs font-medium uppercase tracking-[0.24em] text-emerald-700">
|
|
39
|
+
<ShieldCheck className="size-4" />
|
|
40
|
+
Authenticated session
|
|
41
|
+
</span>
|
|
42
|
+
<div className="space-y-1">
|
|
43
|
+
<h1 className="text-3xl font-semibold tracking-tight text-slate-950">
|
|
44
|
+
Welcome {user.name}
|
|
45
|
+
</h1>
|
|
46
|
+
<p className="text-sm text-slate-600">{user.email}</p>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
<SignOutButton />
|
|
50
|
+
</header>
|
|
51
|
+
|
|
52
|
+
<section className="grid gap-5 md:grid-cols-2">
|
|
53
|
+
<Card>
|
|
54
|
+
<CardHeader>
|
|
55
|
+
<CardTitle>Protected route example</CardTitle>
|
|
56
|
+
<CardDescription>
|
|
57
|
+
This page verifies the session on the server before rendering any
|
|
58
|
+
content.
|
|
59
|
+
</CardDescription>
|
|
60
|
+
</CardHeader>
|
|
61
|
+
<CardContent className="space-y-4 text-sm text-slate-600">
|
|
62
|
+
<p>
|
|
63
|
+
The route guard calls{" "}
|
|
64
|
+
<code className="font-mono text-slate-900">getSession()</code> in
|
|
65
|
+
<code className="font-mono text-slate-900"> beforeLoad</code>,
|
|
66
|
+
which reads the cookie headers server-side via{" "}
|
|
67
|
+
<code className="font-mono text-slate-900">
|
|
68
|
+
auth.api.getSession
|
|
69
|
+
</code>{" "}
|
|
70
|
+
on every render and navigation.
|
|
71
|
+
</p>
|
|
72
|
+
<p>
|
|
73
|
+
That keeps route protection aligned with Better Auth's
|
|
74
|
+
TanStack Start guidance while staying easy to extend.
|
|
75
|
+
</p>
|
|
76
|
+
</CardContent>
|
|
77
|
+
</Card>
|
|
78
|
+
|
|
79
|
+
<Card>
|
|
80
|
+
<CardHeader>
|
|
81
|
+
<CardTitle>Suggested next steps</CardTitle>
|
|
82
|
+
<CardDescription>
|
|
83
|
+
Keep the generated auth flow, then customize the app around your
|
|
84
|
+
product.
|
|
85
|
+
</CardDescription>
|
|
86
|
+
</CardHeader>
|
|
87
|
+
<CardContent className="space-y-3 text-sm text-slate-600">
|
|
88
|
+
<p>
|
|
89
|
+
Replace the demo dashboard with your first authenticated page.
|
|
90
|
+
</p>
|
|
91
|
+
<p>Extend the schema with profile or onboarding fields.</p>
|
|
92
|
+
<p>
|
|
93
|
+
Add provider-based auth or email verification later if needed.
|
|
94
|
+
</p>
|
|
95
|
+
<Link
|
|
96
|
+
to="/"
|
|
97
|
+
className={cn(
|
|
98
|
+
buttonVariants({ variant: "outline" }),
|
|
99
|
+
"w-fit gap-2"
|
|
100
|
+
)}
|
|
101
|
+
>
|
|
102
|
+
Back to home
|
|
103
|
+
<ArrowRight className="size-4" />
|
|
104
|
+
</Link>
|
|
105
|
+
</CardContent>
|
|
106
|
+
</Card>
|
|
107
|
+
</section>
|
|
108
|
+
</div>
|
|
109
|
+
</main>
|
|
110
|
+
);
|
|
111
111
|
}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { createFileRoute, redirect } from "@tanstack/react-router";
|
|
2
|
-
|
|
3
|
-
import { SignInForm } from "~/components/auth/sign-in-form";
|
|
4
|
-
import { getSession } from "~/lib/auth-functions";
|
|
5
|
-
|
|
6
|
-
export const Route = createFileRoute("/sign-in")({
|
|
7
|
-
beforeLoad: async () => {
|
|
8
|
-
const session = await getSession();
|
|
9
|
-
|
|
10
|
-
if (session) {
|
|
11
|
-
throw redirect({ to: "/dashboard" });
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
component: SignInPage,
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
function SignInPage() {
|
|
18
|
-
return (
|
|
19
|
-
<main className="min-h-screen bg-[radial-gradient(circle_at_top,_rgba(14,165,233,0.16),_transparent_30%),linear-gradient(180deg,_#f8fafc_0%,_#eef2ff_100%)] px-6 py-16 sm:px-10">
|
|
20
|
-
<div className="mx-auto flex min-h-[calc(100vh-8rem)] max-w-5xl items-center gap-12 lg:grid lg:grid-cols-[0.9fr_1.1fr]">
|
|
21
|
-
<section className="hidden space-y-5 lg:block">
|
|
22
|
-
<span className="inline-flex rounded-full border border-sky-200 bg-white/80 px-3 py-1 text-xs font-medium uppercase tracking-[0.24em] text-sky-700">
|
|
23
|
-
Better Auth
|
|
24
|
-
</span>
|
|
25
|
-
<h1 className="text-4xl font-semibold tracking-tight text-slate-950">
|
|
26
|
-
Welcome back.
|
|
27
|
-
</h1>
|
|
28
|
-
<p className="max-w-md text-base leading-7 text-slate-600">
|
|
29
|
-
This generated starter includes protected routes, session-aware page
|
|
30
|
-
guards, and reusable auth form primitives you can extend from here.
|
|
31
|
-
</p>
|
|
32
|
-
</section>
|
|
33
|
-
<SignInForm />
|
|
34
|
-
</div>
|
|
35
|
-
</main>
|
|
36
|
-
);
|
|
1
|
+
import { createFileRoute, redirect } from "@tanstack/react-router";
|
|
2
|
+
|
|
3
|
+
import { SignInForm } from "~/components/auth/sign-in-form";
|
|
4
|
+
import { getSession } from "~/lib/auth-functions";
|
|
5
|
+
|
|
6
|
+
export const Route = createFileRoute("/sign-in")({
|
|
7
|
+
beforeLoad: async () => {
|
|
8
|
+
const session = await getSession();
|
|
9
|
+
|
|
10
|
+
if (session) {
|
|
11
|
+
throw redirect({ to: "/dashboard" });
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
component: SignInPage,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
function SignInPage() {
|
|
18
|
+
return (
|
|
19
|
+
<main className="min-h-screen bg-[radial-gradient(circle_at_top,_rgba(14,165,233,0.16),_transparent_30%),linear-gradient(180deg,_#f8fafc_0%,_#eef2ff_100%)] px-6 py-16 sm:px-10">
|
|
20
|
+
<div className="mx-auto flex min-h-[calc(100vh-8rem)] max-w-5xl items-center gap-12 lg:grid lg:grid-cols-[0.9fr_1.1fr]">
|
|
21
|
+
<section className="hidden space-y-5 lg:block">
|
|
22
|
+
<span className="inline-flex rounded-full border border-sky-200 bg-white/80 px-3 py-1 text-xs font-medium uppercase tracking-[0.24em] text-sky-700">
|
|
23
|
+
Better Auth
|
|
24
|
+
</span>
|
|
25
|
+
<h1 className="text-4xl font-semibold tracking-tight text-slate-950">
|
|
26
|
+
Welcome back.
|
|
27
|
+
</h1>
|
|
28
|
+
<p className="max-w-md text-base leading-7 text-slate-600">
|
|
29
|
+
This generated starter includes protected routes, session-aware page
|
|
30
|
+
guards, and reusable auth form primitives you can extend from here.
|
|
31
|
+
</p>
|
|
32
|
+
</section>
|
|
33
|
+
<SignInForm />
|
|
34
|
+
</div>
|
|
35
|
+
</main>
|
|
36
|
+
);
|
|
37
37
|
}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { createFileRoute, redirect } from "@tanstack/react-router";
|
|
2
|
-
|
|
3
|
-
import { SignUpForm } from "~/components/auth/sign-up-form";
|
|
4
|
-
import { getSession } from "~/lib/auth-functions";
|
|
5
|
-
|
|
6
|
-
export const Route = createFileRoute("/sign-up")({
|
|
7
|
-
beforeLoad: async () => {
|
|
8
|
-
const session = await getSession();
|
|
9
|
-
|
|
10
|
-
if (session) {
|
|
11
|
-
throw redirect({ to: "/dashboard" });
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
component: SignUpPage,
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
function SignUpPage() {
|
|
18
|
-
return (
|
|
19
|
-
<main className="min-h-screen bg-[radial-gradient(circle_at_top,_rgba(56,189,248,0.18),_transparent_28%),linear-gradient(180deg,_#f8fafc_0%,_#ecfeff_100%)] px-6 py-16 sm:px-10">
|
|
20
|
-
<div className="mx-auto flex min-h-[calc(100vh-8rem)] max-w-5xl items-center gap-12 lg:grid lg:grid-cols-[0.9fr_1.1fr]">
|
|
21
|
-
<section className="hidden space-y-5 lg:block">
|
|
22
|
-
<span className="inline-flex rounded-full border border-sky-200 bg-white/80 px-3 py-1 text-xs font-medium uppercase tracking-[0.24em] text-sky-700">
|
|
23
|
-
Better Auth
|
|
24
|
-
</span>
|
|
25
|
-
<h1 className="text-4xl font-semibold tracking-tight text-slate-950">
|
|
26
|
-
Create your account.
|
|
27
|
-
</h1>
|
|
28
|
-
<p className="max-w-md text-base leading-7 text-slate-600">
|
|
29
|
-
Start with email and password today, then layer in profile data,
|
|
30
|
-
onboarding, and provider-based auth when your product needs it.
|
|
31
|
-
</p>
|
|
32
|
-
</section>
|
|
33
|
-
<SignUpForm />
|
|
34
|
-
</div>
|
|
35
|
-
</main>
|
|
36
|
-
);
|
|
1
|
+
import { createFileRoute, redirect } from "@tanstack/react-router";
|
|
2
|
+
|
|
3
|
+
import { SignUpForm } from "~/components/auth/sign-up-form";
|
|
4
|
+
import { getSession } from "~/lib/auth-functions";
|
|
5
|
+
|
|
6
|
+
export const Route = createFileRoute("/sign-up")({
|
|
7
|
+
beforeLoad: async () => {
|
|
8
|
+
const session = await getSession();
|
|
9
|
+
|
|
10
|
+
if (session) {
|
|
11
|
+
throw redirect({ to: "/dashboard" });
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
component: SignUpPage,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
function SignUpPage() {
|
|
18
|
+
return (
|
|
19
|
+
<main className="min-h-screen bg-[radial-gradient(circle_at_top,_rgba(56,189,248,0.18),_transparent_28%),linear-gradient(180deg,_#f8fafc_0%,_#ecfeff_100%)] px-6 py-16 sm:px-10">
|
|
20
|
+
<div className="mx-auto flex min-h-[calc(100vh-8rem)] max-w-5xl items-center gap-12 lg:grid lg:grid-cols-[0.9fr_1.1fr]">
|
|
21
|
+
<section className="hidden space-y-5 lg:block">
|
|
22
|
+
<span className="inline-flex rounded-full border border-sky-200 bg-white/80 px-3 py-1 text-xs font-medium uppercase tracking-[0.24em] text-sky-700">
|
|
23
|
+
Better Auth
|
|
24
|
+
</span>
|
|
25
|
+
<h1 className="text-4xl font-semibold tracking-tight text-slate-950">
|
|
26
|
+
Create your account.
|
|
27
|
+
</h1>
|
|
28
|
+
<p className="max-w-md text-base leading-7 text-slate-600">
|
|
29
|
+
Start with email and password today, then layer in profile data,
|
|
30
|
+
onboarding, and provider-based auth when your product needs it.
|
|
31
|
+
</p>
|
|
32
|
+
</section>
|
|
33
|
+
<SignUpForm />
|
|
34
|
+
</div>
|
|
35
|
+
</main>
|
|
36
|
+
);
|
|
37
37
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
check:
|
|
13
|
+
name: Build, type-check, lint
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v7
|
|
17
|
+
{{#if (eq packageManager 'pnpm')}}
|
|
18
|
+
- uses: pnpm/action-setup@v6
|
|
19
|
+
with:
|
|
20
|
+
version: 11
|
|
21
|
+
{{/if}}
|
|
22
|
+
- uses: actions/setup-node@v7
|
|
23
|
+
with:
|
|
24
|
+
node-version: 24
|
|
25
|
+
{{#if (eq packageManager 'bun')}}
|
|
26
|
+
- uses: oven-sh/setup-bun@v2
|
|
27
|
+
{{/if}}
|
|
28
|
+
- name: Install
|
|
29
|
+
run: {{docker.install}}
|
|
30
|
+
- name: Build
|
|
31
|
+
{{#if ciBuildEnv.length}}
|
|
32
|
+
# Placeholders: the build never connects to a database. Add real values
|
|
33
|
+
# as repository secrets if your build needs them
|
|
34
|
+
env:
|
|
35
|
+
{{#each ciBuildEnv}}
|
|
36
|
+
{{name}}: "{{value}}"
|
|
37
|
+
{{/each}}
|
|
38
|
+
{{/if}}
|
|
39
|
+
run: {{docker.run}} build
|
|
40
|
+
- name: Type-check
|
|
41
|
+
run: {{docker.run}} type:check
|
|
42
|
+
- name: Lint
|
|
43
|
+
run: {{docker.run}} lint
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "ci",
|
|
3
|
+
"name": "GitHub Actions CI",
|
|
4
|
+
"description": "A GitHub Actions workflow that builds, type-checks, and lints every push and pull request",
|
|
5
|
+
"type": "feature",
|
|
6
|
+
"dependencies": {},
|
|
7
|
+
"devDependencies": {},
|
|
8
|
+
"scripts": {},
|
|
9
|
+
"envVars": {}
|
|
10
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "docker",
|
|
3
|
-
"name": "Docker",
|
|
4
|
-
"description": "Docker containerization with multi-stage build and docker-compose",
|
|
5
|
-
"type": "feature",
|
|
6
|
-
"dependencies": {},
|
|
7
|
-
"devDependencies": {},
|
|
8
|
-
"scripts": {
|
|
9
|
-
"docker:build": "docker build -t {{projectName}} .",
|
|
10
|
-
"docker:up": "docker compose up -d --build",
|
|
11
|
-
"docker:down": "docker compose down",
|
|
12
|
-
"docker:logs": "docker compose logs -f"
|
|
13
|
-
},
|
|
14
|
-
"envVars": {}
|
|
15
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"id": "docker",
|
|
3
|
+
"name": "Docker",
|
|
4
|
+
"description": "Docker containerization with multi-stage build and docker-compose",
|
|
5
|
+
"type": "feature",
|
|
6
|
+
"dependencies": {},
|
|
7
|
+
"devDependencies": {},
|
|
8
|
+
"scripts": {
|
|
9
|
+
"docker:build": "docker build -t {{projectName}} .",
|
|
10
|
+
"docker:up": "docker compose up -d --build",
|
|
11
|
+
"docker:down": "docker compose down",
|
|
12
|
+
"docker:logs": "docker compose logs -f"
|
|
13
|
+
},
|
|
14
|
+
"envVars": {}
|
|
15
|
+
}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "drizzle",
|
|
3
|
-
"name": "Drizzle ORM",
|
|
4
|
-
"description": "Drizzle ORM for Express with PostgreSQL",
|
|
5
|
-
"type": "database",
|
|
6
|
-
"dependencies": {
|
|
7
|
-
"drizzle-orm": "^0.45.
|
|
8
|
-
"pg": "^8.23.
|
|
9
|
-
"dotenv": "^17.4.2"
|
|
10
|
-
},
|
|
11
|
-
"devDependencies": {
|
|
12
|
-
"drizzle-kit": "^0.31.
|
|
13
|
-
"@types/pg": "^8.23.1"
|
|
14
|
-
},
|
|
15
|
-
"scripts": {
|
|
16
|
-
"db:generate": "drizzle-kit generate",
|
|
17
|
-
"db:migrate": "drizzle-kit migrate",
|
|
18
|
-
"db:studio": "drizzle-kit studio"
|
|
19
|
-
},
|
|
20
|
-
"envVars": {
|
|
21
|
-
"DATABASE_URL": "postgresql://postgres:postgres@localhost:5432/postgres"
|
|
22
|
-
},
|
|
23
|
-
"overrides": {
|
|
24
|
-
"esbuild": "^0.28.2"
|
|
25
|
-
}
|
|
26
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"id": "drizzle",
|
|
3
|
+
"name": "Drizzle ORM",
|
|
4
|
+
"description": "Drizzle ORM for Express with PostgreSQL",
|
|
5
|
+
"type": "database",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"drizzle-orm": "^0.45.4",
|
|
8
|
+
"pg": "^8.23.1",
|
|
9
|
+
"dotenv": "^17.4.2"
|
|
10
|
+
},
|
|
11
|
+
"devDependencies": {
|
|
12
|
+
"drizzle-kit": "^0.31.11",
|
|
13
|
+
"@types/pg": "^8.23.1"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"db:generate": "drizzle-kit generate",
|
|
17
|
+
"db:migrate": "drizzle-kit migrate",
|
|
18
|
+
"db:studio": "drizzle-kit studio"
|
|
19
|
+
},
|
|
20
|
+
"envVars": {
|
|
21
|
+
"DATABASE_URL": "postgresql://postgres:postgres@localhost:5432/postgres"
|
|
22
|
+
},
|
|
23
|
+
"overrides": {
|
|
24
|
+
"esbuild": "^0.28.2"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "drizzle",
|
|
3
|
-
"name": "Drizzle ORM",
|
|
4
|
-
"description": "Drizzle ORM for NestJS with PostgreSQL",
|
|
5
|
-
"type": "database",
|
|
6
|
-
"dependencies": {
|
|
7
|
-
"drizzle-orm": "^0.45.
|
|
8
|
-
"pg": "^8.23.
|
|
9
|
-
"dotenv": "^17.4.2"
|
|
10
|
-
},
|
|
11
|
-
"devDependencies": {
|
|
12
|
-
"drizzle-kit": "^0.31.
|
|
13
|
-
"@types/pg": "^8.23.1"
|
|
14
|
-
},
|
|
15
|
-
"scripts": {
|
|
16
|
-
"db:generate": "drizzle-kit generate",
|
|
17
|
-
"db:migrate": "drizzle-kit migrate",
|
|
18
|
-
"db:studio": "drizzle-kit studio"
|
|
19
|
-
},
|
|
20
|
-
"envVars": {
|
|
21
|
-
"DATABASE_URL": "postgresql://postgres:postgres@localhost:5432/postgres"
|
|
22
|
-
},
|
|
23
|
-
"overrides": {
|
|
24
|
-
"esbuild": "^0.28.2"
|
|
25
|
-
}
|
|
26
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"id": "drizzle",
|
|
3
|
+
"name": "Drizzle ORM",
|
|
4
|
+
"description": "Drizzle ORM for NestJS with PostgreSQL",
|
|
5
|
+
"type": "database",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"drizzle-orm": "^0.45.4",
|
|
8
|
+
"pg": "^8.23.1",
|
|
9
|
+
"dotenv": "^17.4.2"
|
|
10
|
+
},
|
|
11
|
+
"devDependencies": {
|
|
12
|
+
"drizzle-kit": "^0.31.11",
|
|
13
|
+
"@types/pg": "^8.23.1"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"db:generate": "drizzle-kit generate",
|
|
17
|
+
"db:migrate": "drizzle-kit migrate",
|
|
18
|
+
"db:studio": "drizzle-kit studio"
|
|
19
|
+
},
|
|
20
|
+
"envVars": {
|
|
21
|
+
"DATABASE_URL": "postgresql://postgres:postgres@localhost:5432/postgres"
|
|
22
|
+
},
|
|
23
|
+
"overrides": {
|
|
24
|
+
"esbuild": "^0.28.2"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "drizzle",
|
|
3
|
-
"name": "Drizzle ORM",
|
|
4
|
-
"description": "Drizzle ORM for Next.js with PostgreSQL",
|
|
5
|
-
"type": "database",
|
|
6
|
-
"dependencies": {
|
|
7
|
-
"drizzle-orm": "^0.45.
|
|
8
|
-
"pg": "^8.23.
|
|
9
|
-
"dotenv": "^17.4.2"
|
|
10
|
-
},
|
|
11
|
-
"devDependencies": {
|
|
12
|
-
"drizzle-kit": "^0.31.
|
|
13
|
-
"@types/pg": "^8.23.1"
|
|
14
|
-
},
|
|
15
|
-
"scripts": {
|
|
16
|
-
"db:generate": "drizzle-kit generate",
|
|
17
|
-
"db:migrate": "drizzle-kit migrate",
|
|
18
|
-
"db:studio": "drizzle-kit studio"
|
|
19
|
-
},
|
|
20
|
-
"envVars": {
|
|
21
|
-
"DATABASE_URL": "postgresql://postgres:postgres@localhost:5432/postgres"
|
|
22
|
-
},
|
|
23
|
-
"overrides": {
|
|
24
|
-
"esbuild": "^0.28.2"
|
|
25
|
-
}
|
|
26
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"id": "drizzle",
|
|
3
|
+
"name": "Drizzle ORM",
|
|
4
|
+
"description": "Drizzle ORM for Next.js with PostgreSQL",
|
|
5
|
+
"type": "database",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"drizzle-orm": "^0.45.4",
|
|
8
|
+
"pg": "^8.23.1",
|
|
9
|
+
"dotenv": "^17.4.2"
|
|
10
|
+
},
|
|
11
|
+
"devDependencies": {
|
|
12
|
+
"drizzle-kit": "^0.31.11",
|
|
13
|
+
"@types/pg": "^8.23.1"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"db:generate": "drizzle-kit generate",
|
|
17
|
+
"db:migrate": "drizzle-kit migrate",
|
|
18
|
+
"db:studio": "drizzle-kit studio"
|
|
19
|
+
},
|
|
20
|
+
"envVars": {
|
|
21
|
+
"DATABASE_URL": "postgresql://postgres:postgres@localhost:5432/postgres"
|
|
22
|
+
},
|
|
23
|
+
"overrides": {
|
|
24
|
+
"esbuild": "^0.28.2"
|
|
25
|
+
}
|
|
26
|
+
}
|