Base app architecture:

    Route groups for customer, staff and owner.
* Reusable design system with around 20 UI components.
* Complete Prisma schema.
* Authentication with email/password and Google.
* Role and permission model.
* Protected routes.
* Clean separation between features, services, components and shared utilities.
This commit is contained in:
Stefan Lazic committed 2026-08-02 17:47:23 +01:00
1 parent 468d163299
commit 090646fdfd
201 files changed
+31984

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
import { redirect } from "next/navigation";
import { auth } from "@/auth";
import { BottomNav } from "@/components/navigation/bottom-nav";
import { STAFF_NAV_ITEMS } from "@/lib/navigation/staff-nav-items";
import { prisma } from "@/lib/db/prisma";
export default async function StaffLayout({ children }: { children: React.ReactNode }) {
const session = await auth();
if (!session?.user) {
redirect("/sign-in?callbackUrl=/staff");
}
// Real role gating, not just "is signed in" — a registered customer with
// no StaffProfile is bounced back to their own home rather than seeing
// an empty staff shell. See docs/implementation-plan.md §3 (role
// conflicts) and §11 (permission enforcement).
const staffProfile = await prisma.staffProfile.findUnique({ where: { userId: session.user.id } });
if (!staffProfile) {
redirect("/home");
}
return (
<div className="min-h-screen bg-stone pb-24">
{children}
<BottomNav items={STAFF_NAV_ITEMS} variant="staff" />
</div>
);
}