Skip to content
Merged
5 changes: 3 additions & 2 deletions src/app/(app)/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,13 @@ export default async function AppHomePage() {

const workspace = membership.workspace;
const workspaceTitle = titleCase(workspace.name);
const firstName = session.user.name?.trim().split(/\s+/)[0] || "there";
return (
<main className="mx-auto max-w-7xl px-6 py-10">
<header className="flex flex-wrap items-end justify-between gap-4 border-b border-slate-200 pb-6 dark:border-slate-800">
<div>
<h1 className="text-2xl font-semibold tracking-tight text-slate-950 dark:text-white">{workspaceTitle}</h1>
<p className="mt-1 text-sm text-slate-600 dark:text-slate-400">{roleLabel(membership.role)} workspace</p>
<h1 className="text-2xl font-semibold tracking-tight text-slate-950 dark:text-white">Welcome back, {firstName}</h1>
<p className="mt-1 text-sm text-slate-600 dark:text-slate-400">{workspaceTitle} · {roleLabel(membership.role)} workspace</p>
</div>
<Link href="/app/projects" className="inline-flex items-center rounded-xl bg-indigo-600 px-4 py-2.5 text-sm font-semibold text-white shadow-sm transition hover:bg-indigo-500">Create project</Link>
</header>
Expand Down
2 changes: 1 addition & 1 deletion src/app/(app)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default async function TeamLayout({ children }: Readonly<{ children: Reac
<details className="group relative">
<summary aria-label="Account menu" className="flex cursor-pointer list-none items-center gap-2 rounded-xl border border-slate-200 bg-white py-1.5 pl-1.5 pr-2 text-sm font-medium text-slate-700 transition hover:border-indigo-200 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-950 dark:text-slate-200 dark:hover:border-indigo-900 dark:hover:bg-slate-900 [&::-webkit-details-marker]:hidden">
<span className="grid h-8 w-8 place-items-center rounded-lg bg-indigo-100 text-xs font-bold text-indigo-700 dark:bg-indigo-950 dark:text-indigo-300">{initials}</span>
<span className="hidden max-w-28 truncate sm:block">{accountName}</span>
<span title={accountName} className="hidden max-w-36 truncate sm:block">{accountName}</span>
<svg aria-hidden="true" viewBox="0 0 20 20" className="h-4 w-4 text-slate-400"><path d="m5 7.5 5 5 5-5" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round" /></svg>
</summary>
<div className="absolute right-0 top-[calc(100%+0.65rem)] z-50 w-64 rounded-2xl border border-slate-200 bg-white p-2 shadow-[0_18px_50px_rgba(15,23,42,0.16)] dark:border-slate-700 dark:bg-slate-900">
Expand Down
26 changes: 14 additions & 12 deletions src/app/components/dashboard-stats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ export async function DashboardStats({
];
const completedSteps = steps.filter((step) => step.complete).length;
const cards = [
{ label: "Active projects", value: stats.activeProjects, detail: `Projects marked Active · ${projectCount} total`, icon: "projects" as const, tone: "indigo" },
{ label: "Overdue tasks", value: stats.overdueTasks, icon: "overdue" as const, tone: stats.overdueTasks > 0 ? "danger" : "slate" },
{ label: "Pending reviews", value: stats.pendingReviews, icon: "reviews" as const, tone: "amber" },
{ label: "Deliverable approval rate", value: stats.approvalRate === null ? "—" : `${stats.approvalRate}%`, icon: "approval" as const, tone: "emerald" },
{ label: "Active projects", value: stats.activeProjects, detail: projectCount > stats.activeProjects ? `${projectCount - stats.activeProjects} ${projectCount - stats.activeProjects === 1 ? "project is" : "projects are"} not marked Active · ${projectCount} total` : `All ${projectCount} projects are Active`, icon: "projects" as const, tone: "indigo" },
{ label: "Overdue tasks", value: stats.overdueTasks, detail: stats.overdueTasks > 0 ? "Tasks past their due date" : "No tasks past their due date", icon: "overdue" as const, tone: stats.overdueTasks > 0 ? "danger" : "slate" },
{ label: "Pending reviews", value: stats.pendingReviews, detail: stats.pendingReviews > 0 ? "Deliverables waiting for client decisions" : "No deliverables waiting for review", icon: "reviews" as const, tone: "amber" },
{ label: "Deliverable approval rate", value: stats.approvalRate === null ? "N/A" : `${stats.approvalRate}%`, detail: stats.approvalRate === null ? "No reviews yet" : `${stats.decidedReviews} completed review decisions`, icon: "approval" as const, tone: "emerald" },
];

return (
Expand Down Expand Up @@ -137,14 +137,16 @@ export async function DashboardStats({
<h2 className="font-semibold text-slate-950 dark:text-white">Tasks by status</h2>
<p className="text-xs text-slate-600 dark:text-slate-400">Workspace-wide totals</p>
</div>
<div className="mt-5 grid gap-x-6 sm:grid-cols-2 xl:grid-cols-4">
{Object.entries(stats.tasksByStatus).map(([status, count]) => (
<div key={status} className="flex items-center gap-3 border-t border-slate-100 py-4 dark:border-slate-800">
<span className={`h-2.5 w-2.5 shrink-0 rounded-full ${statusColors[status as keyof typeof statusColors] ?? "bg-slate-400"}`} />
<p className="min-w-0 flex-1 text-sm font-medium text-slate-700 dark:text-slate-300">{statusLabels[status as keyof typeof statusLabels]}</p>
<p className="text-lg font-semibold tabular-nums text-slate-950 dark:text-white">{count}</p>
</div>
))}
<div className="mt-5">
{taskCount > 0 ? <div className="grid gap-x-6 sm:grid-cols-2 xl:grid-cols-4">
{Object.entries(stats.tasksByStatus).map(([status, count]) => (
<div key={status} className="flex items-center gap-3 border-t border-slate-100 py-4 dark:border-slate-800">
<span className={`h-2.5 w-2.5 shrink-0 rounded-full ${statusColors[status as keyof typeof statusColors] ?? "bg-slate-400"}`} />
<p className="min-w-0 flex-1 text-sm font-medium text-slate-700 dark:text-slate-300">{statusLabels[status as keyof typeof statusLabels]}</p>
<p className="text-lg font-semibold tabular-nums text-slate-950 dark:text-white">{count}</p>
</div>
))}
</div> : <div className="rounded-xl border border-dashed border-slate-300 px-5 py-7 text-center dark:border-slate-700"><p className="text-sm font-semibold text-slate-800 dark:text-slate-200">No tasks to summarize yet</p><p className="mt-1 text-xs text-slate-600 dark:text-slate-400">Create a task in a project to see its status distribution here.</p><Link href={firstProjectId ? `/app/projects/${firstProjectId}` : "/app/projects"} className="mt-3 inline-flex text-xs font-bold text-indigo-700 hover:underline dark:text-indigo-300">{firstProjectId ? "Add your first task" : "Create a project first"}</Link></div>}
</div>
<p className="mt-3 text-xs leading-5 text-slate-600 dark:text-slate-400">
Approval rate is based on completed client review decisions ({stats.decidedReviews} total).
Expand Down
48 changes: 32 additions & 16 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ function WorkspacePreview() {
<p className="text-[10px] text-slate-500 dark:text-slate-400">Sample workspace</p>
</div>
</div>
<span className="rounded-full border border-indigo-100 bg-indigo-50 px-2.5 py-1 text-[9px] font-semibold text-indigo-700 dark:border-indigo-900 dark:bg-indigo-950 dark:text-indigo-300">Illustrative preview</span>
<span className="rounded-full border border-indigo-100 bg-indigo-50 px-2.5 py-1 text-[10px] font-semibold text-indigo-700 dark:border-indigo-900 dark:bg-indigo-950 dark:text-indigo-300">Illustrative preview</span>
</div>
<div className="grid gap-3 pt-3 sm:grid-cols-[120px_1fr]">
<aside className="hidden rounded-xl bg-slate-50 p-3 dark:bg-slate-900 sm:block">
<p className="px-2 pb-3 text-[9px] font-bold uppercase tracking-[.12em] text-slate-600 dark:text-slate-300">Workspace</p>
<p className="px-2 pb-3 text-[10px] font-bold uppercase tracking-[.12em] text-slate-600 dark:text-slate-300">Workspace</p>
<div className="space-y-1 text-[10px]">
<p className="rounded-lg bg-indigo-100 px-2.5 py-2 font-semibold text-indigo-700 dark:bg-indigo-950 dark:text-indigo-300">Overview</p>
<p className="px-2.5 py-2 text-slate-500 dark:text-slate-400">Projects</p>
Expand All @@ -35,23 +35,23 @@ function WorkspacePreview() {
<div className="min-w-0 space-y-3">
<div className="flex items-end justify-between gap-3 px-1">
<div>
<p className="text-[9px] font-semibold uppercase tracking-[.14em] text-indigo-600">Overview</p>
<p className="text-[10px] font-semibold uppercase tracking-[.14em] text-indigo-600">Overview</p>
<h2 className="mt-1 text-sm font-bold text-slate-900 dark:text-white sm:text-base">Your workspace</h2>
</div>
<span className="rounded-lg bg-indigo-600 px-2.5 py-1.5 text-[9px] font-semibold text-white">New project</span>
<span className="rounded-lg bg-indigo-600 px-2.5 py-1.5 text-[10px] font-semibold text-white">New project</span>
</div>
<div className="grid grid-cols-3 gap-2">
{[["3", "Projects"], ["5", "Open tasks"], ["2", "Reviews"]].map(([value, label]) => (
<div key={label} className="rounded-xl border border-slate-100 bg-white p-2.5 dark:border-slate-800 dark:bg-slate-950">
<p className="text-base font-bold tabular-nums text-slate-900 dark:text-white sm:text-lg">{value}</p>
<p className="mt-1 text-[9px] text-slate-500 dark:text-slate-400">{label}</p>
<p className="mt-1 text-[10px] text-slate-500 dark:text-slate-400">{label}</p>
</div>
))}
</div>
<div className="rounded-xl border border-slate-100 p-3 dark:border-slate-800">
<div className="mb-3 flex items-center justify-between gap-2">
<p className="text-[10px] font-semibold text-slate-800 dark:text-slate-200">Recent projects</p>
<p className="text-[9px] font-medium text-indigo-600">View all</p>
<p className="text-[10px] font-medium text-indigo-600">View all</p>
</div>
<div className="space-y-3">
{[
Expand All @@ -60,25 +60,25 @@ function WorkspacePreview() {
["Monthly report", "In progress", "30%", "w-[30%]"],
].map(([name, phase, value, width]) => (
<div key={name} className="flex items-center gap-2.5">
<span className="grid h-7 w-7 shrink-0 place-items-center rounded-lg bg-indigo-50 text-[9px] font-bold text-indigo-600 dark:bg-indigo-950 dark:text-indigo-300">{name.slice(0, 1)}</span>
<span className="grid h-7 w-7 shrink-0 place-items-center rounded-lg bg-indigo-50 text-[10px] font-bold text-indigo-600 dark:bg-indigo-950 dark:text-indigo-300">{name.slice(0, 1)}</span>
<div className="min-w-0 flex-1">
<div className="flex items-center justify-between gap-2">
<p className="truncate text-[9px] font-semibold text-slate-800 dark:text-slate-200">{name}</p>
<span className="text-[8px] text-slate-500">{value}</span>
<p className="truncate text-[10px] font-semibold text-slate-800 dark:text-slate-200">{name}</p>
<span className="text-[10px] text-slate-500">{value}</span>
</div>
<div className="mt-1 h-1 overflow-hidden rounded-full bg-slate-100 dark:bg-slate-800"><div className={`h-full rounded-full bg-indigo-500 ${width}`} /></div>
<p className="mt-1 text-[8px] text-slate-600 dark:text-slate-300">{phase}</p>
<p className="mt-1 text-[10px] text-slate-600 dark:text-slate-300">{phase}</p>
</div>
</div>
))}
</div>
</div>
<p className="px-1 text-center text-[9px] text-slate-600 dark:text-slate-300">Sample interface · illustrative content only</p>
<p className="px-1 text-center text-[10px] text-slate-600 dark:text-slate-300">Sample interface · illustrative content only</p>
</div>
</div>
</div>
<div className="absolute -bottom-5 -left-3 hidden rounded-2xl border border-slate-200 bg-white px-4 py-3 shadow-xl dark:border-slate-700 dark:bg-slate-900 sm:block">
<p className="text-[9px] font-semibold text-slate-500 dark:text-slate-400">A clear workflow</p>
<div className="absolute -bottom-7 -right-3 hidden rounded-2xl border border-slate-200 bg-white px-4 py-3 shadow-xl dark:border-slate-700 dark:bg-slate-900 sm:block">
<p className="text-[10px] font-semibold text-slate-600 dark:text-slate-300">A clear workflow</p>
<p className="mt-1 text-xs font-bold text-slate-900 dark:text-white">Client → Project → Delivery</p>
</div>
</section>
Expand All @@ -90,7 +90,7 @@ export default async function HomePage() {
const primaryHref = session?.user?.id ? "/app" : "/register";

return (
<main className="min-h-screen overflow-hidden">
<main className="min-h-screen overflow-x-clip">
<nav className="mx-auto flex max-w-7xl items-center justify-between gap-4 px-6 py-5 sm:py-6">
<Link href="/" className="flex items-center gap-2 text-lg font-bold tracking-tight text-indigo-700 dark:text-indigo-400">
<span className="grid h-8 w-8 place-items-center rounded-xl bg-indigo-600 text-xs font-bold text-white">CF</span>
Expand All @@ -108,12 +108,12 @@ export default async function HomePage() {
</div>
</nav>

<section className="mx-auto grid max-w-7xl items-center gap-14 px-6 pb-24 pt-12 sm:pt-16 lg:grid-cols-[minmax(0,1fr)_minmax(420px,1fr)] lg:gap-12 lg:pb-28 lg:pt-20">
<section className="mx-auto grid max-w-7xl items-center gap-12 px-6 pb-20 pt-8 sm:pt-10 lg:grid-cols-[minmax(0,1fr)_minmax(420px,1fr)] lg:gap-12 lg:pb-24 lg:pt-12">
<div className="max-w-2xl">
<p className="inline-flex items-center gap-2 rounded-full border border-indigo-100 bg-indigo-50 px-3 py-1.5 text-xs font-semibold text-indigo-700 dark:border-indigo-900 dark:bg-indigo-950/70 dark:text-indigo-300">
For freelancers and small agencies
</p>
<h1 className="mt-6 text-5xl font-semibold leading-[1.05] tracking-tight text-slate-950 dark:text-white sm:text-6xl xl:text-7xl">
<h1 className="mt-6 text-5xl font-semibold leading-[1.05] tracking-tight text-slate-950 dark:text-white sm:text-6xl xl:text-6xl">
Client work,
<span className="block text-indigo-600 dark:text-indigo-400">without the chaos.</span>
</h1>
Expand Down Expand Up @@ -169,6 +169,22 @@ export default async function HomePage() {
</article>
))}
</section>

<section className="border-y border-slate-200 bg-slate-50/80 py-16 dark:border-slate-800 dark:bg-slate-900/40">
<div className="mx-auto max-w-7xl px-6">
<div className="mx-auto max-w-2xl rounded-3xl border border-slate-200 bg-white p-8 text-center shadow-sm dark:border-slate-700 dark:bg-slate-950">
<p className="text-xs font-bold uppercase tracking-[.18em] text-indigo-600 dark:text-indigo-400">Straightforward pricing</p>
<h2 className="mt-3 text-2xl font-semibold text-slate-950 dark:text-white sm:text-3xl">Open source, ready to self-host.</h2>
<p className="mt-3 text-sm leading-7 text-slate-600 dark:text-slate-400">ClientFlow is an open-source project. You can inspect the code and run your own instance; hosting, email, and file-storage costs depend on the providers you choose.</p>
<Link href={primaryHref} className="mt-6 inline-flex rounded-xl bg-indigo-600 px-5 py-3 text-sm font-semibold text-white transition hover:bg-indigo-500">Create workspace</Link>
</div>
</div>
</section>
<footer className="mx-auto flex max-w-7xl flex-wrap items-center justify-between gap-4 px-6 py-8 text-xs text-slate-600 dark:text-slate-400">
<span>ClientFlow · Client and project operations</span>
<div className="flex items-center gap-5"><Link href="/login" className="hover:text-indigo-600">Sign in</Link><a href="https://github.com/ADAMDEV01/ClientFlow" target="_blank" rel="noreferrer" className="hover:text-indigo-600">GitHub</a></div>
<span>Keep every delivery moving.</span>
</footer>
</main>
);
}
Loading