# dachakaf1/dar-chakaf architecture

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

- Interactive diagram: https://gitdiagram.com/dachakaf1/dar-chakaf
- Repository: https://github.com/dachakaf1/dar-chakaf

## Overview

Dar Chakaf is a furniture showcase and sales-lead website with an administrator CMS. Visitors browse product categories and details, then can save/compare products, request a quote, or contact the business; administrators manage catalog content, media, and inquiries. The graph emphasizes documented routing and sampled API behavior. Some API capabilities are represented from the source index and server routes; unsampled frontend-to-API calls are not asserted.

Main entry points: [`server.js`](https://github.com/dachakaf1/dar-chakaf/blob/main/server.js) (Web server), [`api/lib/db.js`](https://github.com/dachakaf1/dar-chakaf/blob/main/api/lib/db.js) (PostgreSQL), [`api/produits`](https://github.com/dachakaf1/dar-chakaf/tree/main/api/produits) (Product handlers), [`api/produits/index.js`](https://github.com/dachakaf1/dar-chakaf/blob/main/api/produits/index.js) (Product dispatcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_public_pages["Public pages<br/>[index.html]"]
  node_product_pages["Product pages<br/>[categorie.html]"]
  node_lead_pages["Quote and contact<br/>[devis.html]"]
  node_admin_ui["Admin console<br/>[dashboard.html]"]
end

subgraph group_catalog["Catalog and media"]
  node_product_router["Product dispatcher<br/>[index.js]"]
  node_product_handlers["Product handlers"]
  node_categories["Categories<br/>[index.js]"]
  node_gallery["Gallery<br/>[index.js]"]
  node_product_images["Image processing<br/>[images-batch.js]"]
  node_image_storage["Blob image storage<br/>[blob-upload.js]"]
end

subgraph group_content["Business content"]
  node_about_content["About and offers<br/>[offers.js]"]
  node_blog["Blog<br/>[index.js]"]
  node_testimonials["Reviews<br/>[index.js]"]
  node_site_settings["Site settings<br/>[index.js]"]
end

subgraph group_operations["Admin operations"]
  node_quote_api["Quote requests<br/>[index.js]"]
  node_messages["Contact messages<br/>[index.js]"]
  node_newsletter["Newsletter<br/>[index.js]"]
  node_admin_users["Administrator accounts<br/>[index.js]"]
end

subgraph group_platform["API platform"]
  node_server["Web server<br/>[server.js]"]
  node_auth["Authentication<br/>[index.js]"]
  node_database[("PostgreSQL<br/>[db.js]")]
end

node_visitor(("Visitor"))
node_blob_service[("Blob CDN")]

node_visitor -->|"browses"| node_public_pages
node_visitor -->|"browses"| node_product_pages
node_visitor -->|"submits inquiry"| node_lead_pages
node_server -->|"serves"| node_public_pages
node_server -.->|"serves"| node_admin_ui
node_server -->|"routes products"| node_product_router
node_server -->|"routes categories"| node_categories
node_server -->|"routes gallery"| node_gallery
node_server -->|"routes about"| node_about_content
node_server -->|"routes blog"| node_blog
node_server -.->|"routes reviews"| node_testimonials
node_server -->|"routes settings"| node_site_settings
node_server -->|"routes quotes"| node_quote_api
node_server -->|"routes messages"| node_messages
node_server -->|"routes newsletter"| node_newsletter
node_server -->|"routes users"| node_admin_users
node_server -->|"routes sign-in"| node_auth
node_product_router -->|"dispatches categories"| node_product_handlers
node_product_router -.->|"dispatches category data"| node_categories
node_product_handlers -->|"reads and writes"| node_database
node_categories -->|"reads and writes"| node_database
node_gallery -->|"reads and writes"| node_database
node_gallery -->|"uploads and deletes"| node_image_storage
node_image_storage -->|"stores images"| node_blob_service
node_product_handlers -->|"batches image rows"| node_product_images
node_product_handlers -->|"uploads image data"| node_image_storage
node_about_content -->|"reads and writes"| node_database
node_blog -->|"reads and writes"| node_database
node_testimonials -->|"reads and writes"| node_database
node_site_settings -->|"reads and writes"| node_database
node_quote_api -->|"reads and writes"| node_database
node_messages -->|"reads and writes"| node_database
node_newsletter -->|"reads and writes"| node_database
node_admin_users -->|"reads and writes"| node_database
node_auth -->|"reads and writes"| node_database

click node_public_pages "https://github.com/dachakaf1/dar-chakaf/blob/main/index.html"
click node_product_pages "https://github.com/dachakaf1/dar-chakaf/blob/main/produits/categorie.html"
click node_lead_pages "https://github.com/dachakaf1/dar-chakaf/blob/main/devis.html"
click node_admin_ui "https://github.com/dachakaf1/dar-chakaf/blob/main/admin/dashboard.html"
click node_server "https://github.com/dachakaf1/dar-chakaf/blob/main/server.js"
click node_product_router "https://github.com/dachakaf1/dar-chakaf/blob/main/api/produits/index.js"
click node_product_handlers "https://github.com/dachakaf1/dar-chakaf/tree/main/api/produits"
click node_categories "https://github.com/dachakaf1/dar-chakaf/blob/main/api/categories/index.js"
click node_gallery "https://github.com/dachakaf1/dar-chakaf/blob/main/api/galerie/index.js"
click node_product_images "https://github.com/dachakaf1/dar-chakaf/blob/main/api/lib/images-batch.js"
click node_image_storage "https://github.com/dachakaf1/dar-chakaf/blob/main/api/lib/blob-upload.js"
click node_about_content "https://github.com/dachakaf1/dar-chakaf/blob/main/api/apropos/offers.js"
click node_blog "https://github.com/dachakaf1/dar-chakaf/blob/main/api/blog/index.js"
click node_testimonials "https://github.com/dachakaf1/dar-chakaf/blob/main/api/avis/index.js"
click node_site_settings "https://github.com/dachakaf1/dar-chakaf/blob/main/api/parametres/index.js"
click node_quote_api "https://github.com/dachakaf1/dar-chakaf/blob/main/api/devis/index.js"
click node_messages "https://github.com/dachakaf1/dar-chakaf/blob/main/api/messages/index.js"
click node_newsletter "https://github.com/dachakaf1/dar-chakaf/blob/main/api/newsletter/index.js"
click node_admin_users "https://github.com/dachakaf1/dar-chakaf/blob/main/api/utilisateurs/index.js"
click node_auth "https://github.com/dachakaf1/dar-chakaf/blob/main/api/auth/index.js"
click node_database "https://github.com/dachakaf1/dar-chakaf/blob/main/api/lib/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_public_pages,node_product_pages,node_lead_pages,node_admin_ui toneBlue
class node_product_router,node_product_handlers,node_categories,node_gallery,node_product_images,node_image_storage,node_blob_service toneAmber
class node_about_content,node_blog,node_testimonials,node_site_settings toneMint
class node_quote_api,node_messages,node_newsletter,node_admin_users toneRose
class node_server,node_auth,node_database,node_visitor toneIndigo
```

## Components

### Web experience

- [Public pages](https://github.com/dachakaf1/dar-chakaf/blob/main/index.html): `index.html`
- [Product pages](https://github.com/dachakaf1/dar-chakaf/blob/main/produits/categorie.html): `produits/categorie.html`
- [Quote and contact](https://github.com/dachakaf1/dar-chakaf/blob/main/devis.html): `devis.html`
- [Admin console](https://github.com/dachakaf1/dar-chakaf/blob/main/admin/dashboard.html): `admin/dashboard.html`

### Catalog and media

- [Product dispatcher](https://github.com/dachakaf1/dar-chakaf/blob/main/api/produits/index.js): `api/produits/index.js`
- [Product handlers](https://github.com/dachakaf1/dar-chakaf/tree/main/api/produits): `api/produits`
- [Categories](https://github.com/dachakaf1/dar-chakaf/blob/main/api/categories/index.js): `api/categories/index.js`
- [Gallery](https://github.com/dachakaf1/dar-chakaf/blob/main/api/galerie/index.js): `api/galerie/index.js`
- [Image processing](https://github.com/dachakaf1/dar-chakaf/blob/main/api/lib/images-batch.js): `api/lib/images-batch.js`
- [Blob image storage](https://github.com/dachakaf1/dar-chakaf/blob/main/api/lib/blob-upload.js): `api/lib/blob-upload.js`

### Business content

- [About and offers](https://github.com/dachakaf1/dar-chakaf/blob/main/api/apropos/offers.js): `api/apropos/offers.js`
- [Blog](https://github.com/dachakaf1/dar-chakaf/blob/main/api/blog/index.js): `api/blog/index.js`
- [Reviews](https://github.com/dachakaf1/dar-chakaf/blob/main/api/avis/index.js): `api/avis/index.js`
- [Site settings](https://github.com/dachakaf1/dar-chakaf/blob/main/api/parametres/index.js): `api/parametres/index.js`

### Admin operations

- [Quote requests](https://github.com/dachakaf1/dar-chakaf/blob/main/api/devis/index.js): `api/devis/index.js`
- [Contact messages](https://github.com/dachakaf1/dar-chakaf/blob/main/api/messages/index.js): `api/messages/index.js`
- [Newsletter](https://github.com/dachakaf1/dar-chakaf/blob/main/api/newsletter/index.js): `api/newsletter/index.js`
- [Administrator accounts](https://github.com/dachakaf1/dar-chakaf/blob/main/api/utilisateurs/index.js): `api/utilisateurs/index.js`

### API platform

- [Web server](https://github.com/dachakaf1/dar-chakaf/blob/main/server.js): `server.js`
- [Authentication](https://github.com/dachakaf1/dar-chakaf/blob/main/api/auth/index.js): `api/auth/index.js`
- [PostgreSQL](https://github.com/dachakaf1/dar-chakaf/blob/main/api/lib/db.js): `api/lib/db.js`

### Other components

- **Visitor**
- **Blob CDN**

## Connections

- Visitor → Public pages: browses
- Visitor → Product pages: browses
- Visitor → Quote and contact: submits inquiry
- Web server → Public pages: serves (evidence: `server.js`)
- Web server → Admin console: serves
- Web server → Product dispatcher: routes products (evidence: `server.js`)
- Web server → Categories: routes categories (evidence: `server.js`)
- Web server → Gallery: routes gallery (evidence: `server.js`)
- Web server → About and offers: routes about (evidence: `server.js`)
- Web server → Blog: routes blog (evidence: `server.js`)
- Web server → Reviews: routes reviews
- Web server → Site settings: routes settings (evidence: `server.js`)
- Web server → Quote requests: routes quotes (evidence: `server.js`)
- Web server → Contact messages: routes messages (evidence: `server.js`)
- Web server → Newsletter: routes newsletter (evidence: `server.js`)
- Web server → Administrator accounts: routes users (evidence: `server.js`)
- Web server → Authentication: routes sign-in (evidence: `server.js`)
- Product dispatcher → Product handlers: dispatches categories (evidence: `api/produits/index.js`)
- Product dispatcher → Categories: dispatches category data
- Product handlers → PostgreSQL: reads and writes (evidence: `api/produits/generic.js`)
- Categories → PostgreSQL: reads and writes (evidence: `api/categories/index.js`)
- Gallery → PostgreSQL: reads and writes (evidence: `api/galerie/index.js`)
- Gallery → Blob image storage: uploads and deletes (evidence: `api/galerie/index.js`)
- Blob image storage → Blob CDN: stores images (evidence: `api/lib/blob-upload.js`)
- Product handlers → Image processing: batches image rows (evidence: `api/produits/generic.js`)
- Product handlers → Blob image storage: uploads image data (evidence: `api/produits/generic.js`)
- About and offers → PostgreSQL: reads and writes (evidence: `api/apropos/offers.js`)
- Blog → PostgreSQL: reads and writes (evidence: `api/blog/index.js`)
- Reviews → PostgreSQL: reads and writes (evidence: `api/avis/index.js`)
- Site settings → PostgreSQL: reads and writes (evidence: `api/parametres/index.js`)
- Quote requests → PostgreSQL: reads and writes (evidence: `api/devis/index.js`)
- Contact messages → PostgreSQL: reads and writes (evidence: `api/messages/index.js`)
- Newsletter → PostgreSQL: reads and writes (evidence: `api/newsletter/index.js`)
- Administrator accounts → PostgreSQL: reads and writes (evidence: `api/utilisateurs/index.js`)
- Authentication → PostgreSQL: reads and writes (evidence: `api/auth/index.js`)
