Remove all obsolete authentication, settings, admin, and demo-related components and pages

- Eliminated redundant components, pages, and layouts related to authentication (`login`, `register`, `password-reset`, etc.), user settings, admin, and demos.
- Simplified the frontend structure by removing unused dynamic imports, forms, and test code.
- Refactored configurations and metadata imports to exclude references to removed features.
- Streamlined the project for future development and improved maintainability by discarding legacy and unused code.
This commit is contained in:
Felipe Cardoso
2025-11-18 12:41:57 +01:00
parent a73d3c7d3e
commit d1b47006f4
56 changed files with 259 additions and 208 deletions

View File

@@ -0,0 +1,28 @@
/**
* Authenticated Route Group Layout
* Wraps all authenticated routes with AuthGuard and provides common layout structure
*/
import type { Metadata } from 'next';
import { AuthGuard } from '@/components/auth';
import { Header } from '@/components/layout/Header';
import { Footer } from '@/components/layout/Footer';
export const metadata: Metadata = {
title: {
template: '%s | FastNext Template',
default: 'Dashboard',
},
};
export default function AuthenticatedLayout({ children }: { children: React.ReactNode }) {
return (
<AuthGuard>
<div className="flex min-h-screen flex-col">
<Header />
<main className="flex-1">{children}</main>
<Footer />
</div>
</AuthGuard>
);
}

View File

@@ -0,0 +1,78 @@
/**
* Settings Layout
* Provides tabbed navigation for settings pages
*/
'use client';
import { usePathname } from '@/lib/i18n/routing';
import { Link } from '@/lib/i18n/routing';
import { Tabs, TabsList, TabsTrigger } from '@/components/ui/tabs';
import { User, Lock, Monitor, Settings as SettingsIcon } from 'lucide-react';
/**
* Settings tabs configuration
*/
const settingsTabs = [
{
value: 'profile',
label: 'Profile',
href: '/settings/profile',
icon: User,
},
{
value: 'password',
label: 'Password',
href: '/settings/password',
icon: Lock,
},
{
value: 'sessions',
label: 'Sessions',
href: '/settings/sessions',
icon: Monitor,
},
{
value: 'preferences',
label: 'Preferences',
href: '/settings/preferences',
icon: SettingsIcon,
},
];
export default function SettingsLayout({ children }: { children: React.ReactNode }) {
const pathname = usePathname();
// Determine active tab based on pathname
const activeTab = settingsTabs.find((tab) => pathname.startsWith(tab.href))?.value || 'profile';
return (
<div className="container mx-auto px-4 py-8">
{/* Page Header */}
<div className="mb-8">
<h1 className="text-3xl font-bold text-foreground">Settings</h1>
<p className="mt-2 text-muted-foreground">Manage your account settings and preferences</p>
</div>
{/* Tabs Navigation */}
<Tabs value={activeTab} className="space-y-6">
<TabsList className="grid w-full grid-cols-2 md:grid-cols-4 lg:w-[600px]">
{settingsTabs.map((tab) => {
const Icon = tab.icon;
return (
<TabsTrigger key={tab.value} value={tab.value} asChild>
<Link href={tab.href} className="flex items-center space-x-2">
<Icon className="h-4 w-4" />
<span>{tab.label}</span>
</Link>
</TabsTrigger>
);
})}
</TabsList>
{/* Tab Content */}
<div className="rounded-lg border bg-card text-card-foreground p-6">{children}</div>
</Tabs>
</div>
);
}

View File

@@ -0,0 +1,11 @@
/**
* Settings Index Page
* Redirects to /settings/profile
*/
import { redirect } from 'next/navigation';
export default async function SettingsPage({ params }: { params: Promise<{ locale: string }> }) {
const { locale } = await params;
redirect(`/${locale}/settings/profile`);
}

View File

@@ -0,0 +1,23 @@
/**
* Password Settings Page
* Secure password change functionality for authenticated users
*/
'use client';
import { PasswordChangeForm } from '@/components/settings';
export default function PasswordSettingsPage() {
return (
<div className="space-y-6">
<div>
<h2 className="text-2xl font-semibold text-foreground">Password Settings</h2>
<p className="text-muted-foreground mt-1">
Change your password to keep your account secure
</p>
</div>
<PasswordChangeForm />
</div>
);
}

View File

@@ -0,0 +1,21 @@
/**
* User Preferences Page
* Theme, notifications, and other preferences
*/
/* istanbul ignore next - Next.js type import for metadata */
import type { Metadata } from 'next';
/* istanbul ignore next - Next.js metadata, not executable code */
export const metadata: Metadata = {
title: 'Preferences',
};
export default function PreferencesPage() {
return (
<div>
<h2 className="text-2xl font-semibold text-foreground mb-4">Preferences</h2>
<p className="text-muted-foreground">Configure your preferences (Coming in Task 3.5)</p>
</div>
);
}

View File

@@ -0,0 +1,21 @@
/**
* Profile Settings Page
* User profile management - edit name, email, and other profile information
*/
'use client';
import { ProfileSettingsForm } from '@/components/settings';
export default function ProfileSettingsPage() {
return (
<div className="space-y-6">
<div>
<h2 className="text-2xl font-semibold text-foreground">Profile Settings</h2>
<p className="text-muted-foreground mt-1">Manage your profile information</p>
</div>
<ProfileSettingsForm />
</div>
);
}

View File

@@ -0,0 +1,23 @@
/**
* Session Management Page
* View and manage active sessions across all devices
*/
'use client';
import { SessionsManager } from '@/components/settings';
export default function SessionsPage() {
return (
<div className="space-y-6">
<div>
<h2 className="text-2xl font-semibold text-foreground">Active Sessions</h2>
<p className="text-muted-foreground mt-1">
View and manage devices signed in to your account
</p>
</div>
<SessionsManager />
</div>
);
}