# shukrypeter79-max/pmcosmeticshub architecture

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

- Interactive diagram: https://gitdiagram.com/shukrypeter79-max/pmcosmeticshub
- Repository: https://github.com/shukrypeter79-max/pmcosmeticshub

## Overview

PM.Cosmetics appears to be a cosmetics-commerce product with web and mobile clients backed by an Express API. Its user-facing stages include browsing products, authentication, cart management, orders and payments, with profile, wishlist, reviews, stores and invoices as additional API capabilities. The mobile product-detail and cart excerpts show HTTP calls to product and cart endpoints; API registration is visible in the server entry point. Most web screens and API route implementations were not sampled, so their internal calls and persistence are not inferred.

Main entry points: [`apps/api/src/index.ts`](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/api/src/index.ts) (API server), [`apps/mobile/App.tsx`](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/mobile/App.tsx) (Mobile navigation), [`apps/api/src/middleware/auth.ts`](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/api/src/middleware/auth.ts) (Token middleware), [`apps/api/src/routes/cart.ts`](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/api/src/routes/cart.ts) (Cart routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile app"]
  node_mobile_app["Mobile navigation<br/>[App.tsx]"]
  node_mobile_store["Client state<br/>[store.ts]"]
  node_m_home["Home screen<br/>[HomeScreen.tsx]"]
  node_m_shop["Shop screen<br/>[ShopScreen.tsx]"]
  node_m_detail["Product detail"]
  node_m_cart["Cart screen<br/>[CartScreen.tsx]"]
  node_m_login["Login screen<br/>[LoginScreen.tsx]"]
  node_m_register["Register screen<br/>[RegisterScreen.tsx]"]
  node_m_profile["Profile screen<br/>[ProfileScreen.tsx]"]
  node_m_orders["Orders screen<br/>[OrdersScreen.tsx]"]
  node_m_wishlist["Wishlist screen<br/>[WishlistScreen.tsx]"]
end

subgraph group_web["Web storefront"]
  node_web_home["Storefront home<br/>[page.tsx]"]
  node_web_shop["Web shop<br/>[page.tsx]"]
  node_web_login["Web login<br/>[page.tsx]"]
  node_web_register["Web registration<br/>[page.tsx]"]
  node_web_dashboard["Dashboard<br/>[page.tsx]"]
end

subgraph group_api["Commerce API"]
  node_api_server["API server<br/>[index.ts]"]
  node_api_auth["Authentication<br/>[auth.ts]"]
  node_api_products["Product routes<br/>[products.ts]"]
  node_api_cart["Cart routes<br/>[cart.ts]"]
  node_api_orders["Order routes<br/>[orders.ts]"]
  node_api_payments["Payment routes<br/>[payments.ts]"]
  node_api_users["User routes<br/>[users.ts]"]
  node_api_stores["Store routes<br/>[stores.ts]"]
  node_api_wishlist["Wishlist routes<br/>[wishlist.ts]"]
  node_api_reviews["Review routes<br/>[reviews.ts]"]
  node_api_invoices["Invoice routes<br/>[invoices.ts]"]
  node_api_auth_mw["Token middleware<br/>[auth.ts]"]
  node_api_errors["Error handling<br/>[errorHandler.ts]"]
end

subgraph group_legacy["Products service"]
  node_legacy_entry["Products entry<br/>[index.ts]"]
  node_legacy_routes["Product endpoints<br/>[products.routes.ts]"]
  node_legacy_controller["Product queries"]
  node_legacy_db[("Product database<br/>[db.ts]")]
end

node_shopper(("Shopper"))

node_shopper -->|"uses"| node_mobile_app
node_shopper -.->|"visits"| node_web_home
node_mobile_app -->|"provides state"| node_mobile_store
node_mobile_app -->|"navigates"| node_m_home
node_mobile_app -->|"navigates"| node_m_shop
node_mobile_app -->|"navigates"| node_m_detail
node_mobile_app -->|"navigates"| node_m_cart
node_mobile_app -->|"navigates"| node_m_login
node_mobile_app -->|"navigates"| node_m_register
node_mobile_app -->|"navigates"| node_m_profile
node_mobile_app -->|"navigates"| node_m_orders
node_mobile_app -->|"navigates"| node_m_wishlist
node_m_detail -->|"fetches product"| node_api_products
node_m_detail -->|"adds item"| node_api_cart
node_m_cart -->|"reads and removes"| node_api_cart
node_api_server -->|"routes requests"| node_api_auth
node_api_server -->|"routes requests"| node_api_products
node_api_server -->|"routes requests"| node_api_cart
node_api_server -->|"routes requests"| node_api_orders
node_api_server -->|"routes requests"| node_api_payments
node_api_server -->|"routes requests"| node_api_users
node_api_server -->|"routes requests"| node_api_stores
node_api_server -->|"routes requests"| node_api_wishlist
node_api_server -->|"routes requests"| node_api_reviews
node_api_server -->|"routes requests"| node_api_invoices
node_api_server -->|"handles errors"| node_api_errors
node_api_auth -->|"authenticates"| node_api_auth_mw
node_api_reviews -->|"authenticates"| node_api_auth_mw
node_api_cart -->|"authenticates"| node_api_auth_mw
node_api_orders -->|"authenticates"| node_api_auth_mw
node_api_payments -->|"authenticates"| node_api_auth_mw
node_api_products -->|"authenticates"| node_api_auth_mw
node_api_users -->|"authenticates"| node_api_auth_mw
node_api_stores -->|"authenticates"| node_api_auth_mw
node_api_wishlist -->|"authenticates"| node_api_auth_mw
node_legacy_entry -->|"mounts routes"| node_legacy_routes
node_legacy_routes -->|"dispatches"| node_legacy_controller
node_legacy_controller -->|"queries"| node_legacy_db

click node_mobile_app "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/mobile/App.tsx"
click node_mobile_store "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/mobile/store.ts"
click node_m_home "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/mobile/screens/HomeScreen.tsx"
click node_m_shop "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/mobile/screens/ShopScreen.tsx"
click node_m_detail "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/mobile/screens/ProductDetailScreen.tsx"
click node_m_cart "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/mobile/screens/CartScreen.tsx"
click node_m_login "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/mobile/screens/LoginScreen.tsx"
click node_m_register "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/mobile/screens/RegisterScreen.tsx"
click node_m_profile "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/mobile/screens/ProfileScreen.tsx"
click node_m_orders "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/mobile/screens/OrdersScreen.tsx"
click node_m_wishlist "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/mobile/screens/WishlistScreen.tsx"
click node_web_home "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/web/app/page.tsx"
click node_web_shop "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/web/app/shop/page.tsx"
click node_web_login "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/web/app/login/page.tsx"
click node_web_register "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/web/app/register/page.tsx"
click node_web_dashboard "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/web/app/dashboard/page.tsx"
click node_api_server "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/api/src/index.ts"
click node_api_auth "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/api/src/routes/auth.ts"
click node_api_products "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/api/src/routes/products.ts"
click node_api_cart "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/api/src/routes/cart.ts"
click node_api_orders "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/api/src/routes/orders.ts"
click node_api_payments "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/api/src/routes/payments.ts"
click node_api_users "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/api/src/routes/users.ts"
click node_api_stores "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/api/src/routes/stores.ts"
click node_api_wishlist "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/api/src/routes/wishlist.ts"
click node_api_reviews "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/api/src/routes/reviews.ts"
click node_api_invoices "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/api/src/routes/invoices.ts"
click node_api_auth_mw "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/api/src/middleware/auth.ts"
click node_api_errors "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/api/src/middleware/errorHandler.ts"
click node_legacy_entry "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/src/index.ts"
click node_legacy_routes "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/src/api/products/products.routes.ts"
click node_legacy_controller "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/src/api/products/products.controller.ts"
click node_legacy_db "https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/src/db/db.ts"

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_mobile_app,node_mobile_store,node_m_home,node_m_shop,node_m_detail,node_m_cart,node_m_login,node_m_register,node_m_profile,node_m_orders,node_m_wishlist toneBlue
class node_web_home,node_web_shop,node_web_login,node_web_register,node_web_dashboard toneAmber
class node_api_server,node_api_auth,node_api_products,node_api_cart,node_api_orders,node_api_payments,node_api_users,node_api_stores,node_api_wishlist,node_api_reviews,node_api_invoices,node_api_auth_mw,node_api_errors toneMint
class node_legacy_entry,node_legacy_routes,node_legacy_controller,node_legacy_db toneRose
class node_shopper toneIndigo
```

## Components

### Mobile app

- [Mobile navigation](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/mobile/App.tsx): `apps/mobile/App.tsx`
- [Client state](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/mobile/store.ts): `apps/mobile/store.ts`
- [Home screen](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/mobile/screens/HomeScreen.tsx): `apps/mobile/screens/HomeScreen.tsx`
- [Shop screen](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/mobile/screens/ShopScreen.tsx): `apps/mobile/screens/ShopScreen.tsx`
- [Product detail](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/mobile/screens/ProductDetailScreen.tsx): `apps/mobile/screens/ProductDetailScreen.tsx`
- [Cart screen](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/mobile/screens/CartScreen.tsx): `apps/mobile/screens/CartScreen.tsx`
- [Login screen](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/mobile/screens/LoginScreen.tsx): `apps/mobile/screens/LoginScreen.tsx`
- [Register screen](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/mobile/screens/RegisterScreen.tsx): `apps/mobile/screens/RegisterScreen.tsx`
- [Profile screen](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/mobile/screens/ProfileScreen.tsx): `apps/mobile/screens/ProfileScreen.tsx`
- [Orders screen](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/mobile/screens/OrdersScreen.tsx): `apps/mobile/screens/OrdersScreen.tsx`
- [Wishlist screen](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/mobile/screens/WishlistScreen.tsx): `apps/mobile/screens/WishlistScreen.tsx`

### Web storefront

- [Storefront home](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/web/app/page.tsx): `apps/web/app/page.tsx`
- [Web shop](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/web/app/shop/page.tsx): `apps/web/app/shop/page.tsx`
- [Web login](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/web/app/login/page.tsx): `apps/web/app/login/page.tsx`
- [Web registration](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/web/app/register/page.tsx): `apps/web/app/register/page.tsx`
- [Dashboard](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/web/app/dashboard/page.tsx): `apps/web/app/dashboard/page.tsx`

### Commerce API

- [API server](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/api/src/index.ts): `apps/api/src/index.ts`
- [Authentication](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/api/src/routes/auth.ts): `apps/api/src/routes/auth.ts`
- [Product routes](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/api/src/routes/products.ts): `apps/api/src/routes/products.ts`
- [Cart routes](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/api/src/routes/cart.ts): `apps/api/src/routes/cart.ts`
- [Order routes](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/api/src/routes/orders.ts): `apps/api/src/routes/orders.ts`
- [Payment routes](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/api/src/routes/payments.ts): `apps/api/src/routes/payments.ts`
- [User routes](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/api/src/routes/users.ts): `apps/api/src/routes/users.ts`
- [Store routes](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/api/src/routes/stores.ts): `apps/api/src/routes/stores.ts`
- [Wishlist routes](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/api/src/routes/wishlist.ts): `apps/api/src/routes/wishlist.ts`
- [Review routes](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/api/src/routes/reviews.ts): `apps/api/src/routes/reviews.ts`
- [Invoice routes](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/api/src/routes/invoices.ts): `apps/api/src/routes/invoices.ts`
- [Token middleware](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/api/src/middleware/auth.ts): `apps/api/src/middleware/auth.ts`
- [Error handling](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/apps/api/src/middleware/errorHandler.ts): `apps/api/src/middleware/errorHandler.ts`

### Products service

- [Products entry](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/src/index.ts): `src/index.ts`
- [Product endpoints](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/src/api/products/products.routes.ts): `src/api/products/products.routes.ts`
- [Product queries](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/src/api/products/products.controller.ts): `src/api/products/products.controller.ts`
- [Product database](https://github.com/shukrypeter79-max/pmcosmeticshub/blob/main/src/db/db.ts): `src/db/db.ts`

### Other components

- **Shopper**

## Connections

- Shopper → Mobile navigation: uses (evidence: `apps/mobile/App.tsx`)
- Shopper → Storefront home: visits
- Mobile navigation → Client state: provides state (evidence: `apps/mobile/App.tsx`)
- Mobile navigation → Home screen: navigates (evidence: `apps/mobile/App.tsx`)
- Mobile navigation → Shop screen: navigates (evidence: `apps/mobile/App.tsx`)
- Mobile navigation → Product detail: navigates (evidence: `apps/mobile/App.tsx`)
- Mobile navigation → Cart screen: navigates (evidence: `apps/mobile/App.tsx`)
- Mobile navigation → Login screen: navigates (evidence: `apps/mobile/App.tsx`)
- Mobile navigation → Register screen: navigates (evidence: `apps/mobile/App.tsx`)
- Mobile navigation → Profile screen: navigates (evidence: `apps/mobile/App.tsx`)
- Mobile navigation → Orders screen: navigates (evidence: `apps/mobile/App.tsx`)
- Mobile navigation → Wishlist screen: navigates (evidence: `apps/mobile/App.tsx`)
- Product detail → Product routes: fetches product (evidence: `apps/mobile/screens/ProductDetailScreen.tsx`)
- Product detail → Cart routes: adds item (evidence: `apps/mobile/screens/ProductDetailScreen.tsx`)
- Cart screen → Cart routes: reads and removes (evidence: `apps/mobile/screens/CartScreen.tsx`)
- API server → Authentication: routes requests (evidence: `apps/api/src/index.ts`)
- API server → Product routes: routes requests (evidence: `apps/api/src/index.ts`)
- API server → Cart routes: routes requests (evidence: `apps/api/src/index.ts`)
- API server → Order routes: routes requests (evidence: `apps/api/src/index.ts`)
- API server → Payment routes: routes requests (evidence: `apps/api/src/index.ts`)
- API server → User routes: routes requests (evidence: `apps/api/src/index.ts`)
- API server → Store routes: routes requests (evidence: `apps/api/src/index.ts`)
- API server → Wishlist routes: routes requests (evidence: `apps/api/src/index.ts`)
- API server → Review routes: routes requests (evidence: `apps/api/src/index.ts`)
- API server → Invoice routes: routes requests (evidence: `apps/api/src/index.ts`)
- API server → Error handling: handles errors (evidence: `apps/api/src/index.ts`)
- Authentication → Token middleware: authenticates (evidence: `apps/api/src/routes/auth.ts`)
- Review routes → Token middleware: authenticates (evidence: `apps/api/src/routes/reviews.ts`)
- Cart routes → Token middleware: authenticates (evidence: `apps/api/src/routes/cart.ts`)
- Order routes → Token middleware: authenticates (evidence: `apps/api/src/routes/orders.ts`)
- Payment routes → Token middleware: authenticates (evidence: `apps/api/src/routes/payments.ts`)
- Product routes → Token middleware: authenticates (evidence: `apps/api/src/routes/products.ts`)
- User routes → Token middleware: authenticates (evidence: `apps/api/src/routes/users.ts`)
- Store routes → Token middleware: authenticates (evidence: `apps/api/src/routes/stores.ts`)
- Wishlist routes → Token middleware: authenticates (evidence: `apps/api/src/routes/wishlist.ts`)
- Products entry → Product endpoints: mounts routes (evidence: `src/index.ts`)
- Product endpoints → Product queries: dispatches (evidence: `src/api/products/products.routes.ts`)
- Product queries → Product database: queries (evidence: `src/api/products/products.controller.ts`)
