How samio11/craftify_server works
Cartify is an Express/TypeScript e-commerce API. Customers authenticate, browse products and categories, manage carts, and initiate checkout; sellers and administrators manage catalog data, while users can manage reviews. Payment callbacks update the payment flow through SSLCommerz. The graph follows documented capabilities and relationships visible in the excerpts or SOURCE INDEX; unsampled implementation details are represented only where the README supports them.
Main entry points: payment.services.ts Payment operations · app.ts Express API · product.service.ts Product management · user.service.ts User management
Components 24
Identity & Access
- Authentication
src/app/modules/auth/auth.controller.ts - Auth routes
src/app/modules/auth/auth.routes.ts - Role authorization
src/app/middlewares/checkAuth.ts - User management
src/app/modules/user/user.service.ts - User records
src/app/modules/user/user.model.ts
Catalog & Engagement
- Product management
src/app/modules/product/product.service.ts - Product records
src/app/modules/product/products.model.ts - Category management
src/app/modules/category/category.services.ts - Category records
src/app/modules/category/category.model.ts - Product reviews
src/app/modules/review/review.services.ts - Review records
src/app/modules/review/review.model.ts
Cart & Payments
- Cart operations
src/app/modules/cart/cart.services.ts - Cart records
src/app/modules/cart/cart.model.ts - Payment operations
src/app/modules/payment/payment.services.ts - Payment records
src/app/modules/payment/payment.model.ts - SSLCommerz integration
src/app/modules/sslCommerz/sslCommer.service.ts
API Platform
- Express API
src/app.ts - Query builder
src/app/utils/QueryBuilder.ts - Image upload config
src/app/config/multer.config.ts - Error handling
src/app/middlewares/globalErrorHandler.ts
Other components
- Customer
- Seller
- Administrator
- SSLCommerz gateway
Connections 29
- Customer → Express API: uses API
- Seller → Express API: uses API
- Administrator → Express API: uses API
- Express API → Auth routes: mounts API
src/app.ts - Auth routes → Authentication: routes to
src/app/modules/auth/auth.routes.ts - Authentication → User management: authenticates user
- Role authorization → User records: checks user
src/app/middlewares/checkAuth.ts - Express API → Error handling: handles errors
src/app.ts - Product management → Product records: reads and writes
src/app/modules/product/product.service.ts - Product management → Category records: uses category
src/app/modules/product/product.service.ts - Category management → Category records: reads and writes
src/app/modules/category/category.services.ts - Product reviews → Review records: reads and writes
src/app/modules/review/review.services.ts - Product reviews → Product records: uses products
src/app/modules/review/review.services.ts - Cart operations → Cart records: reads and writes
src/app/modules/cart/cart.services.ts - Cart operations → Product records: uses products
src/app/modules/cart/cart.services.ts - Cart operations → Payment operations: initiates payment
src/app/modules/cart/cart.services.ts - Payment operations → Payment records: reads and writes
src/app/modules/payment/payment.services.ts - Payment operations → Cart records: uses cart
src/app/modules/payment/payment.services.ts - Payment operations → Product records: uses products
src/app/modules/payment/payment.services.ts - Payment operations → SSLCommerz integration: requests gateway
src/app/modules/payment/payment.services.ts - SSLCommerz integration → SSLCommerz gateway: starts checkout
- User management → User records: reads and writes
src/app/modules/user/user.service.ts - Product management → Query builder: builds queries
src/app/modules/product/product.service.ts - Category management → Query builder: builds queries
src/app/modules/category/category.services.ts - Product reviews → Query builder: builds queries
src/app/modules/review/review.services.ts - User management → Query builder: builds queries
src/app/modules/user/user.service.ts - Product management → Image upload config: uploads images
- Category management → Image upload config: uploads images
- User management → Image upload config: uploads profile image