How panapolll/commerce-api works
This is a NestJS commerce API. Customers authenticate, browse products, manage a cart, create orders at checkout, and pay for pending orders; successful payment clears the cart and triggers a notification. Admins can manage products and access user records. The sampled code confirms authentication, cart, order, payment, and notification call paths; the README documents product and checkout capabilities, but their service implementations were not sampled, so uncertain internal links are omitted.
Main entry points: payments.service.ts Payment service · auth.service.ts Auth service · auth.controller.ts Auth endpoints · users.controller.ts User endpoints
Components 20
API entry
- NestJS bootstrap
src/main.ts - Application modules
src/app.module.ts
Identity and users
- Auth endpoints
src/auth/auth.controller.ts - Auth service
src/auth/auth.service.ts - User endpoints
src/users/users.controller.ts - User service
src/users/users.service.ts - JWT service
Commerce workflow
- Product endpoints
src/products/products.controller.ts - Product service
src/products/products.service.ts - Cart endpoints
src/cart/cart.controller.ts - Cart service
src/cart/cart.service.ts - Order endpoints
src/orders/orders.controller.ts - Order service
src/orders/orders.service.ts
Payments and notifications
- Payment endpoints
src/payments/payments.controller.ts - Payment service
src/payments/payments.service.ts - Omise
- Notification service client
src/notfications/notfications.service.ts
Other components
- Customer or admin
- Notification service
- MongoDB
Connections 20
- NestJS bootstrap → Application modules: starts
- Customer or admin → Auth endpoints: authenticates
- Customer or admin → User endpoints: requests profile
- Customer or admin → Product endpoints: browses or manages
- Customer or admin → Cart endpoints: manages cart
- Customer or admin → Order endpoints: checks out
- Customer or admin → Payment endpoints: pays or submits webhook
- Auth endpoints → Auth service: calls
- Auth service → User service: finds or creates user
- Auth service → JWT service: signs token
- User endpoints → User service: queries users
- Product endpoints → Product service: calls
- Cart endpoints → Cart service: calls
- Order endpoints → Order service: calls
- Payment endpoints → Payment service: calls
- Payment service → Omise: creates charge
- Payment service → MongoDB: reads and updates order
- Payment service → Cart service: clears cart
- Payment service → Notification service client: sends payment notice
- Notification service client → Notification service: posts notification