How varunsahu258/shopflow works
ShopFlow is an ecommerce web application: shoppers browse products, authenticate, manage a cart, check out, and review orders. The React client routes those screens and sends API requests through a shared Axios hook; Express routes implement the domain operations and use PostgreSQL for persistent state. Authentication protects cart and order operations. Product and operational monitoring are also present. The graph reflects the supplied source excerpts and index; monitoring and other unsampled capabilities are included only where their paths and connections are supported.
Main entry points: index.js App routing · useApi.js API client · server.js HTTP server · db.js PostgreSQL
Components 23
Storefront
- App routing
frontend/src/index.js - Auth state
frontend/src/store/authStore.js - API client
frontend/src/hooks/useApi.js - Product browsing
frontend/src/pages/Products.js - Product detail
frontend/src/pages/ProductDetail.js - Sign in and register
frontend/src/pages/Login.js - Registration form
frontend/src/pages/Register.js - Cart management
frontend/src/pages/Cart.js - Checkout
frontend/src/pages/Checkout.js - Order history
frontend/src/pages/Orders.js - Navigation
frontend/src/components/Navbar.js
Backend API
- HTTP server
backend/src/server.js - Authentication
backend/src/routes/auth.js - Token authorization
backend/src/middleware/auth.js - Product catalog API
backend/src/routes/products.js - Cart API
backend/src/routes/cart.js - Order processing
backend/src/routes/orders.js - Health endpoint
backend/src/routes/health.js
Persistence
- PostgreSQL
backend/src/config/db.js
Operations
- Application logging
backend/src/config/logger.js - Prometheus metrics
backend/src/server.js - Monitoring stack
grafana
Other components
- Shopper
Connections 37
- Shopper → App routing: uses
frontend/src/index.js - App routing → Auth state: checks auth
frontend/src/index.js - App routing → Navigation: renders
frontend/src/index.js - App routing → Product browsing: routes to
frontend/src/index.js - App routing → Product detail: routes to
frontend/src/index.js - App routing → Sign in and register: routes to
frontend/src/index.js - App routing → Registration form: routes to
frontend/src/index.js - App routing → Cart management: routes to
frontend/src/index.js - App routing → Checkout: routes to
frontend/src/index.js - App routing → Order history: routes to
frontend/src/index.js - Product browsing → API client: requests
frontend/src/pages/Products.js - Product detail → API client: requests
frontend/src/pages/ProductDetail.js - Sign in and register → API client: requests
frontend/src/pages/Login.js - Registration form → API client: requests
frontend/src/pages/Register.js - Cart management → API client: requests
frontend/src/pages/Cart.js - Checkout → API client: requests
frontend/src/pages/Checkout.js - Order history → API client: requests
frontend/src/pages/Orders.js - Navigation → API client: requests
frontend/src/components/Navbar.js - API client → Auth state: reads token
frontend/src/hooks/useApi.js - API client → HTTP server: HTTP API
- HTTP server → Authentication: routes
backend/src/server.js - HTTP server → Product catalog API: routes
backend/src/server.js - HTTP server → Cart API: routes
backend/src/server.js - HTTP server → Order processing: routes
backend/src/server.js - HTTP server → Health endpoint: routes
backend/src/server.js - Authentication → PostgreSQL: queries
backend/src/routes/auth.js - Authentication → Token authorization: protects profile
backend/src/routes/auth.js - Cart API → Token authorization: guards routes
backend/src/routes/cart.js - Order processing → Token authorization: guards routes
backend/src/routes/orders.js - Product catalog API → PostgreSQL: queries
backend/src/routes/products.js - Cart API → PostgreSQL: queries
backend/src/routes/cart.js - Order processing → PostgreSQL: reads and writes
backend/src/routes/orders.js - Health endpoint → PostgreSQL: checks
backend/src/routes/health.js - PostgreSQL → Application logging: logs errors
backend/src/config/db.js - HTTP server → Application logging: logs requests
backend/src/server.js - Order processing → Prometheus metrics: increments counter
backend/src/routes/orders.js - HTTP server → Monitoring stack: exposes metrics