diff --git a/app/page.tsx b/app/page.tsx index 4a2ed76..ff8da30 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,10 +1,43 @@ "use client"; import Link from "next/link"; +import { useEffect, useState } from "react"; +import { useRouter } from "next/navigation"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; +import { doesSessionExist } from "supertokens-web-js/recipe/session"; export default function HomePage() { + const router = useRouter(); + const [isLoading, setIsLoading] = useState(true); + const [isLoggedIn, setIsLoggedIn] = useState(false); + + useEffect(() => { + // Check if user is already logged in + doesSessionExist().then((exists) => { + setIsLoggedIn(exists); + setIsLoading(false); + + // If logged in, redirect to projects + if (exists) { + router.push("/marks-account/projects"); + } + }).catch(() => { + setIsLoading(false); + }); + }, [router]); + + if (isLoading) { + return ( +
Loading...
+- Vib'n is now running on Coolify! 🎉 + Track, manage, and deploy your AI-coded projects with ease.
-- Connected and operational +
+ Deploy to Coolify with one click
- PostgreSQL running +
+ Track AI coding sessions +
++ Monitor project progress
- Note: Authentication is being migrated from Firebase to PostgreSQL.
-
- This page will be updated with login functionality soon.
-