From 0e67e3378fd31501af5ecf116b2c8e3b887de25a Mon Sep 17 00:00:00 2001 From: anishshobithps Date: Wed, 1 May 2024 06:22:35 +0530 Subject: [PATCH 1/3] rbac and move to db strategy over JWT --- package-lock.json | 32 +++ package.json | 3 +- src/app/(content)/layout.tsx | 21 ++ src/app/{ => (content)}/page.tsx | 4 +- src/app/admin/_components/columns.tsx | 19 ++ src/app/admin/_components/datatable.tsx | 80 ++++++ src/app/admin/layout.tsx | 165 ++++++++++++ src/app/admin/page.tsx | 27 ++ src/app/api/users/route.ts | 33 +++ src/app/layout.tsx | 27 +- src/app/register/_components/Register.tsx | 270 ++++++++++++++++++++ src/app/register/page.tsx | 293 ++-------------------- src/auth.ts | 52 +++- src/components/ui/table.tsx | 120 +++++++++ 14 files changed, 839 insertions(+), 307 deletions(-) create mode 100644 src/app/(content)/layout.tsx rename src/app/{ => (content)}/page.tsx (93%) create mode 100644 src/app/admin/_components/columns.tsx create mode 100644 src/app/admin/_components/datatable.tsx create mode 100644 src/app/admin/layout.tsx create mode 100644 src/app/admin/page.tsx create mode 100644 src/app/api/users/route.ts create mode 100644 src/app/register/_components/Register.tsx create mode 100644 src/components/ui/table.tsx diff --git a/package-lock.json b/package-lock.json index e4895e6..6ec351e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,6 +36,7 @@ "@studio-freight/react-lenis": "^0.0.47", "@tabler/icons-react": "^3.2.0", "@tailwindcss/nesting": "^0.0.0-insiders.565cd3e", + "@tanstack/react-table": "^8.16.0", "@vercel/analytics": "^1.2.2", "@vercel/speed-insights": "^1.0.10", "class-variance-authority": "^0.7.0", @@ -2917,6 +2918,37 @@ "node": ">=4" } }, + "node_modules/@tanstack/react-table": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@tanstack/react-table/-/react-table-8.16.0.tgz", + "integrity": "sha512-rKRjnt8ostqN2fercRVOIH/dq7MAmOENCMvVlKx6P9Iokhh6woBGnIZEkqsY/vEJf1jN3TqLOb34xQGLVRuhAg==", + "dependencies": { + "@tanstack/table-core": "8.16.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "peerDependencies": { + "react": ">=16.8", + "react-dom": ">=16.8" + } + }, + "node_modules/@tanstack/table-core": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@tanstack/table-core/-/table-core-8.16.0.tgz", + "integrity": "sha512-dCG8vQGk4js5v88/k83tTedWOwjGnIyONrKpHpfmSJB8jwFHl8GSu1sBBxbtACVAPtAQgwNxl0rw1d3RqRM1Tg==", + "engines": { + "node": ">=12" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + } + }, "node_modules/@ts-morph/common": { "version": "0.19.0", "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.19.0.tgz", diff --git a/package.json b/package.json index 297becd..ff4fe86 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "build": "next build", "start": "next start", "lint": "next lint", - "postinstall": "prisma generate && prisma migrate deploy" + "postinstall": "prisma generate" }, "prisma": {}, "dependencies": { @@ -38,6 +38,7 @@ "@studio-freight/react-lenis": "^0.0.47", "@tabler/icons-react": "^3.2.0", "@tailwindcss/nesting": "^0.0.0-insiders.565cd3e", + "@tanstack/react-table": "^8.16.0", "@vercel/analytics": "^1.2.2", "@vercel/speed-insights": "^1.0.10", "class-variance-authority": "^0.7.0", diff --git a/src/app/(content)/layout.tsx b/src/app/(content)/layout.tsx new file mode 100644 index 0000000..8de6bc4 --- /dev/null +++ b/src/app/(content)/layout.tsx @@ -0,0 +1,21 @@ +import Glow from "@/components/shared/glow"; +import { StarsCanvas } from "@/components/ui/Stars"; +import Footer from "@/components/widgets/Footer"; +import { Header } from "@/components/widgets/Header"; +import React from "react"; + +function ContentLayout({ children }: { children: React.ReactNode }) { + return ( + <> + + +
+
+ {children} +
+