feat: Introduce user signup functionality with social login, authentication middleware, and updated login/home pages.

This commit is contained in:
pradeepkumar
2025-12-22 10:29:33 +05:30
parent 218337666e
commit de32edb7ab
8 changed files with 484 additions and 172 deletions

View File

@@ -1,63 +1,84 @@
import Image from "next/image";
'use client';
import { useSession, signOut } from 'next-auth/react';
import Link from 'next/link';
export default function Home() {
const { data: session } = useSession();
return (
<div className="flex min-h-screen items-center justify-center bg-zinc-50 font-sans dark:bg-black">
<main className="flex min-h-screen w-full max-w-3xl flex-col items-center justify-between py-32 px-16 bg-white dark:bg-black sm:items-start">
<Image
className="dark:invert"
src="/next.svg"
alt="Next.js logo"
width={100}
height={20}
priority
/>
<div className="flex flex-col items-center gap-6 text-center sm:items-start sm:text-left">
<h1 className="max-w-xs text-3xl font-semibold leading-10 tracking-tight text-black dark:text-zinc-50">
To get started, edit the page.tsx file.
</h1>
<p className="max-w-md text-lg leading-8 text-zinc-600 dark:text-zinc-400">
Looking for a starting point or more instructions? Head over to{" "}
<a
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
className="font-medium text-zinc-950 dark:text-zinc-50"
>
Templates
</a>{" "}
or the{" "}
<a
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
className="font-medium text-zinc-950 dark:text-zinc-50"
>
Learning
</a>{" "}
center.
</p>
<div className="min-h-screen bg-gradient-to-b from-[#c4d9d4] to-[#f0f5fc]">
{/* Header */}
<header className="bg-white/80 backdrop-blur-sm shadow-sm">
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div className="flex justify-between items-center h-16">
{/* Logo */}
<Link href="/">
<img
src="/assets/logo.svg"
alt="RE-QuestN"
className="h-8"
/>
</Link>
{/* User Menu */}
<div className="flex items-center gap-4">
<span className="text-sm text-[#00293d]">
Welcome, {session?.user?.name || session?.user?.email || 'User'}
</span>
<button
onClick={() => signOut({ callbackUrl: '/login' })}
className="px-4 py-2 bg-[#e58625] hover:bg-[#d47a1f] text-white text-sm font-medium rounded-lg transition-colors"
>
Sign Out
</button>
</div>
</div>
</div>
<div className="flex flex-col gap-4 text-base font-medium sm:flex-row">
<a
className="flex h-12 w-full items-center justify-center gap-2 rounded-full bg-foreground px-5 text-background transition-colors hover:bg-[#383838] dark:hover:bg-[#ccc] md:w-[158px]"
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
className="dark:invert"
src="/vercel.svg"
alt="Vercel logomark"
width={16}
height={16}
/>
Deploy Now
</a>
<a
className="flex h-12 w-full items-center justify-center rounded-full border border-solid border-black/[.08] px-5 transition-colors hover:border-transparent hover:bg-black/[.04] dark:border-white/[.145] dark:hover:bg-[#1a1a1a] md:w-[158px]"
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
Documentation
</a>
</header>
{/* Main Content */}
<main className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
<div className="bg-white rounded-[20px] shadow-lg p-8">
<h1 className="text-3xl font-bold text-[#00293d] mb-4">
Welcome to RE-QuestN
</h1>
<p className="text-[#00293d]/70 mb-8">
Your real estate journey starts here. Explore properties, connect with agents, and find your dream home.
</p>
{/* Quick Actions */}
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">
<div className="bg-[#f0f5fc] rounded-[20px] p-6 hover:shadow-md transition-shadow">
<div className="w-12 h-12 bg-[#00293d] rounded-full flex items-center justify-center mb-4">
<svg className="w-6 h-6 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" />
</svg>
</div>
<h3 className="text-lg font-semibold text-[#00293d] mb-2">Browse Properties</h3>
<p className="text-sm text-[#00293d]/70">Explore thousands of listings in your area</p>
</div>
<div className="bg-[#f0f5fc] rounded-[20px] p-6 hover:shadow-md transition-shadow">
<div className="w-12 h-12 bg-[#e58625] rounded-full flex items-center justify-center mb-4">
<svg className="w-6 h-6 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z" />
</svg>
</div>
<h3 className="text-lg font-semibold text-[#00293d] mb-2">Find Agents</h3>
<p className="text-sm text-[#00293d]/70">Connect with top real estate professionals</p>
</div>
<div className="bg-[#f0f5fc] rounded-[20px] p-6 hover:shadow-md transition-shadow">
<div className="w-12 h-12 bg-[#5ba4a4] rounded-full flex items-center justify-center mb-4">
<svg className="w-6 h-6 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" />
</svg>
</div>
<h3 className="text-lg font-semibold text-[#00293d] mb-2">Saved Favorites</h3>
<p className="text-sm text-[#00293d]/70">View your saved properties and searches</p>
</div>
</div>
</div>
</main>
</div>