From 0464163e303333a7ee9eade38d62d3007d3be8f1 Mon Sep 17 00:00:00 2001 From: Rohit Dhakane Date: Fri, 28 Feb 2025 12:47:14 +0530 Subject: [PATCH 1/8] feat: initialize studio app with package.json, tsconfig, and .gitignore --- apps/studio/.gitignore | 3 +++ apps/studio/package.json | 12 ++++++++++++ apps/studio/tsconfig.json | 5 +++++ 3 files changed, 20 insertions(+) create mode 100644 apps/studio/.gitignore create mode 100644 apps/studio/package.json create mode 100644 apps/studio/tsconfig.json diff --git a/apps/studio/.gitignore b/apps/studio/.gitignore new file mode 100644 index 0000000..3a254f0 --- /dev/null +++ b/apps/studio/.gitignore @@ -0,0 +1,3 @@ +node_modules +# Keep environment variables out of version control +.env \ No newline at end of file diff --git a/apps/studio/package.json b/apps/studio/package.json new file mode 100644 index 0000000..3f62d06 --- /dev/null +++ b/apps/studio/package.json @@ -0,0 +1,12 @@ +{ + "name": "studio", + "version": "0.0.0", + "scripts": { + "dev": "prisma studio --schema ../../packages/db/prisma/schema.prisma --port 3005", + "clean": "git clean -xdf .cache .turbo dist node_modules", + "typecheck": "tsc --noEmit --emitDeclarationOnly false" + }, + "devDependencies": { + "prisma": "6.3.1" + } + } \ No newline at end of file diff --git a/apps/studio/tsconfig.json b/apps/studio/tsconfig.json new file mode 100644 index 0000000..61b87a1 --- /dev/null +++ b/apps/studio/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "@repo/typescript-config/nextjs.json", + "include": ["**/*.ts", "**/*.tsx"], + "exclude": ["node_modules"] + } \ No newline at end of file From 02c86439d3935eb46cb6cd881e999f65b60049d3 Mon Sep 17 00:00:00 2001 From: Rohit Dhakane Date: Fri, 28 Feb 2025 13:56:12 +0530 Subject: [PATCH 2/8] feat: group all content in main --- apps/web/app/{ => (main)}/dashboard/page.tsx | 0 apps/web/app/(main)/layout.tsx | 12 ++++++++++++ apps/web/app/{ => (main)}/page.module.css | 0 apps/web/app/{ => (main)}/page.tsx | 0 apps/web/app/{ => (main)}/payment/cancel/page.tsx | 0 apps/web/app/{ => (main)}/payment/success/page.tsx | 0 apps/web/app/{ => (main)}/payment/verify/page.tsx | 0 apps/web/app/{ => (main)}/pricing/page.tsx | 0 apps/web/app/{ => (main)}/purchases/page.tsx | 0 apps/web/app/{ => (main)}/train/page.tsx | 3 +-- apps/web/app/layout.tsx | 4 ---- 11 files changed, 13 insertions(+), 6 deletions(-) rename apps/web/app/{ => (main)}/dashboard/page.tsx (100%) create mode 100644 apps/web/app/(main)/layout.tsx rename apps/web/app/{ => (main)}/page.module.css (100%) rename apps/web/app/{ => (main)}/page.tsx (100%) rename apps/web/app/{ => (main)}/payment/cancel/page.tsx (100%) rename apps/web/app/{ => (main)}/payment/success/page.tsx (100%) rename apps/web/app/{ => (main)}/payment/verify/page.tsx (100%) rename apps/web/app/{ => (main)}/pricing/page.tsx (100%) rename apps/web/app/{ => (main)}/purchases/page.tsx (100%) rename apps/web/app/{ => (main)}/train/page.tsx (99%) diff --git a/apps/web/app/dashboard/page.tsx b/apps/web/app/(main)/dashboard/page.tsx similarity index 100% rename from apps/web/app/dashboard/page.tsx rename to apps/web/app/(main)/dashboard/page.tsx diff --git a/apps/web/app/(main)/layout.tsx b/apps/web/app/(main)/layout.tsx new file mode 100644 index 0000000..a3dd5db --- /dev/null +++ b/apps/web/app/(main)/layout.tsx @@ -0,0 +1,12 @@ +import { Appbar } from "@/components/Appbar"; +import { Footer } from "@/components/Footer"; + +export default function Layout({ children }: { children: React.ReactNode }) { + return ( +
+ +
{children}
+
+
+ ); +} diff --git a/apps/web/app/page.module.css b/apps/web/app/(main)/page.module.css similarity index 100% rename from apps/web/app/page.module.css rename to apps/web/app/(main)/page.module.css diff --git a/apps/web/app/page.tsx b/apps/web/app/(main)/page.tsx similarity index 100% rename from apps/web/app/page.tsx rename to apps/web/app/(main)/page.tsx diff --git a/apps/web/app/payment/cancel/page.tsx b/apps/web/app/(main)/payment/cancel/page.tsx similarity index 100% rename from apps/web/app/payment/cancel/page.tsx rename to apps/web/app/(main)/payment/cancel/page.tsx diff --git a/apps/web/app/payment/success/page.tsx b/apps/web/app/(main)/payment/success/page.tsx similarity index 100% rename from apps/web/app/payment/success/page.tsx rename to apps/web/app/(main)/payment/success/page.tsx diff --git a/apps/web/app/payment/verify/page.tsx b/apps/web/app/(main)/payment/verify/page.tsx similarity index 100% rename from apps/web/app/payment/verify/page.tsx rename to apps/web/app/(main)/payment/verify/page.tsx diff --git a/apps/web/app/pricing/page.tsx b/apps/web/app/(main)/pricing/page.tsx similarity index 100% rename from apps/web/app/pricing/page.tsx rename to apps/web/app/(main)/pricing/page.tsx diff --git a/apps/web/app/purchases/page.tsx b/apps/web/app/(main)/purchases/page.tsx similarity index 100% rename from apps/web/app/purchases/page.tsx rename to apps/web/app/(main)/purchases/page.tsx diff --git a/apps/web/app/train/page.tsx b/apps/web/app/(main)/train/page.tsx similarity index 99% rename from apps/web/app/train/page.tsx rename to apps/web/app/(main)/train/page.tsx index 5d9ab39..5ae3398 100644 --- a/apps/web/app/train/page.tsx +++ b/apps/web/app/(main)/train/page.tsx @@ -22,7 +22,7 @@ import { UploadModal } from "@/components/ui/upload" import { useState } from "react" import { TrainModelInput } from "common/inferred" import axios from "axios" -import { BACKEND_URL } from "../config" +import { BACKEND_URL } from "../../config" import { useRouter } from "next/navigation" import { useAuth } from "@clerk/nextjs" @@ -53,7 +53,6 @@ export default function Train() { const response = await axios.post(`${BACKEND_URL}/ai/training`, input, { headers: { Authorization - : `Bearer ${token}` } }); diff --git a/apps/web/app/layout.tsx b/apps/web/app/layout.tsx index bf5c6db..9230e19 100644 --- a/apps/web/app/layout.tsx +++ b/apps/web/app/layout.tsx @@ -1,9 +1,7 @@ import type { Metadata } from "next"; import localFont from "next/font/local"; import "./globals.css"; -import { Appbar } from "@/components/Appbar"; import { Providers } from "@/components/providers/Providers"; -import { Footer } from "@/components/Footer"; import Script from "next/script"; const geistSans = localFont({ @@ -41,9 +39,7 @@ export default function RootLayout({ >
-
{children}
-
From caea48bb1b824b313473395fc6b3798f70151cfd Mon Sep 17 00:00:00 2001 From: Rohit Dhakane Date: Fri, 28 Feb 2025 22:37:59 +0530 Subject: [PATCH 3/8] feat: add UI components for separator, alert, breadcrumb, and form --- apps/web/components/ui/alert-dialog.tsx | 157 ++++++++++++++++++++++ apps/web/components/ui/alert.tsx | 66 ++++++++++ apps/web/components/ui/breadcrumb.tsx | 109 ++++++++++++++++ apps/web/components/ui/form.tsx | 167 ++++++++++++++++++++++++ apps/web/components/ui/separator.tsx | 28 ++++ 5 files changed, 527 insertions(+) create mode 100644 apps/web/components/ui/alert-dialog.tsx create mode 100644 apps/web/components/ui/alert.tsx create mode 100644 apps/web/components/ui/breadcrumb.tsx create mode 100644 apps/web/components/ui/form.tsx create mode 100644 apps/web/components/ui/separator.tsx diff --git a/apps/web/components/ui/alert-dialog.tsx b/apps/web/components/ui/alert-dialog.tsx new file mode 100644 index 0000000..27a1b77 --- /dev/null +++ b/apps/web/components/ui/alert-dialog.tsx @@ -0,0 +1,157 @@ +"use client" + +import * as React from "react" +import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog" + +import { cn } from "@/lib/utils" +import { buttonVariants } from "@/components/ui/button" + +function AlertDialog({ + ...props +}: React.ComponentProps) { + return +} + +function AlertDialogTrigger({ + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function AlertDialogPortal({ + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function AlertDialogOverlay({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function AlertDialogContent({ + className, + ...props +}: React.ComponentProps) { + return ( + + + + + ) +} + +function AlertDialogHeader({ + className, + ...props +}: React.ComponentProps<"div">) { + return ( +
+ ) +} + +function AlertDialogFooter({ + className, + ...props +}: React.ComponentProps<"div">) { + return ( +
+ ) +} + +function AlertDialogTitle({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function AlertDialogDescription({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function AlertDialogAction({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function AlertDialogCancel({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +export { + AlertDialog, + AlertDialogPortal, + AlertDialogOverlay, + AlertDialogTrigger, + AlertDialogContent, + AlertDialogHeader, + AlertDialogFooter, + AlertDialogTitle, + AlertDialogDescription, + AlertDialogAction, + AlertDialogCancel, +} diff --git a/apps/web/components/ui/alert.tsx b/apps/web/components/ui/alert.tsx new file mode 100644 index 0000000..3b8ee79 --- /dev/null +++ b/apps/web/components/ui/alert.tsx @@ -0,0 +1,66 @@ +import * as React from "react" +import { cva, type VariantProps } from "class-variance-authority" + +import { cn } from "@/lib/utils" + +const alertVariants = cva( + "relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current", + { + variants: { + variant: { + default: "bg-background text-foreground", + destructive: + "text-destructive-foreground [&>svg]:text-current *:data-[slot=alert-description]:text-destructive-foreground/80", + }, + }, + defaultVariants: { + variant: "default", + }, + } +) + +function Alert({ + className, + variant, + ...props +}: React.ComponentProps<"div"> & VariantProps) { + return ( +
+ ) +} + +function AlertTitle({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +function AlertDescription({ + className, + ...props +}: React.ComponentProps<"div">) { + return ( +
+ ) +} + +export { Alert, AlertTitle, AlertDescription } diff --git a/apps/web/components/ui/breadcrumb.tsx b/apps/web/components/ui/breadcrumb.tsx new file mode 100644 index 0000000..eb88f32 --- /dev/null +++ b/apps/web/components/ui/breadcrumb.tsx @@ -0,0 +1,109 @@ +import * as React from "react" +import { Slot } from "@radix-ui/react-slot" +import { ChevronRight, MoreHorizontal } from "lucide-react" + +import { cn } from "@/lib/utils" + +function Breadcrumb({ ...props }: React.ComponentProps<"nav">) { + return