How beyoto/product works
This repository implements a multi-store product catalog with a React storefront and administrator console backed by an Express API. Visitors browse product listings and detail pages, save favorites, and contact or share products; administrators authenticate, manage product listings and images, and view analytics. The backend also provides guest and authentication endpoints, brand-specific product and analytics routes, and scheduled view snapshots. The README is empty, so feature coverage is based on the tree and sampled files; wiring to unsampled route implementations is shown only where the server mounts them.
Main entry points: App.jsx Application routes · app.js Express application · axios.js HTTP client · db.js PostgreSQL
Components 26
Storefront
- Application routes
front/src/App.jsx - Product catalog
front/src/pages/home/HomePage.jsx - Product detail
front/src/pages/ProductPage/ProductPage.jsx - Saved favorites
front/src/components/FavoritesContext.jsx - Contact page
front/src/pages/contactPage/ContactsPage.jsx
Administration
- Admin session
front/src/context/AuthContext.jsx - Admin login
front/src/pages/adminLogin/AdminLogin.jsx - Protected routes
front/src/components/ProtectedRoute.jsx - Product management
front/src/pages/adminPanel/AdminPanel.jsx - Create product
front/src/pages/addProduct/AddProduct.jsx - Edit product
front/src/pages/editProduct/EditProduct.jsx - Analytics dashboard
front/src/pages/adminAnalytics/AdminAnalytics.jsx
Backend API
- HTTP client
front/src/api/axios.js - Express application
back/src/app.js - Product routes
back/src/routes/products.js - Product image routes
back/src/routes/productImages.js - Brand product routes
back/src/routes - Authentication routes
back/src/routes/auth.js - Guest routes
back/src/routes/guests.js - Analytics routes
back/src/routes/analytics.js - View snapshot jobs
back/src/jobs/viewsSnapshotJob.js - JWT authorization
back/src/middleware/checkAuth.js
Data and services
- PostgreSQL
back/src/config/db.js - Cloudinary setup
back/src/config/cloudinary.js
Other components
- Shopper
- Administrator
Connections 34
- Shopper → Application routes: opens
- Administrator → Application routes: opens
- Application routes → Product catalog: routes to
- Application routes → Product detail: routes to
- Application routes → Saved favorites: routes to
- Application routes → Contact page: routes to
- Application routes → Admin login: routes to
- Application routes → Product management: routes to
- Application routes → Create product: routes to
- Application routes → Edit product: routes to
- Application routes → Analytics dashboard: routes to
- Admin login → Admin session: sets session
- Application routes → Protected routes: protects admin
- Product management → Admin session: ends session
- Product catalog → HTTP client: requests catalog
- Product detail → HTTP client: requests product
- Product management → HTTP client: manages products
- Create product → HTTP client: creates product
- Edit product → HTTP client: updates product
- Analytics dashboard → HTTP client: requests metrics
- HTTP client → Express application: HTTP requests
- Express application → Product routes: mounts products
- Express application → Product image routes: mounts images
- Express application → Brand product routes: mounts brand APIs
- Express application → Authentication routes: mounts auth
- Express application → Guest routes: mounts guests
- Express application → Analytics routes: mounts analytics
- Express application → View snapshot jobs: starts jobs
- Authentication routes → PostgreSQL: reads and writes
- Product routes → PostgreSQL: reads and writes
- Analytics routes → PostgreSQL: queries metrics
- View snapshot jobs → PostgreSQL: stores snapshots
- Authentication routes → JWT authorization: uses JWT checks
- Product image routes → Cloudinary setup: image operations