How 123onlywork/backend-stroymat works
This is a NestJS e-commerce API, not the generic starter described by the README: its source tree implements authentication, product and category catalogues, user profiles and favorites, orders, reviews, and statistics. The primary customer workflow is browsing and filtering products, then using authenticated account features; admins manage catalogue data, while users can submit reviews. Controllers dispatch to services, which perform domain logic and, where shown, use Prisma persistence. The order subsystem is included from the source index, but its runtime wiring and persistence calls are not shown in the excerpts.
Main entry points: product.service.ts Product service · prisma.service.ts Prisma database access · auth.service.ts Auth service · review.service.ts Review service
Components 19
Product catalogue
- Product API
src/product/product.controller.ts - Product service
src/product/product.service.ts - Category API
src/category/category.controller.ts - Category service
src/category/category.service.ts
Accounts and access
- Auth API
src/auth/auth.controller.ts - Auth service
src/auth/auth.service.ts - Auth guards
src/auth/decorators/auth.decorator.ts - User API
src/user/user.controller.ts - User service
src/user/user.service.ts
Commerce and feedback
- Order API
src/order/order.controller.ts - Order service
src/order/order.service.ts - Review API
src/review/review.controller.ts - Review service
src/review/review.service.ts
Insights
- Statistics API
src/statistics/statistics.controller.ts - Statistics service
src/statistics/statistics.service.ts
Shared infrastructure
- Pagination
src/pagination/pagination.service.ts - Prisma database access
src/prisma.service.ts
Other components
- Shopper
- Administrator
Connections 27
- Shopper → Product API: browses
src/product/product.controller.ts - Administrator → Product API: manages
src/product/product.controller.ts - Shopper → Category API: browses
src/category/category.controller.ts - Administrator → Category API: manages
src/category/category.controller.ts - Product API → Product service: dispatches
src/product/product.controller.ts - Product service → Pagination: gets paging
src/product/product.service.ts - Product service → Category service: checks category
src/product/product.service.ts - Product service → Prisma database access: queries
src/product/product.service.ts - Category API → Category service: dispatches
src/category/category.controller.ts - Category service → Prisma database access: queries
src/category/category.service.ts - Shopper → Auth API: authenticates
src/auth/auth.controller.ts - Auth API → Auth service: dispatches
src/auth/auth.controller.ts - Auth service → Prisma database access: reads users
src/auth/auth.service.ts - Auth service → User service: loads user
src/auth/auth.service.ts - Shopper → User API: manages profile
src/user/user.controller.ts - User API → User service: dispatches
src/user/user.controller.ts - User service → Prisma database access: reads and writes
src/user/user.service.ts - Shopper → Order API: places orders
- Order API → Order service: dispatches
src/order/order.controller.ts - Shopper → Review API: submits review
src/review/review.controller.ts - Administrator → Review API: reviews entries
src/review/review.controller.ts - Review API → Review service: dispatches
src/review/review.controller.ts - Review service → Product service: checks product
src/review/review.service.ts - Review service → Prisma database access: reads and writes
src/review/review.service.ts - Administrator → Statistics API: requests stats
- Statistics API → Statistics service: dispatches
src/statistics/statistics.controller.ts - Auth guards → Auth API: protects routes