How shakthi2704/elegant-layers works
This is a bakery operations application built with Next.js: staff manage products, recipes, purchasing, inventory, production, point-of-sale, custom cake orders, and financial records, with reports and dashboard views. The main checkout path runs from the POS screen through its terminal and server actions; product administration has a sampled server-action layer backed by Prisma. The README is a generic Next.js starter README, so feature coverage comes from the repository tree and source index. Several domain modules are unsampled; their edges are omitted where the available evidence does not establish calls.
Main entry points: page.tsx POS screen · require-role.ts Role gate · prisma.ts Prisma client · actions.ts Products
Components 26
Sales and Orders
- POS screen
app/(dashboard)/pos/[id]/page.tsx - POS terminal
components/pos/pos-terminal.tsx - Sale actions
app/(dashboard)/pos/actions.ts - Cake orders
app/(dashboard)/cake-orders/[id]/page.tsx - Cake order forms
components/cake-orders/cake-order-form.tsx
Stock and Production
- Purchases
app/(dashboard)/purchases - Inventory
app/(dashboard)/inventory - Production
app/(dashboard)/production
Catalog and Administration
- Products
app/(dashboard)/products/actions.ts - Recipes
app/(dashboard)/recipes - Ingredients
app/(dashboard)/ingredients - Suppliers
app/(dashboard)/suppliers - Users and settings
app/(dashboard)/settings
Finance and Insights
- Expenses and assets
app/(dashboard)/expenses - Income
app/(dashboard)/income/page.tsx - Reports
lib/reports.ts - Dashboard
app/(dashboard)/dashboard/page.tsx
Application Platform
- Sign-in
app/(auth)/sign-in/page.tsx - Auth API
app/api/auth/[...all]/route.ts - Role gate
lib/require-role.ts - Authentication
lib/auth.ts - Prisma client
lib/prisma.ts - PostgreSQL
- Pagination
components/layout/table-pagination.tsx - Date formatting
lib/format.ts
Other components
- Staff
Connections 20
- Staff → POS screen: uses
- POS screen → POS terminal: renders
app/(dashboard)/pos/[id]/page.tsx - POS terminal → Sale actions: calls
components/pos/pos-terminal.tsx - POS screen → Role gate: checks access
app/(dashboard)/pos/[id]/page.tsx - Cake orders → Role gate: checks access
app/(dashboard)/cake-orders/[id]/page.tsx - Cake orders → Prisma client: reads order
app/(dashboard)/cake-orders/[id]/page.tsx - Cake order forms → Products: references actions
components/cake-orders/cake-order-form.tsx - Products → Role gate: checks access
app/(dashboard)/products/actions.ts - Products → Prisma client: reads and writes
app/(dashboard)/products/actions.ts - Products → PostgreSQL: persists through
- Prisma client → PostgreSQL: connects
lib/prisma.ts - Auth API → Authentication: dispatches to
app/api/auth/[...all]/route.ts - Role gate → Authentication: checks session
lib/require-role.ts - Authentication → Prisma client: uses
lib/auth.ts - Sign-in → Role gate: references
- POS screen → Prisma client: loads sale data
app/(dashboard)/pos/[id]/page.tsx - POS screen → Date formatting: formats values
app/(dashboard)/pos/[id]/page.tsx - Cake orders → Date formatting: formats dates
app/(dashboard)/cake-orders/[id]/page.tsx - Reports → Date formatting: uses
components/reports/product-sales-table.tsx - Pagination → POS screen: supports lists