# srisambhujel08/dewy-skincare-shop architecture

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

- Interactive diagram: https://gitdiagram.com/srisambhujel08/dewy-skincare-shop
- Repository: https://github.com/srisambhujel08/dewy-skincare-shop

## Overview

Dewy is a skincare shop with customer accounts and role-based administration. Shoppers browse and filter products, maintain a cart, then sign in to submit checkout; the server validates the cart and calculates the total. Account flows cover registration, login, logout, password recovery and profile/password updates, while admins manage user roles and activation. The client centralizes session state and API requests; the server handles routes and persists user data in SQLite. The sampled source supports these links; payment processing is only a placeholder, not an implemented integration.

Main entry points: [`client/src/App.jsx`](https://github.com/srisambhujel08/dewy-skincare-shop/blob/main/client/src/App.jsx) (App routes), [`client/src/auth.jsx`](https://github.com/srisambhujel08/dewy-skincare-shop/blob/main/client/src/auth.jsx) (Auth state and API), [`server/server.js`](https://github.com/srisambhujel08/dewy-skincare-shop/blob/main/server/server.js) (HTTP API routes), [`client/src/pages/AuthPages.jsx`](https://github.com/srisambhujel08/dewy-skincare-shop/blob/main/client/src/pages/AuthPages.jsx) (Account forms)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Storefront"]
  node_app["App routes<br/>[App.jsx]"]
end

subgraph group_identity["Accounts"]
  node_authstate["Auth state and API<br/>[auth.jsx]"]
  node_authpages["Account forms<br/>[AuthPages.jsx]"]
  node_profile["Profile settings<br/>[Profile.jsx]"]
  node_admin["User administration<br/>[Admin.jsx]"]
end

subgraph group_commerce["Shop and checkout"]
  node_shop["Catalog and cart<br/>[Shop.jsx]"]
end

subgraph group_backend["Server and data"]
  node_api["HTTP API routes<br/>[server.js]"]
  node_users[("User database<br/>[db.js]")]
end

node_shopper(("Shopper"))
node_payment{{"Payment gateway"}}

node_shopper -->|"uses storefront"| node_app
node_app -->|"reads session"| node_authstate
node_app -->|"routes to"| node_shop
node_app -->|"routes to"| node_authpages
node_app -->|"protects route"| node_profile
node_app -->|"protects route"| node_admin
node_authpages -->|"calls API"| node_authstate
node_profile -->|"calls API"| node_authstate
node_admin -->|"calls API"| node_authstate
node_shop -->|"calls API"| node_authstate
node_authstate -->|"sends requests"| node_api
node_api -->|"reads and writes"| node_users
node_api -.->|"payment placeholder"| node_payment

click node_app "https://github.com/srisambhujel08/dewy-skincare-shop/blob/main/client/src/App.jsx"
click node_authstate "https://github.com/srisambhujel08/dewy-skincare-shop/blob/main/client/src/auth.jsx"
click node_authpages "https://github.com/srisambhujel08/dewy-skincare-shop/blob/main/client/src/pages/AuthPages.jsx"
click node_profile "https://github.com/srisambhujel08/dewy-skincare-shop/blob/main/client/src/pages/Profile.jsx"
click node_admin "https://github.com/srisambhujel08/dewy-skincare-shop/blob/main/client/src/pages/Admin.jsx"
click node_shop "https://github.com/srisambhujel08/dewy-skincare-shop/blob/main/client/src/pages/Shop.jsx"
click node_api "https://github.com/srisambhujel08/dewy-skincare-shop/blob/main/server/server.js"
click node_users "https://github.com/srisambhujel08/dewy-skincare-shop/blob/main/server/db.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 toneBlue
class node_authstate,node_authpages,node_profile,node_admin toneAmber
class node_shop toneMint
class node_api,node_users toneRose
class node_shopper,node_payment toneIndigo
```

## Components

### Storefront

- [App routes](https://github.com/srisambhujel08/dewy-skincare-shop/blob/main/client/src/App.jsx): `client/src/App.jsx`

### Accounts

- [Auth state and API](https://github.com/srisambhujel08/dewy-skincare-shop/blob/main/client/src/auth.jsx): `client/src/auth.jsx`
- [Account forms](https://github.com/srisambhujel08/dewy-skincare-shop/blob/main/client/src/pages/AuthPages.jsx): `client/src/pages/AuthPages.jsx`
- [Profile settings](https://github.com/srisambhujel08/dewy-skincare-shop/blob/main/client/src/pages/Profile.jsx): `client/src/pages/Profile.jsx`
- [User administration](https://github.com/srisambhujel08/dewy-skincare-shop/blob/main/client/src/pages/Admin.jsx): `client/src/pages/Admin.jsx`

### Shop and checkout

- [Catalog and cart](https://github.com/srisambhujel08/dewy-skincare-shop/blob/main/client/src/pages/Shop.jsx): `client/src/pages/Shop.jsx`

### Server and data

- [HTTP API routes](https://github.com/srisambhujel08/dewy-skincare-shop/blob/main/server/server.js): `server/server.js`
- [User database](https://github.com/srisambhujel08/dewy-skincare-shop/blob/main/server/db.js): `server/db.js`

### Other components

- **Shopper**
- **Payment gateway**

## Connections

- Shopper → App routes: uses storefront (evidence: `README.md`)
- App routes → Auth state and API: reads session (evidence: `client/src/App.jsx`)
- App routes → Catalog and cart: routes to (evidence: `client/src/App.jsx`)
- App routes → Account forms: routes to (evidence: `client/src/App.jsx`)
- App routes → Profile settings: protects route (evidence: `client/src/App.jsx`)
- App routes → User administration: protects route (evidence: `client/src/App.jsx`)
- Account forms → Auth state and API: calls API (evidence: `client/src/pages/AuthPages.jsx`)
- Profile settings → Auth state and API: calls API (evidence: `client/src/pages/Profile.jsx`)
- User administration → Auth state and API: calls API (evidence: `client/src/pages/Admin.jsx`)
- Catalog and cart → Auth state and API: calls API (evidence: `client/src/pages/Shop.jsx`)
- Auth state and API → HTTP API routes: sends requests (evidence: `client/src/auth.jsx`)
- HTTP API routes → User database: reads and writes (evidence: `server/server.js`)
- HTTP API routes → Payment gateway: payment placeholder
