# a13do/e-store architecture

> Architecture diagram of the GitHub repository a13do/e-store, 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/a13do/e-store
- Repository: https://github.com/a13do/e-store

## Overview

E-Store is a MEAN-stack storefront with a separate Angular admin dashboard. Customers authenticate, browse and inspect products, manage cart and wishlist, then submit orders; administrators manage inventory and review orders. The server exposes API routes backed by MongoDB models, while the shop also persists cart and wishlist data through Firebase. The graph preserves documented capabilities, but unsampled feature internals are represented at their existing directories; their specific call paths are not inferred.

Main entry points: [`server/app.js`](https://github.com/a13do/e-store/blob/main/server/app.js) (Express API), [`client/shop/src/app/app.component.ts`](https://github.com/a13do/e-store/blob/main/client/shop/src/app/app.component.ts) (Shop application), [`client/shop/src/app/core/services/requests.service.ts`](https://github.com/a13do/e-store/blob/main/client/shop/src/app/core/services/requests.service.ts) (Shop API services), [`client/admin/src/app/core/services/products.service.ts`](https://github.com/a13do/e-store/blob/main/client/admin/src/app/core/services/products.service.ts) (Admin API service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shop["Customer storefront"]
  node_shop_app["Shop application<br/>[app.component.ts]"]
  node_shop_auth["Customer authentication"]
  node_catalog["Product discovery"]
  node_product_detail["Product details"]
  node_cart["Cart management"]
  node_wishlist["Wishlist"]
  node_checkout["Order checkout"]
  node_comments["Product comments"]
  node_shop_requests["Shop API services"]
end

subgraph group_admin["Admin dashboard"]
  node_admin_app["Dashboard application<br/>[app.component.ts]"]
  node_admin_auth["Admin authentication<br/>[auth.component.ts]"]
  node_inventory["Inventory management"]
  node_admin_catalog["Product administration"]
  node_admin_orders["Order administration"]
  node_admin_service["Admin API service"]
end

subgraph group_api["Backend API"]
  node_server["Express API<br/>[app.js]"]
  node_auth_api["Authentication endpoints<br/>[auth.js]"]
  node_product_api["Product endpoints<br/>[products.js]"]
  node_orders_api["Order endpoints<br/>[orders.js]"]
  node_categories_api["Category endpoints<br/>[categories.js]"]
  node_comments_api["Comment endpoints<br/>[comment.js]"]
  node_lists_api["User-list endpoints<br/>[user-lists.js]"]
end

subgraph group_data["Persistence"]
  node_mongo[("MongoDB")]
  node_firebase[("Firebase Realtime Database")]
  node_user_model[("User records<br/>[user.js]")]
  node_product_model[("Product records<br/>[product.js]")]
  node_order_model[("Order records<br/>[order.js]")]
  node_category_model[("Category records<br/>[categories.js]")]
  node_comment_model[("Comment records<br/>[comment.js]")]
  node_lists_model[("User-list records<br/>[user-lists.js]")]
end

node_customer(("Customer"))
node_admin_user(("Administrator"))

node_customer -->|"uses"| node_shop_app
node_shop_app -->|"offers sign-in"| node_shop_auth
node_customer -->|"browses products"| node_catalog
node_catalog -->|"opens details"| node_product_detail
node_customer -->|"manages cart"| node_cart
node_customer -->|"manages wishlist"| node_wishlist
node_customer -->|"submits order"| node_checkout
node_customer -.->|"reviews products"| node_comments
node_shop_app -->|"loads cart"| node_cart
node_shop_app -->|"loads wishlist"| node_wishlist
node_cart -->|"uses requests"| node_shop_requests
node_checkout -->|"creates order"| node_shop_requests
node_shop_requests -->|"reads and writes lists"| node_firebase
node_shop_requests -->|"requests products and orders"| node_server
node_admin_user -->|"uses"| node_admin_app
node_admin_app -->|"provides sign-in"| node_admin_auth
node_admin_user -->|"manages inventory"| node_inventory
node_admin_user -->|"reviews orders"| node_admin_orders
node_inventory -->|"uses service"| node_admin_service
node_admin_catalog -->|"uses service"| node_admin_service
node_admin_orders -->|"uses service"| node_admin_service
node_admin_service -->|"requests products and orders"| node_server
node_server -->|"routes auth"| node_auth_api
node_server -->|"routes products"| node_product_api
node_server -->|"routes orders"| node_orders_api
node_server -->|"routes categories"| node_categories_api
node_server -->|"routes comments"| node_comments_api
node_auth_api -->|"queries users"| node_user_model
node_product_api -->|"queries products"| node_product_model
node_server -->|"connects database"| node_mongo
node_orders_api -.->|"persists orders"| node_order_model
node_categories_api -.->|"persists categories"| node_category_model
node_comments_api -.->|"persists comments"| node_comment_model
node_lists_api -.->|"persists lists"| node_lists_model

click node_shop_app "https://github.com/a13do/e-store/blob/main/client/shop/src/app/app.component.ts"
click node_shop_auth "https://github.com/a13do/e-store/tree/main/client/shop/src/app/core/auth"
click node_catalog "https://github.com/a13do/e-store/tree/main/client/shop/src/app/feature/products"
click node_product_detail "https://github.com/a13do/e-store/blob/main/client/shop/src/app/feature/products/product-details/product-details.component.ts"
click node_cart "https://github.com/a13do/e-store/tree/main/client/shop/src/app/feature/cart-page"
click node_wishlist "https://github.com/a13do/e-store/tree/main/client/shop/src/app/wishlist"
click node_checkout "https://github.com/a13do/e-store/blob/main/client/shop/src/app/feature/checkout/checkout.component.ts"
click node_comments "https://github.com/a13do/e-store/tree/main/client/shop/src/app/shared/components/comment"
click node_shop_requests "https://github.com/a13do/e-store/blob/main/client/shop/src/app/core/services/requests.service.ts"
click node_admin_app "https://github.com/a13do/e-store/blob/main/client/admin/src/app/app.component.ts"
click node_admin_auth "https://github.com/a13do/e-store/blob/main/client/admin/src/app/core/auth/auth.component.ts"
click node_inventory "https://github.com/a13do/e-store/blob/main/client/admin/src/app/features/create-product/create-product.component.ts"
click node_admin_catalog "https://github.com/a13do/e-store/blob/main/client/admin/src/app/features/products/products.component.ts"
click node_admin_orders "https://github.com/a13do/e-store/blob/main/client/admin/src/app/features/orders/orders.component.ts"
click node_admin_service "https://github.com/a13do/e-store/blob/main/client/admin/src/app/core/services/products.service.ts"
click node_server "https://github.com/a13do/e-store/blob/main/server/app.js"
click node_auth_api "https://github.com/a13do/e-store/blob/main/server/controllers/auth.js"
click node_product_api "https://github.com/a13do/e-store/blob/main/server/controllers/products.js"
click node_orders_api "https://github.com/a13do/e-store/blob/main/server/controllers/orders.js"
click node_categories_api "https://github.com/a13do/e-store/blob/main/server/controllers/categories.js"
click node_comments_api "https://github.com/a13do/e-store/blob/main/server/controllers/comment.js"
click node_lists_api "https://github.com/a13do/e-store/blob/main/server/controllers/user-lists.js"
click node_user_model "https://github.com/a13do/e-store/blob/main/server/models/user.js"
click node_product_model "https://github.com/a13do/e-store/blob/main/server/models/product.js"
click node_order_model "https://github.com/a13do/e-store/blob/main/server/models/order.js"
click node_category_model "https://github.com/a13do/e-store/blob/main/server/models/categories.js"
click node_comment_model "https://github.com/a13do/e-store/blob/main/server/models/comment.js"
click node_lists_model "https://github.com/a13do/e-store/blob/main/server/models/user-lists.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_shop_app,node_shop_auth,node_catalog,node_product_detail,node_cart,node_wishlist,node_checkout,node_comments,node_shop_requests toneBlue
class node_admin_app,node_admin_auth,node_inventory,node_admin_catalog,node_admin_orders,node_admin_service toneAmber
class node_server,node_auth_api,node_product_api,node_orders_api,node_categories_api,node_comments_api,node_lists_api toneMint
class node_mongo,node_firebase,node_user_model,node_product_model,node_order_model,node_category_model,node_comment_model,node_lists_model toneRose
class node_customer,node_admin_user toneIndigo
```

## Components

### Customer storefront

- [Shop application](https://github.com/a13do/e-store/blob/main/client/shop/src/app/app.component.ts): `client/shop/src/app/app.component.ts`
- [Customer authentication](https://github.com/a13do/e-store/tree/main/client/shop/src/app/core/auth): `client/shop/src/app/core/auth`
- [Product discovery](https://github.com/a13do/e-store/tree/main/client/shop/src/app/feature/products): `client/shop/src/app/feature/products`
- [Product details](https://github.com/a13do/e-store/blob/main/client/shop/src/app/feature/products/product-details/product-details.component.ts): `client/shop/src/app/feature/products/product-details/product-details.component.ts`
- [Cart management](https://github.com/a13do/e-store/tree/main/client/shop/src/app/feature/cart-page): `client/shop/src/app/feature/cart-page`
- [Wishlist](https://github.com/a13do/e-store/tree/main/client/shop/src/app/wishlist): `client/shop/src/app/wishlist`
- [Order checkout](https://github.com/a13do/e-store/blob/main/client/shop/src/app/feature/checkout/checkout.component.ts): `client/shop/src/app/feature/checkout/checkout.component.ts`
- [Product comments](https://github.com/a13do/e-store/tree/main/client/shop/src/app/shared/components/comment): `client/shop/src/app/shared/components/comment`
- [Shop API services](https://github.com/a13do/e-store/blob/main/client/shop/src/app/core/services/requests.service.ts): `client/shop/src/app/core/services/requests.service.ts`

### Admin dashboard

- [Dashboard application](https://github.com/a13do/e-store/blob/main/client/admin/src/app/app.component.ts): `client/admin/src/app/app.component.ts`
- [Admin authentication](https://github.com/a13do/e-store/blob/main/client/admin/src/app/core/auth/auth.component.ts): `client/admin/src/app/core/auth/auth.component.ts`
- [Inventory management](https://github.com/a13do/e-store/blob/main/client/admin/src/app/features/create-product/create-product.component.ts): `client/admin/src/app/features/create-product/create-product.component.ts`
- [Product administration](https://github.com/a13do/e-store/blob/main/client/admin/src/app/features/products/products.component.ts): `client/admin/src/app/features/products/products.component.ts`
- [Order administration](https://github.com/a13do/e-store/blob/main/client/admin/src/app/features/orders/orders.component.ts): `client/admin/src/app/features/orders/orders.component.ts`
- [Admin API service](https://github.com/a13do/e-store/blob/main/client/admin/src/app/core/services/products.service.ts): `client/admin/src/app/core/services/products.service.ts`

### Backend API

- [Express API](https://github.com/a13do/e-store/blob/main/server/app.js): `server/app.js`
- [Authentication endpoints](https://github.com/a13do/e-store/blob/main/server/controllers/auth.js): `server/controllers/auth.js`
- [Product endpoints](https://github.com/a13do/e-store/blob/main/server/controllers/products.js): `server/controllers/products.js`
- [Order endpoints](https://github.com/a13do/e-store/blob/main/server/controllers/orders.js): `server/controllers/orders.js`
- [Category endpoints](https://github.com/a13do/e-store/blob/main/server/controllers/categories.js): `server/controllers/categories.js`
- [Comment endpoints](https://github.com/a13do/e-store/blob/main/server/controllers/comment.js): `server/controllers/comment.js`
- [User-list endpoints](https://github.com/a13do/e-store/blob/main/server/controllers/user-lists.js): `server/controllers/user-lists.js`

### Persistence

- **MongoDB**
- **Firebase Realtime Database**
- [User records](https://github.com/a13do/e-store/blob/main/server/models/user.js): `server/models/user.js`
- [Product records](https://github.com/a13do/e-store/blob/main/server/models/product.js): `server/models/product.js`
- [Order records](https://github.com/a13do/e-store/blob/main/server/models/order.js): `server/models/order.js`
- [Category records](https://github.com/a13do/e-store/blob/main/server/models/categories.js): `server/models/categories.js`
- [Comment records](https://github.com/a13do/e-store/blob/main/server/models/comment.js): `server/models/comment.js`
- [User-list records](https://github.com/a13do/e-store/blob/main/server/models/user-lists.js): `server/models/user-lists.js`

### Other components

- **Customer**
- **Administrator**

## Connections

- Customer → Shop application: uses (evidence: `README.md`)
- Shop application → Customer authentication: offers sign-in (evidence: `README.md`)
- Customer → Product discovery: browses products (evidence: `README.md`)
- Product discovery → Product details: opens details (evidence: `README.md`)
- Customer → Cart management: manages cart (evidence: `README.md`)
- Customer → Wishlist: manages wishlist (evidence: `README.md`)
- Customer → Order checkout: submits order (evidence: `README.md`)
- Customer → Product comments: reviews products
- Shop application → Cart management: loads cart (evidence: `client/shop/src/app/app.component.ts`)
- Shop application → Wishlist: loads wishlist (evidence: `client/shop/src/app/app.component.ts`)
- Cart management → Shop API services: uses requests
- Order checkout → Shop API services: creates order (evidence: `README.md`)
- Shop API services → Firebase Realtime Database: reads and writes lists (evidence: `client/shop/src/app/core/services/requests.service.ts`)
- Shop API services → Express API: requests products and orders (evidence: `client/shop/src/app/core/services/requests.service.ts`)
- Administrator → Dashboard application: uses (evidence: `README.md`)
- Dashboard application → Admin authentication: provides sign-in
- Administrator → Inventory management: manages inventory (evidence: `README.md`)
- Administrator → Order administration: reviews orders (evidence: `README.md`)
- Inventory management → Admin API service: uses service (evidence: `client/admin/src/app/features/create-product/create-product.component.ts`)
- Product administration → Admin API service: uses service (evidence: `client/admin/src/app/features/products/products.component.ts`)
- Order administration → Admin API service: uses service (evidence: `client/admin/src/app/features/orders/orders.component.ts`)
- Admin API service → Express API: requests products and orders (evidence: `client/admin/src/app/core/services/products.service.ts`)
- Express API → Authentication endpoints: routes auth (evidence: `server/app.js`)
- Express API → Product endpoints: routes products (evidence: `server/app.js`)
- Express API → Order endpoints: routes orders (evidence: `server/app.js`)
- Express API → Category endpoints: routes categories (evidence: `server/app.js`)
- Express API → Comment endpoints: routes comments (evidence: `server/app.js`)
- Authentication endpoints → User records: queries users (evidence: `server/controllers/auth.js`)
- Product endpoints → Product records: queries products (evidence: `server/controllers/products.js`)
- Express API → MongoDB: connects database (evidence: `server/app.js`)
- Order endpoints → Order records: persists orders
- Category endpoints → Category records: persists categories
- Comment endpoints → Comment records: persists comments
- User-list endpoints → User-list records: persists lists
