How nguyenkhanhhungdev/assignment_2_brewlite works
BrewLite is a pickup-drink ordering site with customer accounts, sandbox payment, order tracking, and admin tools. The main journey is browsing and customizing a menu, building a cart, placing an order, paying, then following its status; members can also review history and loyalty rewards. Admins separately manage recipes, ingredients and stock, orders, and payment reconciliation. The graph reflects documented capabilities and sampled API calls; several web-to-API and unsampled feature connections are only documented at a high level, so those links are dashed.
Main entry points: app.module.ts API Modules · OrdersManager.tsx Admin Web · orders.service.ts Order Processing · payments.service.ts Payment Processing
Components 24
Customer Web
- Storefront
apps/web/app/page.tsx - Menu Catalog
apps/web/components/MenuCatalog.tsx - Cart
apps/web/app/cart/page.tsx - Checkout
apps/web/app/checkout/page.tsx - Account & History
apps/web/app/account/page.tsx - Web BFF
apps/web/app/api/[...path]/route.ts - Session BFF
apps/web/app/api/session/[...path]/route.ts
API Services
- Authentication
apps/api/src/auth/auth.service.ts - Products & Recipes
apps/api/src/products/products.service.ts - Order Processing
apps/api/src/orders/orders.service.ts - Order Status
apps/api/src/orders/order-state.service.ts - Order History
apps/api/src/orders/orders-history.service.ts - Payment Processing
apps/api/src/payments/payments.service.ts - ZaloPay Sandbox
apps/api/src/payments/zalopay.service.ts - Loyalty
apps/api/src/loyalty/loyalty.service.ts
Admin Operations
- Ingredient Inventory
apps/api/src/ingredients/ingredients.service.ts - Recipe Management
apps/api/src/recipes/recipes.service.ts - Order Administration
apps/api/src/orders/admin-orders.controller.ts - Payment Reconciliation
apps/api/src/payments/payment-operations.controller.ts - Admin Web
apps/web/components/admin/orders/OrdersManager.tsx
Runtime
- PostgreSQL
- API Modules
apps/api/src/app.module.ts
Other components
- Customer
- Administrator
Connections 31
- Customer → Storefront: browses
README.md - Storefront → Menu Catalog: shows menu
- Customer → Menu Catalog: selects drinks
README.md - Customer → Cart: manages cart
README.md - Customer → Checkout: places order
README.md - Customer → Account & History: views account
README.md - Checkout → Web BFF: requests API
- Web BFF → Order Processing: forwards requests
- Web BFF → Products & Recipes: forwards requests
- Session BFF → Authentication: forwards session
- Order Processing → Payment Processing: supports payment
- Payment Processing → ZaloPay Sandbox: uses sandbox
README.md - Customer → ZaloPay Sandbox: pays sandbox
README.md - Account & History → Order History: views history
- Administrator → Admin Web: manages operations
README.md - Admin Web → Ingredient Inventory: manages stock
- Admin Web → Recipe Management: manages recipes
- Admin Web → Order Administration: manages orders
- Admin Web → Payment Reconciliation: reviews payments
- Order Administration → Order Processing: queries orders
apps/api/src/orders/admin-orders.controller.ts - Order Administration → Order Status: changes status
apps/api/src/orders/admin-orders.controller.ts - Payment Reconciliation → Payment Processing: rechecks attempts
apps/api/src/payments/payment-operations.controller.ts - Administrator → Ingredient Inventory: manages ingredients
README.md - Authentication → PostgreSQL: reads and writes
apps/api/src/auth/auth.service.ts - API Modules → Authentication: registers module
apps/api/src/app.module.ts - API Modules → Products & Recipes: registers module
apps/api/src/app.module.ts - API Modules → Order Processing: registers module
apps/api/src/app.module.ts - API Modules → Payment Processing: registers module
apps/api/src/app.module.ts - API Modules → Ingredient Inventory: registers module
apps/api/src/app.module.ts - API Modules → Recipe Management: registers module
apps/api/src/app.module.ts - Administrator → Loyalty: reviews loyalty