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,25 @@
|
|
|
1
|
+
-- CreateTable
|
|
2
|
+
CREATE TABLE "Post" (
|
|
3
|
+
"id" SERIAL NOT NULL,
|
|
4
|
+
"title" TEXT NOT NULL,
|
|
5
|
+
"content" TEXT,
|
|
6
|
+
"published" BOOLEAN NOT NULL DEFAULT false,
|
|
7
|
+
"authorId" INTEGER,
|
|
8
|
+
|
|
9
|
+
CONSTRAINT "Post_pkey" PRIMARY KEY ("id")
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
-- CreateTable
|
|
13
|
+
CREATE TABLE "User" (
|
|
14
|
+
"id" SERIAL NOT NULL,
|
|
15
|
+
"email" TEXT NOT NULL,
|
|
16
|
+
"name" TEXT,
|
|
17
|
+
|
|
18
|
+
CONSTRAINT "User_pkey" PRIMARY KEY ("id")
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
-- CreateIndex
|
|
22
|
+
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
|
|
23
|
+
|
|
24
|
+
-- AddForeignKey
|
|
25
|
+
ALTER TABLE "Post" ADD CONSTRAINT "Post_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
datasource db {
|
|
2
|
+
provider = "postgresql"
|
|
3
|
+
url = env("DATABASE_URL")
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
generator client {
|
|
7
|
+
provider = "prisma-client-js"
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
model Post {
|
|
11
|
+
id Int @id @default(autoincrement())
|
|
12
|
+
title String
|
|
13
|
+
content String?
|
|
14
|
+
published Boolean @default(false)
|
|
15
|
+
author User? @relation(fields: [authorId], references: [id])
|
|
16
|
+
authorId Int?
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
model User {
|
|
20
|
+
id Int @id @default(autoincrement())
|
|
21
|
+
email String @unique
|
|
22
|
+
name String?
|
|
23
|
+
posts Post[]
|
|
24
|
+
}
|
|
@@ -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,117 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
|
|
3
|
+
@plugin "tailwindcss-animate";
|
|
4
|
+
|
|
5
|
+
:root {
|
|
6
|
+
--background: hsl(0 0% 100%);
|
|
7
|
+
--foreground: hsl(240 10% 3.9%);
|
|
8
|
+
|
|
9
|
+
--card: hsl(0 0% 100%);
|
|
10
|
+
--card-foreground: hsl(240 10% 3.9%);
|
|
11
|
+
|
|
12
|
+
--popover: hsl(0 0% 100%);
|
|
13
|
+
--popover-foreground: hsl(240 10% 3.9%);
|
|
14
|
+
|
|
15
|
+
--primary: hsl(240 5.9% 10%);
|
|
16
|
+
--primary-foreground: hsl(0 0% 98%);
|
|
17
|
+
--secondary: hsl(240 4.8% 95.9%);
|
|
18
|
+
--secondary-foreground: hsl(240 5.9% 10%);
|
|
19
|
+
--muted: hsl(240 4.8% 95.9%);
|
|
20
|
+
--muted-foreground: hsl(240 3.8% 46.1%);
|
|
21
|
+
--accent: hsl(240 4.8% 95.9%);
|
|
22
|
+
--accent-foreground: hsl(240 5.9% 10%);
|
|
23
|
+
--destructive: hsl(0 84.2% 60.2%);
|
|
24
|
+
--destructive-foreground: hsl(0 0% 98%);
|
|
25
|
+
|
|
26
|
+
--border: hsl(240 5.9% 90%);
|
|
27
|
+
--input: hsl(240 5.9% 90%);
|
|
28
|
+
--ring: hsl(240 10% 3.9%);
|
|
29
|
+
|
|
30
|
+
--chart-1: hsl(12 76% 61%);
|
|
31
|
+
--chart-2: hsl(173 58% 39%);
|
|
32
|
+
--chart-3: hsl(197 37% 24%);
|
|
33
|
+
--chart-4: hsl(43 74% 66%);
|
|
34
|
+
--chart-5: hsl(27 87% 67%);
|
|
35
|
+
|
|
36
|
+
--radius: 0.6rem;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@media (prefers-color-scheme: dark) {
|
|
40
|
+
:root {
|
|
41
|
+
--background: hsl(240 10% 3.9%);
|
|
42
|
+
--foreground: hsl(0 0% 98%);
|
|
43
|
+
|
|
44
|
+
--card: hsl(240 10% 3.9%);
|
|
45
|
+
--card-foreground: hsl(0 0% 98%);
|
|
46
|
+
|
|
47
|
+
--popover: hsl(240 10% 3.9%);
|
|
48
|
+
--popover-foreground: hsl(0 0% 98%);
|
|
49
|
+
|
|
50
|
+
--primary: hsl(0 0% 98%);
|
|
51
|
+
--primary-foreground: hsl(240 5.9% 10%);
|
|
52
|
+
--secondary: hsl(240 3.7% 15.9%);
|
|
53
|
+
--secondary-foreground: hsl(0 0% 98%);
|
|
54
|
+
--muted: hsl(240 3.7% 15.9%);
|
|
55
|
+
--muted-foreground: hsl(240 5% 64.9%);
|
|
56
|
+
--accent: hsl(240 3.7% 15.9%);
|
|
57
|
+
--accent-foreground: hsl(0 0% 98%);
|
|
58
|
+
--destructive: hsl(0 62.8% 30.6%);
|
|
59
|
+
--destructive-foreground: hsl(0 0% 98%);
|
|
60
|
+
|
|
61
|
+
--border: hsl(240 3.7% 15.9%);
|
|
62
|
+
--input: hsl(240 3.7% 15.9%);
|
|
63
|
+
--ring: hsl(240 4.9% 83.9%);
|
|
64
|
+
|
|
65
|
+
--chart-1: hsl(220 70% 50%);
|
|
66
|
+
--chart-2: hsl(160 60% 45%);
|
|
67
|
+
--chart-3: hsl(30 80% 55%);
|
|
68
|
+
--chart-4: hsl(280 65% 60%);
|
|
69
|
+
--chart-5: hsl(340 75% 55%);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@theme inline {
|
|
74
|
+
--color-background: var(--background);
|
|
75
|
+
--color-foreground: var(--foreground);
|
|
76
|
+
|
|
77
|
+
--color-card: var(--card);
|
|
78
|
+
--color-card-foreground: var(--card-foreground);
|
|
79
|
+
|
|
80
|
+
--color-popover: var(--popover);
|
|
81
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
82
|
+
|
|
83
|
+
--color-primary: var(--primary);
|
|
84
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
85
|
+
--color-secondary: var(--secondary);
|
|
86
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
87
|
+
--color-muted: var(--muted);
|
|
88
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
89
|
+
--color-accent: var(--accent);
|
|
90
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
91
|
+
--color-destructive: var(--destructive);
|
|
92
|
+
--color-destructive-foreground: var(--destructive-foreground);
|
|
93
|
+
|
|
94
|
+
--color-border: var(--border);
|
|
95
|
+
--color-input: var(--input);
|
|
96
|
+
--color-ring: var(--ring);
|
|
97
|
+
|
|
98
|
+
--color-chart-1: var(--chart-1);
|
|
99
|
+
--color-chart-2: var(--chart-2);
|
|
100
|
+
--color-chart-3: var(--chart-3);
|
|
101
|
+
--color-chart-4: var(--chart-4);
|
|
102
|
+
--color-chart-5: var(--chart-5);
|
|
103
|
+
|
|
104
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
105
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
106
|
+
--radius-lg: var(--radius);
|
|
107
|
+
--radius-xl: calc(var(--radius) + 4px);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@layer base {
|
|
111
|
+
* {
|
|
112
|
+
@apply border-border outline-ring/50;
|
|
113
|
+
}
|
|
114
|
+
body {
|
|
115
|
+
@apply bg-background text-foreground;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Metadata } from "next";
|
|
2
|
+
|
|
3
|
+
import { Nunito } from "next/font/google";
|
|
4
|
+
|
|
5
|
+
import "./globals.css";
|
|
6
|
+
|
|
7
|
+
const font = Nunito({ subsets: ["latin"] });
|
|
8
|
+
|
|
9
|
+
export const metadata: Metadata = {
|
|
10
|
+
title: "{{name}}",
|
|
11
|
+
description: "A project by Paaauldev",
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
15
|
+
return (
|
|
16
|
+
<html lang="en">
|
|
17
|
+
<body className={font.className}>{children}</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,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
|
+
}
|
package/package.json
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "create-apppaaaul",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
"description": "Create projects as paaauldev would",
|
|
5
|
-
"main": "index.mjs",
|
|
6
|
-
"bin": {
|
|
7
|
-
"create-apppaaaul": "dist/index.js"
|
|
8
|
-
},
|
|
9
|
-
"files": [
|
|
10
|
-
"dist/**/*"
|
|
11
|
-
],
|
|
12
|
-
"keywords": [
|
|
13
|
-
"react",
|
|
14
|
-
"goncy",
|
|
15
|
-
"paaauldev",
|
|
16
|
-
"next.js",
|
|
17
|
-
"shadcn",
|
|
18
|
-
"tailwindcss"
|
|
19
|
-
],
|
|
20
|
-
"author": "paaauldev",
|
|
21
|
-
"license": "ISC",
|
|
22
|
-
"dependencies": {
|
|
23
|
-
"cross-spawn": "^7.0.6",
|
|
24
|
-
"glob": "^10.4.5",
|
|
25
|
-
"picocolors": "^1.1.1",
|
|
26
|
-
"prompts": "^2.4.2",
|
|
27
|
-
"yargs": "^17.7.2"
|
|
28
|
-
},
|
|
29
|
-
"scripts": {
|
|
30
|
-
"build": "tsup",
|
|
31
|
-
"start": "node dist/index.js",
|
|
32
|
-
"dev": "tsup --watch",
|
|
33
|
-
"bump": "pnpm run build && pnpm version patch && git tag latest --force && git push origin main --tags --force && pnpm publish --tag latest --force"
|
|
34
|
-
},
|
|
35
|
-
"devDependencies": {
|
|
36
|
-
"@types/node": "^20.17.27",
|
|
37
|
-
"@types/prompts": "^2.4.9",
|
|
38
|
-
"@types/yargs": "^17.0.33",
|
|
39
|
-
"prettier": "^3.5.3",
|
|
40
|
-
"tsup": "^8.4.0",
|
|
41
|
-
"typescript": "^5.8.2"
|
|
42
|
-
}
|
|
43
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "create-apppaaaul",
|
|
3
|
+
"version": "2.0.4",
|
|
4
|
+
"description": "Create projects as paaauldev would",
|
|
5
|
+
"main": "index.mjs",
|
|
6
|
+
"bin": {
|
|
7
|
+
"create-apppaaaul": "dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist/**/*"
|
|
11
|
+
],
|
|
12
|
+
"keywords": [
|
|
13
|
+
"react",
|
|
14
|
+
"goncy",
|
|
15
|
+
"paaauldev",
|
|
16
|
+
"next.js",
|
|
17
|
+
"shadcn",
|
|
18
|
+
"tailwindcss"
|
|
19
|
+
],
|
|
20
|
+
"author": "paaauldev",
|
|
21
|
+
"license": "ISC",
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"cross-spawn": "^7.0.6",
|
|
24
|
+
"glob": "^10.4.5",
|
|
25
|
+
"picocolors": "^1.1.1",
|
|
26
|
+
"prompts": "^2.4.2",
|
|
27
|
+
"yargs": "^17.7.2"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "tsup",
|
|
31
|
+
"start": "node dist/index.js",
|
|
32
|
+
"dev": "tsup --watch",
|
|
33
|
+
"bump": "pnpm run build && pnpm version patch && git tag latest --force && git push origin main --tags --force && pnpm publish --tag latest --force"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@types/node": "^20.17.27",
|
|
37
|
+
"@types/prompts": "^2.4.9",
|
|
38
|
+
"@types/yargs": "^17.0.33",
|
|
39
|
+
"prettier": "^3.5.3",
|
|
40
|
+
"tsup": "^8.4.0",
|
|
41
|
+
"typescript": "^5.8.2"
|
|
42
|
+
}
|
|
43
|
+
}
|