How hasarangasam/velora works
Velora is a Sri Lankan fashion-commerce application spanning discovery, cart and checkout, payment confirmation, customer accounts, and administration. The main customer path runs from storefront pages through cart synchronization and order creation to PayHere notification and order history. The graph highlights that server-side order and payment handlers own pricing, persistence, inventory, coupon, and notification actions. README capabilities are included where their source paths are present; some connections are omitted because excerpts do not show their exact wiring.
Main entry points: prisma.ts Commerce database · orders/route.ts Order creation · products/route.ts Product management · page.tsx Admin operations
Components 30
Storefront
- Storefront pages
src/app/(shop)/shop/page.tsx - Catalog queries
src/lib/catalog.ts - Product detail
src/app/(shop)/products/[slug]/page.tsx - Product search
src/app/api/search/route.ts - Reviews
src/lib/reviews.ts - Wishlist
src/app/account/wishlist/actions.ts
Commerce
- Cart interface
src/components/shop/CartPageClient.tsx - Cart state
src/store/cartStore.ts - Cart endpoints
src/app/api/cart/route.ts - Checkout interface
src/components/checkout/CheckoutPageClient.tsx - Order creation
src/app/api/orders/route.ts - Order totals
src/lib/order.ts - PayHere checkout
src/components/payment/PayHereForm.tsx - Payment notification
src/app/api/payments/payhere/notify/route.ts - Order history
src/app/account/orders/page.tsx
Identity & accounts
- Account management
src/app/account/profile/actions.ts - Saved addresses
src/app/api/addresses/route.ts - Authentication
auth.ts
Operations
- Admin operations
src/app/admin/page.tsx - Product management
src/app/api/admin/products/route.ts - Order fulfillment
src/app/admin/orders/actions.ts - Review moderation
src/app/admin/reviews/actions.ts - Notifications
src/lib/notifications.ts
Server services
- Commerce database
src/lib/db/prisma.ts - Product pricing
src/lib/product-pricing.ts - Image service
src/lib/cloudinary.ts - Email delivery
src/lib/email.ts - Cache and limits
src/lib/redis.ts
Other components
- Shopper
- PayHere
Connections 37
- Shopper → Storefront pages: browses
- Storefront pages → Catalog queries: loads products
- Shopper → Product search: searches
- Shopper → Product detail: opens product
- Shopper → Cart interface: manages cart
- Cart interface → Cart state: updates state
- Cart interface → Cart endpoints: syncs cart
- Cart endpoints → Commerce database: reads/writes cart
- Shopper → Checkout interface: checks out
- Checkout interface → Order creation: submits order
- Order creation → Order totals: calculates totals
- Order creation → Product pricing: checks current price
- Order creation → Commerce database: persists order
- Order creation → Notifications: alerts admins
- Order creation → PayHere checkout: returns pending order
- PayHere checkout → PayHere: starts payment
- PayHere → Payment notification: sends result
- Payment notification → Commerce database: confirms payment
- Payment notification → Email delivery: sends confirmation
- Shopper → Order history: tracks order
- Order history → Commerce database: reads orders
- Product detail → Reviews: loads reviews
- Shopper → Wishlist: manages wishlist
- Wishlist → Commerce database: reads/writes wishlist
- Account management → Commerce database: updates account
- Saved addresses → Commerce database: reads/writes addresses
- Shopper → Authentication: signs in
- Admin operations → Product management: manages catalog
- Product management → Commerce database: writes products
- Product management → Cache and limits: invalidates catalog
- Product management → Image service: manages images
- Admin operations → Order fulfillment: fulfills orders
- Order fulfillment → Commerce database: updates order
- Admin operations → Review moderation: moderates reviews
- Review moderation → Commerce database: updates review status
- Notifications → Commerce database: stores notifications
- Product search → Catalog queries: searches catalog