# vtjvlad/abcwear architecture

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

- Interactive diagram: https://gitdiagram.com/vtjvlad/abcwear
- Repository: https://github.com/vtjvlad/abcwear

## Overview

ABC Wear is an e-commerce application with a product catalog, product details and recommendations, authentication and profile management, carts, wishlists, and image uploads. The main workflow is a shopper using the public storefront to reach Express routes, which dispatch API handlers that query MongoDB-backed models; authenticated routes first pass through JWT middleware. The tree also contains Nike-oriented parsing and transformation scripts and older server implementations. Those branches are represented without assuming unsampled wiring; the README provides no further architecture detail.

Main entry points: [`app.js`](https://github.com/vtjvlad/abcwear/blob/main/app.js) (Express routes), [`utils/internalApi.js`](https://github.com/vtjvlad/abcwear/blob/main/utils/internalApi.js) (API handlers), [`public/js/catalog.js`](https://github.com/vtjvlad/abcwear/blob/main/public/js/catalog.js) (Catalog UI), [`public/prodPage.js`](https://github.com/vtjvlad/abcwear/blob/main/public/prodPage.js) (Product page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_catalog_ui["Catalog UI<br/>[catalog.js]"]
  node_product_ui["Product page<br/>[prodPage.js]"]
  node_recommendations_ui["Recommendations UI<br/>[recommendations.js]"]
  node_auth_ui["Authentication UI<br/>[auth.js]"]
  node_cart_ui["Cart UI<br/>[cart.js]"]
  node_wishlist_ui["Wishlist UI<br/>[wishlist.js]"]
end

subgraph group_server["Web server"]
  node_server_app["Express routes<br/>[app.js]"]
  node_api_handlers["API handlers<br/>[internalApi.js]"]
  node_auth_middleware["JWT authentication<br/>[auth.js]"]
  node_request_validation["Request validation<br/>[validators.js]"]
  node_error_handling["Error handling<br/>[errorHandler.js]"]
  node_page_routes["Page routing<br/>[router.js]"]
end

subgraph group_commerce["Commerce data"]
  node_product_data[("Product records<br/>[Product.js]")]
  node_user_data[("User records<br/>[User.js]")]
  node_cart_data[("Cart records<br/>[Cart.js]")]
  node_wishlist_data[("Wishlist records<br/>[Wishlist.js]")]
end

subgraph group_ingest["Product ingestion"]
  node_nike_parsing["Nike parsers<br/>[a1s1nikedata.js]"]
  node_nike_images["Image extraction<br/>[a1s4getnikeimgs.js]"]
  node_nike_transform["Image transforms"]
  node_nike_translate["Product translation<br/>[translate.js]"]
end

subgraph group_legacy["Legacy server"]
  node_legacy_api["Legacy product API<br/>[api.js]"]
  node_legacy_app["Legacy server<br/>[app12.js]"]
  node_legacy_api2["Legacy API variant<br/>[api2.js]"]
  node_sample_server["Example server<br/>[exampleSRV.js]"]
  node_sample_model[("Example model<br/>[model.js]")]
end

node_shopper(("Shopper"))

node_shopper -->|"browses"| node_catalog_ui
node_shopper -->|"views"| node_product_ui
node_shopper -->|"authenticates"| node_auth_ui
node_shopper -->|"manages cart"| node_cart_ui
node_shopper -->|"manages wishlist"| node_wishlist_ui
node_server_app -->|"dispatches"| node_api_handlers
node_server_app -->|"routes pages"| node_page_routes
node_server_app -->|"guards routes"| node_auth_middleware
node_server_app -->|"validates requests"| node_request_validation
node_server_app -->|"handles errors"| node_error_handling
node_auth_middleware -->|"loads user"| node_user_data
node_api_handlers -->|"queries products"| node_product_data
node_api_handlers -->|"manages users"| node_user_data
node_api_handlers -->|"manages carts"| node_cart_data
node_api_handlers -->|"manages wishlists"| node_wishlist_data
node_cart_data -->|"calculates totals"| node_product_data
node_legacy_app -->|"routes to"| node_legacy_api
node_sample_server -->|"uses model"| node_sample_model
node_catalog_ui -.->|"requests catalog data"| node_server_app
node_product_ui -.->|"requests product data"| node_server_app
node_recommendations_ui -.->|"requests recommendations"| node_server_app
node_auth_ui -.->|"submits credentials"| node_server_app
node_cart_ui -.->|"requests cart operations"| node_server_app
node_wishlist_ui -.->|"requests wishlist operations"| node_server_app

click node_catalog_ui "https://github.com/vtjvlad/abcwear/blob/main/public/js/catalog.js"
click node_product_ui "https://github.com/vtjvlad/abcwear/blob/main/public/prodPage.js"
click node_recommendations_ui "https://github.com/vtjvlad/abcwear/blob/main/public/recommendations.js"
click node_auth_ui "https://github.com/vtjvlad/abcwear/blob/main/public/js/auth.js"
click node_cart_ui "https://github.com/vtjvlad/abcwear/blob/main/public/js/cart.js"
click node_wishlist_ui "https://github.com/vtjvlad/abcwear/blob/main/public/js/wishlist.js"
click node_server_app "https://github.com/vtjvlad/abcwear/blob/main/app.js"
click node_api_handlers "https://github.com/vtjvlad/abcwear/blob/main/utils/internalApi.js"
click node_auth_middleware "https://github.com/vtjvlad/abcwear/blob/main/middleware/auth.js"
click node_request_validation "https://github.com/vtjvlad/abcwear/blob/main/middleware/validators.js"
click node_error_handling "https://github.com/vtjvlad/abcwear/blob/main/middleware/errorHandler.js"
click node_page_routes "https://github.com/vtjvlad/abcwear/blob/main/utils/router.js"
click node_product_data "https://github.com/vtjvlad/abcwear/blob/main/models/Product.js"
click node_user_data "https://github.com/vtjvlad/abcwear/blob/main/models/User.js"
click node_cart_data "https://github.com/vtjvlad/abcwear/blob/main/models/Cart.js"
click node_wishlist_data "https://github.com/vtjvlad/abcwear/blob/main/models/Wishlist.js"
click node_nike_parsing "https://github.com/vtjvlad/abcwear/blob/main/pars/a1s1nikedata.js"
click node_nike_images "https://github.com/vtjvlad/abcwear/blob/main/pars/a1s4getnikeimgs.js"
click node_nike_transform "https://github.com/vtjvlad/abcwear/blob/main/pars/a2s6nikeTransformImg.js"
click node_nike_translate "https://github.com/vtjvlad/abcwear/blob/main/pars/translate.js"
click node_legacy_api "https://github.com/vtjvlad/abcwear/blob/main/legacy/api.js"
click node_legacy_app "https://github.com/vtjvlad/abcwear/blob/main/legacy/app12.js"
click node_legacy_api2 "https://github.com/vtjvlad/abcwear/blob/main/legacy/api2.js"
click node_sample_server "https://github.com/vtjvlad/abcwear/blob/main/exampleSRV.js"
click node_sample_model "https://github.com/vtjvlad/abcwear/blob/main/model.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_catalog_ui,node_product_ui,node_recommendations_ui,node_auth_ui,node_cart_ui,node_wishlist_ui toneBlue
class node_server_app,node_api_handlers,node_auth_middleware,node_request_validation,node_error_handling,node_page_routes toneAmber
class node_product_data,node_user_data,node_cart_data,node_wishlist_data toneMint
class node_nike_parsing,node_nike_images,node_nike_transform,node_nike_translate toneRose
class node_legacy_api,node_legacy_app,node_legacy_api2,node_sample_server,node_sample_model,node_shopper toneIndigo
```

## Components

### Storefront

- [Catalog UI](https://github.com/vtjvlad/abcwear/blob/main/public/js/catalog.js): `public/js/catalog.js`
- [Product page](https://github.com/vtjvlad/abcwear/blob/main/public/prodPage.js): `public/prodPage.js`
- [Recommendations UI](https://github.com/vtjvlad/abcwear/blob/main/public/recommendations.js): `public/recommendations.js`
- [Authentication UI](https://github.com/vtjvlad/abcwear/blob/main/public/js/auth.js): `public/js/auth.js`
- [Cart UI](https://github.com/vtjvlad/abcwear/blob/main/public/js/cart.js): `public/js/cart.js`
- [Wishlist UI](https://github.com/vtjvlad/abcwear/blob/main/public/js/wishlist.js): `public/js/wishlist.js`

### Web server

- [Express routes](https://github.com/vtjvlad/abcwear/blob/main/app.js): `app.js`
- [API handlers](https://github.com/vtjvlad/abcwear/blob/main/utils/internalApi.js): `utils/internalApi.js`
- [JWT authentication](https://github.com/vtjvlad/abcwear/blob/main/middleware/auth.js): `middleware/auth.js`
- [Request validation](https://github.com/vtjvlad/abcwear/blob/main/middleware/validators.js): `middleware/validators.js`
- [Error handling](https://github.com/vtjvlad/abcwear/blob/main/middleware/errorHandler.js): `middleware/errorHandler.js`
- [Page routing](https://github.com/vtjvlad/abcwear/blob/main/utils/router.js): `utils/router.js`

### Commerce data

- [Product records](https://github.com/vtjvlad/abcwear/blob/main/models/Product.js): `models/Product.js`
- [User records](https://github.com/vtjvlad/abcwear/blob/main/models/User.js): `models/User.js`
- [Cart records](https://github.com/vtjvlad/abcwear/blob/main/models/Cart.js): `models/Cart.js`
- [Wishlist records](https://github.com/vtjvlad/abcwear/blob/main/models/Wishlist.js): `models/Wishlist.js`

### Product ingestion

- [Nike parsers](https://github.com/vtjvlad/abcwear/blob/main/pars/a1s1nikedata.js): `pars/a1s1nikedata.js`
- [Image extraction](https://github.com/vtjvlad/abcwear/blob/main/pars/a1s4getnikeimgs.js): `pars/a1s4getnikeimgs.js`
- [Image transforms](https://github.com/vtjvlad/abcwear/blob/main/pars/a2s6nikeTransformImg.js): `pars/a2s6nikeTransformImg.js`
- [Product translation](https://github.com/vtjvlad/abcwear/blob/main/pars/translate.js): `pars/translate.js`

### Legacy server

- [Legacy product API](https://github.com/vtjvlad/abcwear/blob/main/legacy/api.js): `legacy/api.js`
- [Legacy server](https://github.com/vtjvlad/abcwear/blob/main/legacy/app12.js): `legacy/app12.js`
- [Legacy API variant](https://github.com/vtjvlad/abcwear/blob/main/legacy/api2.js): `legacy/api2.js`
- [Example server](https://github.com/vtjvlad/abcwear/blob/main/exampleSRV.js): `exampleSRV.js`
- [Example model](https://github.com/vtjvlad/abcwear/blob/main/model.js): `model.js`

### Other components

- **Shopper**

## Connections

- Shopper → Catalog UI: browses
- Shopper → Product page: views
- Shopper → Authentication UI: authenticates
- Shopper → Cart UI: manages cart
- Shopper → Wishlist UI: manages wishlist
- Express routes → API handlers: dispatches (evidence: `app.js`)
- Express routes → Page routing: routes pages (evidence: `app.js`)
- Express routes → JWT authentication: guards routes (evidence: `app.js`)
- Express routes → Request validation: validates requests (evidence: `app.js`)
- Express routes → Error handling: handles errors (evidence: `app.js`)
- JWT authentication → User records: loads user (evidence: `middleware/auth.js`)
- API handlers → Product records: queries products (evidence: `utils/internalApi.js`)
- API handlers → User records: manages users (evidence: `utils/internalApi.js`)
- API handlers → Cart records: manages carts (evidence: `utils/internalApi.js`)
- API handlers → Wishlist records: manages wishlists (evidence: `utils/internalApi.js`)
- Cart records → Product records: calculates totals (evidence: `models/Cart.js`)
- Legacy server → Legacy product API: routes to (evidence: `legacy/app12.js`)
- Example server → Example model: uses model (evidence: `exampleSRV.js`)
- Catalog UI → Express routes: requests catalog data
- Product page → Express routes: requests product data
- Recommendations UI → Express routes: requests recommendations
- Authentication UI → Express routes: submits credentials
- Cart UI → Express routes: requests cart operations
- Wishlist UI → Express routes: requests wishlist operations
