How ngolegiabao/ecommerce-backend-nodejs works
This is a shoe-shop e-commerce backend split into an API gateway and domain services. The main customer journey enters through the gateway, manages a cart, checks out into an order, applies a voucher, and completes payment; identity, catalog, inventory, media, reviews, and loyalty support that flow. The tree and README establish additional admin, analytics, and notification capabilities. Sampled controllers confirm several controller-to-service calls and review, media-event, and identity behavior; unsampled service wiring is shown only where the service boundaries and documented capabilities support it.
Main entry points: app.ts API gateway · src/services Products and categories · user.service.ts Users and addresses · src/services Orders and analytics
Components 20
API entry
- API gateway
api-gateway/src/app.ts
Shopping and orders
- Cart management
cart-service/src/services - Orders and analytics
order-service/src/services - Payment processing
order-service/src/services/payment.service.ts - Discount vouchers
voucher-service/src/services/voucher.service.ts
Catalog and media
- Products and categories
product-service/src/services - Inventory
product-service/src/services/inventory.service.ts - Reviews and ratings
product-service/src/services/review.service.ts - Media uploads
media-service/src/services/file.service.ts
Accounts and loyalty
- Users and addresses
user-service/src/services/user.service.ts - Authentication
user-service/src/services/auth.service.ts - Loyalty points
user-service/src/services/loyalty.service.ts
Events and notifications
- Redis events
product-service/src/core/redis.core.ts - Email notifications
notification-service/src/subscribers/notification.subscriber.ts
Other components
- Customer or admin
- MongoDB
- Email provider
- Cloudinary
- VNPay
- Sentiment analysis
Connections 38
- Customer or admin → API gateway: requests
- API gateway → Cart management: proxies cart
- API gateway → Orders and analytics: proxies orders
- API gateway → Payment processing: proxies payments
- API gateway → Discount vouchers: proxies vouchers
- API gateway → Products and categories: proxies catalog
- API gateway → Inventory: proxies inventory
- API gateway → Reviews and ratings: proxies reviews
- API gateway → Media uploads: proxies media
- API gateway → Users and addresses: proxies users
- API gateway → Authentication: proxies auth
- API gateway → Loyalty points: proxies loyalty
- Cart management → Products and categories: fetches product data
- Orders and analytics → Products and categories: fetches product data
- Orders and analytics → Users and addresses: uses guest account data
- Orders and analytics → Payment processing: creates payments
- Payment processing → VNPay: uses gateway
- Reviews and ratings → Sentiment analysis: analyzes comments
- Reviews and ratings → Users and addresses: fetches public info
- Reviews and ratings → Products and categories: updates rating totals
- Media uploads → Cloudinary: uploads files
- Media uploads → Redis events: publishes upload events
- Redis events → Products and categories: dispatches image updates
- Redis events → Users and addresses: dispatches avatar updates
- Redis events → Email notifications: dispatches events
- Email notifications → Email provider: sends email
- Authentication → Users and addresses: creates guest account
- Authentication → Redis events: stores refresh tokens
- Cart management → MongoDB: reads and writes
- Orders and analytics → MongoDB: reads and writes
- Payment processing → MongoDB: reads and writes
- Discount vouchers → MongoDB: reads and writes
- Products and categories → MongoDB: reads and writes
- Inventory → MongoDB: reads and writes
- Reviews and ratings → MongoDB: reads and writes
- Users and addresses → MongoDB: reads and writes
- Authentication → MongoDB: reads and writes
- Loyalty points → MongoDB: reads and writes