diff --git a/frontend/src/pages/home/index.tsx b/frontend/src/pages/home/index.tsx new file mode 100644 index 0000000..a487dd0 --- /dev/null +++ b/frontend/src/pages/home/index.tsx @@ -0,0 +1,100 @@ +import { useState } from "react"; +import { Button } from "@/components/ui/button"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; +import { Input } from "@/components/ui/input"; +import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; +import { Label } from "@/components/ui/label"; + +export default function MainPage() { + const [email, setEmail] = useState(""); + const [password, setPassword] = useState(""); + const [username, setUsername] = useState(""); + + return ( +
+ {/* Showcase Section */} +
+

Welcome to Our Platform

+

+ A place where you can explore, connect, and engage. Sign up or log in + to get started. +

+ +
+ + {/* Authentication Section */} + + + Join Us + + + + + Login + Register + + + {/* Login Tab */} + +
+
+ + setEmail(e.target.value)} + placeholder="Enter your email" + /> +
+
+ + setPassword(e.target.value)} + placeholder="Enter your password" + /> +
+ +
+
+ + {/* Register Tab */} + +
+
+ + setUsername(e.target.value)} + placeholder="Choose a username" + /> +
+
+ + setEmail(e.target.value)} + placeholder="Enter your email" + /> +
+
+ + setPassword(e.target.value)} + placeholder="Create a password" + /> +
+ +
+
+
+
+
+
+ ); +} diff --git a/frontend/src/routeTree.gen.ts b/frontend/src/routeTree.gen.ts index ba55cfa..fac4e6c 100644 --- a/frontend/src/routeTree.gen.ts +++ b/frontend/src/routeTree.gen.ts @@ -14,10 +14,11 @@ import { createFileRoute } from '@tanstack/react-router' import { Route as rootRoute } from './routes/__root' import { Route as AuthenticatedRouteImport } from './routes/_authenticated/route' -import { Route as AuthenticatedIndexImport } from './routes/_authenticated/index' +import { Route as IndexImport } from './routes/index' import { Route as authSignInImport } from './routes/(auth)/sign-in' import { Route as authOtpImport } from './routes/(auth)/otp' import { Route as auth500Import } from './routes/(auth)/500' +import { Route as AuthenticatedDashboardIndexImport } from './routes/_authenticated/dashboard/index' // Create Virtual Routes @@ -75,10 +76,10 @@ const AuthenticatedRouteRoute = AuthenticatedRouteImport.update({ getParentRoute: () => rootRoute, } as any) -const AuthenticatedIndexRoute = AuthenticatedIndexImport.update({ +const IndexRoute = IndexImport.update({ id: '/', path: '/', - getParentRoute: () => AuthenticatedRouteRoute, + getParentRoute: () => rootRoute, } as any) const errors503LazyRoute = errors503LazyImport @@ -239,6 +240,13 @@ const AuthenticatedAppsIndexLazyRoute = AuthenticatedAppsIndexLazyImport.update( import('./routes/_authenticated/apps/index.lazy').then((d) => d.Route), ) +const AuthenticatedDashboardIndexRoute = + AuthenticatedDashboardIndexImport.update({ + id: '/dashboard/', + path: '/dashboard/', + getParentRoute: () => AuthenticatedRouteRoute, + } as any) + const AuthenticatedSettingsNotificationsLazyRoute = AuthenticatedSettingsNotificationsLazyImport.update({ id: '/notifications', @@ -287,6 +295,13 @@ const AuthenticatedSettingsAccountLazyRoute = declare module '@tanstack/react-router' { interface FileRoutesByPath { + '/': { + id: '/' + path: '/' + fullPath: '/' + preLoaderRoute: typeof IndexImport + parentRoute: typeof rootRoute + } '/_authenticated': { id: '/_authenticated' path: '' @@ -378,13 +393,6 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof errors503LazyImport parentRoute: typeof rootRoute } - '/_authenticated/': { - id: '/_authenticated/' - path: '/' - fullPath: '/' - preLoaderRoute: typeof AuthenticatedIndexImport - parentRoute: typeof AuthenticatedRouteImport - } '/_authenticated/settings/account': { id: '/_authenticated/settings/account' path: '/account' @@ -413,6 +421,13 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof AuthenticatedSettingsNotificationsLazyImport parentRoute: typeof AuthenticatedSettingsRouteLazyImport } + '/_authenticated/dashboard/': { + id: '/_authenticated/dashboard/' + path: '/dashboard' + fullPath: '/dashboard' + preLoaderRoute: typeof AuthenticatedDashboardIndexImport + parentRoute: typeof AuthenticatedRouteImport + } '/_authenticated/apps/': { id: '/_authenticated/apps/' path: '/apps' @@ -495,7 +510,7 @@ const AuthenticatedSettingsRouteLazyRouteWithChildren = interface AuthenticatedRouteRouteChildren { AuthenticatedSettingsRouteLazyRoute: typeof AuthenticatedSettingsRouteLazyRouteWithChildren - AuthenticatedIndexRoute: typeof AuthenticatedIndexRoute + AuthenticatedDashboardIndexRoute: typeof AuthenticatedDashboardIndexRoute AuthenticatedAppsIndexLazyRoute: typeof AuthenticatedAppsIndexLazyRoute AuthenticatedChatsIndexLazyRoute: typeof AuthenticatedChatsIndexLazyRoute AuthenticatedHelpCenterIndexLazyRoute: typeof AuthenticatedHelpCenterIndexLazyRoute @@ -507,7 +522,7 @@ interface AuthenticatedRouteRouteChildren { const AuthenticatedRouteRouteChildren: AuthenticatedRouteRouteChildren = { AuthenticatedSettingsRouteLazyRoute: AuthenticatedSettingsRouteLazyRouteWithChildren, - AuthenticatedIndexRoute: AuthenticatedIndexRoute, + AuthenticatedDashboardIndexRoute: AuthenticatedDashboardIndexRoute, AuthenticatedAppsIndexLazyRoute: AuthenticatedAppsIndexLazyRoute, AuthenticatedChatsIndexLazyRoute: AuthenticatedChatsIndexLazyRoute, AuthenticatedHelpCenterIndexLazyRoute: AuthenticatedHelpCenterIndexLazyRoute, @@ -520,6 +535,7 @@ const AuthenticatedRouteRouteWithChildren = AuthenticatedRouteRoute._addFileChildren(AuthenticatedRouteRouteChildren) export interface FileRoutesByFullPath { + '/': typeof IndexRoute '': typeof AuthenticatedRouteRouteWithChildren '/500': typeof errors500LazyRoute '/otp': typeof authOtpRoute @@ -532,11 +548,11 @@ export interface FileRoutesByFullPath { '/403': typeof errors403LazyRoute '/404': typeof errors404LazyRoute '/503': typeof errors503LazyRoute - '/': typeof AuthenticatedIndexRoute '/settings/account': typeof AuthenticatedSettingsAccountLazyRoute '/settings/appearance': typeof AuthenticatedSettingsAppearanceLazyRoute '/settings/display': typeof AuthenticatedSettingsDisplayLazyRoute '/settings/notifications': typeof AuthenticatedSettingsNotificationsLazyRoute + '/dashboard': typeof AuthenticatedDashboardIndexRoute '/apps': typeof AuthenticatedAppsIndexLazyRoute '/chats': typeof AuthenticatedChatsIndexLazyRoute '/help-center': typeof AuthenticatedHelpCenterIndexLazyRoute @@ -547,6 +563,8 @@ export interface FileRoutesByFullPath { } export interface FileRoutesByTo { + '/': typeof IndexRoute + '': typeof AuthenticatedRouteRouteWithChildren '/500': typeof errors500LazyRoute '/otp': typeof authOtpRoute '/sign-in': typeof authSignInRoute @@ -557,11 +575,11 @@ export interface FileRoutesByTo { '/403': typeof errors403LazyRoute '/404': typeof errors404LazyRoute '/503': typeof errors503LazyRoute - '/': typeof AuthenticatedIndexRoute '/settings/account': typeof AuthenticatedSettingsAccountLazyRoute '/settings/appearance': typeof AuthenticatedSettingsAppearanceLazyRoute '/settings/display': typeof AuthenticatedSettingsDisplayLazyRoute '/settings/notifications': typeof AuthenticatedSettingsNotificationsLazyRoute + '/dashboard': typeof AuthenticatedDashboardIndexRoute '/apps': typeof AuthenticatedAppsIndexLazyRoute '/chats': typeof AuthenticatedChatsIndexLazyRoute '/help-center': typeof AuthenticatedHelpCenterIndexLazyRoute @@ -573,6 +591,7 @@ export interface FileRoutesByTo { export interface FileRoutesById { __root__: typeof rootRoute + '/': typeof IndexRoute '/_authenticated': typeof AuthenticatedRouteRouteWithChildren '/(auth)/500': typeof auth500Route '/(auth)/otp': typeof authOtpRoute @@ -586,11 +605,11 @@ export interface FileRoutesById { '/(errors)/404': typeof errors404LazyRoute '/(errors)/500': typeof errors500LazyRoute '/(errors)/503': typeof errors503LazyRoute - '/_authenticated/': typeof AuthenticatedIndexRoute '/_authenticated/settings/account': typeof AuthenticatedSettingsAccountLazyRoute '/_authenticated/settings/appearance': typeof AuthenticatedSettingsAppearanceLazyRoute '/_authenticated/settings/display': typeof AuthenticatedSettingsDisplayLazyRoute '/_authenticated/settings/notifications': typeof AuthenticatedSettingsNotificationsLazyRoute + '/_authenticated/dashboard/': typeof AuthenticatedDashboardIndexRoute '/_authenticated/apps/': typeof AuthenticatedAppsIndexLazyRoute '/_authenticated/chats/': typeof AuthenticatedChatsIndexLazyRoute '/_authenticated/help-center/': typeof AuthenticatedHelpCenterIndexLazyRoute @@ -603,6 +622,7 @@ export interface FileRoutesById { export interface FileRouteTypes { fileRoutesByFullPath: FileRoutesByFullPath fullPaths: + | '/' | '' | '/500' | '/otp' @@ -615,11 +635,11 @@ export interface FileRouteTypes { | '/403' | '/404' | '/503' - | '/' | '/settings/account' | '/settings/appearance' | '/settings/display' | '/settings/notifications' + | '/dashboard' | '/apps' | '/chats' | '/help-center' @@ -629,6 +649,8 @@ export interface FileRouteTypes { | '/users' fileRoutesByTo: FileRoutesByTo to: + | '/' + | '' | '/500' | '/otp' | '/sign-in' @@ -639,11 +661,11 @@ export interface FileRouteTypes { | '/403' | '/404' | '/503' - | '/' | '/settings/account' | '/settings/appearance' | '/settings/display' | '/settings/notifications' + | '/dashboard' | '/apps' | '/chats' | '/help-center' @@ -653,6 +675,7 @@ export interface FileRouteTypes { | '/users' id: | '__root__' + | '/' | '/_authenticated' | '/(auth)/500' | '/(auth)/otp' @@ -666,11 +689,11 @@ export interface FileRouteTypes { | '/(errors)/404' | '/(errors)/500' | '/(errors)/503' - | '/_authenticated/' | '/_authenticated/settings/account' | '/_authenticated/settings/appearance' | '/_authenticated/settings/display' | '/_authenticated/settings/notifications' + | '/_authenticated/dashboard/' | '/_authenticated/apps/' | '/_authenticated/chats/' | '/_authenticated/help-center/' @@ -682,6 +705,7 @@ export interface FileRouteTypes { } export interface RootRouteChildren { + IndexRoute: typeof IndexRoute AuthenticatedRouteRoute: typeof AuthenticatedRouteRouteWithChildren auth500Route: typeof auth500Route authOtpRoute: typeof authOtpRoute @@ -697,6 +721,7 @@ export interface RootRouteChildren { } const rootRouteChildren: RootRouteChildren = { + IndexRoute: IndexRoute, AuthenticatedRouteRoute: AuthenticatedRouteRouteWithChildren, auth500Route: auth500Route, authOtpRoute: authOtpRoute, @@ -721,6 +746,7 @@ export const routeTree = rootRoute "__root__": { "filePath": "__root.tsx", "children": [ + "/", "/_authenticated", "/(auth)/500", "/(auth)/otp", @@ -735,11 +761,14 @@ export const routeTree = rootRoute "/(errors)/503" ] }, + "/": { + "filePath": "index.tsx" + }, "/_authenticated": { "filePath": "_authenticated/route.tsx", "children": [ "/_authenticated/settings", - "/_authenticated/", + "/_authenticated/dashboard/", "/_authenticated/apps/", "/_authenticated/chats/", "/_authenticated/help-center/", @@ -792,10 +821,6 @@ export const routeTree = rootRoute "/(errors)/503": { "filePath": "(errors)/503.lazy.tsx" }, - "/_authenticated/": { - "filePath": "_authenticated/index.tsx", - "parent": "/_authenticated" - }, "/_authenticated/settings/account": { "filePath": "_authenticated/settings/account.lazy.tsx", "parent": "/_authenticated/settings" @@ -812,6 +837,10 @@ export const routeTree = rootRoute "filePath": "_authenticated/settings/notifications.lazy.tsx", "parent": "/_authenticated/settings" }, + "/_authenticated/dashboard/": { + "filePath": "_authenticated/dashboard/index.tsx", + "parent": "/_authenticated" + }, "/_authenticated/apps/": { "filePath": "_authenticated/apps/index.lazy.tsx", "parent": "/_authenticated" diff --git a/frontend/src/routes/_authenticated/index.tsx b/frontend/src/routes/_authenticated/dashboard/index.tsx similarity index 64% rename from frontend/src/routes/_authenticated/index.tsx rename to frontend/src/routes/_authenticated/dashboard/index.tsx index fbc9d10..296ed27 100644 --- a/frontend/src/routes/_authenticated/index.tsx +++ b/frontend/src/routes/_authenticated/dashboard/index.tsx @@ -1,6 +1,6 @@ import { createFileRoute } from "@tanstack/react-router"; import Dashboard from "@/pages/dashboard"; -export const Route = createFileRoute("/_authenticated/")({ +export const Route = createFileRoute("/_authenticated/dashboard/")({ component: Dashboard }); diff --git a/frontend/src/routes/_authenticated/route.tsx b/frontend/src/routes/_authenticated/route.tsx index 2e0f547..87ee918 100644 --- a/frontend/src/routes/_authenticated/route.tsx +++ b/frontend/src/routes/_authenticated/route.tsx @@ -1,5 +1,5 @@ import Cookies from "js-cookie"; -import { createFileRoute, Outlet } from "@tanstack/react-router"; +import { createFileRoute, Outlet, redirect } from "@tanstack/react-router"; import { cn } from "@/lib/utils"; import { SearchProvider } from "@/context/search-context"; import { SidebarProvider } from "@/components/ui/sidebar"; @@ -7,6 +7,16 @@ import { AppSidebar } from "@/components/layout/app-sidebar"; import SkipToMain from "@/components/skip-to-main"; export const Route = createFileRoute("/_authenticated")({ + beforeLoad: async ({ location }) => { + if (true) { + throw redirect({ + to: "/sign-in", + search: { + redirect: location.href + } + }); + } + }, component: RouteComponent }); diff --git a/frontend/src/routes/index.tsx b/frontend/src/routes/index.tsx new file mode 100644 index 0000000..505a483 --- /dev/null +++ b/frontend/src/routes/index.tsx @@ -0,0 +1,6 @@ +import { createFileRoute } from "@tanstack/react-router"; +import MainPage from "@/pages/home"; + +export const Route = createFileRoute("/")({ + component: MainPage +});