From 30244439f413171dd593a3d7c0466f080841060a Mon Sep 17 00:00:00 2001
From: Iceship
Date: Thu, 3 Oct 2024 17:08:41 +0900
Subject: [PATCH] add dashboard layout
---
.vscode/settings.json | 3 +
middleware.ts | 26 ----
package.json | 2 +-
pnpm-lock.yaml | 120 +++++++--------
src/actions/auth.action.ts | 11 ++
src/app/(app)/layout.tsx | 10 ++
src/app/(app)/page.tsx | 9 ++
src/app/(auth)/layout.tsx | 10 ++
src/app/(auth)/login/page.tsx | 7 +
src/app/(dashboard)/admin/layout.tsx | 10 ++
src/app/(dashboard)/admin/page.tsx | 16 +-
src/app/_components/auth-button.tsx | 74 ----------
src/app/globals.css | 3 -
src/app/layout.tsx | 21 ++-
src/app/page.tsx | 42 ------
src/{components => app}/providers.tsx | 26 ++--
src/components/app-navbar/index.tsx | 4 +-
src/components/auth/auth-button.tsx | 60 ++++++++
src/components/auth/auth-layout.tsx | 47 ++++++
src/components/auth/login.tsx | 19 +++
src/components/home/content.tsx | 46 ++++++
src/components/hooks/use-body-lock.ts | 52 +++++++
.../hooks/use-isomorphic-layout-effect.ts | 4 +
src/components/icons/accounts/dots-icon.tsx | 21 +++
src/components/icons/accounts/export-icon.tsx | 21 +++
src/components/icons/accounts/info-icon.tsx | 19 +++
src/components/icons/accounts/trash-icon.tsx | 21 +++
src/components/icons/acme-icon.tsx | 30 ++++
src/components/icons/acmelogo.tsx | 21 +++
.../icons/breadcrumb/house-icon.tsx | 21 +++
.../icons/breadcrumb/users-icon.tsx | 21 +++
src/components/icons/community.tsx | 25 ++++
src/components/icons/navbar/feedback-icon.tsx | 39 +++++
src/components/icons/navbar/github-icon.tsx | 14 ++
.../icons/navbar/notificationicon.tsx | 26 ++++
src/components/icons/navbar/support-icon.tsx | 21 +++
src/components/icons/searchicon.tsx | 30 ++++
.../icons/sidebar/accounts-icon.tsx | 21 +++
src/components/icons/sidebar/balance-icon.tsx | 21 +++
src/components/icons/sidebar/bottom-icon.tsx | 21 +++
.../icons/sidebar/changelog-icon.tsx | 21 +++
.../icons/sidebar/chevron-down-icon.tsx | 17 +++
.../icons/sidebar/chevron-up-icon.tsx | 20 +++
.../icons/sidebar/customers-icon.tsx | 21 +++
src/components/icons/sidebar/dev-icon.tsx | 21 +++
src/components/icons/sidebar/filter-icon.tsx | 19 +++
src/components/icons/sidebar/home-icon.tsx | 21 +++
.../icons/sidebar/payments-icon.tsx | 21 +++
.../icons/sidebar/products-icon.tsx | 21 +++
src/components/icons/sidebar/reports-icon.tsx | 21 +++
.../icons/sidebar/settings-icon.tsx | 21 +++
src/components/icons/sidebar/view-icon.tsx | 21 +++
src/components/icons/table/delete-icon.tsx | 54 +++++++
src/components/icons/table/edit-icon.tsx | 44 ++++++
src/components/icons/table/eye-icon.tsx | 34 +++++
src/components/layout/layout-context.ts | 17 +++
src/components/layout/layout.tsx | 35 +++++
src/components/navbar/burguer-button.tsx | 18 +++
src/components/navbar/darkmodeswitch.tsx | 13 ++
src/components/navbar/navbar.styles.ts | 43 ++++++
src/components/navbar/navbar.tsx | 71 +++++++++
.../navbar/notifications-dropdown.tsx | 56 +++++++
src/components/navbar/user-dropdown.tsx | 63 ++++++++
src/components/sidebar/collapse-items.tsx | 139 ++++++++++++++++++
src/components/sidebar/companies-dropdown.tsx | 128 ++++++++++++++++
src/components/sidebar/sidebar-item.tsx | 40 +++++
src/components/sidebar/sidebar-menu.tsx | 15 ++
src/components/sidebar/sidebar.styles.ts | 50 +++++++
src/components/sidebar/sidebar.tsx | 130 ++++++++++++++++
src/helpers/schemas.ts | 19 +++
src/helpers/types.ts | 13 ++
src/middleware.ts | 7 +
src/styles/globals.css | 13 ++
73 files changed, 2024 insertions(+), 238 deletions(-)
delete mode 100644 middleware.ts
create mode 100644 src/actions/auth.action.ts
create mode 100644 src/app/(app)/layout.tsx
create mode 100644 src/app/(app)/page.tsx
create mode 100644 src/app/(auth)/layout.tsx
create mode 100644 src/app/(auth)/login/page.tsx
create mode 100644 src/app/(dashboard)/admin/layout.tsx
delete mode 100644 src/app/_components/auth-button.tsx
delete mode 100644 src/app/globals.css
delete mode 100644 src/app/page.tsx
rename src/{components => app}/providers.tsx (50%)
create mode 100644 src/components/auth/auth-button.tsx
create mode 100644 src/components/auth/auth-layout.tsx
create mode 100644 src/components/auth/login.tsx
create mode 100644 src/components/home/content.tsx
create mode 100644 src/components/hooks/use-body-lock.ts
create mode 100644 src/components/hooks/use-isomorphic-layout-effect.ts
create mode 100644 src/components/icons/accounts/dots-icon.tsx
create mode 100644 src/components/icons/accounts/export-icon.tsx
create mode 100644 src/components/icons/accounts/info-icon.tsx
create mode 100644 src/components/icons/accounts/trash-icon.tsx
create mode 100644 src/components/icons/acme-icon.tsx
create mode 100644 src/components/icons/acmelogo.tsx
create mode 100644 src/components/icons/breadcrumb/house-icon.tsx
create mode 100644 src/components/icons/breadcrumb/users-icon.tsx
create mode 100644 src/components/icons/community.tsx
create mode 100644 src/components/icons/navbar/feedback-icon.tsx
create mode 100644 src/components/icons/navbar/github-icon.tsx
create mode 100644 src/components/icons/navbar/notificationicon.tsx
create mode 100644 src/components/icons/navbar/support-icon.tsx
create mode 100644 src/components/icons/searchicon.tsx
create mode 100644 src/components/icons/sidebar/accounts-icon.tsx
create mode 100644 src/components/icons/sidebar/balance-icon.tsx
create mode 100644 src/components/icons/sidebar/bottom-icon.tsx
create mode 100644 src/components/icons/sidebar/changelog-icon.tsx
create mode 100644 src/components/icons/sidebar/chevron-down-icon.tsx
create mode 100644 src/components/icons/sidebar/chevron-up-icon.tsx
create mode 100644 src/components/icons/sidebar/customers-icon.tsx
create mode 100644 src/components/icons/sidebar/dev-icon.tsx
create mode 100644 src/components/icons/sidebar/filter-icon.tsx
create mode 100644 src/components/icons/sidebar/home-icon.tsx
create mode 100644 src/components/icons/sidebar/payments-icon.tsx
create mode 100644 src/components/icons/sidebar/products-icon.tsx
create mode 100644 src/components/icons/sidebar/reports-icon.tsx
create mode 100644 src/components/icons/sidebar/settings-icon.tsx
create mode 100644 src/components/icons/sidebar/view-icon.tsx
create mode 100644 src/components/icons/table/delete-icon.tsx
create mode 100644 src/components/icons/table/edit-icon.tsx
create mode 100644 src/components/icons/table/eye-icon.tsx
create mode 100644 src/components/layout/layout-context.ts
create mode 100644 src/components/layout/layout.tsx
create mode 100644 src/components/navbar/burguer-button.tsx
create mode 100644 src/components/navbar/darkmodeswitch.tsx
create mode 100644 src/components/navbar/navbar.styles.ts
create mode 100644 src/components/navbar/navbar.tsx
create mode 100644 src/components/navbar/notifications-dropdown.tsx
create mode 100644 src/components/navbar/user-dropdown.tsx
create mode 100644 src/components/sidebar/collapse-items.tsx
create mode 100644 src/components/sidebar/companies-dropdown.tsx
create mode 100644 src/components/sidebar/sidebar-item.tsx
create mode 100644 src/components/sidebar/sidebar-menu.tsx
create mode 100644 src/components/sidebar/sidebar.styles.ts
create mode 100644 src/components/sidebar/sidebar.tsx
create mode 100644 src/helpers/schemas.ts
create mode 100644 src/helpers/types.ts
create mode 100644 src/middleware.ts
create mode 100644 src/styles/globals.css
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 6e5059a..9d865f5 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -21,10 +21,13 @@
"editor.defaultFormatter": "Prisma.prisma"
},
"cSpell.words": [
+ "burguer",
+ "Burguer",
"formik",
"Formik",
"jiti",
"nextui",
+ "searchicon",
"signin",
"signout",
"superjson",
diff --git a/middleware.ts b/middleware.ts
deleted file mode 100644
index 72030d7..0000000
--- a/middleware.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import type { NextRequest } from "next/server";
-import { NextResponse } from "next/server";
-
-export function middleware(request: NextRequest) {
- const { pathname } = request.nextUrl;
- console.log("middle pathname:", pathname);
- console.dir(request, { depth: 2 });
-
- if (
- (pathname === "/login" || pathname === "/register") &&
- request.cookies.has("userAuth")
- )
- return NextResponse.redirect(new URL("/", request.url));
-
- if (
- (pathname === "/" || pathname === "/accounts") &&
- !request.cookies.has("userAuth")
- )
- return NextResponse.redirect(new URL("/login", request.url));
-
- return NextResponse.next();
-}
-
-export const config = {
- matcher: ["/", "/accounts", "/login", "/register"],
-};
diff --git a/package.json b/package.json
index b88a391..71ab48b 100644
--- a/package.json
+++ b/package.json
@@ -30,7 +30,7 @@
"framer-motion": "^11.7.0",
"geist": "^1.3.1",
"jiti": "^2.0.0",
- "next": "14.2.13",
+ "next": "14.2.14",
"next-auth": "^4.24.8",
"next-themes": "^0.3.0",
"postgres": "^3.4.4",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index d23b906..7f7ac3f 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -37,7 +37,7 @@ importers:
version: 11.0.0-rc.532(@trpc/server@11.0.0-rc.532)
'@trpc/next':
specifier: 11.0.0-rc.532
- version: 11.0.0-rc.532(@tanstack/react-query@5.56.2(react@18.3.1))(@trpc/client@11.0.0-rc.532(@trpc/server@11.0.0-rc.532))(@trpc/react-query@11.0.0-rc.532(@tanstack/react-query@5.56.2(react@18.3.1))(@trpc/client@11.0.0-rc.532(@trpc/server@11.0.0-rc.532))(@trpc/server@11.0.0-rc.532)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@trpc/server@11.0.0-rc.532)(next@14.2.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
+ version: 11.0.0-rc.532(@tanstack/react-query@5.56.2(react@18.3.1))(@trpc/client@11.0.0-rc.532(@trpc/server@11.0.0-rc.532))(@trpc/react-query@11.0.0-rc.532(@tanstack/react-query@5.56.2(react@18.3.1))(@trpc/client@11.0.0-rc.532(@trpc/server@11.0.0-rc.532))(@trpc/server@11.0.0-rc.532)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@trpc/server@11.0.0-rc.532)(next@14.2.14(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'@trpc/react-query':
specifier: 11.0.0-rc.532
version: 11.0.0-rc.532(@tanstack/react-query@5.56.2(react@18.3.1))(@trpc/client@11.0.0-rc.532(@trpc/server@11.0.0-rc.532))(@trpc/server@11.0.0-rc.532)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
@@ -52,16 +52,16 @@ importers:
version: 11.7.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
geist:
specifier: ^1.3.1
- version: 1.3.1(next@14.2.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1))
+ version: 1.3.1(next@14.2.14(react-dom@18.3.1(react@18.3.1))(react@18.3.1))
jiti:
specifier: ^2.0.0
version: 2.0.0
next:
- specifier: 14.2.13
- version: 14.2.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
+ specifier: 14.2.14
+ version: 14.2.14(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
next-auth:
specifier: ^4.24.8
- version: 4.24.8(next@14.2.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
+ version: 4.24.8(next@14.2.14(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
next-themes:
specifier: ^0.3.0
version: 0.3.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
@@ -316,62 +316,62 @@ packages:
'@jridgewell/trace-mapping@0.3.25':
resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==}
- '@next/env@14.2.13':
- resolution: {integrity: sha512-s3lh6K8cbW1h5Nga7NNeXrbe0+2jIIYK9YaA9T7IufDWnZpozdFUp6Hf0d5rNWUKu4fEuSX2rCKlGjCrtylfDw==}
+ '@next/env@14.2.14':
+ resolution: {integrity: sha512-/0hWQfiaD5//LvGNgc8PjvyqV50vGK0cADYzaoOOGN8fxzBn3iAiaq3S0tCRnFBldq0LVveLcxCTi41ZoYgAgg==}
'@next/eslint-plugin-next@14.2.13':
resolution: {integrity: sha512-z8Mk0VljxhIzsSiZUSdt3wp+t2lKd+jk5a9Jsvh3zDGkItgDMfjv/ZbET6HsxEl/fSihVoHGsXV6VLyDH0lfTQ==}
- '@next/swc-darwin-arm64@14.2.13':
- resolution: {integrity: sha512-IkAmQEa2Htq+wHACBxOsslt+jMoV3msvxCn0WFSfJSkv/scy+i/EukBKNad36grRxywaXUYJc9mxEGkeIs8Bzg==}
+ '@next/swc-darwin-arm64@14.2.14':
+ resolution: {integrity: sha512-bsxbSAUodM1cjYeA4o6y7sp9wslvwjSkWw57t8DtC8Zig8aG8V6r+Yc05/9mDzLKcybb6EN85k1rJDnMKBd9Gw==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [darwin]
- '@next/swc-darwin-x64@14.2.13':
- resolution: {integrity: sha512-Dv1RBGs2TTjkwEnFMVL5XIfJEavnLqqwYSD6LXgTPdEy/u6FlSrLBSSfe1pcfqhFEXRAgVL3Wpjibe5wXJzWog==}
+ '@next/swc-darwin-x64@14.2.14':
+ resolution: {integrity: sha512-cC9/I+0+SK5L1k9J8CInahduTVWGMXhQoXFeNvF0uNs3Bt1Ub0Azb8JzTU9vNCr0hnaMqiWu/Z0S1hfKc3+dww==}
engines: {node: '>= 10'}
cpu: [x64]
os: [darwin]
- '@next/swc-linux-arm64-gnu@14.2.13':
- resolution: {integrity: sha512-yB1tYEFFqo4ZNWkwrJultbsw7NPAAxlPXURXioRl9SdW6aIefOLS+0TEsKrWBtbJ9moTDgU3HRILL6QBQnMevg==}
+ '@next/swc-linux-arm64-gnu@14.2.14':
+ resolution: {integrity: sha512-RMLOdA2NU4O7w1PQ3Z9ft3PxD6Htl4uB2TJpocm+4jcllHySPkFaUIFacQ3Jekcg6w+LBaFvjSPthZHiPmiAUg==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [linux]
- '@next/swc-linux-arm64-musl@14.2.13':
- resolution: {integrity: sha512-v5jZ/FV/eHGoWhMKYrsAweQ7CWb8xsWGM/8m1mwwZQ/sutJjoFaXchwK4pX8NqwImILEvQmZWyb8pPTcP7htWg==}
+ '@next/swc-linux-arm64-musl@14.2.14':
+ resolution: {integrity: sha512-WgLOA4hT9EIP7jhlkPnvz49iSOMdZgDJVvbpb8WWzJv5wBD07M2wdJXLkDYIpZmCFfo/wPqFsFR4JS4V9KkQ2A==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [linux]
- '@next/swc-linux-x64-gnu@14.2.13':
- resolution: {integrity: sha512-aVc7m4YL7ViiRv7SOXK3RplXzOEe/qQzRA5R2vpXboHABs3w8vtFslGTz+5tKiQzWUmTmBNVW0UQdhkKRORmGA==}
+ '@next/swc-linux-x64-gnu@14.2.14':
+ resolution: {integrity: sha512-lbn7svjUps1kmCettV/R9oAvEW+eUI0lo0LJNFOXoQM5NGNxloAyFRNByYeZKL3+1bF5YE0h0irIJfzXBq9Y6w==}
engines: {node: '>= 10'}
cpu: [x64]
os: [linux]
- '@next/swc-linux-x64-musl@14.2.13':
- resolution: {integrity: sha512-4wWY7/OsSaJOOKvMsu1Teylku7vKyTuocvDLTZQq0TYv9OjiYYWt63PiE1nTuZnqQ4RPvME7Xai+9enoiN0Wrg==}
+ '@next/swc-linux-x64-musl@14.2.14':
+ resolution: {integrity: sha512-7TcQCvLQ/hKfQRgjxMN4TZ2BRB0P7HwrGAYL+p+m3u3XcKTraUFerVbV3jkNZNwDeQDa8zdxkKkw2els/S5onQ==}
engines: {node: '>= 10'}
cpu: [x64]
os: [linux]
- '@next/swc-win32-arm64-msvc@14.2.13':
- resolution: {integrity: sha512-uP1XkqCqV2NVH9+g2sC7qIw+w2tRbcMiXFEbMihkQ8B1+V6m28sshBwAB0SDmOe0u44ne1vFU66+gx/28RsBVQ==}
+ '@next/swc-win32-arm64-msvc@14.2.14':
+ resolution: {integrity: sha512-8i0Ou5XjTLEje0oj0JiI0Xo9L/93ghFtAUYZ24jARSeTMXLUx8yFIdhS55mTExq5Tj4/dC2fJuaT4e3ySvXU1A==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [win32]
- '@next/swc-win32-ia32-msvc@14.2.13':
- resolution: {integrity: sha512-V26ezyjPqQpDBV4lcWIh8B/QICQ4v+M5Bo9ykLN+sqeKKBxJVDpEc6biDVyluTXTC40f5IqCU0ttth7Es2ZuMw==}
+ '@next/swc-win32-ia32-msvc@14.2.14':
+ resolution: {integrity: sha512-2u2XcSaDEOj+96eXpyjHjtVPLhkAFw2nlaz83EPeuK4obF+HmtDJHqgR1dZB7Gb6V/d55FL26/lYVd0TwMgcOQ==}
engines: {node: '>= 10'}
cpu: [ia32]
os: [win32]
- '@next/swc-win32-x64-msvc@14.2.13':
- resolution: {integrity: sha512-WwzOEAFBGhlDHE5Z73mNU8CO8mqMNLqaG+AO9ETmzdCQlJhVtWZnOl2+rqgVQS+YHunjOWptdFmNfbpwcUuEsw==}
+ '@next/swc-win32-x64-msvc@14.2.14':
+ resolution: {integrity: sha512-MZom+OvZ1NZxuRovKt1ApevjiUJTcU2PmdJKL66xUPaJeRywnbGGRWUlaAOwunD6dX+pm83vj979NTC8QXjGWg==}
engines: {node: '>= 10'}
cpu: [x64]
os: [win32]
@@ -2639,8 +2639,8 @@ packages:
react: ^16.8 || ^17 || ^18
react-dom: ^16.8 || ^17 || ^18
- next@14.2.13:
- resolution: {integrity: sha512-BseY9YNw8QJSwLYD7hlZzl6QVDoSFHL/URN5K64kVEVpCsSOWeyjbIGK+dZUaRViHTaMQX8aqmnn0PHBbGZezg==}
+ next@14.2.14:
+ resolution: {integrity: sha512-Q1coZG17MW0Ly5x76shJ4dkC23woLAhhnDnw+DfTc7EpZSGuWrlsZ3bZaO8t6u1Yu8FVfhkqJE+U8GC7E0GLPQ==}
engines: {node: '>=18.17.0'}
hasBin: true
peerDependencies:
@@ -3584,37 +3584,37 @@ snapshots:
'@jridgewell/resolve-uri': 3.1.2
'@jridgewell/sourcemap-codec': 1.5.0
- '@next/env@14.2.13': {}
+ '@next/env@14.2.14': {}
'@next/eslint-plugin-next@14.2.13':
dependencies:
glob: 10.3.10
- '@next/swc-darwin-arm64@14.2.13':
+ '@next/swc-darwin-arm64@14.2.14':
optional: true
- '@next/swc-darwin-x64@14.2.13':
+ '@next/swc-darwin-x64@14.2.14':
optional: true
- '@next/swc-linux-arm64-gnu@14.2.13':
+ '@next/swc-linux-arm64-gnu@14.2.14':
optional: true
- '@next/swc-linux-arm64-musl@14.2.13':
+ '@next/swc-linux-arm64-musl@14.2.14':
optional: true
- '@next/swc-linux-x64-gnu@14.2.13':
+ '@next/swc-linux-x64-gnu@14.2.14':
optional: true
- '@next/swc-linux-x64-musl@14.2.13':
+ '@next/swc-linux-x64-musl@14.2.14':
optional: true
- '@next/swc-win32-arm64-msvc@14.2.13':
+ '@next/swc-win32-arm64-msvc@14.2.14':
optional: true
- '@next/swc-win32-ia32-msvc@14.2.13':
+ '@next/swc-win32-ia32-msvc@14.2.14':
optional: true
- '@next/swc-win32-x64-msvc@14.2.13':
+ '@next/swc-win32-x64-msvc@14.2.14':
optional: true
'@nextui-org/accordion@2.0.40(@nextui-org/system@2.2.6(@nextui-org/theme@2.2.11(tailwindcss@3.4.13))(framer-motion@11.7.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@nextui-org/theme@2.2.11(tailwindcss@3.4.13))(framer-motion@11.7.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)':
@@ -5631,11 +5631,11 @@ snapshots:
dependencies:
'@trpc/server': 11.0.0-rc.532
- '@trpc/next@11.0.0-rc.532(@tanstack/react-query@5.56.2(react@18.3.1))(@trpc/client@11.0.0-rc.532(@trpc/server@11.0.0-rc.532))(@trpc/react-query@11.0.0-rc.532(@tanstack/react-query@5.56.2(react@18.3.1))(@trpc/client@11.0.0-rc.532(@trpc/server@11.0.0-rc.532))(@trpc/server@11.0.0-rc.532)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@trpc/server@11.0.0-rc.532)(next@14.2.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)':
+ '@trpc/next@11.0.0-rc.532(@tanstack/react-query@5.56.2(react@18.3.1))(@trpc/client@11.0.0-rc.532(@trpc/server@11.0.0-rc.532))(@trpc/react-query@11.0.0-rc.532(@tanstack/react-query@5.56.2(react@18.3.1))(@trpc/client@11.0.0-rc.532(@trpc/server@11.0.0-rc.532))(@trpc/server@11.0.0-rc.532)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@trpc/server@11.0.0-rc.532)(next@14.2.14(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)':
dependencies:
'@trpc/client': 11.0.0-rc.532(@trpc/server@11.0.0-rc.532)
'@trpc/server': 11.0.0-rc.532
- next: 14.2.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
+ next: 14.2.14(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
react: 18.3.1
react-dom: 18.3.1(react@18.3.1)
optionalDependencies:
@@ -6211,7 +6211,7 @@ snapshots:
'@typescript-eslint/parser': 8.7.0(eslint@8.57.1)(typescript@5.6.2)
eslint: 8.57.1
eslint-import-resolver-node: 0.3.9
- eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@8.7.0(eslint@8.57.1)(typescript@5.6.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0)(eslint@8.57.1)
+ eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@8.7.0(eslint@8.57.1)(typescript@5.6.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.7.0(eslint@8.57.1)(typescript@5.6.2))(eslint@8.57.1))(eslint@8.57.1)
eslint-plugin-import: 2.30.0(@typescript-eslint/parser@8.7.0(eslint@8.57.1)(typescript@5.6.2))(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.1)
eslint-plugin-jsx-a11y: 6.10.0(eslint@8.57.1)
eslint-plugin-react: 7.36.1(eslint@8.57.1)
@@ -6235,13 +6235,13 @@ snapshots:
transitivePeerDependencies:
- supports-color
- eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.7.0(eslint@8.57.1)(typescript@5.6.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0)(eslint@8.57.1):
+ eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.7.0(eslint@8.57.1)(typescript@5.6.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.7.0(eslint@8.57.1)(typescript@5.6.2))(eslint@8.57.1))(eslint@8.57.1):
dependencies:
'@nolyfill/is-core-module': 1.0.39
debug: 4.3.7
enhanced-resolve: 5.17.1
eslint: 8.57.1
- eslint-module-utils: 2.11.1(@typescript-eslint/parser@8.7.0(eslint@8.57.1)(typescript@5.6.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.7.0(eslint@8.57.1)(typescript@5.6.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0)(eslint@8.57.1))(eslint@8.57.1)
+ eslint-module-utils: 2.11.1(@typescript-eslint/parser@8.7.0(eslint@8.57.1)(typescript@5.6.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.7.0(eslint@8.57.1)(typescript@5.6.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.7.0(eslint@8.57.1)(typescript@5.6.2))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1)
fast-glob: 3.3.2
get-tsconfig: 4.8.1
is-bun-module: 1.2.1
@@ -6254,14 +6254,14 @@ snapshots:
- eslint-import-resolver-webpack
- supports-color
- eslint-module-utils@2.11.1(@typescript-eslint/parser@8.7.0(eslint@8.57.1)(typescript@5.6.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.7.0(eslint@8.57.1)(typescript@5.6.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0)(eslint@8.57.1))(eslint@8.57.1):
+ eslint-module-utils@2.11.1(@typescript-eslint/parser@8.7.0(eslint@8.57.1)(typescript@5.6.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.7.0(eslint@8.57.1)(typescript@5.6.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.7.0(eslint@8.57.1)(typescript@5.6.2))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1):
dependencies:
debug: 3.2.7
optionalDependencies:
'@typescript-eslint/parser': 8.7.0(eslint@8.57.1)(typescript@5.6.2)
eslint: 8.57.1
eslint-import-resolver-node: 0.3.9
- eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@8.7.0(eslint@8.57.1)(typescript@5.6.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0)(eslint@8.57.1)
+ eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@8.7.0(eslint@8.57.1)(typescript@5.6.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.7.0(eslint@8.57.1)(typescript@5.6.2))(eslint@8.57.1))(eslint@8.57.1)
transitivePeerDependencies:
- supports-color
@@ -6289,7 +6289,7 @@ snapshots:
doctrine: 2.1.0
eslint: 8.57.1
eslint-import-resolver-node: 0.3.9
- eslint-module-utils: 2.11.1(@typescript-eslint/parser@8.7.0(eslint@8.57.1)(typescript@5.6.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.7.0(eslint@8.57.1)(typescript@5.6.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0)(eslint@8.57.1))(eslint@8.57.1)
+ eslint-module-utils: 2.11.1(@typescript-eslint/parser@8.7.0(eslint@8.57.1)(typescript@5.6.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.7.0(eslint@8.57.1)(typescript@5.6.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.7.0(eslint@8.57.1)(typescript@5.6.2))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1)
hasown: 2.0.2
is-core-module: 2.15.1
is-glob: 4.0.3
@@ -6517,9 +6517,9 @@ snapshots:
functions-have-names@1.2.3: {}
- geist@1.3.1(next@14.2.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)):
+ geist@1.3.1(next@14.2.14(react-dom@18.3.1(react@18.3.1))(react@18.3.1)):
dependencies:
- next: 14.2.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
+ next: 14.2.14(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
get-intrinsic@1.2.4:
dependencies:
@@ -6909,13 +6909,13 @@ snapshots:
natural-compare@1.4.0: {}
- next-auth@4.24.8(next@14.2.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1):
+ next-auth@4.24.8(next@14.2.14(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1):
dependencies:
'@babel/runtime': 7.25.6
'@panva/hkdf': 1.2.1
cookie: 0.5.0
jose: 4.15.9
- next: 14.2.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
+ next: 14.2.14(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
oauth: 0.9.15
openid-client: 5.7.0
preact: 10.24.1
@@ -6929,9 +6929,9 @@ snapshots:
react: 18.3.1
react-dom: 18.3.1(react@18.3.1)
- next@14.2.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1):
+ next@14.2.14(react-dom@18.3.1(react@18.3.1))(react@18.3.1):
dependencies:
- '@next/env': 14.2.13
+ '@next/env': 14.2.14
'@swc/helpers': 0.5.5
busboy: 1.6.0
caniuse-lite: 1.0.30001664
@@ -6941,15 +6941,15 @@ snapshots:
react-dom: 18.3.1(react@18.3.1)
styled-jsx: 5.1.1(react@18.3.1)
optionalDependencies:
- '@next/swc-darwin-arm64': 14.2.13
- '@next/swc-darwin-x64': 14.2.13
- '@next/swc-linux-arm64-gnu': 14.2.13
- '@next/swc-linux-arm64-musl': 14.2.13
- '@next/swc-linux-x64-gnu': 14.2.13
- '@next/swc-linux-x64-musl': 14.2.13
- '@next/swc-win32-arm64-msvc': 14.2.13
- '@next/swc-win32-ia32-msvc': 14.2.13
- '@next/swc-win32-x64-msvc': 14.2.13
+ '@next/swc-darwin-arm64': 14.2.14
+ '@next/swc-darwin-x64': 14.2.14
+ '@next/swc-linux-arm64-gnu': 14.2.14
+ '@next/swc-linux-arm64-musl': 14.2.14
+ '@next/swc-linux-x64-gnu': 14.2.14
+ '@next/swc-linux-x64-musl': 14.2.14
+ '@next/swc-win32-arm64-msvc': 14.2.14
+ '@next/swc-win32-ia32-msvc': 14.2.14
+ '@next/swc-win32-x64-msvc': 14.2.14
transitivePeerDependencies:
- '@babel/core'
- babel-plugin-macros
diff --git a/src/actions/auth.action.ts b/src/actions/auth.action.ts
new file mode 100644
index 0000000..1eaa9ba
--- /dev/null
+++ b/src/actions/auth.action.ts
@@ -0,0 +1,11 @@
+"use server";
+
+import { cookies } from "next/headers";
+
+export const createAuthCookie = async () => {
+ cookies().set("userAuth", "myToken", { secure: true });
+};
+
+export const deleteAuthCookie = async () => {
+ cookies().delete("userAuth");
+};
diff --git a/src/app/(app)/layout.tsx b/src/app/(app)/layout.tsx
new file mode 100644
index 0000000..bdbded6
--- /dev/null
+++ b/src/app/(app)/layout.tsx
@@ -0,0 +1,10 @@
+import { Layout } from "@/components/layout/layout";
+import "@/styles/globals.css";
+
+export default function RootLayout({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return {children};
+}
diff --git a/src/app/(app)/page.tsx b/src/app/(app)/page.tsx
new file mode 100644
index 0000000..b4323e9
--- /dev/null
+++ b/src/app/(app)/page.tsx
@@ -0,0 +1,9 @@
+import type { NextPage } from "next";
+
+import { Content } from "@/components/home/content";
+
+const Home: NextPage = () => {
+ return ;
+};
+
+export default Home;
diff --git a/src/app/(auth)/layout.tsx b/src/app/(auth)/layout.tsx
new file mode 100644
index 0000000..bf0f037
--- /dev/null
+++ b/src/app/(auth)/layout.tsx
@@ -0,0 +1,10 @@
+import { AuthLayoutWrapper } from "@/components/auth/auth-layout";
+import "@/styles/globals.css";
+
+export default function RootLayout({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return {children};
+}
diff --git a/src/app/(auth)/login/page.tsx b/src/app/(auth)/login/page.tsx
new file mode 100644
index 0000000..3665a19
--- /dev/null
+++ b/src/app/(auth)/login/page.tsx
@@ -0,0 +1,7 @@
+import Login from "@/components/auth/login";
+
+const login = () => {
+ return ;
+};
+
+export default login;
diff --git a/src/app/(dashboard)/admin/layout.tsx b/src/app/(dashboard)/admin/layout.tsx
new file mode 100644
index 0000000..bdbded6
--- /dev/null
+++ b/src/app/(dashboard)/admin/layout.tsx
@@ -0,0 +1,10 @@
+import { Layout } from "@/components/layout/layout";
+import "@/styles/globals.css";
+
+export default function RootLayout({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return {children};
+}
diff --git a/src/app/(dashboard)/admin/page.tsx b/src/app/(dashboard)/admin/page.tsx
index 1c9564b..b4323e9 100644
--- a/src/app/(dashboard)/admin/page.tsx
+++ b/src/app/(dashboard)/admin/page.tsx
@@ -1,7 +1,9 @@
-export default function AdminPage() {
- return (
-
-
Admin Dashboard
-
- );
-}
+import type { NextPage } from "next";
+
+import { Content } from "@/components/home/content";
+
+const Home: NextPage = () => {
+ return ;
+};
+
+export default Home;
diff --git a/src/app/_components/auth-button.tsx b/src/app/_components/auth-button.tsx
deleted file mode 100644
index 5cd74a4..0000000
--- a/src/app/_components/auth-button.tsx
+++ /dev/null
@@ -1,74 +0,0 @@
-"use client";
-
-import {
- Avatar,
- Button,
- CircularProgress,
- Dropdown,
- DropdownItem,
- DropdownMenu,
- DropdownTrigger,
-} from "@nextui-org/react";
-import { IconBrandGoogle } from "@tabler/icons-react";
-import { signIn, signOut, useSession } from "next-auth/react";
-
-export default function AuthButton({ minimal = true }: { minimal?: boolean }) {
- const { data, status } = useSession();
-
- if (status === "loading") {
- return ;
- }
-
- if (status === "authenticated") {
- const signOutClick = () =>
- signOut({
- callbackUrl: "/",
- });
- if (minimal) {
- return (
-
- );
- }
-
- return (
-
-
-
-
-
-
- Signed in as
- {data.user?.email}
-
-
- Sign Out
-
-
-
- );
- }
-
- return (
-
- );
-}
diff --git a/src/app/globals.css b/src/app/globals.css
deleted file mode 100644
index b5c61c9..0000000
--- a/src/app/globals.css
+++ /dev/null
@@ -1,3 +0,0 @@
-@tailwind base;
-@tailwind components;
-@tailwind utilities;
diff --git a/src/app/layout.tsx b/src/app/layout.tsx
index 9973bad..c418a04 100644
--- a/src/app/layout.tsx
+++ b/src/app/layout.tsx
@@ -3,10 +3,9 @@ import { Suspense } from "react";
import { GeistSans } from "geist/font/sans";
-import Providers from "@/components/providers";
-import { TRPCReactProvider } from "@/trpc/react";
+import "@/styles/globals.css";
-import "./globals.css";
+import Providers from "./providers";
export const metadata: Metadata = {
title: "Next.js Starter App",
@@ -15,9 +14,9 @@ export const metadata: Metadata = {
export default function RootLayout({
children,
-}: Readonly<{
+}: {
children: React.ReactNode;
-}>) {
+}) {
return (
-
-
-
- {children}
-
-
-
+
+
+ {children}
+
+