How nguyen-hong-tham/may works
MAY Coffee is a F&B ordering platform with a customer storefront, an administrative dashboard, and a NestJS API. Customers discover and customize drinks, authenticate, check out using COD or VNPay, and track orders and loyalty points; staff administer orders and products while admins manage users and reporting. The README documents the platform-level integrations and business flow. Source excerpts confirm checkout orchestration and selected API calls; unsampled subsystem connections are shown only where documented.
Main entry points: orders.service.ts Order processing · prisma.service.ts PostgreSQL · useCheckout.ts Checkout · payments.controller.ts Payments
Components 28
Customer app
- Storefront
MAY/src/App.tsx - Browse catalog
MAY/src/hooks/useProducts.ts - Customer auth
MAY/src/contexts/AuthContext.tsx - Cart
MAY/src/contexts/CartContext.tsx - Checkout
MAY/src/checkout/hooks/useCheckout.ts - Order tracking
MAY/src/contexts/OrdersContext.tsx - Profile and loyalty
MAY/src/profile/hooks/useProfile.ts - AI chat UI
MAY/src/components/Chatbox.tsx
Admin dashboard
- Admin app
MAY-admin/src/App.tsx - Admin auth
MAY-admin/src/pages/auth/hook/useAuth.ts - Catalog management
MAY-admin/src/pages/products/components/ProductForm.tsx - Order management
MAY-admin/src/pages/orders/index.tsx - User management
MAY-admin/src/pages/users/Users.tsx - Dashboards and reports
MAY-admin/src/pages/revenues/index.tsx
Backend domains
- Authentication API
may-api/src/auth/auth.service.ts - Catalog API
may-api/src/products/products.controller.ts - Order processing
may-api/src/orders/orders.service.ts - Payments
may-api/src/payments/payments.controller.ts - Users and loyalty
may-api/src/users/users.controller.ts - Order realtime
may-api/src/orders/orders.gateway.ts - Personalization and chat
may-api/src/personalized/personalization.service.ts - Analytics API
may-api/src/revenues/revenues.service.ts
Data and integrations
- PostgreSQL
may-api/src/prisma/prisma.service.ts
Other components
- Customer
- Staff and admins
- Firebase Auth
- VNPay
- OpenAI
Connections 34
- Customer → Storefront: uses
MAY/src/App.tsx - Storefront → Browse catalog: shows products
MAY/src/App.tsx - Customer → Customer auth: signs in
README.md - Customer auth → Authentication API: authenticates
MAY/src/contexts/AuthContext.tsx - Customer auth → Firebase Auth: verifies OTP
README.md - Customer → Cart: customizes drinks
README.md - Cart → Checkout: checks out
MAY/src/checkout/hooks/useCheckout.ts - Checkout → Order tracking: creates order
MAY/src/checkout/hooks/useCheckout.ts - Checkout → Profile and loyalty: reads profile
MAY/src/checkout/hooks/useCheckout.ts - Checkout → Order processing: submits order
README.md - Order tracking → Order processing: fetches orders
README.md - Profile and loyalty → Users and loyalty: reads loyalty
README.md - Customer → AI chat UI: asks for advice
README.md - AI chat UI → Personalization and chat: requests recommendations
README.md - Staff and admins → Admin app: uses
README.md - Admin app → Admin auth: routes auth
MAY-admin/src/App.tsx - Catalog management → Catalog API: manages catalog
README.md - Order management → Order processing: updates orders
README.md - User management → Users and loyalty: manages users
README.md - Dashboards and reports → Analytics API: requests reports
README.md - Order processing → PostgreSQL: reads and writes
may-api/src/orders/orders.service.ts - Order processing → Order realtime: emits updates
may-api/src/orders/orders.service.ts - Checkout → Payments: starts payment
MAY/src/checkout/hooks/useCheckout.ts - Payments → VNPay: creates payment session
may-api/src/payments/payments.controller.ts - Payments → Order processing: creates or updates order
may-api/src/payments/payments.controller.ts - Payments → PostgreSQL: reads and writes
may-api/src/payments/payments.controller.ts - Authentication API → PostgreSQL: reads and writes
may-api/src/auth/auth.service.ts - Authentication API → Firebase Auth: verifies token
README.md - Catalog API → PostgreSQL: reads and writes
README.md - Users and loyalty → PostgreSQL: reads and writes
README.md - Analytics API → PostgreSQL: queries sales data
README.md - Personalization and chat → OpenAI: requests AI
README.md - Order realtime → Order tracking: notifies status
README.md - Order realtime → Order management: notifies new orders
README.md