# raneemaz/cedarlink architecture

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

- Interactive diagram: https://gitdiagram.com/raneemaz/cedarlink
- Repository: https://github.com/raneemaz/cedarlink

## Overview

CedarLink is a multi-vendor marketplace: customers discover local stores and products, manage a multi-store cart, preview and place cash-on-delivery orders, then track and review delivered purchases. Vendors manage stores, inventory, availability and fulfilment; admins approve marketplace participants and moderate content. The map separates the React client, Flask routes, business services and SQLAlchemy state. README capabilities are included where source excerpts are absent; those unsampled branches are shown without speculative internal call edges.

Main entry points: [`frontend/src/App.jsx`](https://github.com/raneemaz/cedarlink/blob/main/frontend/src/App.jsx) (Marketplace SPA), [`app/extensions.py`](https://github.com/raneemaz/cedarlink/blob/main/app/extensions.py) (Marketplace database), [`app/routes`](https://github.com/raneemaz/cedarlink/tree/main/app/routes) (JSON API), [`app/services/order_service.py`](https://github.com/raneemaz/cedarlink/blob/main/app/services/order_service.py) (Order lifecycle)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React marketplace"]
  node_spa["Marketplace SPA<br/>[App.jsx]"]
  node_catalog_ui["Storefront discovery"]
  node_checkout_ui["Cart and checkout"]
  node_account_ui["Accounts and settings"]
  node_reviews_ui["Reviews interface"]
  node_admin_ui["Admin console"]
end

subgraph group_http["Flask API"]
  node_api["JSON API"]
  node_store_routes["Store endpoints<br/>[store_routes.py]"]
  node_review_routes["Review endpoints<br/>[review_routes.py]"]
  node_auth_routes["Authentication endpoints<br/>[auth_routes.py]"]
  node_product_routes["Product endpoints<br/>[product_routes.py]"]
end

subgraph group_commerce["Commerce services"]
  node_order_service["Order lifecycle<br/>[order_service.py]"]
  node_store_service["Store availability and location<br/>[store_service.py]"]
  node_coupon_service["Coupon rules<br/>[coupon_service.py]"]
end

subgraph group_trust["Accounts and trust"]
  node_reviews["Review and moderation logic<br/>[review_service.py]"]
  node_two_factor["Two-factor and recovery"]
  node_preferences["Shopping interests"]
  node_notifications["Notifications"]
end

subgraph group_state["Marketplace data"]
  node_database[("Marketplace database<br/>[extensions.py]")]
  node_store_model["Store records<br/>[store.py]"]
  node_product_model["Products and categories<br/>[product.py]"]
  node_order_model["Orders and coupons<br/>[order.py]"]
  node_review_model["Review records<br/>[review.py]"]
end

node_customer(("Customer"))
node_vendor(("Vendor"))
node_admin(("Admin"))

node_customer -->|"uses"| node_spa
node_vendor -->|"uses"| node_spa
node_admin -->|"uses"| node_spa
node_spa -->|"routes to"| node_catalog_ui
node_spa -->|"routes to"| node_checkout_ui
node_spa -->|"routes to"| node_account_ui
node_spa -->|"routes to"| node_admin_ui
node_spa -->|"routes to"| node_reviews_ui
node_spa -.->|"calls"| node_api
node_api -->|"dispatches"| node_product_routes
node_api -->|"dispatches"| node_store_routes
node_api -->|"dispatches"| node_auth_routes
node_api -->|"dispatches"| node_review_routes
node_api -->|"dispatches"| node_order_service
node_product_routes -->|"reads interests"| node_preferences
node_store_routes -->|"calls"| node_store_service
node_review_routes -->|"calls"| node_reviews
node_auth_routes -->|"calls"| node_two_factor
node_order_service -->|"validates coupons"| node_coupon_service
node_order_service -->|"checks availability"| node_store_service
node_order_service -->|"notifies"| node_notifications
node_reviews -->|"writes"| node_review_model
node_order_service -->|"writes orders"| node_order_model
node_store_service -->|"updates"| node_store_model
node_product_routes -->|"reads products"| node_product_model
node_coupon_service -->|"uses persistence"| node_database
node_two_factor -->|"uses persistence"| node_database
node_preferences -->|"uses persistence"| node_database
node_notifications -->|"uses persistence"| node_database
node_database -->|"stores"| node_store_model
node_database -->|"stores"| node_product_model
node_database -->|"stores"| node_order_model

click node_spa "https://github.com/raneemaz/cedarlink/blob/main/frontend/src/App.jsx"
click node_catalog_ui "https://github.com/raneemaz/cedarlink/tree/main/frontend/src/pages/Stores"
click node_checkout_ui "https://github.com/raneemaz/cedarlink/tree/main/frontend/src/pages/Checkout"
click node_account_ui "https://github.com/raneemaz/cedarlink/tree/main/frontend/src/pages/Settings"
click node_reviews_ui "https://github.com/raneemaz/cedarlink/tree/main/frontend/src/components/reviews"
click node_admin_ui "https://github.com/raneemaz/cedarlink/tree/main/frontend/src/pages/Admin"
click node_api "https://github.com/raneemaz/cedarlink/tree/main/app/routes"
click node_store_routes "https://github.com/raneemaz/cedarlink/blob/main/app/routes/store_routes.py"
click node_review_routes "https://github.com/raneemaz/cedarlink/blob/main/app/routes/review_routes.py"
click node_auth_routes "https://github.com/raneemaz/cedarlink/blob/main/app/routes/auth_routes.py"
click node_product_routes "https://github.com/raneemaz/cedarlink/blob/main/app/routes/product_routes.py"
click node_order_service "https://github.com/raneemaz/cedarlink/blob/main/app/services/order_service.py"
click node_store_service "https://github.com/raneemaz/cedarlink/blob/main/app/services/store_service.py"
click node_coupon_service "https://github.com/raneemaz/cedarlink/blob/main/app/services/coupon_service.py"
click node_reviews "https://github.com/raneemaz/cedarlink/blob/main/app/services/review_service.py"
click node_two_factor "https://github.com/raneemaz/cedarlink/blob/main/app/services/two_factor_service.py"
click node_preferences "https://github.com/raneemaz/cedarlink/blob/main/app/services/shopping_preferences_service.py"
click node_notifications "https://github.com/raneemaz/cedarlink/blob/main/app/services/notification_service.py"
click node_database "https://github.com/raneemaz/cedarlink/blob/main/app/extensions.py"
click node_store_model "https://github.com/raneemaz/cedarlink/blob/main/app/models/store.py"
click node_product_model "https://github.com/raneemaz/cedarlink/blob/main/app/models/product.py"
click node_order_model "https://github.com/raneemaz/cedarlink/blob/main/app/models/order.py"
click node_review_model "https://github.com/raneemaz/cedarlink/blob/main/app/models/review.py"

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_spa,node_catalog_ui,node_checkout_ui,node_account_ui,node_reviews_ui,node_admin_ui toneBlue
class node_api,node_store_routes,node_review_routes,node_auth_routes,node_product_routes toneAmber
class node_order_service,node_store_service,node_coupon_service toneMint
class node_reviews,node_two_factor,node_preferences,node_notifications toneRose
class node_database,node_store_model,node_product_model,node_order_model,node_review_model,node_customer,node_vendor,node_admin toneIndigo
```

## Components

### React marketplace

- [Marketplace SPA](https://github.com/raneemaz/cedarlink/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Storefront discovery](https://github.com/raneemaz/cedarlink/tree/main/frontend/src/pages/Stores): `frontend/src/pages/Stores`
- [Cart and checkout](https://github.com/raneemaz/cedarlink/tree/main/frontend/src/pages/Checkout): `frontend/src/pages/Checkout`
- [Accounts and settings](https://github.com/raneemaz/cedarlink/tree/main/frontend/src/pages/Settings): `frontend/src/pages/Settings`
- [Reviews interface](https://github.com/raneemaz/cedarlink/tree/main/frontend/src/components/reviews): `frontend/src/components/reviews`
- [Admin console](https://github.com/raneemaz/cedarlink/tree/main/frontend/src/pages/Admin): `frontend/src/pages/Admin`

### Flask API

- [JSON API](https://github.com/raneemaz/cedarlink/tree/main/app/routes): `app/routes`
- [Store endpoints](https://github.com/raneemaz/cedarlink/blob/main/app/routes/store_routes.py): `app/routes/store_routes.py`
- [Review endpoints](https://github.com/raneemaz/cedarlink/blob/main/app/routes/review_routes.py): `app/routes/review_routes.py`
- [Authentication endpoints](https://github.com/raneemaz/cedarlink/blob/main/app/routes/auth_routes.py): `app/routes/auth_routes.py`
- [Product endpoints](https://github.com/raneemaz/cedarlink/blob/main/app/routes/product_routes.py): `app/routes/product_routes.py`

### Commerce services

- [Order lifecycle](https://github.com/raneemaz/cedarlink/blob/main/app/services/order_service.py): `app/services/order_service.py`
- [Store availability and location](https://github.com/raneemaz/cedarlink/blob/main/app/services/store_service.py): `app/services/store_service.py`
- [Coupon rules](https://github.com/raneemaz/cedarlink/blob/main/app/services/coupon_service.py): `app/services/coupon_service.py`

### Accounts and trust

- [Review and moderation logic](https://github.com/raneemaz/cedarlink/blob/main/app/services/review_service.py): `app/services/review_service.py`
- [Two-factor and recovery](https://github.com/raneemaz/cedarlink/blob/main/app/services/two_factor_service.py): `app/services/two_factor_service.py`
- [Shopping interests](https://github.com/raneemaz/cedarlink/blob/main/app/services/shopping_preferences_service.py): `app/services/shopping_preferences_service.py`
- [Notifications](https://github.com/raneemaz/cedarlink/blob/main/app/services/notification_service.py): `app/services/notification_service.py`

### Marketplace data

- [Marketplace database](https://github.com/raneemaz/cedarlink/blob/main/app/extensions.py): `app/extensions.py`
- [Store records](https://github.com/raneemaz/cedarlink/blob/main/app/models/store.py): `app/models/store.py`
- [Products and categories](https://github.com/raneemaz/cedarlink/blob/main/app/models/product.py): `app/models/product.py`
- [Orders and coupons](https://github.com/raneemaz/cedarlink/blob/main/app/models/order.py): `app/models/order.py`
- [Review records](https://github.com/raneemaz/cedarlink/blob/main/app/models/review.py): `app/models/review.py`

### Other components

- **Customer**
- **Vendor**
- **Admin**

## Connections

- Customer → Marketplace SPA: uses
- Vendor → Marketplace SPA: uses
- Admin → Marketplace SPA: uses
- Marketplace SPA → Storefront discovery: routes to (evidence: `frontend/src/App.jsx`)
- Marketplace SPA → Cart and checkout: routes to (evidence: `frontend/src/App.jsx`)
- Marketplace SPA → Accounts and settings: routes to (evidence: `frontend/src/App.jsx`)
- Marketplace SPA → Admin console: routes to (evidence: `frontend/src/App.jsx`)
- Marketplace SPA → Reviews interface: routes to (evidence: `frontend/src/App.jsx`)
- Marketplace SPA → JSON API: calls
- JSON API → Product endpoints: dispatches
- JSON API → Store endpoints: dispatches
- JSON API → Authentication endpoints: dispatches
- JSON API → Review endpoints: dispatches
- JSON API → Order lifecycle: dispatches
- Product endpoints → Shopping interests: reads interests (evidence: `app/routes/product_routes.py`)
- Store endpoints → Store availability and location: calls (evidence: `app/routes/store_routes.py`)
- Review endpoints → Review and moderation logic: calls (evidence: `app/routes/review_routes.py`)
- Authentication endpoints → Two-factor and recovery: calls (evidence: `app/routes/auth_routes.py`)
- Order lifecycle → Coupon rules: validates coupons (evidence: `app/services/order_service.py`)
- Order lifecycle → Store availability and location: checks availability (evidence: `app/services/order_service.py`)
- Order lifecycle → Notifications: notifies (evidence: `app/services/order_service.py`)
- Review and moderation logic → Review records: writes (evidence: `app/services/review_service.py`)
- Order lifecycle → Orders and coupons: writes orders (evidence: `app/services/order_service.py`)
- Store availability and location → Store records: updates (evidence: `app/services/store_service.py`)
- Product endpoints → Products and categories: reads products (evidence: `app/routes/product_routes.py`)
- Coupon rules → Marketplace database: uses persistence (evidence: `app/services/coupon_service.py`)
- Two-factor and recovery → Marketplace database: uses persistence (evidence: `app/services/two_factor_service.py`)
- Shopping interests → Marketplace database: uses persistence (evidence: `app/services/shopping_preferences_service.py`)
- Notifications → Marketplace database: uses persistence (evidence: `app/services/notification_service.py`)
- Marketplace database → Store records: stores (evidence: `app/models/store.py`)
- Marketplace database → Products and categories: stores (evidence: `app/models/product.py`)
- Marketplace database → Orders and coupons: stores (evidence: `app/services/order_service.py`)
