-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created a Database Supabase, Created a responsive Navbar design, Crea…
…ted a authentication pages such as login and signup, added google auth
- Loading branch information
1 parent
c4690fc
commit 3192e01
Showing
8 changed files
with
408 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from "react"; | ||
|
||
const AuthLayout = ({ children }: { children: React.ReactNode }) => { | ||
return ( | ||
<div className="flex w-full h-[90vh] flex-1 items-center justify-center mt-[-20px]"> | ||
{children} | ||
</div> | ||
); | ||
}; | ||
|
||
export default AuthLayout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { SignIn } from "@clerk/nextjs"; | ||
|
||
export default function Page() { | ||
return <SignIn />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { SignUp } from "@clerk/nextjs"; | ||
|
||
export default function Page() { | ||
return <SignUp />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import React from "react"; | ||
import { SignedIn, SignInButton, SignedOut, UserButton } from "@clerk/nextjs"; | ||
import { Button } from "./ui/button"; | ||
import Link from "next/link"; | ||
import { LayoutDashboard, PenBox } from "lucide-react"; | ||
|
||
const Navbar = () => { | ||
return ( | ||
<> | ||
<div className="container mx-auto px-2 md:px-10 z-50 fixed top-0 bg-white/80 backdrop-blur-md border-b"> | ||
<nav className="container flex justify-between items-center py-4 "> | ||
{/* Logo here */} | ||
<Link href="/"> | ||
<div className="text-2xl xl:text-3xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-sky-500 to-blue-600"> | ||
Wealth Manager | ||
</div> | ||
</Link> | ||
|
||
{/* Nav items here */} | ||
<div> | ||
<SignedIn> | ||
<div className="w-full flex items-center justify-between gap-x-4"> | ||
<Link href="/transaction/create"> | ||
<Button type="button"> | ||
<PenBox className="" /> | ||
<span className="hidden md:flex">Add Transaction</span> | ||
</Button> | ||
</Link> | ||
|
||
<Link href="/dashboard"> | ||
<Button | ||
type="button" | ||
variant={"outline"} | ||
className="text-gray-600 hover:text-blue-600" | ||
> | ||
<LayoutDashboard className="" /> | ||
<span className="hidden md:flex">Dashboard</span> | ||
</Button> | ||
</Link> | ||
|
||
<UserButton | ||
appearance={{ | ||
elements: { | ||
avatarBox: "h-10 w-10", | ||
}, | ||
}} | ||
/> | ||
</div> | ||
</SignedIn> | ||
<SignedOut> | ||
<SignInButton forceRedirectUrl={"/dashboard"}> | ||
<Button type="button" variant={"outline"}> | ||
Login | ||
</Button> | ||
</SignInButton> | ||
</SignedOut> | ||
</div> | ||
</nav> | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default Navbar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { clerkMiddleware, createRouteMatcher } from "@clerk/nextjs/server"; | ||
|
||
const isProtected = createRouteMatcher([ | ||
"/dashboard(.*)", | ||
"/account(.*)", | ||
"/transaction(.*)", | ||
]); | ||
|
||
export default clerkMiddleware(async (auth, req) => { | ||
const { userId } = await auth(); | ||
|
||
if (!userId && isProtected(req)) { | ||
const { redirectToSignIn } = await auth(); | ||
|
||
return redirectToSignIn(); | ||
} | ||
|
||
return null; | ||
}); | ||
|
||
export const config = { | ||
matcher: [ | ||
// Skip Next.js internals and all static files, unless found in search params | ||
"/((?!_next|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)", | ||
// Always run for API routes | ||
"/(api|trpc)(.*)", | ||
], | ||
}; |
Oops, something went wrong.