How bhiekeys/vendor-dashboard works
Purpose and Runtime
This is a React single-page vendor dashboard, built and served with Vite. Its feature set is centered on vendor authentication, dashboard overview, products, orders, and account settings. Browser-side application startup is at src/main.jsx, with the root UI assembled in src/App.jsx.
Application Composition and Routing
Routing is centralized in src/Router.jsx, which connects page-level route views to the application shell. Page modules separate route concerns from reusable feature components:
• src/pages/Auth.jsx
• src/pages/Overview.jsx
• src/pages/Product.jsx
• src/pages/Order.jsx
• src/pages/Setting.jsx
Authenticated Dashboard Boundary
src/layouts/DashboardLayout.jsx is the primary authenticated-area shell and likely provides the shared dashboard structure around overview, product, order, and settings pages. Authentication UI is represented by src/components/Login.jsx, src/components/SignUp.jsx, and src/components/LogoutModal.jsx; auth state is isolated under src/utils/Store/vendorAuthStore.jsx.
Vendor API and Service Layer
Network integration is intentionally separated from UI:
• src/utils/api/ThelvoraAPI.js is the API client boundary.
• src/utils/Services/vendorServices.jsx contains vendor-oriented service operations.
• src/utils/Store/vendorAuthStore.jsx holds vendor authentication state.
Components and pages should depend on this layer rather than directly coupling request logic to rendering. The named API client indicates an external Thelvora backend/API service.
Product Management Flow
Product management is a dedicated CRUD feature with route-level add/edit views and composable product UI:
• src/pages/Product.jsx
• src/pages/AddProduct.jsx
• src/pages/EditProduct.jsx
• src/components/Products/ProductLists.jsx
• src/components/Products/AddProducts.jsx
• src/components/Products/EditProducts.jsx
The expected flow is product listing → add or edit route → service/API operation → refreshed product state/list. Deletion and media handling are isolated through src/components/Products/DeleteModal.jsx and src/components/Products/ImageUploader.jsx, making destructive actions and image upload explicit feature boundaries.
Orders and Dashboard Read Models
Order-facing views are split between aggregate and detail rendering:
• src/components/Orders.jsx
• src/components/SingleOrder.jsx
• src/pages/Order.jsx
The overview/dashboard read model is represented by src/pages/Overview.jsx and src/components/OverView.jsx. These views likely consume vendor service data but remain presentation-oriented rather than owning API configuration.
Styling and Frontend Infrastructure
The client uses Vite’s React setup (vite.config.js), Tailwind/PostCSS styling infrastructure (tailwind.config.js, postcss.config.js), and global CSS (src/index.css). Shared non-UI logic is placed in src/utils/helpers.js; static browser assets reside in public and src/assets.
Main entry points: vendorServices.jsx Vendor operations · DashboardLayout.jsx Authenticated dashboard shell · Product.jsx Product list · main.jsx Browser entry
Components 18
Client Runtime
- Vite build and dev server
vite.config.js - Browser entry
src/main.jsx - Root application
src/App.jsx - Route composition · Connects page routes to the application shell.
src/Router.jsx - Global styling
src/index.css
Authentication
- Auth page
src/pages/Auth.jsx - Login, signup and logout UI
src/components/Login.jsx - Vendor auth state
src/utils/Store/vendorAuthStore.jsx
Dashboard Features
- Authenticated dashboard shell · Shared boundary for authenticated vendor routes.
src/layouts/DashboardLayout.jsx - Overview dashboard
src/pages/Overview.jsx - Product list
src/pages/Product.jsx - Add and edit products
src/pages/AddProduct.jsx - Product deletion and media · Encapsulates destructive deletion and image upload.
src/components/Products/DeleteModal.jsx - Orders and order detail
src/pages/Order.jsx - Account settings
src/pages/Setting.jsx
Vendor Data Layer
- Vendor operations · Keeps request operations outside rendering components.
src/utils/Services/vendorServices.jsx - Thelvora API client
src/utils/api/ThelvoraAPI.js
Other components
- Thelvora backend
Connections 23
- Vite build and dev server → Browser entry: serves
- Browser entry → Root application: mounts
- Browser entry → Global styling: loads
- Root application → Route composition: renders
- Route composition → Auth page: public route
- Route composition → Authenticated dashboard shell: authenticated routes
- Auth page → Login, signup and logout UI: composes
- Login, signup and logout UI → Vendor auth state: updates
- Authenticated dashboard shell → Vendor auth state: checks session
- Authenticated dashboard shell → Overview dashboard: hosts route
- Authenticated dashboard shell → Product list: hosts route
- Authenticated dashboard shell → Orders and order detail: hosts route
- Authenticated dashboard shell → Account settings: hosts route
- Product list → Add and edit products: add or edit route
- Product list → Product deletion and media: uses
- Overview dashboard → Vendor operations: loads vendor data
- Product list → Vendor operations: CRUD operations
- Add and edit products → Vendor operations: creates or updates
- Orders and order detail → Vendor operations: loads orders
- Account settings → Vendor operations: loads or updates
- Vendor auth state → Vendor operations: auth operations
- Vendor operations → Thelvora API client: calls
- Thelvora API client → Thelvora backend: HTTP requests