# devrathul/vishalathacart architecture

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

- Interactive diagram: https://gitdiagram.com/devrathul/vishalathacart
- Repository: https://github.com/devrathul/vishalathacart

## Overview

Vishalatha Cart is a React shopping storefront with a separate admin area. Shoppers browse and filter a product catalog, open product details, and can register or sign in; administrators manage products, categories, customers, orders, and their profile. The app routes these screens and provides a shared Redux store with product, category, user, and authentication state. Product data is seeded in client state, while product-image uploads are sent to an API endpoint. Source excerpts show the upload request, but do not establish its server-side implementation or persistence behavior.

Main entry points: [`src/App.jsx`](https://github.com/devrathul/vishalathacart/blob/main/src/App.jsx) (Route application), [`src/app/store.js`](https://github.com/devrathul/vishalathacart/blob/main/src/app/store.js) (Redux store), [`src/components/products/Products.jsx`](https://github.com/devrathul/vishalathacart/blob/main/src/components/products/Products.jsx) (Product catalog), [`src/components/admin/AddProduct.jsx`](https://github.com/devrathul/vishalathacart/blob/main/src/components/admin/AddProduct.jsx) (Product editor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routing["App and navigation"]
  node_app["Route application<br/>[App.jsx]"]
  node_storefront["Storefront shell<br/>[Root.jsx]"]
  node_adminshell["Admin shell<br/>[AdminRoot.jsx]"]
  node_header["Store navigation<br/>[Header.jsx]"]
end

subgraph group_shopping["Storefront shopping"]
  node_home["Home<br/>[Home.jsx]"]
  node_catalog["Product catalog<br/>[Products.jsx]"]
  node_filters["Catalog filters<br/>[ProductFilters.jsx]"]
  node_productcard["Product cards<br/>[ProductCard.jsx]"]
  node_details["Product details<br/>[ProductDetails.jsx]"]
  node_rating["Rating display<br/>[Rating.jsx]"]
  node_signin["Sign in<br/>[SignIn.jsx]"]
  node_signup["Sign up<br/>[SignUp.jsx]"]
end

subgraph group_admin["Admin management"]
  node_adminproducts["Product management<br/>[AdminProduct.jsx]"]
  node_productform["Product editor<br/>[AddProduct.jsx]"]
  node_admincategories["Category management"]
  node_customers["Customer management<br/>[AdminCustomers.jsx]"]
  node_orders["Order management<br/>[AdminOrders.jsx]"]
  node_profile["Admin profile<br/>[AdminProfile.jsx]"]
end

subgraph group_state["Client state"]
  node_productsstate["Product state<br/>[productsSlice.js]"]
  node_categoriesstate["Category state<br/>[categoriesSlice.js]"]
  node_usersstate["User state<br/>[usersSlice.js]"]
  node_authstate["Authentication state<br/>[authSlice.js]"]
  node_store["Redux store<br/>[store.js]"]
end

node_shopper(("Shopper"))
node_administrator(("Administrator"))
node_uploadapi["Image upload API"]

node_shopper -->|"uses storefront"| node_app
node_administrator -->|"uses admin"| node_app
node_app -->|"routes storefront"| node_storefront
node_app -->|"routes admin"| node_adminshell
node_app -->|"routes home"| node_home
node_app -->|"routes catalog"| node_catalog
node_app -->|"routes details"| node_details
node_app -->|"routes sign in"| node_signin
node_app -->|"routes sign up"| node_signup
node_app -->|"routes products"| node_adminproducts
node_app -->|"routes categories"| node_admincategories
node_app -->|"routes customers"| node_customers
node_app -->|"routes orders"| node_orders
node_app -->|"routes editor"| node_productform
node_app -->|"routes profile"| node_profile
node_app -->|"provides state"| node_store
node_storefront -->|"renders header"| node_header
node_catalog -->|"renders filters"| node_filters
node_catalog -->|"renders cards"| node_productcard
node_productcard -->|"uses rating"| node_rating
node_store -->|"registers reducer"| node_productsstate
node_store -->|"registers reducer"| node_categoriesstate
node_store -->|"registers reducer"| node_usersstate
node_store -->|"registers reducer"| node_authstate
node_productform -->|"dispatches changes"| node_productsstate
node_adminproducts -->|"uses product state"| node_productsstate
node_admincategories -->|"uses category state"| node_categoriesstate
node_customers -->|"uses user state"| node_usersstate
node_signin -->|"uses auth state"| node_authstate
node_signup -->|"adds user"| node_usersstate
node_header -->|"updates auth"| node_authstate
node_productform -.->|"uploads images"| node_uploadapi

click node_app "https://github.com/devrathul/vishalathacart/blob/main/src/App.jsx"
click node_storefront "https://github.com/devrathul/vishalathacart/blob/main/src/Root/Root.jsx"
click node_adminshell "https://github.com/devrathul/vishalathacart/blob/main/src/Root/AdminRoot.jsx"
click node_home "https://github.com/devrathul/vishalathacart/blob/main/src/components/Home.jsx"
click node_catalog "https://github.com/devrathul/vishalathacart/blob/main/src/components/products/Products.jsx"
click node_filters "https://github.com/devrathul/vishalathacart/blob/main/src/components/products/ProductFilters.jsx"
click node_productcard "https://github.com/devrathul/vishalathacart/blob/main/src/components/products/ProductCard.jsx"
click node_details "https://github.com/devrathul/vishalathacart/blob/main/src/components/products/ProductDetails.jsx"
click node_rating "https://github.com/devrathul/vishalathacart/blob/main/src/components/common/Rating.jsx"
click node_signin "https://github.com/devrathul/vishalathacart/blob/main/src/components/authorization/SignIn.jsx"
click node_signup "https://github.com/devrathul/vishalathacart/blob/main/src/components/authorization/SignUp.jsx"
click node_header "https://github.com/devrathul/vishalathacart/blob/main/src/components/common/Header.jsx"
click node_adminproducts "https://github.com/devrathul/vishalathacart/blob/main/src/components/admin/AdminProduct.jsx"
click node_productform "https://github.com/devrathul/vishalathacart/blob/main/src/components/admin/AddProduct.jsx"
click node_admincategories "https://github.com/devrathul/vishalathacart/blob/main/src/components/admin/AdminCategories.jsx"
click node_customers "https://github.com/devrathul/vishalathacart/blob/main/src/components/admin/AdminCustomers.jsx"
click node_orders "https://github.com/devrathul/vishalathacart/blob/main/src/components/admin/AdminOrders.jsx"
click node_profile "https://github.com/devrathul/vishalathacart/blob/main/src/components/admin/AdminProfile.jsx"
click node_productsstate "https://github.com/devrathul/vishalathacart/blob/main/src/features/products/productsSlice.js"
click node_categoriesstate "https://github.com/devrathul/vishalathacart/blob/main/src/features/categories/categoriesSlice.js"
click node_usersstate "https://github.com/devrathul/vishalathacart/blob/main/src/features/users/usersSlice.js"
click node_authstate "https://github.com/devrathul/vishalathacart/blob/main/src/features/auth/authSlice.js"
click node_store "https://github.com/devrathul/vishalathacart/blob/main/src/app/store.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_app,node_storefront,node_adminshell,node_header toneBlue
class node_home,node_catalog,node_filters,node_productcard,node_details,node_rating,node_signin,node_signup toneAmber
class node_adminproducts,node_productform,node_admincategories,node_customers,node_orders,node_profile,node_uploadapi toneMint
class node_productsstate,node_categoriesstate,node_usersstate,node_authstate,node_store toneRose
class node_shopper,node_administrator toneIndigo
```

## Components

### App and navigation

- [Route application](https://github.com/devrathul/vishalathacart/blob/main/src/App.jsx): `src/App.jsx`
- [Storefront shell](https://github.com/devrathul/vishalathacart/blob/main/src/Root/Root.jsx): `src/Root/Root.jsx`
- [Admin shell](https://github.com/devrathul/vishalathacart/blob/main/src/Root/AdminRoot.jsx): `src/Root/AdminRoot.jsx`
- [Store navigation](https://github.com/devrathul/vishalathacart/blob/main/src/components/common/Header.jsx): `src/components/common/Header.jsx`

### Storefront shopping

- [Home](https://github.com/devrathul/vishalathacart/blob/main/src/components/Home.jsx): `src/components/Home.jsx`
- [Product catalog](https://github.com/devrathul/vishalathacart/blob/main/src/components/products/Products.jsx): `src/components/products/Products.jsx`
- [Catalog filters](https://github.com/devrathul/vishalathacart/blob/main/src/components/products/ProductFilters.jsx): `src/components/products/ProductFilters.jsx`
- [Product cards](https://github.com/devrathul/vishalathacart/blob/main/src/components/products/ProductCard.jsx): `src/components/products/ProductCard.jsx`
- [Product details](https://github.com/devrathul/vishalathacart/blob/main/src/components/products/ProductDetails.jsx): `src/components/products/ProductDetails.jsx`
- [Rating display](https://github.com/devrathul/vishalathacart/blob/main/src/components/common/Rating.jsx): `src/components/common/Rating.jsx`
- [Sign in](https://github.com/devrathul/vishalathacart/blob/main/src/components/authorization/SignIn.jsx): `src/components/authorization/SignIn.jsx`
- [Sign up](https://github.com/devrathul/vishalathacart/blob/main/src/components/authorization/SignUp.jsx): `src/components/authorization/SignUp.jsx`

### Admin management

- [Product management](https://github.com/devrathul/vishalathacart/blob/main/src/components/admin/AdminProduct.jsx): `src/components/admin/AdminProduct.jsx`
- [Product editor](https://github.com/devrathul/vishalathacart/blob/main/src/components/admin/AddProduct.jsx): `src/components/admin/AddProduct.jsx`
- [Category management](https://github.com/devrathul/vishalathacart/blob/main/src/components/admin/AdminCategories.jsx): `src/components/admin/AdminCategories.jsx`
- [Customer management](https://github.com/devrathul/vishalathacart/blob/main/src/components/admin/AdminCustomers.jsx): `src/components/admin/AdminCustomers.jsx`
- [Order management](https://github.com/devrathul/vishalathacart/blob/main/src/components/admin/AdminOrders.jsx): `src/components/admin/AdminOrders.jsx`
- [Admin profile](https://github.com/devrathul/vishalathacart/blob/main/src/components/admin/AdminProfile.jsx): `src/components/admin/AdminProfile.jsx`

### Client state

- [Product state](https://github.com/devrathul/vishalathacart/blob/main/src/features/products/productsSlice.js): `src/features/products/productsSlice.js`
- [Category state](https://github.com/devrathul/vishalathacart/blob/main/src/features/categories/categoriesSlice.js): `src/features/categories/categoriesSlice.js`
- [User state](https://github.com/devrathul/vishalathacart/blob/main/src/features/users/usersSlice.js): `src/features/users/usersSlice.js`
- [Authentication state](https://github.com/devrathul/vishalathacart/blob/main/src/features/auth/authSlice.js): `src/features/auth/authSlice.js`
- [Redux store](https://github.com/devrathul/vishalathacart/blob/main/src/app/store.js): `src/app/store.js`

### Other components

- **Shopper**
- **Administrator**
- **Image upload API**

## Connections

- Shopper → Route application: uses storefront (evidence: `src/App.jsx`)
- Administrator → Route application: uses admin (evidence: `src/App.jsx`)
- Route application → Storefront shell: routes storefront (evidence: `src/App.jsx`)
- Route application → Admin shell: routes admin (evidence: `src/App.jsx`)
- Route application → Home: routes home (evidence: `src/App.jsx`)
- Route application → Product catalog: routes catalog (evidence: `src/App.jsx`)
- Route application → Product details: routes details (evidence: `src/App.jsx`)
- Route application → Sign in: routes sign in (evidence: `src/App.jsx`)
- Route application → Sign up: routes sign up (evidence: `src/App.jsx`)
- Route application → Product management: routes products (evidence: `src/App.jsx`)
- Route application → Category management: routes categories (evidence: `src/App.jsx`)
- Route application → Customer management: routes customers (evidence: `src/App.jsx`)
- Route application → Order management: routes orders (evidence: `src/App.jsx`)
- Route application → Product editor: routes editor (evidence: `src/App.jsx`)
- Route application → Admin profile: routes profile (evidence: `src/App.jsx`)
- Route application → Redux store: provides state (evidence: `src/App.jsx`)
- Storefront shell → Store navigation: renders header (evidence: `src/Root/Root.jsx`)
- Product catalog → Catalog filters: renders filters (evidence: `src/components/products/Products.jsx`)
- Product catalog → Product cards: renders cards (evidence: `src/components/products/Products.jsx`)
- Product cards → Rating display: uses rating (evidence: `src/components/products/ProductCard.jsx`)
- Redux store → Product state: registers reducer (evidence: `src/app/store.js`)
- Redux store → Category state: registers reducer (evidence: `src/app/store.js`)
- Redux store → User state: registers reducer (evidence: `src/app/store.js`)
- Redux store → Authentication state: registers reducer (evidence: `src/app/store.js`)
- Product editor → Product state: dispatches changes (evidence: `src/components/admin/AddProduct.jsx`)
- Product management → Product state: uses product state (evidence: `src/components/admin/AdminProduct.jsx`)
- Category management → Category state: uses category state (evidence: `src/components/admin/AdminCategories.jsx`)
- Customer management → User state: uses user state (evidence: `src/components/admin/AdminCustomers.jsx`)
- Sign in → Authentication state: uses auth state (evidence: `src/components/authorization/SignIn.jsx`)
- Sign up → User state: adds user (evidence: `src/components/authorization/SignUp.jsx`)
- Store navigation → Authentication state: updates auth (evidence: `src/components/common/Header.jsx`)
- Product editor → Image upload API: uploads images (evidence: `src/components/admin/AddProduct.jsx`)
