Skip to content

Commit

Permalink
add autjs, prisma orm & xata db
Browse files Browse the repository at this point in the history
  • Loading branch information
SkidGod4444 committed Oct 6, 2024
1 parent 58485df commit d2ea4e8
Show file tree
Hide file tree
Showing 27 changed files with 544 additions and 55 deletions.
9 changes: 9 additions & 0 deletions app/(routes)/chat/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react'

export default function ChatPage() {
return (
<div>
Damn! bro can&apos;t you even wait for my wings?
</div>
)
}
19 changes: 14 additions & 5 deletions app/(routes)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,21 @@ import { OsBtn } from "@/components/custom/os.button";
import { OfcLinks } from "@/db/defaults";
import { useUser } from "@/context/user.context";
import DragableCards from "@/components/custom/hero/dragable.cards";
import AuthDialog from "@/components/custom/auth/auth.dialog";

export default function Component() {
const { user } = useUser();
const [isSidebarExpanded, setIsSidebarExpanded] = useState(false);
const [isOpen, setIsOpen] = useState(false);

const handleFormSubmit = async(event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault();
setIsOpen(!isOpen);
}

return (
<div className="relative h-screen z-50 flex flex-col dark:bg-black dark:text-white bg-background text-black font-[family-name:var(--font-geist-regular)] overflow-hidden">

{/* Background */}
<div className="fixed inset-0 z-20 h-full w-full bg-[linear-gradient(to_right,#f0f0f0_1px,transparent_1px),linear-gradient(to_bottom,#f0f0f0_1px,transparent_1px)] bg-[size:3rem_3rem] dark:bg-[linear-gradient(to_right,#333_1px,transparent_1px),linear-gradient(to_bottom,#333_1px,transparent_1px)] dark:bg-[size:3rem_3rem]" />

Expand Down Expand Up @@ -76,12 +84,13 @@ export default function Component() {
{/* Main Content */}
<div className="flex flex-col flex-1 z-40">
{/* Header at the top */}
<header className="flex justify-end items-center p-4">
<Badge>Public Beta</Badge>
<header className="flex justify-end items-center p-4 bg-transparent border-none">
{/* <Badge>Public Beta</Badge> */}
<AuthDialog open={isOpen} onOpenChange={setIsOpen}/>
</header>

<div className="mt-28 md:mt-10">
<OsBtn />
<OsBtn />
</div>
<main className="flex-1 flex flex-col items-center justify-center p-4">
<h2 className="text-4xl mb-4 font-[family-name:var(--font-geist-bold)] tracking-tighter select-none">
Expand All @@ -93,7 +102,7 @@ export default function Component() {

{/* Input area */}
<div className="w-full max-w-3xl mb-10">
<div className="flex flex-col gap-2 bg-background border-black dark:bg-black rounded-xl border border-dashed dark:border-white p-2 min-h-[60px]">
<form onSubmit={handleFormSubmit} className="flex flex-col gap-2 bg-background border-black dark:bg-black rounded-xl border border-dashed dark:border-white p-2 min-h-[60px]">
<CustomTextArea
placeholder="Acter make me a bra for my huge buttons..."
className="flex-1 bg-transparent focus:outline-none shadow-none"
Expand All @@ -106,7 +115,7 @@ export default function Component() {
<ArrowUpIcon className="w-4 h-4" />
</Button>
</div>
</div>
</form>
</div>

<div className="flex flex-wrap justify-center gap-4">
Expand Down
1 change: 0 additions & 1 deletion app/api/auth/[...nextauth]/route.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export { GET, POST } from "@/lib/auth/auth";
export const runtime = "edge";
16 changes: 16 additions & 0 deletions app/api/auth/user/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { NextResponse } from "next/server";
import { auth } from "@/lib/auth/auth";

export async function GET() {
try {
const session = await auth();
if (session) {
return NextResponse.json({ user: session.user });
} else {
return NextResponse.json({ user: null }, { status: 401 });
}
} catch (error) {
console.error("Error in fetching session:", error);
return NextResponse.json({ error: "Internal Server Error" }, { status: 500 });
}
}
Binary file modified app/favicon.ico
Binary file not shown.
5 changes: 5 additions & 0 deletions app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ body {
}
}

::selection {
background-color: #6EE7B7;
color: #000000;
}

@layer base {
* {
@apply border-border;
Expand Down
75 changes: 72 additions & 3 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import "./globals.css";
import { ThemeProvider } from "@/components/custom/theme.provider";
import { UserProvider } from "@/context/user.context";
import { RoutesContext } from "@/context/routes.context";
import { DATA } from "@/db/defaults";

const geistSans = localFont({
src: "./fonts/GeistVF.woff",
Expand Down Expand Up @@ -37,8 +38,76 @@ const geistRegular = localFont({
});

export const metadata: Metadata = {
title: "Acter by Saidev Dhal",
description: "Generated by create next app",
metadataBase: new URL(DATA.url),
title: {
default: DATA.name,
template: `%s - ${DATA.name}`,
},
description: DATA.description,
keywords: [
"Saidev Dhal",
"SkidGod",
"Saidev Dhal Portfolio",
"Saidev Dhal Projects",
"Saidev Dhal Blogs",
"Saidev Dhal Resume",
"Saidev Dhal Contact",
"Saidev Dhal Instagram",
"Saidev Dhal Youtube",
"Saidev Dhal Email",
"Saidev Dhal LinkedIn",
"Saidev Dhal GitHub",
"Saidev Dhal Twitter",
"saidevdhal",
"skidgod",
"skidgod4444",
],
authors: [
{
name: `${DATA.name}`,
url: DATA.url,
},
],
creator: `${DATA.name}`,
openGraph: {
title: `${DATA.name}`,
description: DATA.description,
url: DATA.url,
images: [
{
url: DATA.prevImage,
},
],
siteName: `${DATA.name}`,
locale: "en_US",
type: "website",
},
robots: {
index: true,
follow: true,
googleBot: {
index: true,
follow: true,
"max-video-preview": -1,
"max-image-preview": "large",
"max-snippet": -1,
},
},
twitter: {
title: `${DATA.name}`,
card: "summary_large_image",
site: DATA.url,
creator: `${DATA.name}`,
description: DATA.description,
images: [
{
url: DATA.prevImage,
width: 1200,
height: 630,
alt: `${DATA.name}`,
},
],
},
};

const protectedRoutes = ["/chat", "/history"];
Expand All @@ -50,7 +119,7 @@ export default function RootLayout({
children: React.ReactNode;
}>) {
return (
<html lang="en">
<html lang="en" suppressHydrationWarning>
<body
className={`${geistSans.variable} ${geistMono.variable} ${geistMedium.variable} ${geistBold.variable} ${geistSemiBold.variable} ${geistRegular.variable} antialiased`}
>
Expand Down
Binary file modified bun.lockb
Binary file not shown.
23 changes: 23 additions & 0 deletions components/custom/auth/auth.btns.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"use client"
import { signIn } from "next-auth/react"
import { Button } from '@/components/ui/button';
import { IconBrandGithub, IconBrandGoogle } from '@tabler/icons-react';
import React from 'react'

function LoginWithGoogle() {
return (
<Button onClick={() => signIn("google")}>
<IconBrandGoogle className='size-5 mr-2'/> Continue with Google
</Button>
)
}

function LoginWithGitHub() {
return (
<Button onClick={() => signIn("github")}>
<IconBrandGithub className='size-5 mr-2'/> Continue with GitHub
</Button>
)
}

export {LoginWithGoogle, LoginWithGitHub};
43 changes: 43 additions & 0 deletions components/custom/auth/auth.dialog.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import React from 'react'
import {
Dialog,
DialogContent,
DialogDescription,
DialogHeader,
DialogTrigger,
} from "@/components/ui/dialog"
import { Button } from '@/components/ui/button';
import { LogIn } from 'lucide-react';
import Image from 'next/image';
import { LoginWithGitHub, LoginWithGoogle } from './auth.btns';

interface AuthDialogProps {
open: boolean;
onOpenChange: (open: boolean) => void;
}
export default function AuthDialog({ open, onOpenChange }: AuthDialogProps) {
return (
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogTrigger>
<Button className='rounded-md'>
<LogIn className='mr-2 size-4' />Logon
</Button>
</DialogTrigger>
<DialogContent>
<DialogHeader>
<div className='flex items-center justify-start gap-20 flex-row'>
<Image src="/assets/acter-logo.jpg" width={100} height={100} alt='logo' className='flex items-center justify-center rounded-xl'/>
<div className='flex flex-col items-center justify-between'>
<LoginWithGitHub/>
<span className='text-muted-foreground font-[family-name:var(--font-geist-semi-bold)]'>OR</span>
<LoginWithGoogle/>
</div>
</div>
<DialogDescription>
Continue to Acter with any of the given providers. By using Acter you agree to follow our <a href='/legal/agreement' className='hover:underline cursor-pointer font-bold'>Terms</a> and <a href='/legal/privacy-policy' className='hover:underline cursor-pointer font-bold'>Policy</a>.
</DialogDescription>
</DialogHeader>
</DialogContent>
</Dialog>
)
}
33 changes: 16 additions & 17 deletions components/custom/hero/dragable.cards.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { Button } from "@/components/ui/button";
import {
BoltIcon,
Sparkles,
} from "lucide-react";
import { BoltIcon, Sparkles } from "lucide-react";
import React, { useState } from "react";
import DraggableWrapper from "../dragable.wrapper";
import { Card } from "@/components/ui/card";
Expand Down Expand Up @@ -41,9 +38,9 @@ export default function DragableCards() {
left: -300,
}}
>
<Card className="p-4 shadow-xl">
<SwipeableStackCards />
</Card>
<Card className="p-4 shadow-xl">
<SwipeableStackCards />
</Card>
</DraggableWrapper>
<DraggableWrapper
initial={{ top: -100, right: "15%", rotate: -10 }}
Expand Down Expand Up @@ -79,14 +76,14 @@ export default function DragableCards() {
}}
>
<Card className="p-4 shadow-xl">
<CodeComparison
beforeCode={beforeCode}
afterCode={afterCode}
language="typescript"
filename="sumArrayComparison.ts"
lightTheme="github-light"
darkTheme="github-dark"
/>
<CodeComparison
beforeCode={beforeCode}
afterCode={afterCode}
language="typescript"
filename="sumArrayComparison.ts"
lightTheme="github-light"
darkTheme="github-dark"
/>
</Card>
</DraggableWrapper>

Expand All @@ -113,11 +110,13 @@ export default function DragableCards() {
left: "10%",
}}
>
<div className="shadow-xl rounded-3xl">
<PlaceholdersAndVanishInput
placeholders={placeholders}
onChange={handleChange}
onSubmit={onSubmit}
/>
</div>
</DraggableWrapper>

<DraggableWrapper
Expand All @@ -132,14 +131,14 @@ export default function DragableCards() {
<HeroVideoDialog
className="dark:hidden block"
animationStyle="from-center"
videoSrc="https://www.youtube.com/embed/qh3NGpYRG3I?si=4rb-zSdDkVK9qxxb"
videoSrc="https://firebasestorage.googleapis.com/v0/b/archives-63571.appspot.com/o/portfolio%2Ftestimonials%2Fboxchat-testimonial.mp4?alt=media&token=51be6968-e40f-4074-a0f7-026f98930671"
thumbnailSrc="https://startup-template-sage.vercel.app/hero-light.png"
thumbnailAlt="Hero Video"
/>
<HeroVideoDialog
className="hidden dark:block"
animationStyle="from-center"
videoSrc="https://www.youtube.com/embed/qh3NGpYRG3I?si=4rb-zSdDkVK9qxxb"
videoSrc="https://firebasestorage.googleapis.com/v0/b/archives-63571.appspot.com/o/portfolio%2Ftestimonials%2Fboxchat-testimonial.mp4?alt=media&token=51be6968-e40f-4074-a0f7-026f98930671"
thumbnailSrc="https://startup-template-sage.vercel.app/hero-dark.png"
thumbnailAlt="Hero Video"
/>
Expand Down
26 changes: 26 additions & 0 deletions components/ui/animated-gradient-text.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { ReactNode } from "react";

import { cn } from "@/lib/utils";

export default function AnimatedGradientText({
children,
className,
}: {
children: ReactNode;
className?: string;
}) {
return (
<div
className={cn(
"group relative mx-auto flex max-w-fit flex-row items-center justify-center rounded-2xl bg-white/40 px-4 py-1.5 text-sm font-medium shadow-[inset_0_-8px_10px_#8fdfff1f] backdrop-blur-sm transition-shadow duration-500 ease-out [--bg-size:300%] hover:shadow-[inset_0_-5px_10px_#8fdfff3f] dark:bg-black/40",
className,
)}
>
<div
className={`absolute inset-0 block h-full w-full animate-gradient bg-gradient-to-r from-[#ffaa40]/50 via-[#9c40ff]/50 to-[#ffaa40]/50 bg-[length:var(--bg-size)_100%] p-[1px] ![mask-composite:subtract] [border-radius:inherit] [mask:linear-gradient(#fff_0_0)_content-box,linear-gradient(#fff_0_0)]`}
/>

{children}
</div>
);
}
Loading

0 comments on commit d2ea4e8

Please sign in to comment.