feat: complete HookLab MVP - TikTok Shop coaching platform

Full-stack Next.js 15 application with:
- Landing page with marketing components (Hero, Testimonials, Pricing, FAQ)
- Multi-step candidature form with API route
- Stripe Checkout integration (subscription + webhooks)
- Supabase Auth (login/register) with middleware protection
- Dashboard with progress tracking and module system
- Formations pages with completion tracking
- Profile management with password change
- Database schema with RLS policies
- Resend email integration for transactional emails

Stack: Next.js 15, TypeScript, Tailwind CSS v4, Supabase, Stripe, Resend

https://claude.ai/code/session_01H2aRGDaKgarPvhay2HxN6Y
This commit is contained in:
Claude
2026-02-08 12:39:18 +00:00
parent 240b10b2d7
commit 41e686c560
52 changed files with 11375 additions and 4 deletions

View File

@@ -0,0 +1,146 @@
import Link from "next/link";
import Card from "@/components/ui/Card";
import type { Module, UserProgress } from "@/types/database.types";
interface ModuleCardProps {
module: Module;
progress?: UserProgress;
}
const contentTypeIcons: Record<string, React.ReactNode> = {
video: (
<svg
className="w-4 h-4"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
d="M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"
/>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
d="M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
/>
</svg>
),
pdf: (
<svg
className="w-4 h-4"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
/>
</svg>
),
text: (
<svg
className="w-4 h-4"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
d="M4 6h16M4 12h16M4 18h7"
/>
</svg>
),
quiz: (
<svg
className="w-4 h-4"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
d="M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
/>
</svg>
),
};
export default function ModuleCard({ module, progress }: ModuleCardProps) {
const isCompleted = progress?.completed;
return (
<Link href={`/formations/${module.id}`}>
<Card hover className="relative overflow-hidden group">
{/* Status indicator */}
{isCompleted && (
<div className="absolute top-4 right-4">
<div className="w-6 h-6 rounded-full bg-success flex items-center justify-center">
<svg
className="w-3.5 h-3.5 text-white"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={3}
d="M5 13l4 4L19 7"
/>
</svg>
</div>
</div>
)}
{/* Content type + Duration */}
<div className="flex items-center gap-3 mb-3">
<span
className={`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg text-xs font-medium ${
isCompleted
? "bg-success/10 text-success"
: "bg-primary/10 text-primary"
}`}
>
{module.content_type && contentTypeIcons[module.content_type]}
{module.content_type?.toUpperCase() || "CONTENU"}
</span>
{module.duration_minutes && (
<span className="text-white/30 text-xs">
{module.duration_minutes} min
</span>
)}
</div>
{/* Title */}
<h3 className="text-white font-semibold mb-2 group-hover:text-primary transition-colors">
{module.title}
</h3>
{/* Description */}
{module.description && (
<p className="text-white/50 text-sm line-clamp-2">
{module.description}
</p>
)}
{/* Week badge */}
<div className="mt-4 pt-3 border-t border-dark-border">
<span className="text-white/30 text-xs">
Semaine {module.week_number}
</span>
</div>
</Card>
</Link>
);
}

View File

@@ -0,0 +1,36 @@
interface ProgressBarProps {
value: number; // 0-100
label?: string;
showPercentage?: boolean;
}
export default function ProgressBar({
value,
label,
showPercentage = true,
}: ProgressBarProps) {
const clampedValue = Math.min(100, Math.max(0, value));
return (
<div className="space-y-2">
{(label || showPercentage) && (
<div className="flex items-center justify-between">
{label && (
<span className="text-white/60 text-sm">{label}</span>
)}
{showPercentage && (
<span className="text-white font-medium text-sm">
{Math.round(clampedValue)}%
</span>
)}
</div>
)}
<div className="h-2 bg-dark-lighter rounded-full overflow-hidden">
<div
className="h-full gradient-bg rounded-full transition-all duration-500 ease-out"
style={{ width: `${clampedValue}%` }}
/>
</div>
</div>
);
}

View File

@@ -0,0 +1,156 @@
"use client";
import Link from "next/link";
import { usePathname, useRouter } from "next/navigation";
import { createClient } from "@/lib/supabase/client";
import { cn } from "@/lib/utils";
import type { Profile } from "@/types/database.types";
interface SidebarProps {
user: Profile;
}
const navItems = [
{
label: "Dashboard",
href: "/dashboard",
icon: (
<svg
className="w-5 h-5"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
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>
),
},
{
label: "Formations",
href: "/formations",
icon: (
<svg
className="w-5 h-5"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"
/>
</svg>
),
},
{
label: "Profil",
href: "/profil",
icon: (
<svg
className="w-5 h-5"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"
/>
</svg>
),
},
];
export default function Sidebar({ user }: SidebarProps) {
const pathname = usePathname();
const router = useRouter();
const handleLogout = async () => {
const supabase = createClient();
await supabase.auth.signOut();
router.push("/login");
router.refresh();
};
return (
<aside className="w-64 min-h-screen bg-dark-light border-r border-dark-border p-6 flex flex-col">
{/* Logo */}
<Link href="/dashboard" className="flex items-center gap-2 mb-10">
<div className="w-8 h-8 gradient-bg rounded-lg flex items-center justify-center">
<span className="text-white font-bold text-sm">H</span>
</div>
<span className="text-xl font-bold text-white">
Hook<span className="gradient-text">Lab</span>
</span>
</Link>
{/* Navigation */}
<nav className="flex-1 space-y-1">
{navItems.map((item) => {
const isActive =
pathname === item.href ||
(item.href !== "/dashboard" && pathname.startsWith(item.href));
return (
<Link
key={item.href}
href={item.href}
className={cn(
"flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-medium transition-all",
isActive
? "bg-primary/10 text-primary"
: "text-white/50 hover:text-white hover:bg-white/5"
)}
>
{item.icon}
{item.label}
</Link>
);
})}
</nav>
{/* User info + Logout */}
<div className="border-t border-dark-border pt-4 mt-4">
<div className="flex items-center gap-3 mb-4">
<div className="w-9 h-9 gradient-bg rounded-full flex items-center justify-center text-sm font-bold text-white">
{(user.full_name || user.email)[0].toUpperCase()}
</div>
<div className="flex-1 min-w-0">
<p className="text-white text-sm font-medium truncate">
{user.full_name || "Utilisateur"}
</p>
<p className="text-white/40 text-xs truncate">{user.email}</p>
</div>
</div>
<button
onClick={handleLogout}
className="flex items-center gap-2 text-white/40 hover:text-error text-sm transition-colors cursor-pointer w-full"
>
<svg
className="w-4 h-4"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"
/>
</svg>
Deconnexion
</button>
</div>
</aside>
);
}