How titya-yem/e-commerce works
This is a pet-focused e-commerce application with a React storefront and dashboards backed by an Express/MongoDB API. The primary user flow is browse products, inspect details, manage a cart, and proceed through Stripe checkout; other major workflows cover authentication, appointments, services, comments, and administration. The frontend entry point documents route composition, while the sampled backend code shows service, appointment, comment, and authentication handling. Some controllers, routes, and payment wiring were not sampled, so their connections are omitted or marked unverified.
Main entry points: main.tsx App routes · service.controller.ts Service API · AdminComments.tsx Comment dashboards · ShopPage.tsx Shop catalog
Components 31
Storefront
- App routes
frontend/src/main.tsx - Shop catalog
frontend/src/pages/ShopPage.tsx - Product details
frontend/src/components/ProductDetails.tsx - Cart
frontend/src/components/Cart.tsx - Stripe checkout
backend/src/controllers/payment.controller.ts
Identity
- Sign-in and signup
frontend/src/pages/SignInPage.tsx
User Operations
- Appointment booking
frontend/src/pages/AppointmentPage.tsx - Contact form
frontend/src/pages/ContactPage.tsx - Service catalog
frontend/src/components/Services.tsx
Administration
- Service administration
frontend/src/pages/Dashboard/admin/AdminServices.tsx - Comment dashboards
frontend/src/pages/Dashboard/admin/AdminComments.tsx - Admin dashboard
frontend/src/pages/Dashboard/admin/AdminDashboardPage.tsx - Order management
frontend/src/pages/Dashboard/admin/AdminOrders.tsx - User dashboard
frontend/src/pages/Dashboard/user/UserDashboard.tsx
API and Data
- Authentication
backend/src/controllers/auth.controller.ts - JWT middleware
backend/src/middlewares/auth.middleware.ts - User records
backend/src/models/user.model.ts - Appointment management
backend/src/controllers/appointment.controller.ts - Appointment records
backend/src/models/appointment.model.ts - Service API
backend/src/controllers/service.controller.ts - Service routes
backend/src/routes/service.route.ts - Service records
backend/src/models/service.model.ts - Comment moderation
backend/src/controllers/comment.controller.ts - Comment records
backend/src/models/comment.model.ts - Order handling
backend/src/controllers/order.controller.ts - Product handling
backend/src/controllers/product.controller.ts - Admin analytics
backend/src/controllers/adminAnalytics.controller.ts
Other components
- Shopper
- Administrator
- MongoDB
- Stripe
Connections 29
- Shopper → App routes: opens
frontend/src/main.tsx - App routes → Shop catalog: routes to
frontend/src/main.tsx - App routes → Product details: routes to
frontend/src/main.tsx - App routes → Cart: routes to
frontend/src/main.tsx - Shopper → Sign-in and signup: signs up
- Sign-in and signup → Authentication: submits credentials
- Authentication → User records: reads and updates
backend/src/controllers/auth.controller.ts - JWT middleware → User records: checks token identity
- Shopper → Appointment booking: books
- Appointment booking → Appointment management: submits booking
- Appointment management → Appointment records: creates and queries
backend/src/controllers/appointment.controller.ts - Shopper → Contact form: sends inquiry
- Shopper → Service catalog: browses
- Service administration → Service API: updates services
frontend/src/pages/Dashboard/admin/AdminServices.tsx - Service routes → Service API: dispatches
backend/src/routes/service.route.ts - Service API → Service records: reads and writes
backend/src/controllers/service.controller.ts - Service API → MongoDB: persists records
- Shopper → Comment dashboards: manages comments
- Administrator → Comment dashboards: moderates
- Comment dashboards → Comment moderation: requests moderation
- Comment moderation → Comment records: reads and updates
backend/src/controllers/comment.controller.ts - Administrator → Admin dashboard: views analytics
- Administrator → Order management: manages orders
- Shopper → User dashboard: views account
- Order management → Order handling: requests orders
- Cart → Stripe checkout: starts checkout
- Stripe checkout → Stripe: creates payment
- Shop catalog → Product handling: loads products
- Admin dashboard → Admin analytics: loads analytics