# mg7434209-hue/geseticaret architecture

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

- Interactive diagram: https://gitdiagram.com/mg7434209-hue/geseticaret
- Repository: https://github.com/mg7434209-hue/geseticaret

## Overview

GES MARKETİM is a solar-product dropshipping storefront with an admin catalog and order-management interface. The main customer journey is browsing products, adding them to a persistent cart, checking out, and viewing order confirmation; the backend validates prices and records orders. Separate capabilities include customer accounts, admin catalog and supplier management, supplier CSV synchronization, payment processing, SEO/sitemaps, and an assistant/calculation service. Edges are limited to excerpted imports/calls and explicit README statements; several route internals are unsampled.

Main entry points: [`backend/src/index.ts`](https://github.com/mg7434209-hue/geseticaret/blob/main/backend/src/index.ts) (Express API), [`backend/src/routes/admin.ts`](https://github.com/mg7434209-hue/geseticaret/blob/main/backend/src/routes/admin.ts) (Admin routes), [`backend/src/db/schema.ts`](https://github.com/mg7434209-hue/geseticaret/blob/main/backend/src/db/schema.ts) (Commerce database), [`backend/src/routes/orders.ts`](https://github.com/mg7434209-hue/geseticaret/blob/main/backend/src/routes/orders.ts) (Order handling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_store["Storefront routes<br/>[App.tsx]"]
  node_browse["Product browsing<br/>[Products.tsx]"]
  node_productui["Product UI<br/>[product-ui.tsx]"]
  node_cart["Persistent cart<br/>[CartContext.tsx]"]
  node_checkout["Checkout<br/>[Checkout.tsx]"]
  node_customerctx["Customer sessions"]
  node_frontendapi["API client<br/>[api.ts]"]
end

subgraph group_commerce["Commerce API"]
  node_server["Express API<br/>[index.ts]"]
  node_catalog["Catalog routes<br/>[catalog.ts]"]
  node_orders["Order handling<br/>[orders.ts]"]
  node_accounts["Account routes<br/>[account.ts]"]
  node_payment["Payment routes<br/>[payment.ts]"]
end

subgraph group_operations["Admin and Catalog Ops"]
  node_adminui["Admin interface<br/>[AdminProducts.tsx]"]
  node_adminapi["Admin routes<br/>[admin.ts]"]
  node_sync["Supplier CSV sync<br/>[engine.ts]"]
end

subgraph group_platform["Data and Services"]
  node_pricing["Price resolution<br/>[resolvePrice.ts]"]
  node_database[("Commerce database<br/>[schema.ts]")]
  node_adminauth["Admin authentication<br/>[auth.ts]"]
  node_customerauth["Customer authentication<br/>[customerAuth.ts]"]
end

subgraph group_discovery["Discovery and SEO"]
  node_seo["SEO metadata<br/>[seo.ts]"]
  node_sitemap["Dynamic sitemap<br/>[seo.ts]"]
  node_assistant["Solar assistant<br/>[asistan.ts]"]
end

node_shopper(("Shopper"))
node_iyzico{{"iyzico"}}
node_cloudinary{{"Image hosting"}}

node_shopper -->|"browses"| node_store
node_store -->|"routes to"| node_browse
node_browse -->|"requests catalog"| node_frontendapi
node_browse -->|"renders products"| node_productui
node_productui -->|"adds items"| node_cart
node_cart -->|"refreshes products"| node_frontendapi
node_checkout -->|"uses cart"| node_cart
node_checkout -->|"creates order"| node_frontendapi
node_checkout -->|"uses profile"| node_customerctx
node_frontendapi -->|"HTTP requests"| node_server
node_server -->|"mounts routes"| node_catalog
node_server -->|"mounts routes"| node_orders
node_server -->|"mounts routes"| node_accounts
node_server -->|"mounts routes"| node_payment
node_server -->|"mounts routes"| node_adminapi
node_orders -->|"reads and writes"| node_database
node_catalog -.->|"reads catalog"| node_database
node_orders -.->|"validates prices"| node_pricing
node_orders -->|"checks session"| node_customerauth
node_customerctx -->|"calls account API"| node_frontendapi
node_accounts -.->|"reads and writes"| node_database
node_accounts -.->|"uses sessions"| node_customerauth
node_adminui -->|"admin requests"| node_adminapi
node_adminapi -->|"guards routes"| node_adminauth
node_adminapi -->|"manages catalog"| node_database
node_adminapi -->|"resolves prices"| node_pricing
node_adminapi -->|"runs imports"| node_sync
node_sync -->|"resolves prices"| node_pricing
node_sync -->|"updates catalog"| node_database
node_adminapi -.->|"uploads images"| node_cloudinary
node_payment -.->|"verifies callback"| node_iyzico
node_orders -.->|"starts card checkout"| node_iyzico
node_store -->|"sets page metadata"| node_seo
node_server -->|"mounts routes"| node_sitemap
node_sitemap -.->|"reads active catalog"| node_database
node_shopper -.->|"asks questions"| node_assistant
node_server -->|"mounts routes"| node_assistant

click node_store "https://github.com/mg7434209-hue/geseticaret/blob/main/frontend/src/App.tsx"
click node_browse "https://github.com/mg7434209-hue/geseticaret/blob/main/frontend/src/pages/Products.tsx"
click node_productui "https://github.com/mg7434209-hue/geseticaret/blob/main/frontend/src/components/product-ui.tsx"
click node_cart "https://github.com/mg7434209-hue/geseticaret/blob/main/frontend/src/cart/CartContext.tsx"
click node_checkout "https://github.com/mg7434209-hue/geseticaret/blob/main/frontend/src/pages/Checkout.tsx"
click node_customerctx "https://github.com/mg7434209-hue/geseticaret/blob/main/frontend/src/auth/CustomerContext.tsx"
click node_frontendapi "https://github.com/mg7434209-hue/geseticaret/blob/main/frontend/src/lib/api.ts"
click node_server "https://github.com/mg7434209-hue/geseticaret/blob/main/backend/src/index.ts"
click node_catalog "https://github.com/mg7434209-hue/geseticaret/blob/main/backend/src/routes/catalog.ts"
click node_orders "https://github.com/mg7434209-hue/geseticaret/blob/main/backend/src/routes/orders.ts"
click node_accounts "https://github.com/mg7434209-hue/geseticaret/blob/main/backend/src/routes/account.ts"
click node_payment "https://github.com/mg7434209-hue/geseticaret/blob/main/backend/src/routes/payment.ts"
click node_adminui "https://github.com/mg7434209-hue/geseticaret/blob/main/frontend/src/admin/AdminProducts.tsx"
click node_adminapi "https://github.com/mg7434209-hue/geseticaret/blob/main/backend/src/routes/admin.ts"
click node_sync "https://github.com/mg7434209-hue/geseticaret/blob/main/backend/src/lib/sync/engine.ts"
click node_pricing "https://github.com/mg7434209-hue/geseticaret/blob/main/backend/src/db/resolvePrice.ts"
click node_database "https://github.com/mg7434209-hue/geseticaret/blob/main/backend/src/db/schema.ts"
click node_adminauth "https://github.com/mg7434209-hue/geseticaret/blob/main/backend/src/lib/auth.ts"
click node_customerauth "https://github.com/mg7434209-hue/geseticaret/blob/main/backend/src/lib/customerAuth.ts"
click node_seo "https://github.com/mg7434209-hue/geseticaret/blob/main/frontend/src/lib/seo.ts"
click node_sitemap "https://github.com/mg7434209-hue/geseticaret/blob/main/backend/src/routes/seo.ts"
click node_assistant "https://github.com/mg7434209-hue/geseticaret/blob/main/backend/src/routes/asistan.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_store,node_browse,node_productui,node_cart,node_checkout,node_customerctx,node_frontendapi toneBlue
class node_server,node_catalog,node_orders,node_accounts,node_payment toneAmber
class node_adminui,node_adminapi,node_sync toneMint
class node_pricing,node_database,node_adminauth,node_customerauth toneRose
class node_seo,node_sitemap,node_assistant,node_shopper,node_iyzico,node_cloudinary toneIndigo
```

## Components

### Storefront

- [Storefront routes](https://github.com/mg7434209-hue/geseticaret/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Product browsing](https://github.com/mg7434209-hue/geseticaret/blob/main/frontend/src/pages/Products.tsx): `frontend/src/pages/Products.tsx`
- [Product UI](https://github.com/mg7434209-hue/geseticaret/blob/main/frontend/src/components/product-ui.tsx): `frontend/src/components/product-ui.tsx`
- [Persistent cart](https://github.com/mg7434209-hue/geseticaret/blob/main/frontend/src/cart/CartContext.tsx): `frontend/src/cart/CartContext.tsx`
- [Checkout](https://github.com/mg7434209-hue/geseticaret/blob/main/frontend/src/pages/Checkout.tsx): `frontend/src/pages/Checkout.tsx`
- [Customer sessions](https://github.com/mg7434209-hue/geseticaret/blob/main/frontend/src/auth/CustomerContext.tsx): `frontend/src/auth/CustomerContext.tsx`
- [API client](https://github.com/mg7434209-hue/geseticaret/blob/main/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`

### Commerce API

- [Express API](https://github.com/mg7434209-hue/geseticaret/blob/main/backend/src/index.ts): `backend/src/index.ts`
- [Catalog routes](https://github.com/mg7434209-hue/geseticaret/blob/main/backend/src/routes/catalog.ts): `backend/src/routes/catalog.ts`
- [Order handling](https://github.com/mg7434209-hue/geseticaret/blob/main/backend/src/routes/orders.ts): `backend/src/routes/orders.ts`
- [Account routes](https://github.com/mg7434209-hue/geseticaret/blob/main/backend/src/routes/account.ts): `backend/src/routes/account.ts`
- [Payment routes](https://github.com/mg7434209-hue/geseticaret/blob/main/backend/src/routes/payment.ts): `backend/src/routes/payment.ts`

### Admin and Catalog Ops

- [Admin interface](https://github.com/mg7434209-hue/geseticaret/blob/main/frontend/src/admin/AdminProducts.tsx): `frontend/src/admin/AdminProducts.tsx`
- [Admin routes](https://github.com/mg7434209-hue/geseticaret/blob/main/backend/src/routes/admin.ts): `backend/src/routes/admin.ts`
- [Supplier CSV sync](https://github.com/mg7434209-hue/geseticaret/blob/main/backend/src/lib/sync/engine.ts): `backend/src/lib/sync/engine.ts`

### Data and Services

- [Price resolution](https://github.com/mg7434209-hue/geseticaret/blob/main/backend/src/db/resolvePrice.ts): `backend/src/db/resolvePrice.ts`
- [Commerce database](https://github.com/mg7434209-hue/geseticaret/blob/main/backend/src/db/schema.ts): `backend/src/db/schema.ts`
- [Admin authentication](https://github.com/mg7434209-hue/geseticaret/blob/main/backend/src/lib/auth.ts): `backend/src/lib/auth.ts`
- [Customer authentication](https://github.com/mg7434209-hue/geseticaret/blob/main/backend/src/lib/customerAuth.ts): `backend/src/lib/customerAuth.ts`

### Discovery and SEO

- [SEO metadata](https://github.com/mg7434209-hue/geseticaret/blob/main/frontend/src/lib/seo.ts): `frontend/src/lib/seo.ts`
- [Dynamic sitemap](https://github.com/mg7434209-hue/geseticaret/blob/main/backend/src/routes/seo.ts): `backend/src/routes/seo.ts`
- [Solar assistant](https://github.com/mg7434209-hue/geseticaret/blob/main/backend/src/routes/asistan.ts): `backend/src/routes/asistan.ts`

### Other components

- **Shopper**
- **iyzico**
- **Image hosting**

## Connections

- Shopper → Storefront routes: browses (evidence: `frontend/src/App.tsx`)
- Storefront routes → Product browsing: routes to (evidence: `frontend/src/App.tsx`)
- Product browsing → API client: requests catalog (evidence: `frontend/src/lib/api.ts`)
- Product browsing → Product UI: renders products (evidence: `frontend/src/pages/Products.tsx`)
- Product UI → Persistent cart: adds items (evidence: `frontend/src/components/product-ui.tsx`)
- Persistent cart → API client: refreshes products (evidence: `frontend/src/cart/CartContext.tsx`)
- Checkout → Persistent cart: uses cart (evidence: `frontend/src/pages/Checkout.tsx`)
- Checkout → API client: creates order (evidence: `frontend/src/lib/api.ts`)
- Checkout → Customer sessions: uses profile (evidence: `frontend/src/pages/Checkout.tsx`)
- API client → Express API: HTTP requests (evidence: `README.md`)
- Express API → Catalog routes: mounts routes (evidence: `backend/src/index.ts`)
- Express API → Order handling: mounts routes (evidence: `backend/src/index.ts`)
- Express API → Account routes: mounts routes (evidence: `backend/src/index.ts`)
- Express API → Payment routes: mounts routes (evidence: `backend/src/index.ts`)
- Express API → Admin routes: mounts routes (evidence: `backend/src/index.ts`)
- Order handling → Commerce database: reads and writes (evidence: `backend/src/routes/orders.ts`)
- Catalog routes → Commerce database: reads catalog
- Order handling → Price resolution: validates prices
- Order handling → Customer authentication: checks session (evidence: `backend/src/routes/orders.ts`)
- Customer sessions → API client: calls account API (evidence: `frontend/src/auth/CustomerContext.tsx`)
- Account routes → Commerce database: reads and writes
- Account routes → Customer authentication: uses sessions
- Admin interface → Admin routes: admin requests (evidence: `README.md`)
- Admin routes → Admin authentication: guards routes (evidence: `README.md`)
- Admin routes → Commerce database: manages catalog (evidence: `backend/src/routes/admin.ts`)
- Admin routes → Price resolution: resolves prices (evidence: `backend/src/routes/admin.ts`)
- Admin routes → Supplier CSV sync: runs imports (evidence: `backend/src/routes/admin.ts`)
- Supplier CSV sync → Price resolution: resolves prices (evidence: `backend/src/lib/sync/engine.ts`)
- Supplier CSV sync → Commerce database: updates catalog (evidence: `backend/src/lib/sync/engine.ts`)
- Admin routes → Image hosting: uploads images
- Payment routes → iyzico: verifies callback
- Order handling → iyzico: starts card checkout
- Storefront routes → SEO metadata: sets page metadata (evidence: `README.md`)
- Express API → Dynamic sitemap: mounts routes (evidence: `backend/src/index.ts`)
- Dynamic sitemap → Commerce database: reads active catalog
- Shopper → Solar assistant: asks questions
- Express API → Solar assistant: mounts routes (evidence: `backend/src/index.ts`)
