# bensassimohammed/nutrivibe architecture

> Architecture diagram of the GitHub repository bensassimohammed/nutrivibe, 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/bensassimohammed/nutrivibe
- Repository: https://github.com/bensassimohammed/nutrivibe

## Overview

NutriVibe is a storefront and customer portal backed by an admin API. The principal flow is browsing products, managing a cart, and placing an order; administrators manage orders, products, categories, and dashboard data. The frontend also supports authentication, customer profiles/Vibe Club, and an AI-coach capability. The graph shows the visible application routing and sampled service/database calls; README documentation is absent, and some frontend features and backend routes were not sampled, so uncertain links are omitted.

Main entry points: [`frontend/src/App.jsx`](https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/App.jsx) (App router), [`frontend/src/app/core/AppContextProvider.jsx`](https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/app/core/AppContextProvider.jsx) (App providers), [`backend/server.js`](https://github.com/bensassimohammed/nutrivibe/blob/main/backend/server.js) (HTTP API), [`frontend/src/app/core/admin-service.jsx`](https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/app/core/admin-service.jsx) (Admin service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Customer experience"]
  node_app["App router<br/>[App.jsx]"]
  node_landing["Landing<br/>[Landing.jsx]"]
  node_shop["Shop<br/>[Shop.jsx]"]
  node_cart["Cart drawer<br/>[CartDrawer.jsx]"]
  node_auth_ui["Auth modals<br/>[AuthModals.jsx]"]
  node_profile["Vibe Club profile<br/>[Profile.jsx]"]
end

subgraph group_frontend_core["Frontend services"]
  node_context["App providers"]
  node_auth_front["Frontend auth<br/>[auth-service.jsx]"]
  node_navigation["Navigation state"]
  node_products_front["Product service"]
  node_orders_front["Order service<br/>[order-service.jsx]"]
  node_cart_service["Cart service<br/>[cart-service.jsx]"]
  node_coach["AI coach service"]
  node_db_client["Client database services"]
end

subgraph group_admin["Administration"]
  node_admin_ui["Admin views<br/>[Admin.jsx]"]
  node_admin_service["Admin service<br/>[admin-service.jsx]"]
end

subgraph group_backend["Backend and persistence"]
  node_api["HTTP API<br/>[server.js]"]
  node_backend_auth["Authentication service<br/>[auth.service.js]"]
  node_backend_products["Product service<br/>[product.service.js]"]
  node_backend_orders["Order service<br/>[order.service.js]"]
  node_dashboard["Dashboard service"]
  node_database[("PostgreSQL access")]
  node_storage["Image storage<br/>[storage.service.js]"]
end

node_shopper(("Shopper"))
node_object_store[("S3-compatible storage")]

node_shopper -->|"uses"| node_app
node_app -->|"renders"| node_landing
node_app -->|"renders"| node_shop
node_app -->|"renders"| node_cart
node_app -->|"renders"| node_auth_ui
node_app -->|"renders"| node_profile
node_app -->|"routes to"| node_admin_ui
node_app -->|"wraps"| node_context
node_app -->|"reads route state"| node_navigation
node_context -->|"provides"| node_auth_front
node_context -->|"provides"| node_cart_service
node_context -->|"provides"| node_orders_front
node_context -->|"provides"| node_coach
node_context -->|"provides"| node_navigation
node_context -->|"provides"| node_products_front
node_context -->|"provides"| node_admin_service
node_auth_ui -->|"uses"| node_auth_front
node_auth_front -->|"requests login"| node_api
node_admin_ui -->|"uses"| node_admin_service
node_admin_service -->|"requests dashboard"| node_api
node_admin_service -->|"uses"| node_products_front
node_admin_service -->|"uses"| node_orders_front
node_orders_front -->|"uses order data"| node_db_client
node_products_front -->|"uses product data"| node_db_client
node_api -->|"calls"| node_backend_auth
node_api -->|"calls"| node_backend_products
node_api -->|"calls"| node_backend_orders
node_api -->|"calls"| node_dashboard
node_api -->|"uploads images"| node_storage
node_api -->|"initializes"| node_storage
node_backend_auth -->|"queries"| node_database
node_backend_orders -->|"queries"| node_database
node_dashboard -->|"queries"| node_database
node_backend_products -->|"queries"| node_database
node_storage -->|"stores uploads"| node_object_store

click node_app "https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/App.jsx"
click node_landing "https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/app/features/landing/Landing.jsx"
click node_shop "https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/app/features/shop/Shop.jsx"
click node_cart "https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/app/features/cart/CartDrawer.jsx"
click node_auth_ui "https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/app/features/auth/AuthModals.jsx"
click node_profile "https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/app/features/vibe-club/Profile.jsx"
click node_admin_ui "https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/app/features/admin/Admin.jsx"
click node_context "https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/app/core/AppContextProvider.jsx"
click node_auth_front "https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/app/core/auth-service.jsx"
click node_navigation "https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/app/core/navigation-service.jsx"
click node_products_front "https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/app/core/product-service.jsx"
click node_orders_front "https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/app/core/order-service.jsx"
click node_cart_service "https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/app/core/cart-service.jsx"
click node_coach "https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/app/core/ai-coach-service.jsx"
click node_admin_service "https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/app/core/admin-service.jsx"
click node_db_client "https://github.com/bensassimohammed/nutrivibe/tree/main/frontend/src/modules/database/services"
click node_api "https://github.com/bensassimohammed/nutrivibe/blob/main/backend/server.js"
click node_backend_auth "https://github.com/bensassimohammed/nutrivibe/blob/main/backend/src/modules/services/auth.service.js"
click node_backend_products "https://github.com/bensassimohammed/nutrivibe/blob/main/backend/src/modules/services/product.service.js"
click node_backend_orders "https://github.com/bensassimohammed/nutrivibe/blob/main/backend/src/modules/services/order.service.js"
click node_dashboard "https://github.com/bensassimohammed/nutrivibe/blob/main/backend/src/modules/services/dashboard.service.js"
click node_database "https://github.com/bensassimohammed/nutrivibe/blob/main/backend/src/modules/core/database.service.js"
click node_storage "https://github.com/bensassimohammed/nutrivibe/blob/main/backend/src/modules/core/storage.service.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_app,node_landing,node_shop,node_cart,node_auth_ui,node_profile toneBlue
class node_context,node_auth_front,node_navigation,node_products_front,node_orders_front,node_cart_service,node_coach,node_db_client,node_object_store toneAmber
class node_admin_ui,node_admin_service toneMint
class node_api,node_backend_auth,node_backend_products,node_backend_orders,node_dashboard,node_database,node_storage toneRose
class node_shopper toneIndigo
```

## Components

### Customer experience

- [App router](https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Landing](https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/app/features/landing/Landing.jsx): `frontend/src/app/features/landing/Landing.jsx`
- [Shop](https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/app/features/shop/Shop.jsx): `frontend/src/app/features/shop/Shop.jsx`
- [Cart drawer](https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/app/features/cart/CartDrawer.jsx): `frontend/src/app/features/cart/CartDrawer.jsx`
- [Auth modals](https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/app/features/auth/AuthModals.jsx): `frontend/src/app/features/auth/AuthModals.jsx`
- [Vibe Club profile](https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/app/features/vibe-club/Profile.jsx): `frontend/src/app/features/vibe-club/Profile.jsx`

### Frontend services

- [App providers](https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/app/core/AppContextProvider.jsx): `frontend/src/app/core/AppContextProvider.jsx`
- [Frontend auth](https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/app/core/auth-service.jsx): `frontend/src/app/core/auth-service.jsx`
- [Navigation state](https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/app/core/navigation-service.jsx): `frontend/src/app/core/navigation-service.jsx`
- [Product service](https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/app/core/product-service.jsx): `frontend/src/app/core/product-service.jsx`
- [Order service](https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/app/core/order-service.jsx): `frontend/src/app/core/order-service.jsx`
- [Cart service](https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/app/core/cart-service.jsx): `frontend/src/app/core/cart-service.jsx`
- [AI coach service](https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/app/core/ai-coach-service.jsx): `frontend/src/app/core/ai-coach-service.jsx`
- [Client database services](https://github.com/bensassimohammed/nutrivibe/tree/main/frontend/src/modules/database/services): `frontend/src/modules/database/services`

### Administration

- [Admin views](https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/app/features/admin/Admin.jsx): `frontend/src/app/features/admin/Admin.jsx`
- [Admin service](https://github.com/bensassimohammed/nutrivibe/blob/main/frontend/src/app/core/admin-service.jsx): `frontend/src/app/core/admin-service.jsx`

### Backend and persistence

- [HTTP API](https://github.com/bensassimohammed/nutrivibe/blob/main/backend/server.js): `backend/server.js`
- [Authentication service](https://github.com/bensassimohammed/nutrivibe/blob/main/backend/src/modules/services/auth.service.js): `backend/src/modules/services/auth.service.js`
- [Product service](https://github.com/bensassimohammed/nutrivibe/blob/main/backend/src/modules/services/product.service.js): `backend/src/modules/services/product.service.js`
- [Order service](https://github.com/bensassimohammed/nutrivibe/blob/main/backend/src/modules/services/order.service.js): `backend/src/modules/services/order.service.js`
- [Dashboard service](https://github.com/bensassimohammed/nutrivibe/blob/main/backend/src/modules/services/dashboard.service.js): `backend/src/modules/services/dashboard.service.js`
- [PostgreSQL access](https://github.com/bensassimohammed/nutrivibe/blob/main/backend/src/modules/core/database.service.js): `backend/src/modules/core/database.service.js`
- [Image storage](https://github.com/bensassimohammed/nutrivibe/blob/main/backend/src/modules/core/storage.service.js): `backend/src/modules/core/storage.service.js`

### Other components

- **Shopper**
- **S3-compatible storage**

## Connections

- Shopper → App router: uses (evidence: `frontend/src/App.jsx`)
- App router → Landing: renders (evidence: `frontend/src/App.jsx`)
- App router → Shop: renders (evidence: `frontend/src/App.jsx`)
- App router → Cart drawer: renders (evidence: `frontend/src/App.jsx`)
- App router → Auth modals: renders (evidence: `frontend/src/App.jsx`)
- App router → Vibe Club profile: renders (evidence: `frontend/src/App.jsx`)
- App router → Admin views: routes to (evidence: `frontend/src/App.jsx`)
- App router → App providers: wraps (evidence: `frontend/src/App.jsx`)
- App router → Navigation state: reads route state (evidence: `frontend/src/App.jsx`)
- App providers → Frontend auth: provides (evidence: `frontend/src/app/core/AppContextProvider.jsx`)
- App providers → Cart service: provides (evidence: `frontend/src/app/core/AppContextProvider.jsx`)
- App providers → Order service: provides (evidence: `frontend/src/app/core/AppContextProvider.jsx`)
- App providers → AI coach service: provides (evidence: `frontend/src/app/core/AppContextProvider.jsx`)
- App providers → Navigation state: provides (evidence: `frontend/src/app/core/AppContextProvider.jsx`)
- App providers → Product service: provides (evidence: `frontend/src/app/core/AppContextProvider.jsx`)
- App providers → Admin service: provides (evidence: `frontend/src/app/core/AppContextProvider.jsx`)
- Auth modals → Frontend auth: uses
- Frontend auth → HTTP API: requests login (evidence: `frontend/src/app/core/auth-service.jsx`)
- Admin views → Admin service: uses (evidence: `frontend/src/app/features/admin/Admin.jsx`)
- Admin service → HTTP API: requests dashboard (evidence: `frontend/src/app/core/admin-service.jsx`)
- Admin service → Product service: uses (evidence: `frontend/src/app/core/admin-service.jsx`)
- Admin service → Order service: uses (evidence: `frontend/src/app/core/admin-service.jsx`)
- Order service → Client database services: uses order data (evidence: `frontend/src/app/core/order-service.jsx`)
- Product service → Client database services: uses product data (evidence: `frontend/src/app/core/product-service.jsx`)
- HTTP API → Authentication service: calls (evidence: `backend/server.js`)
- HTTP API → Product service: calls (evidence: `backend/server.js`)
- HTTP API → Order service: calls (evidence: `backend/server.js`)
- HTTP API → Dashboard service: calls (evidence: `backend/server.js`)
- HTTP API → Image storage: uploads images (evidence: `backend/server.js`)
- HTTP API → Image storage: initializes (evidence: `backend/server.js`)
- Authentication service → PostgreSQL access: queries (evidence: `backend/src/modules/services/auth.service.js`)
- Order service → PostgreSQL access: queries (evidence: `backend/src/modules/services/order.service.js`)
- Dashboard service → PostgreSQL access: queries (evidence: `backend/src/modules/services/dashboard.service.js`)
- Product service → PostgreSQL access: queries (evidence: `backend/src/modules/services/product.service.js`)
- Image storage → S3-compatible storage: stores uploads (evidence: `backend/src/modules/core/storage.service.js`)
