How giabaot400-boop/brewlite-assignment2 works
BrewLite is a coffee-shop ordering product: customers browse a catalog, manage a cart, create and read orders, pay or cancel, and follow order status. The repository splits the experience between a Next.js frontend/BFF and a NestJS API backed by PostgreSQL. The README documents checkout v2, mock payment, stock, loyalty points, expiry, PWA, and private product APIs. Some web route and checkout implementation details were not excerpted, so links involving those paths are omitted or marked unverified.
Main entry points: prisma.service.ts PostgreSQL · order-workflow.service.ts Order workflow · orders.service.ts Order creation · auth.service.ts Auth service
Components 18
Web experience
- Product catalog
apps/web/src/features/products/components/menu.tsx - Cart and checkout
apps/web/src/features/cart
Authentication
- Auth client
apps/web/src/features/auth/auth-client.ts - Auth BFF routes
apps/web/src/app/api/auth - Auth controller
apps/api/src/auth/auth.controller.ts - Auth service
apps/api/src/auth/auth.service.ts - Auth guard
apps/api/src/auth/auth.guard.ts
Ordering and checkout
- Order endpoints
apps/api/src/orders/orders.controller.ts - Order creation
apps/api/src/orders/orders.service.ts - Order reads
apps/api/src/orders/orders-reader.service.ts - Payment and cancel
apps/api/src/orders/order-actions.controller.ts - Order workflow
apps/api/src/orders/order-workflow.service.ts - Stock and reservations
apps/api/src/database/stock.ts - Loyalty points
apps/api/src/orders/loyalty.ts
API and persistence
- Products API
apps/api/src/products/products.controller.ts - Product queries
apps/api/src/products/products-prisma.service.ts - PostgreSQL
apps/api/src/database/prisma.service.ts
Other components
- Customer
Connections 17
- Customer → Product catalog: browses
README.md - Customer → Cart and checkout: checks out
README.md - Auth client → Auth BFF routes: requests
apps/web/src/features/auth/auth-client.ts - Auth controller → Auth service: delegates to
apps/api/src/auth/auth.controller.ts - Auth guard → Auth service: validates with
apps/api/src/auth/auth.guard.ts - Auth service → PostgreSQL: reads and writes
apps/api/src/auth/auth.service.ts - Products API → Product queries: delegates to
apps/api/src/products/products.controller.ts - Product queries → PostgreSQL: queries
apps/api/src/products/products-prisma.service.ts - Order endpoints → Order creation: creates order
apps/api/src/orders/orders.controller.ts - Order endpoints → Order reads: reads orders
apps/api/src/orders/orders.controller.ts - Order creation → Stock and reservations: reserves stock
apps/api/src/orders/orders.service.ts - Order creation → PostgreSQL: transacts
apps/api/src/orders/orders.service.ts - Order reads → PostgreSQL: reads
apps/api/src/orders/orders-reader.service.ts - Payment and cancel → Order workflow: dispatches actions
apps/api/src/orders/order-actions.controller.ts - Order workflow → Stock and reservations: updates reservations
apps/api/src/orders/order-workflow.service.ts - Order workflow → Loyalty points: awards or reverses
apps/api/src/orders/order-workflow.service.ts - Order workflow → PostgreSQL: transacts
apps/api/src/orders/order-workflow.service.ts