# sharik820/avada_ecommerce architecture

> Architecture diagram of the GitHub repository sharik820/avada_ecommerce, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sharik820/avada_ecommerce
- Repository: https://github.com/sharik820/avada_ecommerce

## Overview

This repository implements an online storefront and its administration portal, backed by an Express API. The principal user journey is browsing products, submitting an order, and viewing order details; separate flows cover accounts and OTP verification, blogs and reviews, and administration of products, blogs, users, and orders. The frontend route table and backend route mounts are visible, as are review-service calls into persistence. Many page-to-API and backend route-to-controller connections are not shown in the excerpts, so those relationships are left unverified rather than asserted.

Main entry points: [`server/src/app.js`](https://github.com/sharik820/avada_ecommerce/blob/main/server/src/app.js) (Express app), [`client/src/routes/Routing.jsx`](https://github.com/sharik820/avada_ecommerce/blob/main/client/src/routes/Routing.jsx) (Route dispatch), [`client/src/api/BackendApi.jsx`](https://github.com/sharik820/avada_ecommerce/blob/main/client/src/api/BackendApi.jsx) (Backend API client), [`server/src/service/productReview.service.js`](https://github.com/sharik820/avada_ecommerce/blob/main/server/src/service/productReview.service.js) (Review services)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_routing["Route dispatch<br/>[Routing.jsx]"]
  node_publicpages["Storefront pages"]
  node_accountpages["Account and OTP"]
  node_checkout["Order and invoice<br/>[Buy_Now_Form.jsx]"]
  node_blogpages["Blog and reviews<br/>[Blog_Details.jsx]"]
  node_frontendapi["Backend API client<br/>[BackendApi.jsx]"]
end

subgraph group_admin["Administration"]
  node_adminpages["Admin console"]
  node_protected["Protected routes<br/>[ProtectedRoute.jsx]"]
end

subgraph group_backend["API domain services"]
  node_apiapp["Express app<br/>[app.js]"]
  node_userdomain["User and auth<br/>[user.controller.js]"]
  node_productdomain["Product catalog"]
  node_blogdomain["Blog content<br/>[blog.controller.js]"]
  node_reviewcontrollers["Review endpoints"]
  node_reviewservices["Review services"]
  node_orderdomain["Orders"]
  node_paymentdomain["Payments"]
  node_admindomain["Admin management"]
end

subgraph group_data["Persistence and integrations"]
  node_dbrepo[("Data repository")]
  node_orderrepo[("Order repository")]
  node_cache["Cache<br/>[cache.js]"]
  node_externalservices{{"Email and payment providers"}}
end

node_visitor(("Shopper"))

node_visitor -->|"navigates"| node_routing
node_routing -->|"dispatches"| node_publicpages
node_routing -->|"dispatches"| node_accountpages
node_routing -->|"dispatches"| node_checkout
node_routing -->|"dispatches"| node_blogpages
node_routing -->|"dispatches"| node_adminpages
node_routing -->|"wraps protected"| node_protected
node_publicpages -.->|"uses API"| node_frontendapi
node_accountpages -.->|"uses API"| node_frontendapi
node_checkout -.->|"uses API"| node_frontendapi
node_blogpages -.->|"uses API"| node_frontendapi
node_adminpages -.->|"uses API"| node_frontendapi
node_frontendapi -.->|"HTTP requests"| node_apiapp
node_apiapp -->|"mounts user routes"| node_userdomain
node_apiapp -->|"mounts product routes"| node_productdomain
node_apiapp -->|"mounts blog routes"| node_blogdomain
node_apiapp -->|"mounts review routes"| node_reviewcontrollers
node_apiapp -->|"mounts order routes"| node_orderdomain
node_apiapp -->|"mounts payment routes"| node_paymentdomain
node_apiapp -->|"mounts admin routes"| node_admindomain
node_reviewcontrollers -->|"calls"| node_reviewservices
node_reviewservices -->|"reads and writes"| node_dbrepo
node_reviewservices -->|"invalidates and reads"| node_cache
node_orderdomain -.->|"uses repository"| node_orderrepo
node_orderdomain -.->|"payment or email"| node_externalservices

click node_routing "https://github.com/sharik820/avada_ecommerce/blob/main/client/src/routes/Routing.jsx"
click node_publicpages "https://github.com/sharik820/avada_ecommerce/tree/main/client/src/pages"
click node_accountpages "https://github.com/sharik820/avada_ecommerce/tree/main/client/src/pages"
click node_checkout "https://github.com/sharik820/avada_ecommerce/blob/main/client/src/pages/Buy_Now_Form.jsx"
click node_blogpages "https://github.com/sharik820/avada_ecommerce/blob/main/client/src/pages/Blog_Details.jsx"
click node_frontendapi "https://github.com/sharik820/avada_ecommerce/blob/main/client/src/api/BackendApi.jsx"
click node_adminpages "https://github.com/sharik820/avada_ecommerce/blob/main/client/src/pages/Admin_Product_add.jsx"
click node_protected "https://github.com/sharik820/avada_ecommerce/blob/main/client/src/auth/ProtectedRoute.jsx"
click node_apiapp "https://github.com/sharik820/avada_ecommerce/blob/main/server/src/app.js"
click node_userdomain "https://github.com/sharik820/avada_ecommerce/blob/main/server/src/controller/user.controller.js"
click node_productdomain "https://github.com/sharik820/avada_ecommerce/blob/main/server/src/controller/product.controller.js"
click node_blogdomain "https://github.com/sharik820/avada_ecommerce/blob/main/server/src/controller/blog.controller.js"
click node_reviewcontrollers "https://github.com/sharik820/avada_ecommerce/blob/main/server/src/controller/productReview.controller.js"
click node_reviewservices "https://github.com/sharik820/avada_ecommerce/blob/main/server/src/service/productReview.service.js"
click node_orderdomain "https://github.com/sharik820/avada_ecommerce/blob/main/server/src/controller/order.controller.js"
click node_paymentdomain "https://github.com/sharik820/avada_ecommerce/blob/main/server/src/controller/payment.controller.js"
click node_admindomain "https://github.com/sharik820/avada_ecommerce/blob/main/server/src/controller/admin.controller.js"
click node_dbrepo "https://github.com/sharik820/avada_ecommerce/blob/main/server/src/repositories/db.repositiories.js"
click node_orderrepo "https://github.com/sharik820/avada_ecommerce/blob/main/server/src/repositories/order.repositiory.js"
click node_cache "https://github.com/sharik820/avada_ecommerce/blob/main/server/src/utils/cache.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_routing,node_publicpages,node_accountpages,node_checkout,node_blogpages,node_frontendapi toneBlue
class node_adminpages,node_protected toneAmber
class node_apiapp,node_userdomain,node_productdomain,node_blogdomain,node_reviewcontrollers,node_reviewservices,node_orderdomain,node_paymentdomain,node_admindomain toneMint
class node_dbrepo,node_orderrepo,node_cache,node_externalservices toneRose
class node_visitor toneIndigo
```

## Components

### Storefront

- [Route dispatch](https://github.com/sharik820/avada_ecommerce/blob/main/client/src/routes/Routing.jsx): `client/src/routes/Routing.jsx`
- [Storefront pages](https://github.com/sharik820/avada_ecommerce/tree/main/client/src/pages): `client/src/pages`
- [Account and OTP](https://github.com/sharik820/avada_ecommerce/tree/main/client/src/pages): `client/src/pages`
- [Order and invoice](https://github.com/sharik820/avada_ecommerce/blob/main/client/src/pages/Buy_Now_Form.jsx): `client/src/pages/Buy_Now_Form.jsx`
- [Blog and reviews](https://github.com/sharik820/avada_ecommerce/blob/main/client/src/pages/Blog_Details.jsx): `client/src/pages/Blog_Details.jsx`
- [Backend API client](https://github.com/sharik820/avada_ecommerce/blob/main/client/src/api/BackendApi.jsx): `client/src/api/BackendApi.jsx`

### Administration

- [Admin console](https://github.com/sharik820/avada_ecommerce/blob/main/client/src/pages/Admin_Product_add.jsx): `client/src/pages/Admin_Product_add.jsx`
- [Protected routes](https://github.com/sharik820/avada_ecommerce/blob/main/client/src/auth/ProtectedRoute.jsx): `client/src/auth/ProtectedRoute.jsx`

### API domain services

- [Express app](https://github.com/sharik820/avada_ecommerce/blob/main/server/src/app.js): `server/src/app.js`
- [User and auth](https://github.com/sharik820/avada_ecommerce/blob/main/server/src/controller/user.controller.js): `server/src/controller/user.controller.js`
- [Product catalog](https://github.com/sharik820/avada_ecommerce/blob/main/server/src/controller/product.controller.js): `server/src/controller/product.controller.js`
- [Blog content](https://github.com/sharik820/avada_ecommerce/blob/main/server/src/controller/blog.controller.js): `server/src/controller/blog.controller.js`
- [Review endpoints](https://github.com/sharik820/avada_ecommerce/blob/main/server/src/controller/productReview.controller.js): `server/src/controller/productReview.controller.js`
- [Review services](https://github.com/sharik820/avada_ecommerce/blob/main/server/src/service/productReview.service.js): `server/src/service/productReview.service.js`
- [Orders](https://github.com/sharik820/avada_ecommerce/blob/main/server/src/controller/order.controller.js): `server/src/controller/order.controller.js`
- [Payments](https://github.com/sharik820/avada_ecommerce/blob/main/server/src/controller/payment.controller.js): `server/src/controller/payment.controller.js`
- [Admin management](https://github.com/sharik820/avada_ecommerce/blob/main/server/src/controller/admin.controller.js): `server/src/controller/admin.controller.js`

### Persistence and integrations

- [Data repository](https://github.com/sharik820/avada_ecommerce/blob/main/server/src/repositories/db.repositiories.js): `server/src/repositories/db.repositiories.js`
- [Order repository](https://github.com/sharik820/avada_ecommerce/blob/main/server/src/repositories/order.repositiory.js): `server/src/repositories/order.repositiory.js`
- [Cache](https://github.com/sharik820/avada_ecommerce/blob/main/server/src/utils/cache.js): `server/src/utils/cache.js`
- **Email and payment providers**

### Other components

- **Shopper**

## Connections

- Shopper → Route dispatch: navigates
- Route dispatch → Storefront pages: dispatches
- Route dispatch → Account and OTP: dispatches
- Route dispatch → Order and invoice: dispatches
- Route dispatch → Blog and reviews: dispatches
- Route dispatch → Admin console: dispatches
- Route dispatch → Protected routes: wraps protected (evidence: `client/src/routes/Routing.jsx`)
- Storefront pages → Backend API client: uses API (evidence: `client/src/pages/Update_Product.jsx`)
- Account and OTP → Backend API client: uses API (evidence: `client/src/pages/Update_Product.jsx`)
- Order and invoice → Backend API client: uses API
- Blog and reviews → Backend API client: uses API
- Admin console → Backend API client: uses API (evidence: `client/src/pages/Admin_Product_add.jsx`)
- Backend API client → Express app: HTTP requests
- Express app → User and auth: mounts user routes (evidence: `server/src/app.js`)
- Express app → Product catalog: mounts product routes (evidence: `server/src/app.js`)
- Express app → Blog content: mounts blog routes (evidence: `server/src/app.js`)
- Express app → Review endpoints: mounts review routes (evidence: `server/src/app.js`)
- Express app → Orders: mounts order routes (evidence: `server/src/app.js`)
- Express app → Payments: mounts payment routes (evidence: `server/src/app.js`)
- Express app → Admin management: mounts admin routes (evidence: `server/src/app.js`)
- Review endpoints → Review services: calls (evidence: `server/src/controller/productReview.controller.js`)
- Review services → Data repository: reads and writes (evidence: `server/src/service/productReview.service.js`)
- Review services → Cache: invalidates and reads (evidence: `server/src/service/productReview.service.js`)
- Orders → Order repository: uses repository
- Orders → Email and payment providers: payment or email
