How phucdang-gif/assignment2 works
BrewLite is a cashless coffee-ordering app. Customers browse drinks and toppings, customize a cart, check out and pay, then track orders; baristas manage the preparation queue. The Next.js client calls a NestJS REST API whose domain services use Prisma and PostgreSQL. README and source-index references support the main stages and several backend calls; unsampled page and service internals are not assumed. Payment-provider integrations are shown as optional because their exact runtime wiring was not excerpted.
Main entry points: prisma.service.ts Prisma data access · orders.controller.ts Orders API · users.service.ts User service · pageProduct.tsx Product customization
Components 25
Customer and staff app
- Storefront
apps/web/app/page.tsx - Product customization
apps/web/app/product/[id]/pageProduct.tsx - Cart
apps/web/app/cart/pageCart.tsx - Checkout
apps/web/app/checkout/page.tsx - Order tracking
apps/web/app/orders/page.tsx - Order detail
apps/web/app/orders/[id]/page.tsx - Barista queue
apps/web/app/barista/page.tsx - Sign in and register
apps/web/app/login/page.tsx
Ordering and catalog
- Products and toppings API
apps/api/src/products/products.controller.ts - Categories API
apps/api/src/categories/categories.controller.ts - Orders API
apps/api/src/orders/orders.controller.ts - Order workflow
apps/api/src/orders/orders.service.ts - Toppings API
apps/api/src/toppings/toppings.controller.ts
Identity and access
- Authentication API
apps/api/src/auth/auth.controller.ts - Authentication
apps/api/src/auth/auth.service.ts - User management
apps/api/src/users/users.controller.ts - User service
apps/api/src/users/users.service.ts - JWT and role guards
apps/api/src/auth/roles.guard.ts
API and persistence
- Prisma data access
apps/api/src/prisma/prisma.service.ts - PostgreSQL
Payments
- Payments API
apps/api/src/payments/payments.controller.ts - Payment processing
apps/api/src/payments/payments.service.ts - Payment providers
Other components
- Customer
- Barista
Connections 30
- Customer → Storefront: browses menu
README.md - Customer → Product customization: customizes drinks
README.md - Customer → Cart: builds order
README.md - Customer → Checkout: checks out
README.md - Customer → Sign in and register: signs in
README.md - Barista → Barista queue: works queue
README.md - Storefront → Products and toppings API: requests menu
README.md - Product customization → Products and toppings API: loads product
- Product customization → Toppings API: loads options
- Checkout → Orders API: submits order
README.md - Checkout → Payments API: initiates payment
README.md - Order tracking → Orders API: loads orders
- Order detail → Orders API: loads order
- Barista queue → Orders API: manages queue
README.md - Sign in and register → Authentication API: authenticates
- Products and toppings API → Prisma data access: delegates to
- Categories API → Prisma data access: delegates to
- Toppings API → Prisma data access: delegates to
- Orders API → Order workflow: dispatches to
apps/api/src/orders/orders.controller.ts - Order workflow → Prisma data access: reads and writes
apps/api/src/orders/orders.service.ts - Order workflow → User service: uses account data
apps/api/src/orders/orders.service.ts - Authentication API → Authentication: dispatches to
apps/api/src/auth/auth.controller.ts - Authentication → User service: looks up users
apps/api/src/auth/auth.service.ts - User management → User service: dispatches to
apps/api/src/users/users.controller.ts - User service → Prisma data access: reads and writes
apps/api/src/users/users.service.ts - JWT and role guards → User service: checks roles
apps/api/src/auth/roles.guard.ts - Payments API → Payment processing: dispatches to
apps/api/src/payments/payments.controller.ts - Payment processing → Prisma data access: reads and writes
apps/api/src/payments/payments.service.ts - Payment processing → Payment providers: connects optionally
README.md - Prisma data access → PostgreSQL: queries
README.md