create-ej-app 1.0.0

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 (103) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +5 -0
  3. package/cli.js +68 -0
  4. package/package.json +36 -0
  5. package/template/.env.example +12 -0
  6. package/template/.eslintrc.cjs +24 -0
  7. package/template/components.json +16 -0
  8. package/template/next.config.mjs +18 -0
  9. package/template/package.json +68 -0
  10. package/template/postcss.config.cjs +6 -0
  11. package/template/prettier.config.ts +11 -0
  12. package/template/prisma/schema.prisma +136 -0
  13. package/template/public/next.svg +1 -0
  14. package/template/src/app/(app)/dashboard/page.tsx +19 -0
  15. package/template/src/app/(app)/layout.tsx +117 -0
  16. package/template/src/app/(app)/roles/[id]/actions.ts +100 -0
  17. package/template/src/app/(app)/roles/[id]/page.tsx +36 -0
  18. package/template/src/app/(app)/roles/[id]/render.tsx +266 -0
  19. package/template/src/app/(app)/roles/actions.ts +67 -0
  20. package/template/src/app/(app)/roles/page.tsx +51 -0
  21. package/template/src/app/(app)/roles/render.tsx +70 -0
  22. package/template/src/app/(app)/settings/actions.ts +18 -0
  23. package/template/src/app/(app)/settings/loading.tsx +28 -0
  24. package/template/src/app/(app)/settings/page.tsx +28 -0
  25. package/template/src/app/(app)/settings/render.tsx +113 -0
  26. package/template/src/app/(app)/tasks/[id]/actions.ts +107 -0
  27. package/template/src/app/(app)/tasks/[id]/page.tsx +55 -0
  28. package/template/src/app/(app)/tasks/[id]/render.tsx +307 -0
  29. package/template/src/app/(app)/tasks/actions.ts +75 -0
  30. package/template/src/app/(app)/tasks/page.tsx +66 -0
  31. package/template/src/app/(app)/tasks/render.tsx +124 -0
  32. package/template/src/app/(app)/users/[id]/actions.ts +104 -0
  33. package/template/src/app/(app)/users/[id]/page.tsx +39 -0
  34. package/template/src/app/(app)/users/[id]/render.tsx +320 -0
  35. package/template/src/app/(app)/users/actions.ts +67 -0
  36. package/template/src/app/(app)/users/page.tsx +61 -0
  37. package/template/src/app/(app)/users/render.tsx +108 -0
  38. package/template/src/app/(auth)/layout.tsx +20 -0
  39. package/template/src/app/(auth)/login/page.tsx +49 -0
  40. package/template/src/app/(auth)/login/user-auth-form.tsx +152 -0
  41. package/template/src/app/(marketing)/layout.tsx +42 -0
  42. package/template/src/app/(marketing)/page.tsx +96 -0
  43. package/template/src/app/api/auth/[...nextauth]/route.ts +7 -0
  44. package/template/src/app/favicon.ico +0 -0
  45. package/template/src/app/globals.css +76 -0
  46. package/template/src/app/layout.tsx +32 -0
  47. package/template/src/components/app-nav-command.tsx +160 -0
  48. package/template/src/components/dark-mode-toggle.tsx +43 -0
  49. package/template/src/components/data-table/data-table-column-header.tsx +91 -0
  50. package/template/src/components/data-table/data-table-faceted-filter.tsx +149 -0
  51. package/template/src/components/data-table/data-table-loading.tsx +77 -0
  52. package/template/src/components/data-table/data-table-pagination.tsx +94 -0
  53. package/template/src/components/data-table/data-table-toolbar.tsx +78 -0
  54. package/template/src/components/data-table/data-table-types.ts +17 -0
  55. package/template/src/components/data-table/data-table-view-options.tsx +59 -0
  56. package/template/src/components/data-table/data-table.tsx +301 -0
  57. package/template/src/components/data-table/simple-data-table.tsx +109 -0
  58. package/template/src/components/empty-placeholder.tsx +78 -0
  59. package/template/src/components/heading.tsx +17 -0
  60. package/template/src/components/icons.tsx +83 -0
  61. package/template/src/components/main-nav.tsx +64 -0
  62. package/template/src/components/mobile-nav.tsx +50 -0
  63. package/template/src/components/shell.tsx +13 -0
  64. package/template/src/components/side-nav.tsx +51 -0
  65. package/template/src/components/site-footer.tsx +31 -0
  66. package/template/src/components/system-info.tsx +36 -0
  67. package/template/src/components/theme-provider.tsx +13 -0
  68. package/template/src/components/ui/alert-dialog.tsx +145 -0
  69. package/template/src/components/ui/avatar.tsx +50 -0
  70. package/template/src/components/ui/badge.tsx +36 -0
  71. package/template/src/components/ui/button.tsx +56 -0
  72. package/template/src/components/ui/card.tsx +79 -0
  73. package/template/src/components/ui/checkbox.tsx +30 -0
  74. package/template/src/components/ui/command.tsx +155 -0
  75. package/template/src/components/ui/dialog.tsx +123 -0
  76. package/template/src/components/ui/dropdown-menu.tsx +200 -0
  77. package/template/src/components/ui/form.tsx +176 -0
  78. package/template/src/components/ui/input.tsx +25 -0
  79. package/template/src/components/ui/label.tsx +26 -0
  80. package/template/src/components/ui/popover.tsx +31 -0
  81. package/template/src/components/ui/select.tsx +121 -0
  82. package/template/src/components/ui/separator.tsx +31 -0
  83. package/template/src/components/ui/skeleton.tsx +15 -0
  84. package/template/src/components/ui/table.tsx +114 -0
  85. package/template/src/components/ui/textarea.tsx +24 -0
  86. package/template/src/components/ui/toast.tsx +127 -0
  87. package/template/src/components/ui/toaster.tsx +35 -0
  88. package/template/src/components/ui/use-toast.ts +189 -0
  89. package/template/src/components/user-account-nav.tsx +60 -0
  90. package/template/src/components/user-avatar.tsx +25 -0
  91. package/template/src/env.mjs +67 -0
  92. package/template/src/hooks/use-debounce.ts +17 -0
  93. package/template/src/hooks/use-lock-body.tsx +12 -0
  94. package/template/src/lib/auth.ts +183 -0
  95. package/template/src/lib/cn.ts +4 -0
  96. package/template/src/lib/db.ts +20 -0
  97. package/template/src/lib/delay.ts +2 -0
  98. package/template/src/lib/formatDate.ts +11 -0
  99. package/template/src/lib/generateLabel.ts +5 -0
  100. package/template/src/lib/siteConfig.ts +4 -0
  101. package/template/src/types/UnwrapPromise.ts +1 -0
  102. package/template/tailwind.config.ts +79 -0
  103. package/template/tsconfig.json +46 -0
@@ -0,0 +1,61 @@
1
+ import { User, UserType } from '@prisma/client'
2
+ import { Metadata } from 'next'
3
+ import { notFound } from 'next/navigation'
4
+
5
+ import { authGuard } from '@/lib/auth'
6
+ import { siteConfig } from '@/lib/siteConfig'
7
+ import { getUsers } from './actions'
8
+ import { Render } from './render'
9
+
10
+ export const metadata: Metadata = {
11
+ title: 'Users' + ' | ' + siteConfig.name
12
+ }
13
+
14
+ const Users = async ({
15
+ searchParams
16
+ }: {
17
+ searchParams: {
18
+ page?: string
19
+ limit?: string
20
+ sort?: string
21
+ name?: string
22
+ email?: string
23
+ type?: string
24
+ }
25
+ }) => {
26
+ const session = await authGuard(['Root'])
27
+ if (!session) return notFound()
28
+
29
+ const page = searchParams.page ? parseInt(searchParams.page) : 1
30
+ const limit = searchParams.limit ? parseInt(searchParams.limit) : 10
31
+
32
+ const [sortBy, sortOrder] =
33
+ typeof searchParams.sort === 'string'
34
+ ? (searchParams.sort.split('.') as [
35
+ keyof User | undefined,
36
+ 'asc' | 'desc' | undefined
37
+ ])
38
+ : []
39
+
40
+ const name = searchParams.name
41
+ const email = searchParams.email
42
+
43
+ const type =
44
+ typeof searchParams.type === 'string'
45
+ ? (searchParams.type.split('.') as UserType[])
46
+ : undefined
47
+
48
+ const data = await getUsers({
49
+ page,
50
+ limit,
51
+ sortBy,
52
+ sortOrder,
53
+ name,
54
+ email,
55
+ type
56
+ })
57
+
58
+ return <Render data={data} />
59
+ }
60
+
61
+ export default Users
@@ -0,0 +1,108 @@
1
+ 'use client'
2
+
3
+ import { UserType } from '@prisma/client'
4
+ import Link from 'next/link'
5
+ import { FC } from 'react'
6
+
7
+ import { DataTable } from '@/components/data-table/data-table'
8
+ import { DataTableColumnHeader } from '@/components/data-table/data-table-column-header'
9
+ import { Heading } from '@/components/heading'
10
+ import { Icons } from '@/components/icons'
11
+ import { Shell } from '@/components/shell'
12
+ import { Button } from '@/components/ui/button'
13
+ import { formatDateTime, timesAgo } from '@/lib/formatDate'
14
+ import { generateLabel } from '@/lib/generateLabel'
15
+ import { GetUsersFnDataType } from './actions'
16
+
17
+ const types = Object.values(UserType).map(x => ({
18
+ label: generateLabel(x),
19
+ value: x
20
+ }))
21
+
22
+ export const Render: FC<{
23
+ data: GetUsersFnDataType
24
+ }> = ({ data }) => {
25
+ return (
26
+ <Shell>
27
+ <Heading heading="Users" text="List of all the users">
28
+ <Link href="/users/new">
29
+ <Button>
30
+ <Icons.add className="mr-2 h-4 w-4" />
31
+ New
32
+ </Button>
33
+ </Link>
34
+ </Heading>
35
+ <DataTable
36
+ columns={[
37
+ {
38
+ accessorKey: 'name',
39
+ header: ({ column }) => (
40
+ <DataTableColumnHeader column={column} title="Name" />
41
+ ),
42
+ cell: ({ row }) => (
43
+ <Link
44
+ className="underline underline-offset-4"
45
+ href={`/users/${row.original.id}`}
46
+ >
47
+ {row.original.name}
48
+ </Link>
49
+ )
50
+ },
51
+ {
52
+ accessorKey: 'email',
53
+ header: ({ column }) => (
54
+ <DataTableColumnHeader column={column} title="Email" />
55
+ )
56
+ },
57
+ {
58
+ accessorKey: 'type',
59
+ header: ({ column }) => (
60
+ <DataTableColumnHeader column={column} title="Type" />
61
+ )
62
+ },
63
+ {
64
+ accessorKey: 'role',
65
+ header: ({ column }) => (
66
+ <DataTableColumnHeader column={column} title="Role" />
67
+ ),
68
+ cell: ({ row }) => row.original.role?.name,
69
+ enableSorting: false
70
+ },
71
+ {
72
+ accessorKey: 'createdAt',
73
+ header: ({ column }) => (
74
+ <DataTableColumnHeader column={column} title="Created At" />
75
+ ),
76
+ cell: ({ row }) => formatDateTime(row.original.createdAt)
77
+ },
78
+ {
79
+ accessorKey: 'updatedAt',
80
+ header: ({ column }) => (
81
+ <DataTableColumnHeader column={column} title="Updated At" />
82
+ ),
83
+ cell: ({ row }) => timesAgo(row.original.updatedAt)
84
+ }
85
+ ]}
86
+ data={data.users}
87
+ total={data.total}
88
+ searchableColumns={[
89
+ {
90
+ id: 'name',
91
+ title: 'Name'
92
+ },
93
+ {
94
+ id: 'email',
95
+ title: 'Email'
96
+ }
97
+ ]}
98
+ filterableColumns={[
99
+ {
100
+ id: 'type',
101
+ title: 'Type',
102
+ options: types
103
+ }
104
+ ]}
105
+ />
106
+ </Shell>
107
+ )
108
+ }
@@ -0,0 +1,20 @@
1
+ import { redirect } from 'next/navigation'
2
+ import { ReactNode } from 'react'
3
+
4
+ import { SiteFooter } from '@/components/site-footer'
5
+ import { getAuthSession } from '@/lib/auth'
6
+
7
+ const AuthLayout = async ({ children }: { children: ReactNode }) => {
8
+ const session = await getAuthSession()
9
+
10
+ if (session?.user) return redirect('/dashboard')
11
+
12
+ return (
13
+ <div className="flex min-h-screen flex-col justify-between">
14
+ <main>{children}</main>
15
+ <SiteFooter />
16
+ </div>
17
+ )
18
+ }
19
+
20
+ export default AuthLayout
@@ -0,0 +1,49 @@
1
+ import Link from 'next/link'
2
+
3
+ import { Icons } from '@/components/icons'
4
+ import { Button } from '@/components/ui/button'
5
+ import { UserAuthForm } from './user-auth-form'
6
+
7
+ const LoginPage = () => {
8
+ return (
9
+ <div className="container flex h-[90vh] w-screen flex-col items-center justify-center">
10
+ <Link href="/" className="absolute left-4 top-4">
11
+ <Button variant="ghost">
12
+ <Icons.chevronLeft className="mr-2 h-4 w-4" />
13
+ Back
14
+ </Button>
15
+ </Link>
16
+ <div className="mx-auto flex w-full flex-col justify-center space-y-6 sm:w-80">
17
+ <div className="flex flex-col space-y-2 text-center">
18
+ <Icons.logo className="mx-auto h-6 w-6" />
19
+ <h1 className="text-2xl font-semibold tracking-tight">
20
+ Welcome back
21
+ </h1>
22
+ <p className="text-sm text-muted-foreground">
23
+ Enter your email to sign in to your account
24
+ </p>
25
+ </div>
26
+ <UserAuthForm />
27
+ <p className="px-8 text-center text-sm text-muted-foreground">
28
+ By clicking continue, you agree to our{' '}
29
+ <Link
30
+ href="/terms"
31
+ className="underline underline-offset-4 hover:text-primary"
32
+ >
33
+ Terms of Service
34
+ </Link>{' '}
35
+ and{' '}
36
+ <Link
37
+ href="/privacy"
38
+ className="underline underline-offset-4 hover:text-primary"
39
+ >
40
+ Privacy Policy
41
+ </Link>
42
+ .
43
+ </p>
44
+ </div>
45
+ </div>
46
+ )
47
+ }
48
+
49
+ export default LoginPage
@@ -0,0 +1,152 @@
1
+ 'use client'
2
+
3
+ import { zodResolver } from '@hookform/resolvers/zod'
4
+ import { signIn } from 'next-auth/react'
5
+ import { useSearchParams } from 'next/navigation'
6
+ import { FC, HTMLAttributes, useState } from 'react'
7
+ import { useForm } from 'react-hook-form'
8
+ import { z } from 'zod'
9
+
10
+ import { Icons } from '@/components/icons'
11
+ import { Button } from '@/components/ui/button'
12
+ import { Input } from '@/components/ui/input'
13
+ import { Label } from '@/components/ui/label'
14
+ import { toast } from '@/components/ui/use-toast'
15
+ import { cn } from '@/lib/cn'
16
+
17
+ const userAuthSchema = z.object({
18
+ email: z.string().email()
19
+ })
20
+
21
+ type FormData = z.infer<typeof userAuthSchema>
22
+
23
+ interface UserAuthFormProps extends HTMLAttributes<HTMLDivElement> {}
24
+
25
+ export const UserAuthForm: FC = ({
26
+ className,
27
+ ...props
28
+ }: UserAuthFormProps) => {
29
+ const {
30
+ register,
31
+ handleSubmit,
32
+ formState: { errors }
33
+ } = useForm<FormData>({
34
+ resolver: zodResolver(userAuthSchema)
35
+ })
36
+ const [isLoading, setIsLoading] = useState(false)
37
+ const [isGoogleLoading, setIsGoogleLoading] = useState(false)
38
+ const [isGithubLoading, setIsGithubLoading] = useState(false)
39
+
40
+ const searchParams = useSearchParams()
41
+
42
+ async function onSubmit(data: FormData) {
43
+ setIsLoading(true)
44
+
45
+ const signInResult = await signIn('email', {
46
+ email: data.email.toLowerCase(),
47
+ redirect: false,
48
+ callbackUrl: searchParams?.get('from') || '/dashboard'
49
+ })
50
+
51
+ setIsLoading(false)
52
+
53
+ if (!signInResult?.ok) {
54
+ return toast({
55
+ title: 'Something went wrong.',
56
+ description: 'Your sign in request failed. Please try again.',
57
+ variant: 'destructive'
58
+ })
59
+ }
60
+
61
+ return toast({
62
+ title: 'Check your email',
63
+ description: 'We sent you a login link. Be sure to check your spam too.'
64
+ })
65
+ }
66
+
67
+ return (
68
+ <div className={cn('grid gap-6', className)} {...props}>
69
+ <form onSubmit={handleSubmit(onSubmit)}>
70
+ <div className="grid gap-2">
71
+ <div className="grid gap-1">
72
+ <Label className="sr-only" htmlFor="email">
73
+ Email
74
+ </Label>
75
+ <Input
76
+ id="email"
77
+ placeholder="name@example.com"
78
+ type="email"
79
+ autoCapitalize="none"
80
+ autoComplete="email"
81
+ autoCorrect="off"
82
+ disabled={isLoading}
83
+ {...register('email')}
84
+ />
85
+ {errors?.email && (
86
+ <p className="px-1 text-xs text-red-600">
87
+ {errors.email.message}
88
+ </p>
89
+ )}
90
+ </div>
91
+ <Button
92
+ disabled={isLoading || isGoogleLoading || isGithubLoading}
93
+ type="submit"
94
+ >
95
+ {isLoading && (
96
+ <Icons.spinner className="mr-2 h-4 w-4 animate-spin" />
97
+ )}
98
+ Sign in with Email
99
+ </Button>
100
+ </div>
101
+ </form>
102
+ <div className="relative">
103
+ <div className="absolute inset-0 flex items-center">
104
+ <span className="w-full border-t" />
105
+ </div>
106
+ <div className="relative flex justify-center text-xs uppercase">
107
+ <span className="bg-background px-2 text-muted-foreground">
108
+ Or continue with
109
+ </span>
110
+ </div>
111
+ </div>
112
+ <div className="grid gap-2">
113
+ <Button
114
+ variant="outline"
115
+ onClick={async () => {
116
+ setIsGoogleLoading(true)
117
+ await signIn('google', {
118
+ callbackUrl: searchParams?.get('from') || '/dashboard'
119
+ })
120
+ setIsGoogleLoading(false)
121
+ }}
122
+ disabled={isLoading || isGoogleLoading || isGithubLoading}
123
+ >
124
+ {isGoogleLoading ? (
125
+ <Icons.spinner className="mr-2 h-4 w-4 animate-spin" />
126
+ ) : (
127
+ <Icons.google className="mr-2 h-4 w-4" />
128
+ )}
129
+ Google
130
+ </Button>
131
+ <Button
132
+ variant="outline"
133
+ onClick={async () => {
134
+ setIsGithubLoading(true)
135
+ await signIn('github', {
136
+ callbackUrl: searchParams?.get('from') || '/dashboard'
137
+ })
138
+ setIsGithubLoading(false)
139
+ }}
140
+ disabled={isLoading || isGoogleLoading || isGithubLoading}
141
+ >
142
+ {isGithubLoading ? (
143
+ <Icons.spinner className="mr-2 h-4 w-4 animate-spin" />
144
+ ) : (
145
+ <Icons.github className="mr-2 h-4 w-4" />
146
+ )}
147
+ Github
148
+ </Button>
149
+ </div>
150
+ </div>
151
+ )
152
+ }
@@ -0,0 +1,42 @@
1
+ import { ReactNode } from 'react'
2
+
3
+ import { Icons } from '@/components/icons'
4
+ import { MainNav } from '@/components/main-nav'
5
+ import { SiteFooter } from '@/components/site-footer'
6
+ import { Button } from '@/components/ui/button'
7
+ import { getAuthSession } from '@/lib/auth'
8
+ import Link from 'next/link'
9
+
10
+ const Layout = async ({ children }: { children: ReactNode }) => {
11
+ const session = await getAuthSession()
12
+
13
+ return (
14
+ <div className="flex min-h-screen flex-col space-y-4">
15
+ <header className="sticky top-0 z-40 border-b bg-background">
16
+ <div className="container flex h-16 items-center justify-between py-4">
17
+ <MainNav />
18
+ <div className="flex items-center justify-center space-x-4">
19
+ {session?.user ? (
20
+ <Link href="/dashboard">
21
+ <Button size="sm" variant="secondary">
22
+ Dashboard
23
+ </Button>
24
+ </Link>
25
+ ) : (
26
+ <Link href="/login">
27
+ <Button size="sm" variant="secondary">
28
+ <Icons.login className="mr-2 h-4 w-4" />
29
+ Sign In
30
+ </Button>
31
+ </Link>
32
+ )}
33
+ </div>
34
+ </div>
35
+ </header>
36
+ <main className="flex-1">{children}</main>
37
+ <SiteFooter className="border-t" />
38
+ </div>
39
+ )
40
+ }
41
+
42
+ export default Layout
@@ -0,0 +1,96 @@
1
+ import Image from 'next/image'
2
+
3
+ const links = [
4
+ {
5
+ href: 'https://nextjs.org',
6
+ title: 'Next.js',
7
+ description: 'Find in-depth information about Next.js features and API.'
8
+ },
9
+ {
10
+ href: 'https://typescriptlang.org',
11
+ title: 'TypeScript',
12
+ description:
13
+ 'Learn about TypeScript and how it helps you write better JavaScript.'
14
+ },
15
+ {
16
+ href: 'https://prisma.io',
17
+ title: 'Prisma',
18
+ description: 'Prisma is a next-generation ORM for Node.js and TypeScript.'
19
+ },
20
+ {
21
+ href: 'https://next-auth.js.org',
22
+ title: 'NextAuth.js',
23
+ description:
24
+ 'Authentication for Next.js featuring sign in with GitHub and more.'
25
+ },
26
+ {
27
+ href: 'https://tailwindcss.com',
28
+ title: 'Tailwind CSS',
29
+ description:
30
+ 'A utility-first CSS framework for rapidly building custom designs.'
31
+ },
32
+ {
33
+ href: 'https://shadcn.com',
34
+ title: 'Shadcn UI',
35
+ description: 'An awesome ui component library with tailwindcss.'
36
+ },
37
+ {
38
+ href: 'https://nextjs.org/docs/app/api-reference/functions/server-actions',
39
+ title: 'Server Actions',
40
+ description: 'Learn about Server Actions and how to use them.'
41
+ },
42
+ {
43
+ href: 'https://vercel.com/new',
44
+ title: 'Vercel',
45
+ description:
46
+ 'Instantly deploy your Next.js site to a shareable URL with Vercel.'
47
+ }
48
+ ]
49
+
50
+ const Home = () => {
51
+ return (
52
+ <div className="flex min-h-[80vh] flex-col items-center justify-between">
53
+ <div className="max-w-5xl w-full items-center justify-between font-mono text-sm lg:flex">
54
+ <p className="flex w-full justify-center border-b border-gray-300 bg-gradient-to-b from-zinc-200 pb-6 pt-8 backdrop-blur-2xl dark:border-neutral-800 dark:bg-zinc-800/30 dark:from-inherit lg:static lg:w-auto lg:rounded-xl lg:border lg:bg-gray-200 lg:p-4 lg:dark:bg-zinc-800/30">
55
+ Get started by editing&nbsp;
56
+ <code className="font-mono font-bold">src/app/page.tsx</code>
57
+ </p>
58
+ </div>
59
+
60
+ <div className="mt-12 flex place-items-center before:absolute before:h-[300px] before:w-[240px] before:-translate-x-1/2 before:rounded-full before:bg-gradient-radial before:from-white before:to-transparent before:blur-2xl before:content-[''] after:absolute after:-z-20 after:h-[180px] after:w-[120px] after:translate-x-1/3 after:bg-gradient-conic after:from-sky-200 after:via-blue-200 after:blur-2xl after:content-[''] before:dark:bg-gradient-to-br before:dark:from-transparent before:dark:to-blue-700 before:dark:opacity-10 after:dark:from-sky-900 after:dark:via-[#0141ff] after:dark:opacity-40 before:lg:h-[360px] z-[-1]">
61
+ <Image
62
+ className="dark:drop-shadow-[0_0_0.3rem_#ffffff70] dark:invert"
63
+ src="/next.svg"
64
+ alt="Next.js Logo"
65
+ width={180}
66
+ height={37}
67
+ priority
68
+ />
69
+ </div>
70
+
71
+ <div className="my-8 grid text-center lg:max-w-5xl lg:w-full lg:grid-cols-4 lg:text-left gap-2">
72
+ {links.map((l, i) => (
73
+ <a
74
+ key={i}
75
+ href={l.href}
76
+ className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
77
+ target="_blank"
78
+ rel="noopener noreferrer"
79
+ >
80
+ <h2 className="mb-3 text-2xl font-semibold">
81
+ {l.title + ' '}
82
+ <span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
83
+ -&gt;
84
+ </span>
85
+ </h2>
86
+ <p className="m-0 max-w-[30ch] text-sm opacity-50">
87
+ {l.description}
88
+ </p>
89
+ </a>
90
+ ))}
91
+ </div>
92
+ </div>
93
+ )
94
+ }
95
+
96
+ export default Home
@@ -0,0 +1,7 @@
1
+ import NextAuth from 'next-auth'
2
+
3
+ import { authOptions } from '@/lib/auth'
4
+
5
+ const handler = NextAuth(authOptions)
6
+
7
+ export { handler as GET, handler as POST }
Binary file
@@ -0,0 +1,76 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
4
+
5
+ @layer base {
6
+ :root {
7
+ --background: 0 0% 100%;
8
+ --foreground: 0 0% 3.9%;
9
+
10
+ --card: 0 0% 100%;
11
+ --card-foreground: 0 0% 3.9%;
12
+
13
+ --popover: 0 0% 100%;
14
+ --popover-foreground: 0 0% 3.9%;
15
+
16
+ --primary: 0 0% 9%;
17
+ --primary-foreground: 0 0% 98%;
18
+
19
+ --secondary: 0 0% 96.1%;
20
+ --secondary-foreground: 0 0% 9%;
21
+
22
+ --muted: 0 0% 96.1%;
23
+ --muted-foreground: 0 0% 45.1%;
24
+
25
+ --accent: 0 0% 96.1%;
26
+ --accent-foreground: 0 0% 9%;
27
+
28
+ --destructive: 0 84.2% 60.2%;
29
+ --destructive-foreground: 0 0% 98%;
30
+
31
+ --border: 0 0% 89.8%;
32
+ --input: 0 0% 89.8%;
33
+ --ring: 0 0% 3.9%;
34
+
35
+ --radius: 0.5rem;
36
+ }
37
+
38
+ .dark {
39
+ --background: 0 0% 3.9%;
40
+ --foreground: 0 0% 98%;
41
+
42
+ --card: 0 0% 3.9%;
43
+ --card-foreground: 0 0% 98%;
44
+
45
+ --popover: 0 0% 3.9%;
46
+ --popover-foreground: 0 0% 98%;
47
+
48
+ --primary: 0 0% 98%;
49
+ --primary-foreground: 0 0% 9%;
50
+
51
+ --secondary: 0 0% 14.9%;
52
+ --secondary-foreground: 0 0% 98%;
53
+
54
+ --muted: 0 0% 14.9%;
55
+ --muted-foreground: 0 0% 63.9%;
56
+
57
+ --accent: 0 0% 14.9%;
58
+ --accent-foreground: 0 0% 98%;
59
+
60
+ --destructive: 0 62.8% 30.6%;
61
+ --destructive-foreground: 0 0% 98%;
62
+
63
+ --border: 0 0% 14.9%;
64
+ --input: 0 0% 14.9%;
65
+ --ring: 0 0% 83.1%;
66
+ }
67
+ }
68
+
69
+ @layer base {
70
+ * {
71
+ @apply border-border;
72
+ }
73
+ body {
74
+ @apply bg-background text-foreground;
75
+ }
76
+ }
@@ -0,0 +1,32 @@
1
+ import { Analytics } from '@vercel/analytics/react'
2
+ import { Metadata } from 'next'
3
+ import { Inter } from 'next/font/google'
4
+ import { ReactNode } from 'react'
5
+
6
+ import { ThemeProvider } from '@/components/theme-provider'
7
+ import { Toaster } from '@/components/ui/toaster'
8
+ import { siteConfig } from '@/lib/siteConfig'
9
+ import './globals.css'
10
+
11
+ const inter = Inter({ subsets: ['latin'] })
12
+
13
+ export const metadata: Metadata = {
14
+ title: siteConfig.name,
15
+ description: siteConfig.description
16
+ }
17
+
18
+ const RootLayout = ({ children }: { children: ReactNode }) => {
19
+ return (
20
+ <html lang="en" suppressHydrationWarning>
21
+ <body className={inter.className}>
22
+ <ThemeProvider attribute="class" defaultTheme="system" enableSystem>
23
+ {children}
24
+ <Analytics />
25
+ <Toaster />
26
+ </ThemeProvider>
27
+ </body>
28
+ </html>
29
+ )
30
+ }
31
+
32
+ export default RootLayout