How alisamershaboot19/ecommercefullstackproject works
This repository implements an authenticated commerce storefront: customers browse products, create a checkout, pay through Polar, then view orders and access support chat/video; staff manage products and support orders. The backend also synchronizes Clerk identities and processes payment and identity webhooks. The sampled frontend currently shows only Clerk sign-in/sign-up and user controls, so the richer storefront workflow is represented by the backend APIs and documented integration code rather than inferred frontend screens. Several route, webhook, schema, and job implementations were not sampled; their wiring is shown only where entry-point imports establish it.
Main entry points: src/index.ts Express entry · db/index.ts Commerce database · users.ts Local user lookup · App.jsx React app
Components 27
Storefront
- React app
frontend/src/App.jsx - Frontend bootstrap
frontend/src/main.jsx - Express entry
backend/src/index.ts - Product catalog
backend/src/controllers/productControllers.ts - Product routes
backend/src/routes/productRouter.ts
Commerce
- Checkout orchestration
backend/src/controllers/checkoutController.ts - Checkout routes
backend/src/routes/checkoutRouter.ts - Polar checkout client
backend/src/lib/polar.ts - Payment webhook
backend/src/webhooks/polar.ts - Order operations
backend/src/controllers/orderController.ts - Order routes
backend/src/routes/orderRoute.ts - Commerce database
backend/src/db/index.ts - Data model
backend/src/db/schema.ts
Identity
- Clerk identity
- Identity webhook
backend/src/webhooks/clerk.ts - Local user lookup
backend/src/lib/users.ts - Account endpoint
backend/src/controllers/meController.ts
Support and admin
- Stream support
backend/src/lib/stream.ts - Stream token API
backend/src/controllers/streamController.ts - Stream routes
backend/src/routes/streamRouter.ts - Admin operations
backend/src/controllers/adminControllers.ts - Admin routes
backend/src/routes/adminRoute.ts - ImageKit media
backend/src/lib/imageKit.ts
Other components
- Customer
- Staff
- Polar payments
- Stream Chat service
Connections 32
- Customer → React app: uses
- Staff → React app: uses
- Frontend bootstrap → React app: renders
- React app → Clerk identity: authenticates
- Express entry → Product routes: mounts
- Express entry → Checkout routes: mounts
- Express entry → Order routes: mounts
- Express entry → Stream routes: mounts
- Express entry → Admin routes: mounts
- Express entry → Account endpoint: mounts account API
- Express entry → Identity webhook: dispatches webhook
- Express entry → Payment webhook: dispatches webhook
- Product routes → Product catalog: dispatches
- Product catalog → Commerce database: queries products
- Checkout orchestration → Local user lookup: loads account
- Checkout orchestration → Commerce database: reads products; stores session
- Checkout orchestration → Polar checkout client: creates checkout
- Polar checkout client → Polar payments: requests payment
- Payment webhook → Commerce database: updates commerce state
- Order operations → Local user lookup: loads account
- Order operations → Commerce database: queries orders and items
- Order operations → Stream support: creates support channel
- Stream token API → Local user lookup: loads account
- Stream token API → Clerk identity: loads profile
- Stream token API → Stream support: creates token
- Stream support → Stream Chat service: calls chat API
- Admin operations → Local user lookup: checks account
- Admin operations → Commerce database: manages products
- Admin operations → ImageKit media: deletes media asset
- ImageKit media → ImageKit media: integrates media
- Account endpoint → Local user lookup: loads account
- Identity webhook → Commerce database: synchronizes identity