create-apppaaaul 2.0.2 → 2.0.4
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/README.md +20 -20
- package/dist/index.js +168 -0
- package/dist/index.js.map +1 -0
- package/dist/templates/nextjs-ts-clean/project/.editorconfig +9 -0
- package/dist/templates/nextjs-ts-clean/project/.vscode/launch.json +28 -0
- package/dist/templates/nextjs-ts-clean/project/.vscode/settings.json +8 -0
- package/dist/templates/nextjs-ts-clean/project/README.md +15 -0
- package/dist/templates/nextjs-ts-clean/project/eslint.config.mjs +172 -0
- package/dist/templates/nextjs-ts-clean/project/next.config.mjs +13 -0
- package/dist/templates/nextjs-ts-clean/project/package.json +46 -0
- package/dist/templates/nextjs-ts-clean/project/pnpm-lock.yaml +5463 -0
- package/dist/templates/nextjs-ts-clean/project/postcss.config.js +6 -0
- package/dist/templates/nextjs-ts-clean/project/public/next.svg +1 -0
- package/dist/templates/nextjs-ts-clean/project/public/vercel.svg +1 -0
- package/dist/templates/nextjs-ts-clean/project/src/app/favicon.ico +0 -0
- package/dist/templates/nextjs-ts-clean/project/src/app/globals.css +77 -0
- package/dist/templates/nextjs-ts-clean/project/src/app/layout.tsx +26 -0
- package/dist/templates/nextjs-ts-clean/project/src/app/page.tsx +5 -0
- package/dist/templates/nextjs-ts-clean/project/src/components/ui/button.tsx +49 -0
- package/dist/templates/nextjs-ts-clean/project/src/lib/utils.ts +6 -0
- package/dist/templates/nextjs-ts-clean/project/tailwind.config.ts +80 -0
- package/dist/templates/nextjs-ts-clean/project/tsconfig.json +27 -0
- package/dist/templates/nextjs-ts-landing/project/.editorconfig +9 -0
- package/dist/templates/nextjs-ts-landing/project/.eslintrc.cjs +101 -0
- package/dist/templates/nextjs-ts-landing/project/.eslintrc.mjs +172 -0
- package/dist/templates/nextjs-ts-landing/project/.vscode/launch.json +28 -0
- package/dist/templates/nextjs-ts-landing/project/.vscode/settings.json +8 -0
- package/dist/templates/nextjs-ts-landing-drizzle/project/.editorconfig +9 -0
- package/dist/templates/nextjs-ts-landing-drizzle/project/.eslintrc.mjs +172 -0
- package/dist/templates/nextjs-ts-landing-drizzle/project/.vscode/launch.json +28 -0
- package/dist/templates/nextjs-ts-landing-drizzle/project/.vscode/settings.json +8 -0
- package/dist/templates/nextjs-ts-landing-drizzle/project/README.md +15 -0
- package/dist/templates/nextjs-ts-landing-drizzle/project/components.json +17 -0
- package/dist/templates/nextjs-ts-landing-drizzle/project/docker-compose.yml +15 -0
- package/dist/templates/nextjs-ts-landing-drizzle/project/drizzle.config.ts +11 -0
- package/dist/templates/nextjs-ts-landing-drizzle/project/next.config.mjs +10 -0
- package/dist/templates/nextjs-ts-landing-drizzle/project/package.json +57 -0
- package/dist/templates/nextjs-ts-landing-drizzle/project/pnpm-lock.yaml +6248 -0
- package/dist/templates/nextjs-ts-landing-drizzle/project/postcss.config.js +6 -0
- package/dist/templates/nextjs-ts-landing-drizzle/project/public/next.svg +1 -0
- package/dist/templates/nextjs-ts-landing-drizzle/project/public/vercel.svg +1 -0
- package/dist/templates/nextjs-ts-landing-drizzle/project/src/app/api/auth/[...nextauth]/route.ts +3 -0
- package/dist/templates/nextjs-ts-landing-drizzle/project/src/app/favicon.ico +0 -0
- package/dist/templates/nextjs-ts-landing-drizzle/project/src/app/globals.css +47 -0
- package/dist/templates/nextjs-ts-landing-drizzle/project/src/app/layout.tsx +20 -0
- package/dist/templates/nextjs-ts-landing-drizzle/project/src/app/page.tsx +5 -0
- package/dist/templates/nextjs-ts-landing-drizzle/project/src/auth.ts +79 -0
- package/dist/templates/nextjs-ts-landing-drizzle/project/src/components/ui/button.tsx +49 -0
- package/dist/templates/nextjs-ts-landing-drizzle/project/src/db/index.ts +25 -0
- package/dist/templates/nextjs-ts-landing-drizzle/project/src/db/schema.ts +93 -0
- package/dist/templates/nextjs-ts-landing-drizzle/project/src/lib/utils.ts +6 -0
- package/dist/templates/nextjs-ts-landing-drizzle/project/tailwind.config.ts +80 -0
- package/dist/templates/nextjs-ts-landing-drizzle/project/tsconfig.json +27 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.editorconfig +9 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.vscode/launch.json +28 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.vscode/settings.json +8 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/README.md +15 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/components.json +17 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/docker-compose.yml +15 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/eslint.config.mjs +172 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/next.config.mjs +10 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/package.json +58 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/pnpm-lock.yaml +5854 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/pnpm-workspace.yaml +6 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/postcss.config.mjs +5 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/prisma/migrations/20250329125127_init/migration.sql +25 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/prisma/migrations/migration_lock.toml +3 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/prisma/schema.prisma +24 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/public/next.svg +1 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/public/vercel.svg +1 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/src/app/api/auth/[...nextauth]/route.ts +3 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/src/app/favicon.ico +0 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/src/app/globals.css +117 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/src/app/layout.tsx +20 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/src/app/page.tsx +5 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/src/auth.ts +79 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/src/components/ui/button.tsx +49 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/src/lib/db.ts +11 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/src/lib/utils.ts +6 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/tailwind.config.ts +80 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/tsconfig.json +27 -0
- package/package.json +43 -43
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.7zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.6h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17.8l18.3-22.7z"/><path fill="#000" d="M81 79.3 17 0H0v79.3h13.6V17l50.2 62.3H81Zm252.6-.4c-1 0-1.8-.4-2.5-1s-1.1-1.6-1.1-2.6.3-1.8 1-2.5 1.6-1 2.6-1 1.8.3 2.5 1a3.4 3.4 0 0 1 .6 4.3 3.7 3.7 0 0 1-3 1.8zm23.2-33.5h6v23.3c0 2.1-.4 4-1.3 5.5a9.1 9.1 0 0 1-3.8 3.5c-1.6.8-3.5 1.3-5.7 1.3-2 0-3.7-.4-5.3-1s-2.8-1.8-3.7-3.2c-.9-1.3-1.4-3-1.4-5h6c.1.8.3 1.6.7 2.2s1 1.2 1.6 1.5c.7.4 1.5.5 2.4.5 1 0 1.8-.2 2.4-.6a4 4 0 0 0 1.6-1.8c.3-.8.5-1.8.5-3V45.5zm30.9 9.1a4.4 4.4 0 0 0-2-3.3 7.5 7.5 0 0 0-4.3-1.1c-1.3 0-2.4.2-3.3.5-.9.4-1.6 1-2 1.6a3.5 3.5 0 0 0-.3 4c.3.5.7.9 1.3 1.2l1.8 1 2 .5 3.2.8c1.3.3 2.5.7 3.7 1.2a13 13 0 0 1 3.2 1.8 8.1 8.1 0 0 1 3 6.5c0 2-.5 3.7-1.5 5.1a10 10 0 0 1-4.4 3.5c-1.8.8-4.1 1.2-6.8 1.2-2.6 0-4.9-.4-6.8-1.2-2-.8-3.4-2-4.5-3.5a10 10 0 0 1-1.7-5.6h6a5 5 0 0 0 3.5 4.6c1 .4 2.2.6 3.4.6 1.3 0 2.5-.2 3.5-.6 1-.4 1.8-1 2.4-1.7a4 4 0 0 0 .8-2.4c0-.9-.2-1.6-.7-2.2a11 11 0 0 0-2.1-1.4l-3.2-1-3.8-1c-2.8-.7-5-1.7-6.6-3.2a7.2 7.2 0 0 1-2.4-5.7 8 8 0 0 1 1.7-5 10 10 0 0 1 4.3-3.5c2-.8 4-1.2 6.4-1.2 2.3 0 4.4.4 6.2 1.2 1.8.8 3.2 2 4.3 3.4 1 1.4 1.5 3 1.5 5h-5.8z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 283 64"><path fill="black" d="M141 16c-11 0-19 7-19 18s9 18 20 18c7 0 13-3 16-7l-7-5c-2 3-6 4-9 4-5 0-9-3-10-7h28v-3c0-11-8-18-19-18zm-9 15c1-4 4-7 9-7s8 3 9 7h-18zm117-15c-11 0-19 7-19 18s9 18 20 18c6 0 12-3 16-7l-8-5c-2 3-5 4-8 4-5 0-9-3-11-7h28l1-3c0-11-8-18-19-18zm-10 15c2-4 5-7 10-7s8 3 9 7h-19zm-39 3c0 6 4 10 10 10 4 0 7-2 9-5l8 5c-3 5-9 8-17 8-11 0-19-7-19-18s8-18 19-18c8 0 14 3 17 8l-8 5c-2-3-5-5-9-5-6 0-10 4-10 10zm83-29v46h-9V5h9zM37 0l37 64H0L37 0zm92 5-27 48L74 5h10l18 30 17-30h10zm59 12v10l-3-1c-6 0-10 4-10 10v15h-9V17h9v9c0-5 6-9 13-9z"/></svg>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
@tailwind base;
|
|
2
|
+
@tailwind components;
|
|
3
|
+
@tailwind utilities;
|
|
4
|
+
|
|
5
|
+
@layer base {
|
|
6
|
+
:root {
|
|
7
|
+
--background: 15 23 42; /* slate-900 */
|
|
8
|
+
--foreground: 241 245 249; /* slate-100 */
|
|
9
|
+
|
|
10
|
+
--card: 23 37 84; /* blue-950 */
|
|
11
|
+
--card-foreground: 241 245 249; /* slate-100 */
|
|
12
|
+
|
|
13
|
+
--popover: 23 37 84; /* blue-950 */
|
|
14
|
+
--popover-foreground: 241 245 249; /* slate-100 */
|
|
15
|
+
|
|
16
|
+
--primary: 37 99 235; /* blue-600 */
|
|
17
|
+
--primary-foreground: 241 245 249; /* slate-100 */
|
|
18
|
+
|
|
19
|
+
--secondary: 147 197 253; /* blue-300 */
|
|
20
|
+
--secondary-foreground: 15 23 42; /* slate-900 */
|
|
21
|
+
|
|
22
|
+
--muted: 51 65 85; /* slate-700 */
|
|
23
|
+
--muted-foreground: 148 163 184; /* slate-400 */
|
|
24
|
+
|
|
25
|
+
--accent: 147 197 253; /* blue-300 */
|
|
26
|
+
--accent-foreground: 15 23 42; /* slate-900 */
|
|
27
|
+
|
|
28
|
+
--destructive: 239 68 68; /* red-500 */
|
|
29
|
+
--destructive-foreground: 241 245 249; /* slate-100 */
|
|
30
|
+
|
|
31
|
+
--border: 147 197 253; /* blue-300 */
|
|
32
|
+
--input: 147 197 253; /* blue-300 */
|
|
33
|
+
--ring: 241 245 249; /* slate-100 */
|
|
34
|
+
|
|
35
|
+
--radius: 0.5rem;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@layer base {
|
|
40
|
+
* {
|
|
41
|
+
@apply border-border;
|
|
42
|
+
}
|
|
43
|
+
body {
|
|
44
|
+
@apply bg-background text-foreground;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type {Metadata} from "next";
|
|
2
|
+
import {Nunito} from "next/font/google";
|
|
3
|
+
|
|
4
|
+
import "./globals.css";
|
|
5
|
+
|
|
6
|
+
const font = Nunito({subsets: ["latin"]});
|
|
7
|
+
|
|
8
|
+
export const metadata: Metadata = {
|
|
9
|
+
title: "{{name}}",
|
|
10
|
+
description: "A project by Paaauldev",
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default function RootLayout({children}: {children: React.ReactNode}) {
|
|
14
|
+
return (
|
|
15
|
+
<html lang="en">
|
|
16
|
+
<body className={font.className}>{children}
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
|
|
5
|
+
import { DrizzleAdapter } from "@auth/drizzle-adapter";
|
|
6
|
+
import NextAuth, { type User } from "next-auth";
|
|
7
|
+
import Credentials from "next-auth/providers/credentials";
|
|
8
|
+
|
|
9
|
+
import { getUserFromDb } from "./actions/user-actions";
|
|
10
|
+
import { db } from "./db";
|
|
11
|
+
|
|
12
|
+
export const { handlers, signIn, signOut, auth } = NextAuth({
|
|
13
|
+
adapter: DrizzleAdapter(db),
|
|
14
|
+
providers: [
|
|
15
|
+
Credentials({
|
|
16
|
+
// You can specify which fields should be submitted, by adding keys to the `credentials` object.
|
|
17
|
+
// e.g. domain, username, password, 2FA token, etc.
|
|
18
|
+
credentials: {
|
|
19
|
+
email: {},
|
|
20
|
+
password: {},
|
|
21
|
+
},
|
|
22
|
+
authorize: async (credentials) => {
|
|
23
|
+
let user = null;
|
|
24
|
+
|
|
25
|
+
// logic to salt and hash password
|
|
26
|
+
// const pwHash = saltAndHashPassword(credentials.password)
|
|
27
|
+
|
|
28
|
+
// logic to verify if user exists
|
|
29
|
+
user = await getUserFromDb(credentials.email as string, credentials.password as string);
|
|
30
|
+
|
|
31
|
+
if (!user) {
|
|
32
|
+
// No user found, so this is their first attempt to login
|
|
33
|
+
// meaning this is also the place you could do registration
|
|
34
|
+
throw new Error("User not found.");
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (!user.success) {
|
|
38
|
+
throw new Error(user.message);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// return user object with the their profile data
|
|
42
|
+
return user.data as unknown as User;
|
|
43
|
+
},
|
|
44
|
+
}),
|
|
45
|
+
],
|
|
46
|
+
secret: process.env.AUTH_SECRET,
|
|
47
|
+
session: {
|
|
48
|
+
strategy: "jwt",
|
|
49
|
+
maxAge: 30 * 24 * 60 * 60, // 30 days
|
|
50
|
+
},
|
|
51
|
+
callbacks: {
|
|
52
|
+
jwt({ token, user }) {
|
|
53
|
+
if (user) {
|
|
54
|
+
token.role = user.role;
|
|
55
|
+
token.email = user.email;
|
|
56
|
+
token.name = user.name;
|
|
57
|
+
token.surname = user.surname;
|
|
58
|
+
token.dni = user.dni;
|
|
59
|
+
token.phone = user.phone;
|
|
60
|
+
token.id = user.id;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return token;
|
|
64
|
+
},
|
|
65
|
+
session({ session, token }) {
|
|
66
|
+
if (session.user) {
|
|
67
|
+
session.user.role = token.role as string;
|
|
68
|
+
session.user.email = token.email;
|
|
69
|
+
session.user.name = token.name;
|
|
70
|
+
session.user.surname = token.surname;
|
|
71
|
+
session.user.dni = token.dni;
|
|
72
|
+
session.user.phone = token.phone;
|
|
73
|
+
session.user.id = token.id;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return session;
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import {Slot} from "@radix-ui/react-slot";
|
|
3
|
+
import {cva, type VariantProps} from "class-variance-authority";
|
|
4
|
+
|
|
5
|
+
import {cn} from "@/lib/utils";
|
|
6
|
+
|
|
7
|
+
const buttonVariants = cva(
|
|
8
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
13
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
14
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
15
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
16
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
17
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
18
|
+
},
|
|
19
|
+
size: {
|
|
20
|
+
default: "h-10 px-4 py-2",
|
|
21
|
+
sm: "h-9 rounded-md px-3",
|
|
22
|
+
lg: "h-11 rounded-md px-8",
|
|
23
|
+
icon: "h-10 w-10",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
variant: "default",
|
|
28
|
+
size: "default",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
export interface ButtonProps
|
|
34
|
+
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
35
|
+
VariantProps<typeof buttonVariants> {
|
|
36
|
+
asChild?: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
40
|
+
({className, variant, size, asChild = false, ...props}, ref) => {
|
|
41
|
+
const Comp = asChild ? Slot : "button";
|
|
42
|
+
|
|
43
|
+
return <Comp ref={ref} className={cn(buttonVariants({variant, size, className}))} {...props} />;
|
|
44
|
+
},
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
Button.displayName = "Button";
|
|
48
|
+
|
|
49
|
+
export {Button, buttonVariants};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/* eslint-disable no-var */
|
|
2
|
+
import { config } from "dotenv";
|
|
3
|
+
import { drizzle, type PostgresJsDatabase } from "drizzle-orm/postgres-js";
|
|
4
|
+
import postgres from "postgres";
|
|
5
|
+
|
|
6
|
+
import * as schema from "./schema";
|
|
7
|
+
|
|
8
|
+
config({ path: ".env" });
|
|
9
|
+
|
|
10
|
+
const client = postgres(process.env.DATABASE_URL ?? "");
|
|
11
|
+
|
|
12
|
+
declare global {
|
|
13
|
+
var db: PostgresJsDatabase<typeof schema> | undefined;
|
|
14
|
+
}
|
|
15
|
+
let db: PostgresJsDatabase<typeof schema>;
|
|
16
|
+
|
|
17
|
+
if (process.env.NODE_ENV === "production") {
|
|
18
|
+
db = drizzle(client, { schema });
|
|
19
|
+
} else {
|
|
20
|
+
if (!global.db) global.db = drizzle(client, { schema });
|
|
21
|
+
|
|
22
|
+
db = global.db;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { db };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import {
|
|
2
|
+
pgEnum,
|
|
3
|
+
pgTable,
|
|
4
|
+
text,
|
|
5
|
+
timestamp,
|
|
6
|
+
boolean,
|
|
7
|
+
primaryKey,
|
|
8
|
+
integer,
|
|
9
|
+
} from "drizzle-orm/pg-core";
|
|
10
|
+
|
|
11
|
+
export const roleEnum = pgEnum("role", ["admin", "user"]);
|
|
12
|
+
|
|
13
|
+
export const users = pgTable("users", {
|
|
14
|
+
id: text("id")
|
|
15
|
+
.primaryKey()
|
|
16
|
+
.$defaultFn(() => crypto.randomUUID()),
|
|
17
|
+
name: text("name"),
|
|
18
|
+
email: text("email").notNull(),
|
|
19
|
+
emailVerified: timestamp("emailVerified", { mode: "date" }),
|
|
20
|
+
password: text("password"),
|
|
21
|
+
role: roleEnum("role").default("user"),
|
|
22
|
+
createdAt: timestamp("createdAt", { mode: "date" }).notNull().default(new Date()),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export const accounts = pgTable(
|
|
26
|
+
"account",
|
|
27
|
+
{
|
|
28
|
+
user: text("user")
|
|
29
|
+
.notNull()
|
|
30
|
+
.references(() => users.id, { onDelete: "cascade" }),
|
|
31
|
+
type: text("type").$type<AdapterAccountType>().notNull(),
|
|
32
|
+
provider: text("provider").notNull(),
|
|
33
|
+
providerAccountId: text("providerAccountId").notNull(),
|
|
34
|
+
refresh_token: text("refresh_token"),
|
|
35
|
+
access_token: text("access_token"),
|
|
36
|
+
expires_at: integer("expires_at"),
|
|
37
|
+
token_type: text("token_type"),
|
|
38
|
+
scope: text("scope"),
|
|
39
|
+
id_token: text("id_token"),
|
|
40
|
+
session_state: text("session_state"),
|
|
41
|
+
},
|
|
42
|
+
(account) => ({
|
|
43
|
+
compoundKey: primaryKey({
|
|
44
|
+
columns: [account.provider, account.providerAccountId],
|
|
45
|
+
}),
|
|
46
|
+
}),
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
export const sessions = pgTable("session", {
|
|
50
|
+
sessionToken: text("sessionToken").primaryKey(),
|
|
51
|
+
user: text("user")
|
|
52
|
+
.notNull()
|
|
53
|
+
.references(() => users.id, { onDelete: "cascade" }),
|
|
54
|
+
expires: timestamp("expires", { mode: "date" }).notNull(),
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export const verificationTokens = pgTable(
|
|
58
|
+
"verificationToken",
|
|
59
|
+
{
|
|
60
|
+
identifier: text("identifier").notNull(),
|
|
61
|
+
token: text("token").notNull(),
|
|
62
|
+
expires: timestamp("expires", { mode: "date" }).notNull(),
|
|
63
|
+
},
|
|
64
|
+
(verificationToken) => ({
|
|
65
|
+
compositePk: primaryKey({
|
|
66
|
+
columns: [verificationToken.identifier, verificationToken.token],
|
|
67
|
+
}),
|
|
68
|
+
}),
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
export const authenticators = pgTable(
|
|
72
|
+
"authenticator",
|
|
73
|
+
{
|
|
74
|
+
credentialID: text("credentialID").notNull().unique(),
|
|
75
|
+
user: text("user")
|
|
76
|
+
.notNull()
|
|
77
|
+
.references(() => users.id, { onDelete: "cascade" }),
|
|
78
|
+
providerAccountId: text("providerAccountId").notNull(),
|
|
79
|
+
credentialPublicKey: text("credentialPublicKey").notNull(),
|
|
80
|
+
counter: integer("counter").notNull(),
|
|
81
|
+
credentialDeviceType: text("credentialDeviceType").notNull(),
|
|
82
|
+
credentialBackedUp: boolean("credentialBackedUp").notNull(),
|
|
83
|
+
transports: text("transports"),
|
|
84
|
+
},
|
|
85
|
+
(authenticator) => ({
|
|
86
|
+
compositePK: primaryKey({
|
|
87
|
+
columns: [authenticator.user, authenticator.credentialID],
|
|
88
|
+
}),
|
|
89
|
+
}),
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
export type SelectUser = typeof users.$inferSelect;
|
|
93
|
+
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type {Config} from "tailwindcss";
|
|
2
|
+
|
|
3
|
+
const config = {
|
|
4
|
+
darkMode: ["class"],
|
|
5
|
+
content: [
|
|
6
|
+
"./pages/**/*.{ts,tsx}",
|
|
7
|
+
"./components/**/*.{ts,tsx}",
|
|
8
|
+
"./app/**/*.{ts,tsx}",
|
|
9
|
+
"./src/**/*.{ts,tsx}",
|
|
10
|
+
],
|
|
11
|
+
prefix: "",
|
|
12
|
+
theme: {
|
|
13
|
+
container: {
|
|
14
|
+
center: true,
|
|
15
|
+
padding: "2rem",
|
|
16
|
+
screens: {
|
|
17
|
+
"2xl": "1400px",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
extend: {
|
|
21
|
+
colors: {
|
|
22
|
+
border: "rgb(var(--border))",
|
|
23
|
+
input: "rgb(var(--input))",
|
|
24
|
+
ring: "rgb(var(--ring))",
|
|
25
|
+
background: "rgb(var(--background))",
|
|
26
|
+
foreground: "rgb(var(--foreground))",
|
|
27
|
+
primary: {
|
|
28
|
+
DEFAULT: "rgb(var(--primary))",
|
|
29
|
+
foreground: "rgb(var(--primary-foreground))",
|
|
30
|
+
},
|
|
31
|
+
secondary: {
|
|
32
|
+
DEFAULT: "rgb(var(--secondary))",
|
|
33
|
+
foreground: "rgb(var(--secondary-foreground))",
|
|
34
|
+
},
|
|
35
|
+
destructive: {
|
|
36
|
+
DEFAULT: "rgb(var(--destructive))",
|
|
37
|
+
foreground: "rgb(var(--destructive-foreground))",
|
|
38
|
+
},
|
|
39
|
+
muted: {
|
|
40
|
+
DEFAULT: "rgb(var(--muted))",
|
|
41
|
+
foreground: "rgb(var(--muted-foreground))",
|
|
42
|
+
},
|
|
43
|
+
accent: {
|
|
44
|
+
DEFAULT: "rgb(var(--accent))",
|
|
45
|
+
foreground: "rgb(var(--accent-foreground))",
|
|
46
|
+
},
|
|
47
|
+
popover: {
|
|
48
|
+
DEFAULT: "rgb(var(--popover))",
|
|
49
|
+
foreground: "rgb(var(--popover-foreground))",
|
|
50
|
+
},
|
|
51
|
+
card: {
|
|
52
|
+
DEFAULT: "rgb(var(--card))",
|
|
53
|
+
foreground: "rgb(var(--card-foreground))",
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
borderRadius: {
|
|
57
|
+
lg: "var(--radius)",
|
|
58
|
+
md: "calc(var(--radius) - 2px)",
|
|
59
|
+
sm: "calc(var(--radius) - 4px)",
|
|
60
|
+
},
|
|
61
|
+
keyframes: {
|
|
62
|
+
"accordion-down": {
|
|
63
|
+
from: {height: "0"},
|
|
64
|
+
to: {height: "var(--radix-accordion-content-height)"},
|
|
65
|
+
},
|
|
66
|
+
"accordion-up": {
|
|
67
|
+
from: {height: "var(--radix-accordion-content-height)"},
|
|
68
|
+
to: {height: "0"},
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
animation: {
|
|
72
|
+
"accordion-down": "accordion-down 0.2s ease-out",
|
|
73
|
+
"accordion-up": "accordion-up 0.2s ease-out",
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
plugins: [require("tailwindcss-animate")],
|
|
78
|
+
} satisfies Config;
|
|
79
|
+
|
|
80
|
+
export default config;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es6",
|
|
4
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
|
5
|
+
"allowJs": true,
|
|
6
|
+
"skipLibCheck": true,
|
|
7
|
+
"strict": true,
|
|
8
|
+
"noEmit": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"module": "esnext",
|
|
11
|
+
"moduleResolution": "bundler",
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"isolatedModules": true,
|
|
14
|
+
"jsx": "preserve",
|
|
15
|
+
"incremental": true,
|
|
16
|
+
"plugins": [
|
|
17
|
+
{
|
|
18
|
+
"name": "next"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"paths": {
|
|
22
|
+
"@/*": ["./src/*"]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
|
26
|
+
"exclude": ["node_modules"]
|
|
27
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.2.0",
|
|
3
|
+
"configurations": [
|
|
4
|
+
{
|
|
5
|
+
"name": "Next.js: debug server-side",
|
|
6
|
+
"type": "node-terminal",
|
|
7
|
+
"request": "launch",
|
|
8
|
+
"command": "pnpm dev"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"name": "Next.js: debug client-side",
|
|
12
|
+
"type": "chrome",
|
|
13
|
+
"request": "launch",
|
|
14
|
+
"url": "http://localhost:3000"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name": "Next.js: debug full stack",
|
|
18
|
+
"type": "node-terminal",
|
|
19
|
+
"request": "launch",
|
|
20
|
+
"command": "pnpm dev",
|
|
21
|
+
"serverReadyAction": {
|
|
22
|
+
"pattern": "started server on .+, url: (https?://.+)",
|
|
23
|
+
"uriFormat": "%s",
|
|
24
|
+
"action": "debugWithChrome"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
## Getting Started with {{name}}
|
|
2
|
+
|
|
3
|
+
First, run the development server:
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm run dev
|
|
7
|
+
# or
|
|
8
|
+
yarn dev
|
|
9
|
+
# or
|
|
10
|
+
pnpm dev
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
|
14
|
+
|
|
15
|
+
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
+
"style": "default",
|
|
4
|
+
"rsc": true,
|
|
5
|
+
"tsx": true,
|
|
6
|
+
"tailwind": {
|
|
7
|
+
"config": "tailwind.config.ts",
|
|
8
|
+
"css": "src/app/globals.css",
|
|
9
|
+
"baseColor": "zinc",
|
|
10
|
+
"cssVariables": true,
|
|
11
|
+
"prefix": ""
|
|
12
|
+
},
|
|
13
|
+
"aliases": {
|
|
14
|
+
"components": "@/components",
|
|
15
|
+
"utils": "@/lib/utils"
|
|
16
|
+
}
|
|
17
|
+
}
|