# fitandsleek-official/fitandsleek-official-v3 architecture

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

- Interactive diagram: https://gitdiagram.com/fitandsleek-official/fitandsleek-official-v3
- Repository: https://github.com/fitandsleek-official/fitandsleek-official-v3

## Overview

FitandSleek Pro is a multi-client commerce platform: shoppers browse and check out through the React storefront, while staff manage catalog, orders, inventory, and reporting through the admin UI. Both are documented as Laravel API clients; the README also identifies a Flutter mobile storefront. Laravel owns the domain records and key commerce stages, with optional Telegram and AI capabilities alongside them. The graph preserves README-documented product areas, but source-level links are limited to relationships visible in supplied excerpts or the SOURCE INDEX.

Main entry points: [`backend/routes/api.php`](https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/backend/routes/api.php) (Laravel API), [`backend/app/Models/Order.php`](https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/backend/app/Models/Order.php) (Orders and payments), [`frontend/src/pages/admin/CompleteHomepageManager.jsx`](https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/frontend/src/pages/admin/CompleteHomepageManager.jsx) (Admin console), [`backend/app/Services/ReplacementFulfillmentService.php`](https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/backend/app/Services/ReplacementFulfillmentService.php) (Replacements)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Commerce clients"]
  node_web["React storefront<br/>[App.jsx]"]
  node_adminui["Admin console"]
  node_mobile["Flutter app"]
end

subgraph group_commerce["Commerce API"]
  node_api["Laravel API<br/>[api.php]"]
  node_auth["Authentication<br/>[AuthController.php]"]
  node_catalog["Catalog and search"]
  node_product[("Product records<br/>[Product.php]")]
  node_cart["Cart and checkout<br/>[CartController.php]"]
  node_orders[("Orders and payments<br/>[Order.php]")]
  node_fulfillment[("Shipment tracking<br/>[Shipment.php]")]
  node_replacement["Replacements"]
end

subgraph group_operations["Operations"]
  node_adminapi["Admin operations API"]
  node_inventory[("Inventory and stock")]
  node_reports["Sales reporting"]
end

subgraph group_integrations["Integrations"]
  node_telegram["Telegram commerce"]
  node_ai["AI services<br/>[main.py]"]
  node_faqai["AI chat service<br/>[app.py]"]
end

node_shopper(("Shopper"))
node_staff(("Staff"))
node_db[("PostgreSQL")]
node_paymentprovider["Payment providers"]

node_shopper -->|"browses and buys"| node_web
node_staff -->|"manages store"| node_adminui
node_web -.->|"API requests"| node_api
node_adminui -->|"API requests"| node_api
node_mobile -->|"uses API"| node_api
node_api -.->|"routes requests"| node_auth
node_api -.->|"routes requests"| node_catalog
node_api -.->|"routes requests"| node_cart
node_catalog -->|"reads products"| node_product
node_cart -.->|"creates orders"| node_orders
node_orders -.->|"processes payment"| node_paymentprovider
node_orders -.->|"tracks shipment"| node_fulfillment
node_orders -.->|"opens cases"| node_replacement
node_replacement -->|"consumes stock"| node_inventory
node_replacement -->|"creates replacement order"| node_orders
node_adminui -.->|"admin requests"| node_adminapi
node_adminapi -.->|"manages stock"| node_inventory
node_reports -->|"queries sales"| node_orders
node_telegram -->|"reads order"| node_orders
node_telegram -->|"sends invoice"| node_paymentprovider
node_faqai -.->|"AI integration"| node_ai
node_api -.->|"persists commerce data"| node_db

click node_web "https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/frontend/src/App.jsx"
click node_adminui "https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/frontend/src/pages/admin/CompleteHomepageManager.jsx"
click node_mobile "https://github.com/fitandsleek-official/fitandsleek-official-v3/tree/main/mobile"
click node_api "https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/backend/routes/api.php"
click node_auth "https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/backend/app/Http/Controllers/Api/AuthController.php"
click node_catalog "https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/backend/app/Http/Controllers/Api/Storefront/ProductController.php"
click node_product "https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/backend/app/Models/Product.php"
click node_cart "https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/backend/app/Http/Controllers/Api/Storefront/CartController.php"
click node_orders "https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/backend/app/Models/Order.php"
click node_fulfillment "https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/backend/app/Models/Shipment.php"
click node_replacement "https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/backend/app/Services/ReplacementFulfillmentService.php"
click node_adminapi "https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/backend/app/Http/Controllers/Api/Admin/ProductAdminController.php"
click node_inventory "https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/backend/app/Services/InventoryLotService.php"
click node_reports "https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/backend/app/Http/Controllers/Api/Admin/ReportController.php"
click node_telegram "https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/backend/app/Http/Controllers/Api/TelegramWebhookController.php"
click node_ai "https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/ai-service/main.py"
click node_faqai "https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/fitandsleekAIchat/app.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_web,node_adminui,node_mobile toneBlue
class node_api,node_auth,node_catalog,node_product,node_cart,node_orders,node_fulfillment,node_replacement,node_db toneAmber
class node_adminapi,node_inventory,node_reports toneMint
class node_telegram,node_ai,node_faqai toneRose
class node_shopper,node_staff,node_paymentprovider toneIndigo
```

## Components

### Commerce clients

- [React storefront](https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Admin console](https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/frontend/src/pages/admin/CompleteHomepageManager.jsx): `frontend/src/pages/admin/CompleteHomepageManager.jsx`
- [Flutter app](https://github.com/fitandsleek-official/fitandsleek-official-v3/tree/main/mobile): `mobile`

### Commerce API

- [Laravel API](https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/backend/routes/api.php): `backend/routes/api.php`
- [Authentication](https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/backend/app/Http/Controllers/Api/AuthController.php): `backend/app/Http/Controllers/Api/AuthController.php`
- [Catalog and search](https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/backend/app/Http/Controllers/Api/Storefront/ProductController.php): `backend/app/Http/Controllers/Api/Storefront/ProductController.php`
- [Product records](https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/backend/app/Models/Product.php): `backend/app/Models/Product.php`
- [Cart and checkout](https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/backend/app/Http/Controllers/Api/Storefront/CartController.php): `backend/app/Http/Controllers/Api/Storefront/CartController.php`
- [Orders and payments](https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/backend/app/Models/Order.php): `backend/app/Models/Order.php`
- [Shipment tracking](https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/backend/app/Models/Shipment.php): `backend/app/Models/Shipment.php`
- [Replacements](https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/backend/app/Services/ReplacementFulfillmentService.php): `backend/app/Services/ReplacementFulfillmentService.php`

### Operations

- [Admin operations API](https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/backend/app/Http/Controllers/Api/Admin/ProductAdminController.php): `backend/app/Http/Controllers/Api/Admin/ProductAdminController.php`
- [Inventory and stock](https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/backend/app/Services/InventoryLotService.php): `backend/app/Services/InventoryLotService.php`
- [Sales reporting](https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/backend/app/Http/Controllers/Api/Admin/ReportController.php): `backend/app/Http/Controllers/Api/Admin/ReportController.php`

### Integrations

- [Telegram commerce](https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/backend/app/Http/Controllers/Api/TelegramWebhookController.php): `backend/app/Http/Controllers/Api/TelegramWebhookController.php`
- [AI services](https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/ai-service/main.py): `ai-service/main.py`
- [AI chat service](https://github.com/fitandsleek-official/fitandsleek-official-v3/blob/main/fitandsleekAIchat/app.py): `fitandsleekAIchat/app.py`

### Other components

- **Shopper**
- **Staff**
- **PostgreSQL**
- **Payment providers**

## Connections

- Shopper → React storefront: browses and buys (evidence: `README.md`)
- Staff → Admin console: manages store (evidence: `README.md`)
- React storefront → Laravel API: API requests (evidence: `README.md`)
- Admin console → Laravel API: API requests (evidence: `frontend/src/pages/admin/CompleteHomepageManager.jsx`)
- Flutter app → Laravel API: uses API (evidence: `README.md`)
- Laravel API → Authentication: routes requests
- Laravel API → Catalog and search: routes requests
- Laravel API → Cart and checkout: routes requests
- Catalog and search → Product records: reads products (evidence: `backend/app/Http/Controllers/Api/Storefront/ProductController.php`)
- Cart and checkout → Orders and payments: creates orders
- Orders and payments → Payment providers: processes payment
- Orders and payments → Shipment tracking: tracks shipment (evidence: `backend/app/Models/Order.php`)
- Orders and payments → Replacements: opens cases (evidence: `backend/app/Services/ReplacementFulfillmentService.php`)
- Replacements → Inventory and stock: consumes stock (evidence: `backend/app/Services/ReplacementFulfillmentService.php`)
- Replacements → Orders and payments: creates replacement order (evidence: `backend/app/Services/ReplacementFulfillmentService.php`)
- Admin console → Admin operations API: admin requests
- Admin operations API → Inventory and stock: manages stock
- Sales reporting → Orders and payments: queries sales (evidence: `backend/app/Http/Controllers/Api/Admin/ReportController.php`)
- Telegram commerce → Orders and payments: reads order (evidence: `backend/app/Http/Controllers/Api/TelegramWebhookController.php`)
- Telegram commerce → Payment providers: sends invoice (evidence: `backend/app/Http/Controllers/Api/TelegramWebhookController.php`)
- AI chat service → AI services: AI integration
- Laravel API → PostgreSQL: persists commerce data
