create-tnt-stack 0.4.2 → 0.4.4-beta.255730d

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.
@@ -1,105 +1,97 @@
1
- import Link from "next/link"
1
+ import { fileURLToPath } from "url"
2
2
 
3
3
  export default function HomePage() {
4
+ const fileURL = `vscode://file/${fileURLToPath(import.meta.url)}`
5
+
4
6
  return (
5
- <main className="flex min-h-screen flex-col items-center justify-center px-4 text-center">
6
- {/* Logo */}
7
- <div className="mb-8">
8
- <div className="relative flex h-24 w-24 items-center justify-center">
7
+ <main className="mx-auto flex h-screen max-w-5xl flex-col items-center justify-between overflow-hidden p-6 sm:p-[45px]">
8
+ <div className="flex grow flex-col items-center justify-center">
9
+ {/* Logo */}
10
+ <picture className="relative">
9
11
  <div className="absolute inset-0 animate-pulse rounded-xl bg-gradient-to-r from-purple-500 to-cyan-500 opacity-20 blur-xl dark:from-purple-800 dark:to-cyan-800" />
10
- <svg
11
- xmlns="http://www.w3.org/2000/svg"
12
- width="80"
13
- height="80"
14
- viewBox="0 0 24 24"
15
- fill="none"
16
- stroke="currentColor"
17
- strokeWidth="2"
18
- strokeLinecap="round"
19
- strokeLinejoin="round"
20
- className="rounded-lg bg-gradient-to-r from-purple-500 to-cyan-500 dark:from-purple-800 dark:to-cyan-800"
21
- >
22
- <polyline points="4 17 10 11 4 5" />
23
- <line x1="12" x2="20" y1="19" y2="19" />
24
- </svg>
25
- </div>
26
- </div>
12
+ <source srcSet="https://github.com/SlickYeet/create-tnt-stack/blob/main/docs/public/logo.light.png?raw=true" />
13
+ <img
14
+ src="https://github.com/SlickYeet/create-tnt-stack/blob/main/docs/public/logo.light.png?raw=true"
15
+ alt="Logo"
16
+ width={65}
17
+ height={65}
18
+ className="block h-auto max-w-full"
19
+ />
20
+ </picture>
27
21
 
28
- <div className="max-w-xl text-balance">
29
- <h1 className="mb-8 bg-gradient-to-r from-purple-500 to-cyan-500 bg-clip-text pb-1.5 text-6xl font-bold tracking-tighter text-transparent md:text-7xl lg:text-8xl">
22
+ <h1 className="mt-6 bg-gradient-to-r from-purple-500 to-cyan-500 bg-clip-text text-center text-4xl leading-10 text-transparent sm:text-5xl sm:leading-14 md:text-6xl md:leading-20 lg:mt-10 lg:text-7xl lg:font-bold">
30
23
  TNT-Powered Next.js App
31
24
  </h1>
32
- <p className="mb-12 text-xl text-neutral-700 md:text-2xl dark:text-neutral-300">
33
- Build modern web applications with todat&apos;s most popular tools
25
+ <p className="mt-4 text-center text-lg text-neutral-700 md:text-xl lg:mt-6 dark:text-neutral-300">
26
+ Build modern web applications with today&apos;s most popular tools
34
27
  </p>
35
- </div>
36
28
 
37
- <div className="mb-12 flex flex-col gap-10 sm:flex-row">
38
- <Link
39
- href="https://create.tntstack.org"
40
- target="_blank"
41
- referrerPolicy="no-referrer"
42
- className="hover:text-primary relative flex items-center justify-center gap-2 text-lg font-medium"
43
- >
44
- Website
45
- <svg
46
- xmlns="http://www.w3.org/2000/svg"
47
- viewBox="0 0 24 24"
48
- strokeLinecap="round"
49
- strokeLinejoin="round"
50
- className="absolute top-0 -right-4 size-4 fill-none stroke-current stroke-2"
29
+ <div className="mt-12 flex items-center gap-3">
30
+ <a
31
+ href="https://create.tntstack.org"
32
+ target="_blank"
33
+ rel="noopener noreferrer"
34
+ className="flex items-center rounded-md border border-white px-2 py-1 outline-none focus:opacity-80 active:opacity-70"
51
35
  >
52
- <path d="M7 7h10v10" />
53
- <path d="M7 17 17 7" />
54
- </svg>
55
- </Link>
56
-
57
- <Link
58
- href="https://create.tntstack.org/introduction"
59
- target="_blank"
60
- referrerPolicy="no-referrer"
61
- className="hover:text-primary relative flex items-center justify-center gap-2 text-lg font-medium"
62
- >
63
- Docs
64
- <svg
65
- xmlns="http://www.w3.org/2000/svg"
66
- viewBox="0 0 24 24"
67
- strokeLinecap="round"
68
- strokeLinejoin="round"
69
- className="absolute top-0 -right-4 size-4 fill-none stroke-current stroke-2"
36
+ Website
37
+ <svg
38
+ xmlns="http://www.w3.org/2000/svg"
39
+ viewBox="0 0 24 24"
40
+ strokeLinecap="round"
41
+ strokeLinejoin="round"
42
+ className="mb-1.5 size-4 fill-none stroke-current stroke-2"
43
+ >
44
+ <path d="M7 7h10v10" />
45
+ <path d="M7 17 17 7" />
46
+ </svg>
47
+ </a>
48
+ <a
49
+ href="https://create.tntstack.org/introduction"
50
+ target="_blank"
51
+ rel="noopener noreferrer"
52
+ className="flex items-center rounded-md border border-white px-2 py-1 outline-none focus:opacity-80 active:opacity-70"
70
53
  >
71
- <path d="M7 7h10v10" />
72
- <path d="M7 17 17 7" />
73
- </svg>
74
- </Link>
75
-
76
- <Link
77
- href="https://github.com/SlickYeet/create-tnt-stack"
78
- target="_blank"
79
- referrerPolicy="no-referrer"
80
- className="hover:text-primary relative flex items-center justify-center gap-2 text-lg font-medium"
81
- >
82
- GitHub
83
- <svg
84
- xmlns="http://www.w3.org/2000/svg"
85
- viewBox="0 0 24 24"
86
- strokeLinecap="round"
87
- strokeLinejoin="round"
88
- className="absolute top-0 -right-4 size-4 fill-none stroke-current stroke-2"
54
+ Docs
55
+ <svg
56
+ xmlns="http://www.w3.org/2000/svg"
57
+ viewBox="0 0 24 24"
58
+ strokeLinecap="round"
59
+ strokeLinejoin="round"
60
+ className="mb-1.5 size-4 fill-none stroke-current stroke-2"
61
+ >
62
+ <path d="M7 7h10v10" />
63
+ <path d="M7 17 17 7" />
64
+ </svg>
65
+ </a>
66
+ <a
67
+ href="https://github.com/SlickYeet/create-tnt-stack"
68
+ target="_blank"
69
+ rel="noopener noreferrer"
70
+ className="flex items-center rounded-md border border-white px-2 py-1 outline-none focus:opacity-80 active:opacity-70"
89
71
  >
90
- <path d="M7 7h10v10" />
91
- <path d="M7 17 17 7" />
92
- </svg>
93
- </Link>
72
+ GitHub
73
+ <svg
74
+ xmlns="http://www.w3.org/2000/svg"
75
+ viewBox="0 0 24 24"
76
+ strokeLinecap="round"
77
+ strokeLinejoin="round"
78
+ className="mb-1.5 size-4 fill-none stroke-current stroke-2"
79
+ >
80
+ <path d="M7 7h10v10" />
81
+ <path d="M7 17 17 7" />
82
+ </svg>
83
+ </a>
84
+ </div>
94
85
  </div>
95
86
 
96
- <div className="mt-16 text-sm text-neutral-600 dark:text-neutral-400">
97
- <p>
98
- Get started by editing{" "}
99
- <code className="rounded-md bg-neutral-200 px-2 py-1 dark:bg-neutral-800">
100
- src/app/page.tsx
101
- </code>
102
- </p>
87
+ <div className="flex flex-col items-center gap-1 text-sm text-neutral-600 lg:flex-row lg:gap-2 dark:text-neutral-400">
88
+ <p className="m-0">Get started by editing </p>
89
+ <a
90
+ href={fileURL}
91
+ className="rounded-md bg-neutral-200 px-2 py-1 dark:bg-neutral-800"
92
+ >
93
+ <code>src/app/page.tsx</code>
94
+ </a>
103
95
  </div>
104
96
  </main>
105
97
  )
@@ -0,0 +1,126 @@
1
+ import { fileURLToPath } from "url"
2
+
3
+ import { auth, signIn, signOut } from "@/server/auth"
4
+
5
+ export default async function HomePage() {
6
+ const session = await auth()
7
+ const user = session?.user
8
+
9
+ const fileURL = `vscode://file/${fileURLToPath(import.meta.url)}`
10
+
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]">
13
+ <header className="ml-auto">
14
+ {user ? (
15
+ <button
16
+ onClick={async () => {
17
+ "use server"
18
+ await signOut()
19
+ }}
20
+ className="cursor-pointer rounded-md bg-rose-400 px-4 py-2"
21
+ >
22
+ Sign Out
23
+ </button>
24
+ ) : (
25
+ <button
26
+ onClick={async () => {
27
+ "use server"
28
+ await signIn("discord")
29
+ }}
30
+ className="cursor-pointer rounded-md bg-purple-400 px-4 py-2"
31
+ >
32
+ Sign In
33
+ </button>
34
+ )}
35
+ </header>
36
+
37
+ <div className="flex grow flex-col items-center justify-center">
38
+ {/* Logo */}
39
+ <picture className="relative">
40
+ <div className="absolute inset-0 animate-pulse rounded-xl bg-gradient-to-r from-purple-500 to-cyan-500 opacity-20 blur-xl dark:from-purple-800 dark:to-cyan-800" />
41
+ <source srcSet="https://github.com/SlickYeet/create-tnt-stack/blob/main/docs/public/logo.light.png?raw=true" />
42
+ <img
43
+ src="https://github.com/SlickYeet/create-tnt-stack/blob/main/docs/public/logo.light.png?raw=true"
44
+ alt="Logo"
45
+ width={65}
46
+ height={65}
47
+ className="block h-auto max-w-full"
48
+ />
49
+ </picture>
50
+
51
+ <h1 className="mt-6 bg-gradient-to-r from-purple-500 to-cyan-500 bg-clip-text text-center text-4xl leading-10 text-transparent sm:text-5xl sm:leading-14 md:text-6xl md:leading-20 lg:mt-10 lg:text-7xl lg:font-bold">
52
+ TNT-Powered Next.js App
53
+ </h1>
54
+ <p className="mt-4 text-center text-lg text-neutral-700 md:text-xl lg:mt-6 dark:text-neutral-300">
55
+ Build modern web applications with today&apos;s most popular tools
56
+ </p>
57
+
58
+ <div className="mt-12 flex items-center gap-3">
59
+ <a
60
+ href="https://create.tntstack.org"
61
+ target="_blank"
62
+ rel="noopener noreferrer"
63
+ className="flex items-center rounded-md border border-white px-2 py-1 outline-none focus:opacity-80 active:opacity-70"
64
+ >
65
+ Website
66
+ <svg
67
+ xmlns="http://www.w3.org/2000/svg"
68
+ viewBox="0 0 24 24"
69
+ strokeLinecap="round"
70
+ strokeLinejoin="round"
71
+ className="mb-1.5 size-4 fill-none stroke-current stroke-2"
72
+ >
73
+ <path d="M7 7h10v10" />
74
+ <path d="M7 17 17 7" />
75
+ </svg>
76
+ </a>
77
+ <a
78
+ href="https://create.tntstack.org/introduction"
79
+ target="_blank"
80
+ rel="noopener noreferrer"
81
+ className="flex items-center rounded-md border border-white px-2 py-1 outline-none focus:opacity-80 active:opacity-70"
82
+ >
83
+ Docs
84
+ <svg
85
+ xmlns="http://www.w3.org/2000/svg"
86
+ viewBox="0 0 24 24"
87
+ strokeLinecap="round"
88
+ strokeLinejoin="round"
89
+ className="mb-1.5 size-4 fill-none stroke-current stroke-2"
90
+ >
91
+ <path d="M7 7h10v10" />
92
+ <path d="M7 17 17 7" />
93
+ </svg>
94
+ </a>
95
+ <a
96
+ href="https://github.com/SlickYeet/create-tnt-stack"
97
+ target="_blank"
98
+ rel="noopener noreferrer"
99
+ className="flex items-center rounded-md border border-white px-2 py-1 outline-none focus:opacity-80 active:opacity-70"
100
+ >
101
+ GitHub
102
+ <svg
103
+ xmlns="http://www.w3.org/2000/svg"
104
+ viewBox="0 0 24 24"
105
+ strokeLinecap="round"
106
+ strokeLinejoin="round"
107
+ className="mb-1.5 size-4 fill-none stroke-current stroke-2"
108
+ >
109
+ <path d="M7 7h10v10" />
110
+ <path d="M7 17 17 7" />
111
+ </svg>
112
+ </a>
113
+ </div>
114
+ </div>
115
+ <div className="flex flex-col items-center gap-1 text-sm text-neutral-600 lg:flex-row lg:gap-2 dark:text-neutral-400">
116
+ <p className="m-0">Get started by editing </p>
117
+ <a
118
+ href={fileURL}
119
+ className="rounded-md bg-neutral-200 px-2 py-1 dark:bg-neutral-800"
120
+ >
121
+ <code>src/app/page.tsx</code>
122
+ </a>
123
+ </div>
124
+ </main>
125
+ )
126
+ }
@@ -1,7 +1,6 @@
1
1
  import { fileURLToPath } from "url"
2
2
  import config from "@payload-config"
3
3
  import { headers as getHeaders } from "next/headers.js"
4
- import Image from "next/image"
5
4
  import { getPayload } from "payload"
6
5
 
7
6
  import "./globals.css"
@@ -15,44 +14,123 @@ export default async function HomePage() {
15
14
  const fileURL = `vscode://file/${fileURLToPath(import.meta.url)}`
16
15
 
17
16
  return (
18
- <div className="home">
19
- <div className="content">
20
- <picture>
21
- <source srcSet="https://raw.githubusercontent.com/payloadcms/payload/main/packages/ui/src/assets/payload-favicon.svg" />
22
- <Image
23
- alt="Payload Logo"
24
- height={65}
25
- src="https://raw.githubusercontent.com/payloadcms/payload/main/packages/ui/src/assets/payload-favicon.svg"
17
+ <main className="mx-auto flex h-screen max-w-5xl flex-col items-center justify-between overflow-hidden p-6 sm:p-[45px]">
18
+ <div className="flex grow flex-col items-center justify-center">
19
+ {/* Logo */}
20
+ <picture className="relative">
21
+ <div className="absolute inset-0 animate-pulse rounded-xl bg-gradient-to-r from-purple-500 to-cyan-500 opacity-20 blur-xl dark:from-purple-800 dark:to-cyan-800" />
22
+ <source srcSet="https://github.com/SlickYeet/create-tnt-stack/blob/main/docs/public/logo.light.png?raw=true" />
23
+ <img
24
+ src="https://github.com/SlickYeet/create-tnt-stack/blob/main/docs/public/logo.light.png?raw=true"
25
+ alt="Logo"
26
26
  width={65}
27
+ height={65}
28
+ className="block h-auto max-w-full"
27
29
  />
28
30
  </picture>
29
- {!user && <h1>Welcome to your new project.</h1>}
30
- {user && <h1>Welcome back, {user.email}</h1>}
31
- <div className="links">
31
+
32
+ {!user && (
33
+ <>
34
+ <h1 className="mt-6 bg-gradient-to-r from-purple-500 to-cyan-500 bg-clip-text text-center text-4xl leading-10 text-transparent sm:text-5xl sm:leading-14 md:text-6xl md:leading-20 lg:mt-10 lg:text-7xl lg:font-bold">
35
+ TNT-Powered Next.js App
36
+ </h1>
37
+ <p className="mt-4 text-center text-lg text-neutral-700 md:text-xl lg:mt-6 dark:text-neutral-300">
38
+ Build modern web applications with today&apos;s most popular tools
39
+ </p>
40
+ </>
41
+ )}
42
+ {user && (
43
+ <h1 className="mt-6 bg-gradient-to-r from-purple-500 to-cyan-500 bg-clip-text text-center text-4xl leading-10 text-transparent sm:text-5xl sm:leading-14 md:text-6xl md:leading-20 lg:mt-10 lg:text-7xl lg:font-bold">
44
+ Welcome back, {user.email}
45
+ </h1>
46
+ )}
47
+
48
+ <div className="mt-12 flex items-center gap-3">
32
49
  <a
33
- className="admin"
34
50
  href={payloadConfig.routes.admin}
35
51
  rel="noopener noreferrer"
36
52
  target="_blank"
53
+ className="rounded-md bg-white px-2 py-1 text-black focus:opacity-80 focus:outline-none active:opacity-70 active:outline-none"
37
54
  >
38
55
  Go to admin panel
39
56
  </a>
40
57
  <a
41
- className="docs"
42
58
  href="https://payloadcms.com/docs"
43
59
  rel="noopener noreferrer"
44
60
  target="_blank"
61
+ className="rounded-md border border-white px-2 py-1 text-white focus:opacity-80 focus:outline-none active:opacity-70 active:outline-none"
62
+ >
63
+ Payload Docs
64
+ </a>
65
+ </div>
66
+
67
+ <div className="mt-12 flex items-center gap-3">
68
+ <a
69
+ href="https://create.tntstack.org"
70
+ target="_blank"
71
+ rel="noopener noreferrer"
72
+ className="flex items-center rounded-md border border-white px-2 py-1 outline-none focus:opacity-80 active:opacity-70"
73
+ >
74
+ Website
75
+ <svg
76
+ xmlns="http://www.w3.org/2000/svg"
77
+ viewBox="0 0 24 24"
78
+ strokeLinecap="round"
79
+ strokeLinejoin="round"
80
+ className="mb-1.5 size-4 fill-none stroke-current stroke-2"
81
+ >
82
+ <path d="M7 7h10v10" />
83
+ <path d="M7 17 17 7" />
84
+ </svg>
85
+ </a>
86
+ <a
87
+ href="https://create.tntstack.org/introduction"
88
+ target="_blank"
89
+ rel="noopener noreferrer"
90
+ className="flex items-center rounded-md border border-white px-2 py-1 outline-none focus:opacity-80 active:opacity-70"
45
91
  >
46
- Documentation
92
+ Docs
93
+ <svg
94
+ xmlns="http://www.w3.org/2000/svg"
95
+ viewBox="0 0 24 24"
96
+ strokeLinecap="round"
97
+ strokeLinejoin="round"
98
+ className="mb-1.5 size-4 fill-none stroke-current stroke-2"
99
+ >
100
+ <path d="M7 7h10v10" />
101
+ <path d="M7 17 17 7" />
102
+ </svg>
103
+ </a>
104
+ <a
105
+ href="https://github.com/SlickYeet/create-tnt-stack"
106
+ target="_blank"
107
+ rel="noopener noreferrer"
108
+ className="flex items-center rounded-md border border-white px-2 py-1 outline-none focus:opacity-80 active:opacity-70"
109
+ >
110
+ GitHub
111
+ <svg
112
+ xmlns="http://www.w3.org/2000/svg"
113
+ viewBox="0 0 24 24"
114
+ strokeLinecap="round"
115
+ strokeLinejoin="round"
116
+ className="mb-1.5 size-4 fill-none stroke-current stroke-2"
117
+ >
118
+ <path d="M7 7h10v10" />
119
+ <path d="M7 17 17 7" />
120
+ </svg>
47
121
  </a>
48
122
  </div>
49
123
  </div>
50
- <div className="footer">
51
- <p>Update this page by editing</p>
52
- <a className="codeLink" href={fileURL}>
53
- <code>app/(frontend)/page.tsx</code>
124
+
125
+ <div className="flex flex-col items-center gap-1 text-sm text-neutral-600 lg:flex-row lg:gap-2 dark:text-neutral-400">
126
+ <p className="m-0">Get started by editing </p>
127
+ <a
128
+ href={fileURL}
129
+ className="rounded-md bg-neutral-200 px-2 py-1 dark:bg-neutral-800"
130
+ >
131
+ <code>src/app/(frontend)/page.tsx</code>
54
132
  </a>
55
133
  </div>
56
- </div>
134
+ </main>
57
135
  )
58
136
  }
@@ -0,0 +1,5 @@
1
+ import NextAuth from "next-auth"
2
+
3
+ import { authConfig } from "@/server/auth/config"
4
+
5
+ export const { handlers, signIn, signOut, auth } = NextAuth(authConfig)
@@ -0,0 +1,30 @@
1
+ import { PrismaAdapter } from "@auth/prisma-adapter"
2
+ import { NextAuthConfig } from "next-auth"
3
+ import Discord from "next-auth/providers/discord"
4
+
5
+ import { env } from "@/env"
6
+ import { db } from "@/server/db"
7
+
8
+ /**
9
+ * This is the Auth.js configuration for the application.
10
+ *
11
+ * @see https://authjs.dev/getting-started/installation
12
+ */
13
+ export const authConfig: NextAuthConfig = {
14
+ adapter: PrismaAdapter(db),
15
+ providers: [
16
+ Discord({
17
+ clientId: env.DISCORD_CLIENT_ID,
18
+ clientSecret: env.DISCORD_CLIENT_SECRET,
19
+ }),
20
+ /**
21
+ * ...add more providers here.
22
+ *
23
+ * Most other providers require a bit more work than the Discord provider. For example, the
24
+ * GitHub provider requires you to add the `refresh_token_expires_in` field to the Account
25
+ * model. Refer to the Auth.js docs for the provider you want to use. Example:
26
+ *
27
+ * @see https://authjs.dev/getting-started/providers/github
28
+ */
29
+ ],
30
+ }
@@ -0,0 +1,27 @@
1
+ import { NextAuthConfig } from "next-auth"
2
+ import Discord from "next-auth/providers/discord"
3
+
4
+ import { env } from "@/env"
5
+
6
+ /**
7
+ * This is the Auth.js configuration for the application.
8
+ *
9
+ * @see https://authjs.dev/getting-started/installation
10
+ */
11
+ export const authConfig: NextAuthConfig = {
12
+ providers: [
13
+ Discord({
14
+ clientId: env.DISCORD_CLIENT_ID,
15
+ clientSecret: env.DISCORD_CLIENT_SECRET,
16
+ }),
17
+ /**
18
+ * ...add more providers here.
19
+ *
20
+ * Most other providers require a bit more work than the Discord provider. For example, the
21
+ * GitHub provider requires you to add the `refresh_token_expires_in` field to the Account
22
+ * model. Refer to the Auth.js docs for the provider you want to use. Example:
23
+ *
24
+ * @see https://authjs.dev/getting-started/providers/github
25
+ */
26
+ ],
27
+ }