How soumil0707/ecom-2 works
This is a monorepo for an e-commerce storefront, an admin dashboard, and separate product, order, and payment services. The visible customer workflow is product browsing and selection, cart management, shipping entry, then Stripe payment; payment webhooks handle a checkout-completion event, but the webhook excerpt marks order creation as a TODO. Admin product, user, and payment views are present, though their pages use hard-coded sample data. The README provides no additional architecture detail, and several service entrypoints and routes were not sampled, so those connections are left out.
Main entry points: cart/page.tsx Cart and checkout · stripe.ts Stripe client · session.route.ts Payment sessions · [id]/page.tsx Product detail
Components 26
Customer storefront
- Product browsing
apps/client/src/app/products - Product detail
apps/client/src/app/products/[id]/page.tsx - Product selection
apps/client/src/components/ProductInteraction.tsx - Cart and checkout
apps/client/src/app/cart/page.tsx - Cart state
apps/client/src/stores/cartStore.ts - Shipping form
apps/client/src/components/ShippingForm.tsx - Payment form
apps/client/src/components/StripePaymentForm.tsx
Admin dashboard
- Product admin
apps/admin/src/app/products/page.tsx - Product table
apps/admin/src/app/products/data-table.tsx - User admin
apps/admin/src/app/users/page.tsx - User table
apps/admin/src/app/users/data-table.tsx - User detail
apps/admin/src/app/users/[id]/page.tsx - Payment admin
apps/admin/src/app/payments/page.tsx - Payment table
apps/admin/src/app/payments/data-table.tsx
Commerce services
- Product API
apps/product-service/src/controllers/product.controller.ts - Category API
apps/product-service/src/controllers/category.controller.ts - Order routes
apps/order-service/src/routes/order.ts - Payment sessions
apps/payment-service/src/route/session.route.ts - Payment webhook
apps/payment-service/src/route/webhooks.route.ts - Stripe client
apps/payment-service/src/utils/stripe.ts - Stripe products
apps/payment-service/src/utils/stripeProduct.ts
External integrations
- Stripe
Shared packages
- Product database
packages/product-db/src/client.ts - Order database
packages/order-db/src/order-model.ts - Kafka package
packages/kafka/src/client.ts
Other components
- Shopper
Connections 18
- Shopper → Product browsing: browses
- Shopper → Product detail: views
- Product detail → Product selection: renders
apps/client/src/app/products/[id]/page.tsx - Shopper → Cart and checkout: checks out
- Cart and checkout → Cart state: reads and updates
apps/client/src/app/cart/page.tsx - Cart and checkout → Shipping form: renders
apps/client/src/app/cart/page.tsx - Cart and checkout → Payment form: renders
apps/client/src/app/cart/page.tsx - Product admin → Product table: renders
apps/admin/src/app/products/page.tsx - User admin → User table: renders
apps/admin/src/app/users/page.tsx - Payment admin → Payment table: renders
apps/admin/src/app/payments/page.tsx - Product API → Product database: reads and writes
apps/product-service/src/controllers/product.controller.ts - Category API → Product database: reads and writes
apps/product-service/src/controllers/category.controller.ts - Order routes → Order database: uses
apps/order-service/src/routes/order.ts - Payment sessions → Stripe client: uses
apps/payment-service/src/route/session.route.ts - Payment sessions → Stripe products: uses
apps/payment-service/src/route/session.route.ts - Payment webhook → Stripe client: verifies events
apps/payment-service/src/route/webhooks.route.ts - Stripe client → Stripe: calls
- Stripe products → Stripe client: uses
apps/payment-service/src/utils/stripeProduct.ts