# lethabomohapi/avantgardecouture_fullstack architecture

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

- Interactive diagram: https://gitdiagram.com/lethabomohapi/avantgardecouture_fullstack
- Repository: https://github.com/lethabomohapi/avantgardecouture_fullstack

## Overview

Avant Garde Couture is a same-origin streetwear storefront: shoppers browse a shared catalogue, build a cart, submit orders for EFT or PayFast, and manage accounts; contact, product enquiries, and newsletter subscriptions are additional workflows. The backend handles authentication, order and stock rules, durable communications, and MySQL persistence. The README documents several capabilities whose detailed implementations were not sampled, so those branches are represented at subsystem level; edges are limited to visible source references or documented relationships.

Main entry points: [`backend/src/models/index.js`](https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/backend/src/models/index.js) (Domain Models), [`backend/src/app.js`](https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/backend/src/app.js) (HTTP App), [`backend/src/services/mail.js`](https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/backend/src/services/mail.js) (Mail Queue), [`assets/js/api.js`](https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/assets/js/api.js) (API Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_web_pages["Store Pages<br/>[index.html]"]
  node_catalogue_ui["Catalogue UI<br/>[shop.js]"]
  node_cart_ui["Cart UI<br/>[cart.js]"]
  node_api_client["API Client<br/>[api.js]"]
end

subgraph group_identity["Accounts"]
  node_auth_ui["Sign-in UI<br/>[auth.js]"]
  node_account_ui["Account UI<br/>[account.js]"]
  node_auth_routes["Auth Routes<br/>[auth.js]"]
  node_auth_controller["Auth Sessions<br/>[authController.js]"]
  node_auth_middleware["Session Guard<br/>[auth.js]"]
  node_user_routes["User Routes<br/>[user.js]"]
  node_user_controller["Profile And Wishlist<br/>[userController.js]"]
end

subgraph group_commerce["Orders And Payments"]
  node_store_routes["Store Routes<br/>[store.js]"]
  node_order_service["Order And Stock Rules<br/>[orders.js]"]
  node_payfast_service["PayFast Verification<br/>[payfast.js]"]
end

subgraph group_communications["Customer Communications"]
  node_communications_routes["Enquiries And Newsletter<br/>[communications.js]"]
  node_mail_service["Mail Queue<br/>[mail.js]"]
end

subgraph group_platform["Backend Platform"]
  node_app_router["HTTP App<br/>[app.js]"]
  node_models["Domain Models<br/>[index.js]"]
  node_database[("MySQL Access<br/>[database.js]")]
  node_migration["Schema Migration<br/>[migrate.js]"]
end

node_shopper(("Shopper"))
node_mysql[("MySQL")]
node_payfast["PayFast"]
node_smtp["SMTP Provider"]

node_shopper -->|"browses"| node_web_pages
node_web_pages -->|"uses"| node_catalogue_ui
node_web_pages -->|"uses"| node_cart_ui
node_catalogue_ui -->|"requests data"| node_api_client
node_cart_ui -->|"submits checkout"| node_api_client
node_auth_ui -->|"requests sessions"| node_api_client
node_account_ui -->|"requests account data"| node_api_client
node_api_client -->|"calls same-origin API"| node_app_router
node_app_router -->|"mounts"| node_auth_routes
node_app_router -->|"mounts"| node_user_routes
node_app_router -->|"mounts"| node_store_routes
node_app_router -->|"mounts"| node_communications_routes
node_auth_routes -->|"dispatches"| node_auth_controller
node_user_routes -->|"dispatches"| node_user_controller
node_user_routes -->|"guards"| node_auth_middleware
node_store_routes -->|"guards"| node_auth_middleware
node_store_routes -->|"invokes"| node_order_service
node_store_routes -->|"invokes"| node_payfast_service
node_communications_routes -->|"queues mail"| node_mail_service
node_auth_controller -->|"queues reset mail"| node_mail_service
node_order_service -->|"queues order mail"| node_mail_service
node_payfast_service -->|"records payment"| node_order_service
node_auth_controller -->|"reads and writes"| node_models
node_auth_middleware -->|"checks session"| node_models
node_user_controller -->|"reads and writes"| node_models
node_order_service -->|"reads and updates"| node_models
node_communications_routes -->|"saves records"| node_models
node_mail_service -->|"claims mail jobs"| node_models
node_models -->|"defines ORM models"| node_database
node_database -->|"connects"| node_mysql
node_migration -->|"uses connection"| node_database
node_app_router -->|"routes notifications"| node_payfast_service
node_payfast_service -.->|"verifies notifications"| node_payfast
node_mail_service -.->|"delivers mail"| node_smtp

click node_web_pages "https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/index.html"
click node_catalogue_ui "https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/assets/js/shop.js"
click node_cart_ui "https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/assets/js/cart.js"
click node_api_client "https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/assets/js/api.js"
click node_auth_ui "https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/assets/js/auth.js"
click node_account_ui "https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/assets/js/account.js"
click node_auth_routes "https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/backend/src/routes/auth.js"
click node_auth_controller "https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/backend/src/controllers/authController.js"
click node_auth_middleware "https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/backend/src/middleware/auth.js"
click node_user_routes "https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/backend/src/routes/user.js"
click node_user_controller "https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/backend/src/controllers/userController.js"
click node_store_routes "https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/backend/src/routes/store.js"
click node_order_service "https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/backend/src/services/orders.js"
click node_payfast_service "https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/backend/src/services/payfast.js"
click node_communications_routes "https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/backend/src/routes/communications.js"
click node_mail_service "https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/backend/src/services/mail.js"
click node_app_router "https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/backend/src/app.js"
click node_models "https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/backend/src/models/index.js"
click node_database "https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/backend/src/config/database.js"
click node_migration "https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/backend/src/config/migrate.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_web_pages,node_catalogue_ui,node_cart_ui,node_api_client toneBlue
class node_auth_ui,node_account_ui,node_auth_routes,node_auth_controller,node_auth_middleware,node_user_routes,node_user_controller,node_mysql toneAmber
class node_store_routes,node_order_service,node_payfast_service toneMint
class node_communications_routes,node_mail_service toneRose
class node_app_router,node_models,node_database,node_migration,node_shopper,node_payfast,node_smtp toneIndigo
```

## Components

### Storefront

- [Store Pages](https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/index.html): `index.html`
- [Catalogue UI](https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/assets/js/shop.js): `assets/js/shop.js`
- [Cart UI](https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/assets/js/cart.js): `assets/js/cart.js`
- [API Client](https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/assets/js/api.js): `assets/js/api.js`

### Accounts

- [Sign-in UI](https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/assets/js/auth.js): `assets/js/auth.js`
- [Account UI](https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/assets/js/account.js): `assets/js/account.js`
- [Auth Routes](https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/backend/src/routes/auth.js): `backend/src/routes/auth.js`
- [Auth Sessions](https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/backend/src/controllers/authController.js): `backend/src/controllers/authController.js`
- [Session Guard](https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/backend/src/middleware/auth.js): `backend/src/middleware/auth.js`
- [User Routes](https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/backend/src/routes/user.js): `backend/src/routes/user.js`
- [Profile And Wishlist](https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/backend/src/controllers/userController.js): `backend/src/controllers/userController.js`

### Orders And Payments

- [Store Routes](https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/backend/src/routes/store.js): `backend/src/routes/store.js`
- [Order And Stock Rules](https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/backend/src/services/orders.js): `backend/src/services/orders.js`
- [PayFast Verification](https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/backend/src/services/payfast.js): `backend/src/services/payfast.js`

### Customer Communications

- [Enquiries And Newsletter](https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/backend/src/routes/communications.js): `backend/src/routes/communications.js`
- [Mail Queue](https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/backend/src/services/mail.js): `backend/src/services/mail.js`

### Backend Platform

- [HTTP App](https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/backend/src/app.js): `backend/src/app.js`
- [Domain Models](https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/backend/src/models/index.js): `backend/src/models/index.js`
- [MySQL Access](https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/backend/src/config/database.js): `backend/src/config/database.js`
- [Schema Migration](https://github.com/lethabomohapi/avantgardecouture_fullstack/blob/main/backend/src/config/migrate.js): `backend/src/config/migrate.js`

### Other components

- **Shopper**
- **MySQL**
- **PayFast**
- **SMTP Provider**

## Connections

- Shopper → Store Pages: browses (evidence: `README.md`)
- Store Pages → Catalogue UI: uses (evidence: `README.md`)
- Store Pages → Cart UI: uses (evidence: `README.md`)
- Catalogue UI → API Client: requests data (evidence: `README.md`)
- Cart UI → API Client: submits checkout (evidence: `README.md`)
- Sign-in UI → API Client: requests sessions (evidence: `README.md`)
- Account UI → API Client: requests account data (evidence: `README.md`)
- API Client → HTTP App: calls same-origin API (evidence: `README.md`)
- HTTP App → Auth Routes: mounts (evidence: `backend/src/app.js`)
- HTTP App → User Routes: mounts (evidence: `backend/src/app.js`)
- HTTP App → Store Routes: mounts (evidence: `backend/src/app.js`)
- HTTP App → Enquiries And Newsletter: mounts (evidence: `backend/src/app.js`)
- Auth Routes → Auth Sessions: dispatches (evidence: `backend/src/routes/auth.js`)
- User Routes → Profile And Wishlist: dispatches (evidence: `backend/src/routes/user.js`)
- User Routes → Session Guard: guards (evidence: `backend/src/routes/user.js`)
- Store Routes → Session Guard: guards (evidence: `backend/src/routes/store.js`)
- Store Routes → Order And Stock Rules: invokes (evidence: `backend/src/routes/store.js`)
- Store Routes → PayFast Verification: invokes (evidence: `backend/src/routes/store.js`)
- Enquiries And Newsletter → Mail Queue: queues mail (evidence: `backend/src/routes/communications.js`)
- Auth Sessions → Mail Queue: queues reset mail (evidence: `backend/src/controllers/authController.js`)
- Order And Stock Rules → Mail Queue: queues order mail (evidence: `backend/src/services/orders.js`)
- PayFast Verification → Order And Stock Rules: records payment (evidence: `backend/src/services/payfast.js`)
- Auth Sessions → Domain Models: reads and writes (evidence: `backend/src/controllers/authController.js`)
- Session Guard → Domain Models: checks session (evidence: `backend/src/middleware/auth.js`)
- Profile And Wishlist → Domain Models: reads and writes (evidence: `backend/src/controllers/userController.js`)
- Order And Stock Rules → Domain Models: reads and updates (evidence: `backend/src/services/orders.js`)
- Enquiries And Newsletter → Domain Models: saves records (evidence: `backend/src/routes/communications.js`)
- Mail Queue → Domain Models: claims mail jobs (evidence: `backend/src/services/mail.js`)
- Domain Models → MySQL Access: defines ORM models (evidence: `backend/src/models/index.js`)
- MySQL Access → MySQL: connects (evidence: `backend/src/config/database.js`)
- Schema Migration → MySQL Access: uses connection (evidence: `backend/src/config/migrate.js`)
- HTTP App → PayFast Verification: routes notifications (evidence: `backend/src/app.js`)
- PayFast Verification → PayFast: verifies notifications
- Mail Queue → SMTP Provider: delivers mail
