# ravaly23/e-commerce-ved architecture

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

- Interactive diagram: https://gitdiagram.com/ravaly23/e-commerce-ved
- Repository: https://github.com/ravaly23/e-commerce-ved

## Overview

This is a React/TypeScript marketplace frontend for browsing and favoriting articles, managing a cart and orders, and supporting buyer, seller, and admin accounts. The main flow is browser entry → routed pages → product/account actions → shared state and the API client. The graph preserves major routes and core modules named in the source index; unsampled pages are represented by their exact paths, but their internal behavior is not assumed. Edges reflect shown imports, route configuration, or explicit calls.

Main entry points: [`src/App.tsx`](https://github.com/ravaly23/e-commerce-ved/blob/main/src/App.tsx) (Route configuration), [`src/services/api.ts`](https://github.com/ravaly23/e-commerce-ved/blob/main/src/services/api.ts) (API client), [`src/Pages/ArticleDetail.tsx`](https://github.com/ravaly23/e-commerce-ved/blob/main/src/Pages/ArticleDetail.tsx) (Article detail), [`src/main.tsx`](https://github.com/ravaly23/e-commerce-ved/blob/main/src/main.tsx) (React entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Marketplace"]
  node_home["Marketplace home<br/>[Home.tsx]"]
  node_catalog["Article listing<br/>[ArticleCard.tsx]"]
  node_article["Article detail<br/>[ArticleDetail.tsx]"]
  node_favorites["Favorites<br/>[FavoritesPage.tsx]"]
  node_cart["Shopping cart<br/>[CartPage.tsx]"]
  node_orders["Order history"]
end

subgraph group_accounts["Accounts"]
  node_auth_page["Authentication"]
  node_buyer_profile["Buyer profile<br/>[ProfilAcheteur.tsx]"]
end

subgraph group_operations["Seller and admin"]
  node_seller["Seller workspace<br/>[Dashboard.tsx]"]
  node_listing["Article management<br/>[AddArticle.tsx]"]
  node_admin["Admin console<br/>[Admin.tsx]"]
end

subgraph group_runtime["Shared runtime"]
  node_entry["React entry<br/>[main.tsx]"]
  node_router["Route configuration<br/>[App.tsx]"]
  node_cart_state["Cart state<br/>[CartContext.tsx]"]
  node_cart_hook["Cart hook<br/>[useCart.ts]"]
  node_auth_state["Auth state<br/>[AuthContext.tsx]"]
  node_api["API client<br/>[api.ts]"]
end

node_visitor(("Shopper / user"))
node_backend{{"Marketplace API"}}

node_visitor -->|"opens"| node_entry
node_entry -->|"mounts"| node_router
node_router -->|"routes"| node_home
node_router -->|"routes"| node_favorites
node_router -->|"routes"| node_cart
node_router -->|"routes"| node_orders
node_router -->|"routes"| node_article
node_router -->|"routes"| node_buyer_profile
node_router -->|"routes"| node_auth_page
node_router -->|"routes"| node_seller
node_router -->|"routes"| node_listing
node_router -->|"routes"| node_admin
node_entry -->|"provides"| node_auth_state
node_entry -->|"provides"| node_cart_state
node_catalog -->|"delegates cart"| node_cart_hook
node_cart_hook -->|"reads context"| node_cart_state
node_article -->|"uses cart"| node_cart_hook
node_article -->|"uses context"| node_cart_state
node_favorites -->|"renders cards"| node_catalog
node_favorites -->|"uses cart"| node_cart_hook
node_auth_state -->|"sends login"| node_api
node_router -->|"loads articles"| node_api
node_router -->|"loads favorites"| node_favorites
node_router -->|"loads profile data"| node_buyer_profile
node_article -->|"requests article"| node_api
node_buyer_profile -->|"requests account data"| node_api
node_listing -->|"submits listing"| node_api
node_admin -.->|"uses API"| node_api
node_api -->|"sends HTTP"| node_backend

click node_entry "https://github.com/ravaly23/e-commerce-ved/blob/main/src/main.tsx"
click node_router "https://github.com/ravaly23/e-commerce-ved/blob/main/src/App.tsx"
click node_home "https://github.com/ravaly23/e-commerce-ved/blob/main/src/Pages/Home.tsx"
click node_catalog "https://github.com/ravaly23/e-commerce-ved/blob/main/src/components/ArticleCard.tsx"
click node_article "https://github.com/ravaly23/e-commerce-ved/blob/main/src/Pages/ArticleDetail.tsx"
click node_favorites "https://github.com/ravaly23/e-commerce-ved/blob/main/src/Pages/FavoritesPage.tsx"
click node_cart "https://github.com/ravaly23/e-commerce-ved/blob/main/src/Pages/CartPage.tsx"
click node_orders "https://github.com/ravaly23/e-commerce-ved/blob/main/src/Pages/OrderHistoryPage.tsx"
click node_cart_state "https://github.com/ravaly23/e-commerce-ved/blob/main/src/context/CartContext.tsx"
click node_cart_hook "https://github.com/ravaly23/e-commerce-ved/blob/main/src/hooks/useCart.ts"
click node_auth_page "https://github.com/ravaly23/e-commerce-ved/blob/main/src/Pages/Authentification.tsx"
click node_auth_state "https://github.com/ravaly23/e-commerce-ved/blob/main/src/context/AuthContext.tsx"
click node_buyer_profile "https://github.com/ravaly23/e-commerce-ved/blob/main/src/Pages/ProfilAcheteur.tsx"
click node_seller "https://github.com/ravaly23/e-commerce-ved/blob/main/src/Pages/Dashboard.tsx"
click node_listing "https://github.com/ravaly23/e-commerce-ved/blob/main/src/Pages/AddArticle.tsx"
click node_admin "https://github.com/ravaly23/e-commerce-ved/blob/main/src/Pages/Admin.tsx"
click node_api "https://github.com/ravaly23/e-commerce-ved/blob/main/src/services/api.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_home,node_catalog,node_article,node_favorites,node_cart,node_orders,node_visitor toneBlue
class node_auth_page,node_buyer_profile toneAmber
class node_seller,node_listing,node_admin,node_backend toneMint
class node_entry,node_router,node_cart_state,node_cart_hook,node_auth_state,node_api toneRose
```

## Components

### Marketplace

- [Marketplace home](https://github.com/ravaly23/e-commerce-ved/blob/main/src/Pages/Home.tsx): `src/Pages/Home.tsx`
- [Article listing](https://github.com/ravaly23/e-commerce-ved/blob/main/src/components/ArticleCard.tsx): `src/components/ArticleCard.tsx`
- [Article detail](https://github.com/ravaly23/e-commerce-ved/blob/main/src/Pages/ArticleDetail.tsx): `src/Pages/ArticleDetail.tsx`
- [Favorites](https://github.com/ravaly23/e-commerce-ved/blob/main/src/Pages/FavoritesPage.tsx): `src/Pages/FavoritesPage.tsx`
- [Shopping cart](https://github.com/ravaly23/e-commerce-ved/blob/main/src/Pages/CartPage.tsx): `src/Pages/CartPage.tsx`
- [Order history](https://github.com/ravaly23/e-commerce-ved/blob/main/src/Pages/OrderHistoryPage.tsx): `src/Pages/OrderHistoryPage.tsx`

### Accounts

- [Authentication](https://github.com/ravaly23/e-commerce-ved/blob/main/src/Pages/Authentification.tsx): `src/Pages/Authentification.tsx`
- [Buyer profile](https://github.com/ravaly23/e-commerce-ved/blob/main/src/Pages/ProfilAcheteur.tsx): `src/Pages/ProfilAcheteur.tsx`

### Seller and admin

- [Seller workspace](https://github.com/ravaly23/e-commerce-ved/blob/main/src/Pages/Dashboard.tsx): `src/Pages/Dashboard.tsx`
- [Article management](https://github.com/ravaly23/e-commerce-ved/blob/main/src/Pages/AddArticle.tsx): `src/Pages/AddArticle.tsx`
- [Admin console](https://github.com/ravaly23/e-commerce-ved/blob/main/src/Pages/Admin.tsx): `src/Pages/Admin.tsx`

### Shared runtime

- [React entry](https://github.com/ravaly23/e-commerce-ved/blob/main/src/main.tsx): `src/main.tsx`
- [Route configuration](https://github.com/ravaly23/e-commerce-ved/blob/main/src/App.tsx): `src/App.tsx`
- [Cart state](https://github.com/ravaly23/e-commerce-ved/blob/main/src/context/CartContext.tsx): `src/context/CartContext.tsx`
- [Cart hook](https://github.com/ravaly23/e-commerce-ved/blob/main/src/hooks/useCart.ts): `src/hooks/useCart.ts`
- [Auth state](https://github.com/ravaly23/e-commerce-ved/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [API client](https://github.com/ravaly23/e-commerce-ved/blob/main/src/services/api.ts): `src/services/api.ts`

### Other components

- **Shopper / user**
- **Marketplace API**

## Connections

- Shopper / user → React entry: opens (evidence: `src/main.tsx`)
- React entry → Route configuration: mounts (evidence: `src/main.tsx`)
- Route configuration → Marketplace home: routes (evidence: `src/App.tsx`)
- Route configuration → Favorites: routes (evidence: `src/App.tsx`)
- Route configuration → Shopping cart: routes (evidence: `src/App.tsx`)
- Route configuration → Order history: routes (evidence: `src/App.tsx`)
- Route configuration → Article detail: routes (evidence: `src/App.tsx`)
- Route configuration → Buyer profile: routes (evidence: `src/App.tsx`)
- Route configuration → Authentication: routes (evidence: `src/App.tsx`)
- Route configuration → Seller workspace: routes (evidence: `src/App.tsx`)
- Route configuration → Article management: routes (evidence: `src/App.tsx`)
- Route configuration → Admin console: routes (evidence: `src/App.tsx`)
- React entry → Auth state: provides (evidence: `src/main.tsx`)
- React entry → Cart state: provides (evidence: `src/main.tsx`)
- Article listing → Cart hook: delegates cart (evidence: `src/components/ArticleCard.tsx`)
- Cart hook → Cart state: reads context (evidence: `src/hooks/useCart.ts`)
- Article detail → Cart hook: uses cart (evidence: `src/Pages/ArticleDetail.tsx`)
- Article detail → Cart state: uses context (evidence: `src/Pages/ArticleDetail.tsx`)
- Favorites → Article listing: renders cards (evidence: `src/Pages/FavoritesPage.tsx`)
- Favorites → Cart hook: uses cart (evidence: `src/Pages/FavoritesPage.tsx`)
- Auth state → API client: sends login (evidence: `src/context/AuthContext.tsx`)
- Route configuration → API client: loads articles (evidence: `src/App.tsx`)
- Route configuration → Favorites: loads favorites (evidence: `src/App.tsx`)
- Route configuration → Buyer profile: loads profile data (evidence: `src/App.tsx`)
- Article detail → API client: requests article (evidence: `src/Pages/ArticleDetail.tsx`)
- Buyer profile → API client: requests account data (evidence: `src/Pages/ProfilAcheteur.tsx`)
- Article management → API client: submits listing (evidence: `src/Pages/AddArticle.tsx`)
- Admin console → API client: uses API (evidence: `src/Pages/Admin.tsx`)
- API client → Marketplace API: sends HTTP (evidence: `src/services/api.ts`)
