How mzotti/ecommerce-nestjs works
Zotti is a full-stack e-commerce platform: shoppers browse products, manage carts and accounts, and submit orders; staff manage catalogue, orders, customers, users, and analytics in the backoffice. The React SPA calls a NestJS API gateway, which routes to domain microservices communicating over RabbitMQ. The graph preserves the documented payment and analytics capabilities and the sampled service-level responsibilities. Internal links use SOURCE INDEX references or excerpts; links documented only at architecture level cite the README.
Main entry points: app.module.ts Request routing · orders.service.ts Order lifecycle · storeRoutes.tsx Store and backoffice UI · customers.service.ts Customer accounts
Components 23
React storefront
- Store and backoffice UI
front/src/routes/storeRoutes.tsx - Catalogue browsing
front/src/pages/store/Products/index.tsx - Cart and checkout
front/src/pages/store/Checkout/index.tsx - Backoffice operations
front/src/routes/backofficeRoutes.tsx - HTTP API client
front/src/services/api.ts
API gateway
- Request routing
back/apps/api-gateway/src/app.module.ts - JWT and role guards
back/apps/api-gateway/src/common/jwt/roles.guard.ts - Analytics endpoints
back/apps/api-gateway/src/modules/backoffice/analytics/analytics.controller.ts
Identity and accounts
- Authentication and users
back/apps/auth-service/src/modules/auth/auth.service.ts - Customer accounts
back/apps/auth-service/src/modules/customers/customers.service.ts - Address management
back/apps/auth-service/src/modules/addresses/addresses.service.ts - Payment cards
back/apps/auth-service/src/modules/payment-cards/payment-cards.service.ts
Commerce services
- Product catalogue and stock
back/apps/products-service/src/modules/products/products.service.ts - Categories
back/apps/products-service/src/modules/categories/categories.service.ts - Order lifecycle
back/apps/orders-service/src/modules/orders/orders.service.ts - Order items
back/apps/orders-service/src/modules/orders-items/orders-items.service.ts - Payment processing
back/apps/payments-service/src/modules/payment/payment.service.ts - Payment provider selection
back/apps/payments-service/src/modules/payment/providers/payment-provider.factory.ts
Analytics
- Order and product analytics
back/apps/analytics-service/src/modules/analytics/analytics.service.ts
Other components
- Shopper or staff
- PostgreSQL data access
back/libs/database/src/prisma.service.ts - RabbitMQ
- External payment provider
Connections 28
- Shopper or staff → Store and backoffice UI: uses
- Store and backoffice UI → Catalogue browsing: routes to
front/src/routes/storeRoutes.tsx - Store and backoffice UI → Cart and checkout: routes to
front/src/routes/storeRoutes.tsx - Store and backoffice UI → Backoffice operations: routes to
front/src/routes.tsx - Catalogue browsing → HTTP API client: requests data
- Cart and checkout → HTTP API client: submits orders
- Backoffice operations → HTTP API client: requests operations
- HTTP API client → Request routing: calls API
- Request routing → JWT and role guards: guards access
- Request routing → Authentication and users: routes requests
- Request routing → Product catalogue and stock: routes requests
- Request routing → Order lifecycle: routes requests
- Request routing → Payment processing: routes requests
back/apps/payments-service/src/modules/payment/payment.service.ts - Request routing → Analytics endpoints: routes requests
- Analytics endpoints → Order and product analytics: requests reports
- Authentication and users → Customer accounts: manages
- Customer accounts → Address management: manages
- Customer accounts → Payment cards: manages
- Product catalogue and stock → Categories: uses
- Order lifecycle → Order items: uses
back/apps/orders-service/src/modules/orders/orders.service.ts - Order lifecycle → Payment processing: coordinates
back/apps/orders-service/src/modules/orders/orders.service.ts - Payment processing → Payment provider selection: selects provider
back/apps/payments-service/src/modules/payment/payment.service.ts - Payment provider selection → External payment provider: dispatches payment
- Product catalogue and stock → RabbitMQ: consumes order events
- Order lifecycle → RabbitMQ: consumes status events
- Customer accounts → PostgreSQL data access: persists data
- Product catalogue and stock → PostgreSQL data access: persists catalogue
- Order lifecycle → PostgreSQL data access: persists orders