create-lx2-app 0.11.5-beta.cb1ede2 → 0.11.5-beta.d3a3f4c

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 (56) hide show
  1. package/dist/index.js +28 -26
  2. package/package.json +2 -1
  3. package/template/packages/config/biome.jsonc +46 -9
  4. package/template/packages/config/next/with-payload.ts +14 -0
  5. package/template/packages/config/tsconfig/base.json +8 -2
  6. package/template/packages/config/tsconfig/with-payload.json +8 -2
  7. package/template/packages/src/app/api/trpc/[trpc]/route.ts +34 -0
  8. package/template/packages/src/app/layout/with-trpc.tsx +37 -0
  9. package/template/packages/src/app/page/base.tsx +4 -1
  10. package/template/packages/src/app/page/with-authjs-drizzle.tsx +4 -1
  11. package/template/packages/src/app/page/with-authjs-prisma.tsx +4 -1
  12. package/template/packages/src/app/page/with-authjs.tsx +4 -1
  13. package/template/packages/src/app/page/with-better-auth-drizzle.tsx +4 -1
  14. package/template/packages/src/app/page/with-better-auth-prisma.tsx +4 -1
  15. package/template/packages/src/app/page/with-better-auth.tsx +4 -1
  16. package/template/packages/src/app/page/with-drizzle.tsx +4 -1
  17. package/template/packages/src/app/page/with-payload.tsx +4 -1
  18. package/template/packages/src/app/page/with-prisma.tsx +4 -1
  19. package/template/packages/src/app/page/with-trpc.tsx +118 -0
  20. package/template/packages/src/components/greeting.tsx +21 -0
  21. package/template/packages/src/env/with-better-auth-db.js +2 -2
  22. package/template/packages/src/env/with-better-auth.js +2 -2
  23. package/template/packages/src/env/with-trpc-authjs-db.js +55 -0
  24. package/template/packages/src/env/with-trpc-authjs.js +53 -0
  25. package/template/packages/src/env/with-trpc-better-auth-db.js +52 -0
  26. package/template/packages/src/env/with-trpc-better-auth.js +50 -0
  27. package/template/packages/src/env/with-trpc-db.js +46 -0
  28. package/template/packages/src/env/with-trpc.js +44 -0
  29. package/template/packages/src/lib/api/client.tsx +85 -0
  30. package/template/packages/src/lib/api/query-client.ts +22 -0
  31. package/template/packages/src/lib/api/server.ts +31 -0
  32. package/template/packages/src/lib/auth/better-auth-client.ts +1 -1
  33. package/template/packages/src/lib/utils.ts +7 -0
  34. package/template/packages/src/server/api/init/base.ts +103 -0
  35. package/template/packages/src/server/api/init/with-authjs-db.ts +132 -0
  36. package/template/packages/src/server/api/init/with-authjs.ts +130 -0
  37. package/template/packages/src/server/api/init/with-betterauth-db.ts +134 -0
  38. package/template/packages/src/server/api/init/with-betterauth.ts +132 -0
  39. package/template/packages/src/server/api/init/with-db.ts +106 -0
  40. package/template/packages/src/server/api/root.ts +23 -0
  41. package/template/packages/src/server/api/routers/post/base.ts +46 -0
  42. package/template/packages/src/server/api/routers/post/with-auth-drizzle.ts +44 -0
  43. package/template/packages/src/server/api/routers/post/with-auth-prisma.ts +47 -0
  44. package/template/packages/src/server/api/routers/post/with-auth.ts +43 -0
  45. package/template/packages/src/server/api/routers/post/with-drizzle.ts +36 -0
  46. package/template/packages/src/server/api/routers/post/with-prisma.ts +37 -0
  47. package/template/packages/src/server/auth/better-auth-with-drizzle.ts +1 -1
  48. package/template/packages/src/server/auth/better-auth-with-prisma.ts +1 -1
  49. package/template/packages/src/server/auth/better-auth.ts +1 -0
  50. package/template/packages/src/server/auth/config/authjs-with-drizzle.ts +1 -1
  51. package/template/packages/src/server/auth/config/authjs-with-prisma.ts +1 -1
  52. package/template/packages/src/server/auth/config/authjs.ts +1 -1
  53. package/template/packages/src/server/db/schema-drizzle/with-authjs-mysql.ts +1 -1
  54. package/template/packages/src/server/db/schema-drizzle/with-authjs-postgresql.ts +1 -1
  55. package/template/packages/src/server/db/schema-drizzle/with-authjs-sqlite.ts +1 -1
  56. /package/template/{base/next.config.ts → packages/config/next/base.ts} +0 -0
@@ -15,7 +15,7 @@ export default async function HomePage() {
15
15
  const fileURL = `vscode://file/${fileURLToPath(import.meta.url)}`
16
16
 
17
17
  return (
18
- <main className="mx-auto flex h-screen max-w-5xl flex-col items-center justify-between overflow-hidden p-6 sm:p-[45px]">
18
+ <main className="mx-auto flex h-screen max-w-5xl flex-col items-center justify-between overflow-hidden p-6 sm:p-11.25">
19
19
  {/* Header */}
20
20
  <header className="ml-auto">
21
21
  {user ? (
@@ -94,6 +94,7 @@ export default async function HomePage() {
94
94
  strokeLinejoin="round"
95
95
  className="mb-1.5 size-4 fill-none stroke-current stroke-2"
96
96
  >
97
+ <title>Docs</title>
97
98
  <path d="M7 7h10v10" />
98
99
  <path d="M7 17 17 7" />
99
100
  </svg>
@@ -112,6 +113,7 @@ export default async function HomePage() {
112
113
  strokeLinejoin="round"
113
114
  className="mb-1.5 size-4 fill-none stroke-current stroke-2"
114
115
  >
116
+ <title>Discord</title>
115
117
  <path d="M7 7h10v10" />
116
118
  <path d="M7 17 17 7" />
117
119
  </svg>
@@ -130,6 +132,7 @@ export default async function HomePage() {
130
132
  strokeLinejoin="round"
131
133
  className="mb-1.5 size-4 fill-none stroke-current stroke-2"
132
134
  >
135
+ <title>GitHub</title>
133
136
  <path d="M7 7h10v10" />
134
137
  <path d="M7 17 17 7" />
135
138
  </svg>
@@ -19,7 +19,7 @@ export default async function HomePage() {
19
19
  const fileURL = `vscode://file/${fileURLToPath(import.meta.url)}`
20
20
 
21
21
  return (
22
- <main className="mx-auto flex h-screen max-w-5xl flex-col items-center justify-between overflow-hidden p-6 sm:p-[45px]">
22
+ <main className="mx-auto flex h-screen max-w-5xl flex-col items-center justify-between overflow-hidden p-6 sm:p-11.25">
23
23
  {/* Header */}
24
24
  <header className="ml-auto">
25
25
  {user ? (
@@ -98,6 +98,7 @@ export default async function HomePage() {
98
98
  strokeLinejoin="round"
99
99
  className="mb-1.5 size-4 fill-none stroke-current stroke-2"
100
100
  >
101
+ <title>Docs</title>
101
102
  <path d="M7 7h10v10" />
102
103
  <path d="M7 17 17 7" />
103
104
  </svg>
@@ -116,6 +117,7 @@ export default async function HomePage() {
116
117
  strokeLinejoin="round"
117
118
  className="mb-1.5 size-4 fill-none stroke-current stroke-2"
118
119
  >
120
+ <title>Discord</title>
119
121
  <path d="M7 7h10v10" />
120
122
  <path d="M7 17 17 7" />
121
123
  </svg>
@@ -134,6 +136,7 @@ export default async function HomePage() {
134
136
  strokeLinejoin="round"
135
137
  className="mb-1.5 size-4 fill-none stroke-current stroke-2"
136
138
  >
139
+ <title>GitHub</title>
137
140
  <path d="M7 7h10v10" />
138
141
  <path d="M7 17 17 7" />
139
142
  </svg>
@@ -9,7 +9,7 @@ export default async function HomePage() {
9
9
  const fileURL = `vscode://file/${fileURLToPath(import.meta.url)}`
10
10
 
11
11
  return (
12
- <main className="mx-auto flex h-screen max-w-5xl flex-col items-center justify-between overflow-hidden p-6 sm:p-[45px]">
12
+ <main className="mx-auto flex h-screen max-w-5xl flex-col items-center justify-between overflow-hidden p-6 sm:p-11.25">
13
13
  {/* Header */}
14
14
  <header className="ml-auto">
15
15
  {user ? (
@@ -88,6 +88,7 @@ export default async function HomePage() {
88
88
  strokeLinejoin="round"
89
89
  className="mb-1.5 size-4 fill-none stroke-current stroke-2"
90
90
  >
91
+ <title>Docs</title>
91
92
  <path d="M7 7h10v10" />
92
93
  <path d="M7 17 17 7" />
93
94
  </svg>
@@ -106,6 +107,7 @@ export default async function HomePage() {
106
107
  strokeLinejoin="round"
107
108
  className="mb-1.5 size-4 fill-none stroke-current stroke-2"
108
109
  >
110
+ <title>Discord</title>
109
111
  <path d="M7 7h10v10" />
110
112
  <path d="M7 17 17 7" />
111
113
  </svg>
@@ -124,6 +126,7 @@ export default async function HomePage() {
124
126
  strokeLinejoin="round"
125
127
  className="mb-1.5 size-4 fill-none stroke-current stroke-2"
126
128
  >
129
+ <title>GitHub</title>
127
130
  <path d="M7 7h10v10" />
128
131
  <path d="M7 17 17 7" />
129
132
  </svg>
@@ -19,7 +19,7 @@ export default async function HomePage() {
19
19
  const fileURL = `vscode://file/${fileURLToPath(import.meta.url)}`
20
20
 
21
21
  return (
22
- <main className="mx-auto flex h-screen max-w-5xl flex-col items-center justify-between overflow-hidden p-6 sm:p-[45px]">
22
+ <main className="mx-auto flex h-screen max-w-5xl flex-col items-center justify-between overflow-hidden p-6 sm:p-11.25">
23
23
  {/* Header */}
24
24
  <header className="ml-auto">
25
25
  {user ? (
@@ -110,6 +110,7 @@ export default async function HomePage() {
110
110
  strokeLinejoin="round"
111
111
  className="mb-1.5 size-4 fill-none stroke-current stroke-2"
112
112
  >
113
+ <title>Docs</title>
113
114
  <path d="M7 7h10v10" />
114
115
  <path d="M7 17 17 7" />
115
116
  </svg>
@@ -128,6 +129,7 @@ export default async function HomePage() {
128
129
  strokeLinejoin="round"
129
130
  className="mb-1.5 size-4 fill-none stroke-current stroke-2"
130
131
  >
132
+ <title>Discord</title>
131
133
  <path d="M7 7h10v10" />
132
134
  <path d="M7 17 17 7" />
133
135
  </svg>
@@ -146,6 +148,7 @@ export default async function HomePage() {
146
148
  strokeLinejoin="round"
147
149
  className="mb-1.5 size-4 fill-none stroke-current stroke-2"
148
150
  >
151
+ <title>GitHub</title>
149
152
  <path d="M7 7h10v10" />
150
153
  <path d="M7 17 17 7" />
151
154
  </svg>
@@ -23,7 +23,7 @@ export default async function HomePage() {
23
23
  const fileURL = `vscode://file/${fileURLToPath(import.meta.url)}`
24
24
 
25
25
  return (
26
- <main className="mx-auto flex h-screen max-w-5xl flex-col items-center justify-between overflow-hidden p-6 sm:p-[45px]">
26
+ <main className="mx-auto flex h-screen max-w-5xl flex-col items-center justify-between overflow-hidden p-6 sm:p-11.25">
27
27
  {/* Header */}
28
28
  <header className="ml-auto">
29
29
  {user ? (
@@ -114,6 +114,7 @@ export default async function HomePage() {
114
114
  strokeLinejoin="round"
115
115
  className="mb-1.5 size-4 fill-none stroke-current stroke-2"
116
116
  >
117
+ <title>Docs</title>
117
118
  <path d="M7 7h10v10" />
118
119
  <path d="M7 17 17 7" />
119
120
  </svg>
@@ -132,6 +133,7 @@ export default async function HomePage() {
132
133
  strokeLinejoin="round"
133
134
  className="mb-1.5 size-4 fill-none stroke-current stroke-2"
134
135
  >
136
+ <title>Discord</title>
135
137
  <path d="M7 7h10v10" />
136
138
  <path d="M7 17 17 7" />
137
139
  </svg>
@@ -150,6 +152,7 @@ export default async function HomePage() {
150
152
  strokeLinejoin="round"
151
153
  className="mb-1.5 size-4 fill-none stroke-current stroke-2"
152
154
  >
155
+ <title>GitHub</title>
153
156
  <path d="M7 7h10v10" />
154
157
  <path d="M7 17 17 7" />
155
158
  </svg>
@@ -13,7 +13,7 @@ export default async function HomePage() {
13
13
  const fileURL = `vscode://file/${fileURLToPath(import.meta.url)}`
14
14
 
15
15
  return (
16
- <main className="mx-auto flex h-screen max-w-5xl flex-col items-center justify-between overflow-hidden p-6 sm:p-[45px]">
16
+ <main className="mx-auto flex h-screen max-w-5xl flex-col items-center justify-between overflow-hidden p-6 sm:p-11.25">
17
17
  {/* Header */}
18
18
  <header className="ml-auto">
19
19
  {user ? (
@@ -104,6 +104,7 @@ export default async function HomePage() {
104
104
  strokeLinejoin="round"
105
105
  className="mb-1.5 size-4 fill-none stroke-current stroke-2"
106
106
  >
107
+ <title>Docs</title>
107
108
  <path d="M7 7h10v10" />
108
109
  <path d="M7 17 17 7" />
109
110
  </svg>
@@ -122,6 +123,7 @@ export default async function HomePage() {
122
123
  strokeLinejoin="round"
123
124
  className="mb-1.5 size-4 fill-none stroke-current stroke-2"
124
125
  >
126
+ <title>Discord</title>
125
127
  <path d="M7 7h10v10" />
126
128
  <path d="M7 17 17 7" />
127
129
  </svg>
@@ -140,6 +142,7 @@ export default async function HomePage() {
140
142
  strokeLinejoin="round"
141
143
  className="mb-1.5 size-4 fill-none stroke-current stroke-2"
142
144
  >
145
+ <title>GitHub</title>
143
146
  <path d="M7 7h10v10" />
144
147
  <path d="M7 17 17 7" />
145
148
  </svg>
@@ -11,7 +11,7 @@ export default async function HomePage() {
11
11
  const fileURL = `vscode://file/${fileURLToPath(import.meta.url)}`
12
12
 
13
13
  return (
14
- <main className="mx-auto flex h-screen max-w-5xl flex-col items-center justify-between overflow-hidden p-6 sm:p-[45px]">
14
+ <main className="mx-auto flex h-screen max-w-5xl flex-col items-center justify-between overflow-hidden p-6 sm:p-11.25">
15
15
  <div className="flex grow flex-col items-center justify-center">
16
16
  {/* Logo */}
17
17
  <picture className="relative">
@@ -52,6 +52,7 @@ export default async function HomePage() {
52
52
  strokeLinejoin="round"
53
53
  className="mb-1.5 size-4 fill-none stroke-current stroke-2"
54
54
  >
55
+ <title>Docs</title>
55
56
  <path d="M7 7h10v10" />
56
57
  <path d="M7 17 17 7" />
57
58
  </svg>
@@ -70,6 +71,7 @@ export default async function HomePage() {
70
71
  strokeLinejoin="round"
71
72
  className="mb-1.5 size-4 fill-none stroke-current stroke-2"
72
73
  >
74
+ <title>Discord</title>
73
75
  <path d="M7 7h10v10" />
74
76
  <path d="M7 17 17 7" />
75
77
  </svg>
@@ -88,6 +90,7 @@ export default async function HomePage() {
88
90
  strokeLinejoin="round"
89
91
  className="mb-1.5 size-4 fill-none stroke-current stroke-2"
90
92
  >
93
+ <title>GitHub</title>
91
94
  <path d="M7 7h10v10" />
92
95
  <path d="M7 17 17 7" />
93
96
  </svg>
@@ -12,7 +12,7 @@ export default async function HomePage() {
12
12
  const fileURL = `vscode://file/${fileURLToPath(import.meta.url)}`
13
13
 
14
14
  return (
15
- <main className="mx-auto flex h-screen max-w-5xl flex-col items-center justify-between overflow-hidden p-6 sm:p-[45px]">
15
+ <main className="mx-auto flex h-screen max-w-5xl flex-col items-center justify-between overflow-hidden p-6 sm:p-11.25">
16
16
  <div className="flex grow flex-col items-center justify-center">
17
17
  {/* Logo */}
18
18
  <picture className="relative">
@@ -86,6 +86,7 @@ export default async function HomePage() {
86
86
  strokeLinejoin="round"
87
87
  className="mb-1.5 size-4 fill-none stroke-current stroke-2"
88
88
  >
89
+ <title>Docs</title>
89
90
  <path d="M7 7h10v10" />
90
91
  <path d="M7 17 17 7" />
91
92
  </svg>
@@ -104,6 +105,7 @@ export default async function HomePage() {
104
105
  strokeLinejoin="round"
105
106
  className="mb-1.5 size-4 fill-none stroke-current stroke-2"
106
107
  >
108
+ <title>Discord</title>
107
109
  <path d="M7 7h10v10" />
108
110
  <path d="M7 17 17 7" />
109
111
  </svg>
@@ -122,6 +124,7 @@ export default async function HomePage() {
122
124
  strokeLinejoin="round"
123
125
  className="mb-1.5 size-4 fill-none stroke-current stroke-2"
124
126
  >
127
+ <title>GitHub</title>
125
128
  <path d="M7 7h10v10" />
126
129
  <path d="M7 17 17 7" />
127
130
  </svg>
@@ -15,7 +15,7 @@ export default async function HomePage() {
15
15
  const fileURL = `vscode://file/${fileURLToPath(import.meta.url)}`
16
16
 
17
17
  return (
18
- <main className="mx-auto flex h-screen max-w-5xl flex-col items-center justify-between overflow-hidden p-6 sm:p-[45px]">
18
+ <main className="mx-auto flex h-screen max-w-5xl flex-col items-center justify-between overflow-hidden p-6 sm:p-11.25">
19
19
  <div className="flex grow flex-col items-center justify-center">
20
20
  {/* Logo */}
21
21
  <picture className="relative">
@@ -56,6 +56,7 @@ export default async function HomePage() {
56
56
  strokeLinejoin="round"
57
57
  className="mb-1.5 size-4 fill-none stroke-current stroke-2"
58
58
  >
59
+ <title>Docs</title>
59
60
  <path d="M7 7h10v10" />
60
61
  <path d="M7 17 17 7" />
61
62
  </svg>
@@ -74,6 +75,7 @@ export default async function HomePage() {
74
75
  strokeLinejoin="round"
75
76
  className="mb-1.5 size-4 fill-none stroke-current stroke-2"
76
77
  >
78
+ <title>Discord</title>
77
79
  <path d="M7 7h10v10" />
78
80
  <path d="M7 17 17 7" />
79
81
  </svg>
@@ -92,6 +94,7 @@ export default async function HomePage() {
92
94
  strokeLinejoin="round"
93
95
  className="mb-1.5 size-4 fill-none stroke-current stroke-2"
94
96
  >
97
+ <title>GitHub</title>
95
98
  <path d="M7 7h10v10" />
96
99
  <path d="M7 17 17 7" />
97
100
  </svg>
@@ -0,0 +1,118 @@
1
+ import { fileURLToPath } from "url"
2
+
3
+ import { Greeting } from "@/components/greeting"
4
+ import { api, HydrateClient } from "@/lib/api/server"
5
+
6
+ export const dynamic = "force-dynamic"
7
+
8
+ export default async function HomePage() {
9
+ const fileURL = `vscode://file/${fileURLToPath(import.meta.url)}`
10
+
11
+ void api.post.greeting({ text: "from tRPC!" })
12
+
13
+ return (
14
+ <HydrateClient>
15
+ <main className="mx-auto flex h-screen max-w-5xl flex-col items-center justify-between overflow-hidden p-6 sm:p-11.25">
16
+ <div className="flex grow flex-col items-center justify-center">
17
+ {/* Logo */}
18
+ <picture className="relative">
19
+ <div className="absolute inset-0 animate-pulse bg-linear-to-r from-[oklch(0.7468_0.1455_302.21)] via-[oklch(0.7345_0.0464_270.71)] to-[oklch(0.7563_0.1807_347.17)] opacity-20 blur-lg dark:via-[oklch(0.5567_0.0816_269.53)]" />
20
+
21
+ <source srcSet="https://github.com/SlickYeet/create-lx2-app/blob/f1209465d59e03e284702d9f492f1bc1cfa49c32/docs/v2/public/android-chrome-192x192.png?raw=true" />
22
+ <img
23
+ src="https://github.com/SlickYeet/create-lx2-app/blob/f1209465d59e03e284702d9f492f1bc1cfa49c32/docs/v2/public/android-chrome-192x192.png?raw=true"
24
+ alt="Logo"
25
+ width={65}
26
+ height={65}
27
+ className="block h-auto max-w-full"
28
+ />
29
+ </picture>
30
+
31
+ {/* Title & Description */}
32
+ <h1 className="mt-6 text-5xl font-bold tracking-tight text-balance md:text-6xl lg:text-7xl">
33
+ Create{" "}
34
+ <span className="text-[oklch(0.7468_0.1455_302.21)]">Lx2</span> App
35
+ </h1>
36
+ <p className="text-center text-lg text-neutral-700 md:text-xl lg:mt-6 dark:text-neutral-300">
37
+ The Most Opinionated Way to Build Next.js Apps
38
+ </p>
39
+
40
+ {/* Links */}
41
+ <div className="mt-12 flex items-center gap-3">
42
+ <a
43
+ href="https://create.lx2.dev/docs"
44
+ target="_blank"
45
+ rel="noopener noreferrer"
46
+ className="flex items-center rounded-md border border-white/25 px-2 py-1 outline-none hover:opacity-80 focus:opacity-80 active:opacity-70"
47
+ >
48
+ Docs
49
+ <svg
50
+ xmlns="http://www.w3.org/2000/svg"
51
+ viewBox="0 0 24 24"
52
+ strokeLinecap="round"
53
+ strokeLinejoin="round"
54
+ className="mb-1.5 size-4 fill-none stroke-current stroke-2"
55
+ >
56
+ <title>Docs</title>
57
+ <path d="M7 7h10v10" />
58
+ <path d="M7 17 17 7" />
59
+ </svg>
60
+ </a>
61
+ <a
62
+ href="https://link.lx2.dev/discord"
63
+ target="_blank"
64
+ rel="noopener noreferrer"
65
+ className="flex items-center rounded-md border border-white/25 px-2 py-1 outline-none hover:opacity-80 focus:opacity-80 active:opacity-70"
66
+ >
67
+ Discord
68
+ <svg
69
+ xmlns="http://www.w3.org/2000/svg"
70
+ viewBox="0 0 24 24"
71
+ strokeLinecap="round"
72
+ strokeLinejoin="round"
73
+ className="mb-1.5 size-4 fill-none stroke-current stroke-2"
74
+ >
75
+ <title>Discord</title>
76
+ <path d="M7 7h10v10" />
77
+ <path d="M7 17 17 7" />
78
+ </svg>
79
+ </a>
80
+ <a
81
+ href="https://github.com/SlickYeet/create-lx2-app"
82
+ target="_blank"
83
+ rel="noopener noreferrer"
84
+ className="flex items-center rounded-md border border-white/25 px-2 py-1 outline-none hover:opacity-80 focus:opacity-80 active:opacity-70"
85
+ >
86
+ GitHub
87
+ <svg
88
+ xmlns="http://www.w3.org/2000/svg"
89
+ viewBox="0 0 24 24"
90
+ strokeLinecap="round"
91
+ strokeLinejoin="round"
92
+ className="mb-1.5 size-4 fill-none stroke-current stroke-2"
93
+ >
94
+ <title>GitHub</title>
95
+ <path d="M7 7h10v10" />
96
+ <path d="M7 17 17 7" />
97
+ </svg>
98
+ </a>
99
+ </div>
100
+
101
+ {/* tRPC Greeting */}
102
+ <Greeting />
103
+ </div>
104
+
105
+ {/* Footer */}
106
+ <div className="flex flex-col items-center gap-1 text-sm text-neutral-600 lg:flex-row lg:gap-2 dark:text-neutral-400">
107
+ <p className="m-0">Get started by editing </p>
108
+ <a
109
+ href={fileURL}
110
+ className="rounded-md bg-neutral-200 px-2 py-1 dark:bg-neutral-800"
111
+ >
112
+ <code>src/app/page.tsx</code>
113
+ </a>
114
+ </div>
115
+ </main>
116
+ </HydrateClient>
117
+ )
118
+ }
@@ -0,0 +1,21 @@
1
+ "use client"
2
+
3
+ import { api } from "@/lib/api/client"
4
+
5
+ export function Greeting() {
6
+ const [greeting] = api.post.greeting.useSuspenseQuery({
7
+ text: "from tRPC!",
8
+ })
9
+
10
+ return (
11
+ <div className="mt-12 flex flex-col items-center gap-3">
12
+ <div className="mb-4">
13
+ <h2 className="mb-4 text-center">
14
+ <span className="text-2xl text-neutral-700 dark:text-neutral-300">
15
+ {greeting}
16
+ </span>
17
+ </h2>
18
+ </div>
19
+ </div>
20
+ )
21
+ }
@@ -23,7 +23,7 @@ export const env = createEnv({
23
23
  */
24
24
  client: {
25
25
  // NEXT_PUBLIC_CLIENTVAR: z.string(),
26
- NEXT_PUBLIC_BETTER_AUTH_URL: z.url(),
26
+ NEXT_PUBLIC_URL: z.url(),
27
27
  },
28
28
 
29
29
  /**
@@ -34,7 +34,7 @@ export const env = createEnv({
34
34
  NODE_ENV: process.env.NODE_ENV,
35
35
  DATABASE_URL: process.env.DATABASE_URL,
36
36
  BETTER_AUTH_SECRET: process.env.BETTER_AUTH_SECRET,
37
- NEXT_PUBLIC_BETTER_AUTH_URL: process.env.NEXT_PUBLIC_BETTER_AUTH_URL,
37
+ NEXT_PUBLIC_URL: process.env.NEXT_PUBLIC_URL,
38
38
  DISCORD_CLIENT_ID: process.env.DISCORD_CLIENT_ID,
39
39
  DISCORD_CLIENT_SECRET: process.env.DISCORD_CLIENT_SECRET,
40
40
  },
@@ -20,7 +20,7 @@ export const env = createEnv({
20
20
  */
21
21
  client: {
22
22
  // NEXT_PUBLIC_CLIENTVAR: z.string(),
23
- NEXT_PUBLIC_BETTER_AUTH_URL: z.url(),
23
+ NEXT_PUBLIC_URL: z.url(),
24
24
  },
25
25
 
26
26
  /**
@@ -31,7 +31,7 @@ export const env = createEnv({
31
31
  NODE_ENV: process.env.NODE_ENV,
32
32
  // NEXT_PUBLIC_CLIENTVAR: process.env.NEXT_PUBLIC_CLIENTVAR,
33
33
  BETTER_AUTH_SECRET: process.env.BETTER_AUTH_SECRET,
34
- NEXT_PUBLIC_BETTER_AUTH_URL: process.env.NEXT_PUBLIC_BETTER_AUTH_URL,
34
+ NEXT_PUBLIC_URL: process.env.NEXT_PUBLIC_URL,
35
35
  DISCORD_CLIENT_ID: process.env.DISCORD_CLIENT_ID,
36
36
  DISCORD_CLIENT_SECRET: process.env.DISCORD_CLIENT_SECRET,
37
37
  },
@@ -0,0 +1,55 @@
1
+ import { createEnv } from "@t3-oss/env-nextjs"
2
+ import { z } from "zod"
3
+
4
+ export const env = createEnv({
5
+ /**
6
+ * Specify your server-side environment variables schema here. This way you can ensure the app
7
+ * isn't built with invalid env vars.
8
+ */
9
+ server: {
10
+ DATABASE_URL: z.url(),
11
+ AUTH_SECRET:
12
+ process.env.NODE_ENV === "production"
13
+ ? z.string()
14
+ : z.string().optional(),
15
+ DISCORD_CLIENT_ID: z.string(),
16
+ DISCORD_CLIENT_SECRET: z.string(),
17
+ NODE_ENV: z
18
+ .enum(["development", "test", "production"])
19
+ .default("development"),
20
+ },
21
+
22
+ /**
23
+ * Specify your client-side environment variables schema here. This way you can ensure the app
24
+ * isn't built with invalid env vars. To expose them to the client, prefix them with
25
+ * `NEXT_PUBLIC_`.
26
+ */
27
+ client: {
28
+ // NEXT_PUBLIC_CLIENTVAR: z.string(),
29
+ NEXT_PUBLIC_URL: z.url(),
30
+ },
31
+
32
+ /**
33
+ * You can't destruct `process.env` as a regular object in the Next.js edge runtimes (e.g.
34
+ * middlewares) or client-side so we need to destruct manually.
35
+ */
36
+ runtimeEnv: {
37
+ DATABASE_URL: process.env.DATABASE_URL,
38
+ AUTH_SECRET: process.env.AUTH_SECRET,
39
+ DISCORD_CLIENT_ID: process.env.DISCORD_CLIENT_ID,
40
+ DISCORD_CLIENT_SECRET: process.env.DISCORD_CLIENT_SECRET,
41
+ NODE_ENV: process.env.NODE_ENV,
42
+ // NEXT_PUBLIC_CLIENTVAR: process.env.NEXT_PUBLIC_CLIENTVAR,
43
+ NEXT_PUBLIC_URL: process.env.NEXT_PUBLIC_URL,
44
+ },
45
+ /**
46
+ * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially
47
+ * useful for Docker builds.
48
+ */
49
+ skipValidation: !!process.env.SKIP_ENV_VALIDATION,
50
+ /**
51
+ * Makes it so that empty strings are treated as undefined. `SOME_VAR: z.string()` and
52
+ * `SOME_VAR=''` will throw an error.
53
+ */
54
+ emptyStringAsUndefined: true,
55
+ })
@@ -0,0 +1,53 @@
1
+ import { createEnv } from "@t3-oss/env-nextjs"
2
+ import { z } from "zod"
3
+
4
+ export const env = createEnv({
5
+ /**
6
+ * Specify your server-side environment variables schema here. This way you can ensure the app
7
+ * isn't built with invalid env vars.
8
+ */
9
+ server: {
10
+ AUTH_SECRET:
11
+ process.env.NODE_ENV === "production"
12
+ ? z.string()
13
+ : z.string().optional(),
14
+ DISCORD_CLIENT_ID: z.string(),
15
+ DISCORD_CLIENT_SECRET: z.string(),
16
+ NODE_ENV: z
17
+ .enum(["development", "test", "production"])
18
+ .default("development"),
19
+ },
20
+
21
+ /**
22
+ * Specify your client-side environment variables schema here. This way you can ensure the app
23
+ * isn't built with invalid env vars. To expose them to the client, prefix them with
24
+ * `NEXT_PUBLIC_`.
25
+ */
26
+ client: {
27
+ // NEXT_PUBLIC_CLIENTVAR: z.string(),
28
+ NEXT_PUBLIC_URL: z.url(),
29
+ },
30
+
31
+ /**
32
+ * You can't destruct `process.env` as a regular object in the Next.js edge runtimes (e.g.
33
+ * middlewares) or client-side so we need to destruct manually.
34
+ */
35
+ runtimeEnv: {
36
+ AUTH_SECRET: process.env.AUTH_SECRET,
37
+ DISCORD_CLIENT_ID: process.env.DISCORD_CLIENT_ID,
38
+ DISCORD_CLIENT_SECRET: process.env.DISCORD_CLIENT_SECRET,
39
+ NODE_ENV: process.env.NODE_ENV,
40
+ // NEXT_PUBLIC_CLIENTVAR: process.env.NEXT_PUBLIC_CLIENTVAR,
41
+ NEXT_PUBLIC_URL: process.env.NEXT_PUBLIC_URL,
42
+ },
43
+ /**
44
+ * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially
45
+ * useful for Docker builds.
46
+ */
47
+ skipValidation: !!process.env.SKIP_ENV_VALIDATION,
48
+ /**
49
+ * Makes it so that empty strings are treated as undefined. `SOME_VAR: z.string()` and
50
+ * `SOME_VAR=''` will throw an error.
51
+ */
52
+ emptyStringAsUndefined: true,
53
+ })
@@ -0,0 +1,52 @@
1
+ import { createEnv } from "@t3-oss/env-nextjs"
2
+ import { z } from "zod"
3
+
4
+ export const env = createEnv({
5
+ /**
6
+ * Specify your server-side environment variables schema here. This way you can ensure the app
7
+ * isn't built with invalid env vars.
8
+ */
9
+ server: {
10
+ DATABASE_URL: z.url(),
11
+ NODE_ENV: z
12
+ .enum(["development", "test", "production"])
13
+ .default("development"),
14
+ BETTER_AUTH_SECRET: z.string(),
15
+ DISCORD_CLIENT_ID: z.string(),
16
+ DISCORD_CLIENT_SECRET: z.string(),
17
+ },
18
+
19
+ /**
20
+ * Specify your client-side environment variables schema here. This way you can ensure the app
21
+ * isn't built with invalid env vars. To expose them to the client, prefix them with
22
+ * `NEXT_PUBLIC_`.
23
+ */
24
+ client: {
25
+ // NEXT_PUBLIC_CLIENTVAR: z.string(),
26
+ NEXT_PUBLIC_URL: z.url(),
27
+ },
28
+
29
+ /**
30
+ * You can't destruct `process.env` as a regular object in the Next.js edge runtimes (e.g.
31
+ * middlewares) or client-side so we need to destruct manually.
32
+ */
33
+ runtimeEnv: {
34
+ DATABASE_URL: process.env.DATABASE_URL,
35
+ BETTER_AUTH_SECRET: process.env.BETTER_AUTH_SECRET,
36
+ DISCORD_CLIENT_ID: process.env.DISCORD_CLIENT_ID,
37
+ DISCORD_CLIENT_SECRET: process.env.DISCORD_CLIENT_SECRET,
38
+ NODE_ENV: process.env.NODE_ENV,
39
+ // NEXT_PUBLIC_CLIENTVAR: process.env.NEXT_PUBLIC_CLIENTVAR,
40
+ NEXT_PUBLIC_URL: process.env.NEXT_PUBLIC_URL,
41
+ },
42
+ /**
43
+ * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially
44
+ * useful for Docker builds.
45
+ */
46
+ skipValidation: !!process.env.SKIP_ENV_VALIDATION,
47
+ /**
48
+ * Makes it so that empty strings are treated as undefined. `SOME_VAR: z.string()` and
49
+ * `SOME_VAR=''` will throw an error.
50
+ */
51
+ emptyStringAsUndefined: true,
52
+ })