# gouthamreddy17/eco-choice architecture

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

- Interactive diagram: https://gitdiagram.com/gouthamreddy17/eco-choice
- Repository: https://github.com/gouthamreddy17/eco-choice

## Overview

Eco-Choice is a MERN e-commerce platform for organic and safe products. Customers browse and search product information, manage a cart, check out, and receive an order confirmation; administrators authenticate, manage products, monitor orders, view analytics, and manage users. The graph includes the two React applications, Express route handlers, and MongoDB models. Frontend-to-backend links follow explicit API calls or documented capabilities; unsampled admin API connections are shown as unverified where appropriate.

Main entry points: [`eco-choice-frontend/src/App.jsx`](https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-frontend/src/App.jsx) (Storefront routing), [`eco-choice-backend/routes/adminRoutes.js`](https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-backend/routes/adminRoutes.js) (Admin API), [`eco-choice-admin/src/App.jsx`](https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-admin/src/App.jsx) (Admin routing), [`eco-choice-backend/server.js`](https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-backend/server.js) (Express API server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Customer storefront"]
  node_storefront_app["Storefront routing<br/>[App.jsx]"]
  node_navigation["Navigation and search<br/>[Navbar.jsx]"]
  node_home["Home<br/>[Home.jsx]"]
  node_catalog["Product catalog<br/>[Products.jsx]"]
  node_product_details["Product details<br/>[ProductDetails.jsx]"]
end

subgraph group_commerce["Commerce and identity"]
  node_cart["Shopping cart<br/>[Cart.jsx]"]
  node_checkout["Checkout<br/>[Checkout.jsx]"]
  node_confirmation["Order confirmation"]
  node_login["Customer login<br/>[Login.jsx]"]
  node_registration["Registration<br/>[Register.jsx]"]
  node_profile["Customer profile<br/>[Profile.jsx]"]
  node_order_history["Order history<br/>[Orders.jsx]"]
end

subgraph group_admin["Admin console"]
  node_admin_app["Admin routing<br/>[App.jsx]"]
  node_admin_login["Admin authentication<br/>[AdminLogin.jsx]"]
  node_dashboard["Dashboard analytics<br/>[Dashboard.jsx]"]
  node_admin_products["Product management<br/>[Products.jsx]"]
  node_product_form["Product editor<br/>[ProductForm.jsx]"]
  node_admin_orders["Order monitoring<br/>[Orders.jsx]"]
  node_admin_users["User management<br/>[Users.jsx]"]
end

subgraph group_backend["Backend services"]
  node_api_server["Express API server<br/>[server.js]"]
  node_product_routes["Product API<br/>[productRoutes.js]"]
  node_user_routes["User API<br/>[userRoutes.js]"]
  node_order_routes["Order API<br/>[orderRoutes.js]"]
  node_admin_routes["Admin API<br/>[adminRoutes.js]"]
  node_product_model[("Product records<br/>[Product.js]")]
  node_order_model[("Order records<br/>[Order.js]")]
  node_user_model[("User records<br/>[user.js]")]
end

node_customer(("Customer"))

node_customer -->|"uses"| node_storefront_app
node_storefront_app -->|"renders"| node_navigation
node_storefront_app -->|"routes to"| node_home
node_storefront_app -->|"routes to"| node_catalog
node_storefront_app -->|"routes to"| node_product_details
node_storefront_app -->|"routes to"| node_cart
node_storefront_app -->|"routes to"| node_checkout
node_storefront_app -->|"routes to"| node_confirmation
node_storefront_app -->|"routes to"| node_login
node_storefront_app -->|"routes to"| node_registration
node_storefront_app -->|"routes to"| node_profile
node_navigation -->|"fetches products"| node_product_routes
node_storefront_app -->|"posts order"| node_order_routes
node_checkout -->|"submits address"| node_storefront_app
node_storefront_app -->|"passes order details"| node_confirmation
node_admin_app -->|"routes to"| node_admin_login
node_admin_app -->|"routes to"| node_dashboard
node_admin_app -->|"routes to"| node_admin_products
node_admin_app -->|"routes to"| node_product_form
node_admin_app -->|"routes to"| node_admin_orders
node_admin_app -->|"routes to"| node_admin_users
node_product_form -->|"creates or updates"| node_admin_routes
node_api_server -->|"mounts"| node_product_routes
node_api_server -->|"mounts"| node_user_routes
node_api_server -->|"mounts"| node_order_routes
node_api_server -->|"mounts"| node_admin_routes
node_product_routes -->|"queries"| node_product_model
node_order_routes -->|"saves and queries"| node_order_model
node_admin_routes -->|"manages"| node_product_model
node_admin_routes -->|"manages"| node_order_model
node_admin_routes -.->|"queries users"| node_user_model
node_admin_login -.->|"authenticates via"| node_admin_routes
node_dashboard -.->|"requests analytics"| node_admin_routes
node_admin_products -.->|"manages products"| node_admin_routes
node_admin_orders -.->|"monitors orders"| node_admin_routes
node_admin_users -.->|"manages users"| node_admin_routes
node_login -.->|"authenticates via"| node_user_routes
node_registration -.->|"registers via"| node_user_routes
node_order_history -.->|"retrieves orders"| node_order_routes

click node_storefront_app "https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-frontend/src/App.jsx"
click node_navigation "https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-frontend/src/components/Navbar.jsx"
click node_home "https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-frontend/src/pages/Home.jsx"
click node_catalog "https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-frontend/src/pages/Products.jsx"
click node_product_details "https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-frontend/src/pages/ProductDetails.jsx"
click node_cart "https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-frontend/src/pages/Cart.jsx"
click node_checkout "https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-frontend/src/pages/Checkout.jsx"
click node_confirmation "https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-frontend/src/pages/OrderConfirmation.jsx"
click node_login "https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-frontend/src/pages/Login.jsx"
click node_registration "https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-frontend/src/pages/Register.jsx"
click node_profile "https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-frontend/src/pages/Profile.jsx"
click node_order_history "https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-frontend/src/pages/Orders.jsx"
click node_admin_app "https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-admin/src/App.jsx"
click node_admin_login "https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-admin/src/pages/AdminLogin.jsx"
click node_dashboard "https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-admin/src/pages/Dashboard.jsx"
click node_admin_products "https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-admin/src/pages/Products.jsx"
click node_product_form "https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-admin/src/pages/ProductForm.jsx"
click node_admin_orders "https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-admin/src/pages/Orders.jsx"
click node_admin_users "https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-admin/src/pages/Users.jsx"
click node_api_server "https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-backend/server.js"
click node_product_routes "https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-backend/routes/productRoutes.js"
click node_user_routes "https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-backend/routes/userRoutes.js"
click node_order_routes "https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-backend/routes/orderRoutes.js"
click node_admin_routes "https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-backend/routes/adminRoutes.js"
click node_product_model "https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-backend/models/Product.js"
click node_order_model "https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-backend/models/Order.js"
click node_user_model "https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-backend/models/user.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_storefront_app,node_navigation,node_home,node_catalog,node_product_details toneBlue
class node_cart,node_checkout,node_confirmation,node_login,node_registration,node_profile,node_order_history toneAmber
class node_admin_app,node_admin_login,node_dashboard,node_admin_products,node_product_form,node_admin_orders,node_admin_users toneMint
class node_api_server,node_product_routes,node_user_routes,node_order_routes,node_admin_routes,node_product_model,node_order_model,node_user_model toneRose
class node_customer toneIndigo
```

## Components

### Customer storefront

- [Storefront routing](https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-frontend/src/App.jsx): `eco-choice-frontend/src/App.jsx`
- [Navigation and search](https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-frontend/src/components/Navbar.jsx): `eco-choice-frontend/src/components/Navbar.jsx`
- [Home](https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-frontend/src/pages/Home.jsx): `eco-choice-frontend/src/pages/Home.jsx`
- [Product catalog](https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-frontend/src/pages/Products.jsx): `eco-choice-frontend/src/pages/Products.jsx`
- [Product details](https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-frontend/src/pages/ProductDetails.jsx): `eco-choice-frontend/src/pages/ProductDetails.jsx`

### Commerce and identity

- [Shopping cart](https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-frontend/src/pages/Cart.jsx): `eco-choice-frontend/src/pages/Cart.jsx`
- [Checkout](https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-frontend/src/pages/Checkout.jsx): `eco-choice-frontend/src/pages/Checkout.jsx`
- [Order confirmation](https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-frontend/src/pages/OrderConfirmation.jsx): `eco-choice-frontend/src/pages/OrderConfirmation.jsx`
- [Customer login](https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-frontend/src/pages/Login.jsx): `eco-choice-frontend/src/pages/Login.jsx`
- [Registration](https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-frontend/src/pages/Register.jsx): `eco-choice-frontend/src/pages/Register.jsx`
- [Customer profile](https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-frontend/src/pages/Profile.jsx): `eco-choice-frontend/src/pages/Profile.jsx`
- [Order history](https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-frontend/src/pages/Orders.jsx): `eco-choice-frontend/src/pages/Orders.jsx`

### Admin console

- [Admin routing](https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-admin/src/App.jsx): `eco-choice-admin/src/App.jsx`
- [Admin authentication](https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-admin/src/pages/AdminLogin.jsx): `eco-choice-admin/src/pages/AdminLogin.jsx`
- [Dashboard analytics](https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-admin/src/pages/Dashboard.jsx): `eco-choice-admin/src/pages/Dashboard.jsx`
- [Product management](https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-admin/src/pages/Products.jsx): `eco-choice-admin/src/pages/Products.jsx`
- [Product editor](https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-admin/src/pages/ProductForm.jsx): `eco-choice-admin/src/pages/ProductForm.jsx`
- [Order monitoring](https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-admin/src/pages/Orders.jsx): `eco-choice-admin/src/pages/Orders.jsx`
- [User management](https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-admin/src/pages/Users.jsx): `eco-choice-admin/src/pages/Users.jsx`

### Backend services

- [Express API server](https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-backend/server.js): `eco-choice-backend/server.js`
- [Product API](https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-backend/routes/productRoutes.js): `eco-choice-backend/routes/productRoutes.js`
- [User API](https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-backend/routes/userRoutes.js): `eco-choice-backend/routes/userRoutes.js`
- [Order API](https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-backend/routes/orderRoutes.js): `eco-choice-backend/routes/orderRoutes.js`
- [Admin API](https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-backend/routes/adminRoutes.js): `eco-choice-backend/routes/adminRoutes.js`
- [Product records](https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-backend/models/Product.js): `eco-choice-backend/models/Product.js`
- [Order records](https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-backend/models/Order.js): `eco-choice-backend/models/Order.js`
- [User records](https://github.com/gouthamreddy17/eco-choice/blob/main/eco-choice-backend/models/user.js): `eco-choice-backend/models/user.js`

### Other components

- **Customer**

## Connections

- Customer → Storefront routing: uses (evidence: `README.md`)
- Storefront routing → Navigation and search: renders (evidence: `eco-choice-frontend/src/App.jsx`)
- Storefront routing → Home: routes to (evidence: `eco-choice-frontend/src/App.jsx`)
- Storefront routing → Product catalog: routes to (evidence: `eco-choice-frontend/src/App.jsx`)
- Storefront routing → Product details: routes to (evidence: `eco-choice-frontend/src/App.jsx`)
- Storefront routing → Shopping cart: routes to (evidence: `eco-choice-frontend/src/App.jsx`)
- Storefront routing → Checkout: routes to (evidence: `eco-choice-frontend/src/App.jsx`)
- Storefront routing → Order confirmation: routes to (evidence: `eco-choice-frontend/src/App.jsx`)
- Storefront routing → Customer login: routes to (evidence: `eco-choice-frontend/src/App.jsx`)
- Storefront routing → Registration: routes to (evidence: `eco-choice-frontend/src/App.jsx`)
- Storefront routing → Customer profile: routes to (evidence: `eco-choice-frontend/src/App.jsx`)
- Navigation and search → Product API: fetches products (evidence: `eco-choice-frontend/src/components/Navbar.jsx`)
- Storefront routing → Order API: posts order (evidence: `eco-choice-frontend/src/App.jsx`)
- Checkout → Storefront routing: submits address (evidence: `eco-choice-frontend/src/App.jsx`)
- Storefront routing → Order confirmation: passes order details (evidence: `eco-choice-frontend/src/App.jsx`)
- Admin routing → Admin authentication: routes to (evidence: `eco-choice-admin/src/App.jsx`)
- Admin routing → Dashboard analytics: routes to (evidence: `eco-choice-admin/src/App.jsx`)
- Admin routing → Product management: routes to (evidence: `eco-choice-admin/src/App.jsx`)
- Admin routing → Product editor: routes to (evidence: `eco-choice-admin/src/App.jsx`)
- Admin routing → Order monitoring: routes to (evidence: `eco-choice-admin/src/App.jsx`)
- Admin routing → User management: routes to (evidence: `eco-choice-admin/src/App.jsx`)
- Product editor → Admin API: creates or updates (evidence: `eco-choice-admin/src/pages/ProductForm.jsx`)
- Express API server → Product API: mounts (evidence: `eco-choice-backend/server.js`)
- Express API server → User API: mounts (evidence: `eco-choice-backend/server.js`)
- Express API server → Order API: mounts (evidence: `eco-choice-backend/server.js`)
- Express API server → Admin API: mounts (evidence: `eco-choice-backend/server.js`)
- Product API → Product records: queries (evidence: `eco-choice-backend/routes/productRoutes.js`)
- Order API → Order records: saves and queries (evidence: `eco-choice-backend/routes/orderRoutes.js`)
- Admin API → Product records: manages (evidence: `eco-choice-backend/routes/adminRoutes.js`)
- Admin API → Order records: manages (evidence: `eco-choice-backend/routes/adminRoutes.js`)
- Admin API → User records: queries users
- Admin authentication → Admin API: authenticates via
- Dashboard analytics → Admin API: requests analytics
- Product management → Admin API: manages products
- Order monitoring → Admin API: monitors orders
- User management → Admin API: manages users
- Customer login → User API: authenticates via
- Registration → User API: registers via
- Order history → Order API: retrieves orders
