# abanoubtalaatr/grocery-training-project-round-2 architecture

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

- Interactive diagram: https://gitdiagram.com/abanoubtalaatr/grocery-training-project-round-2
- Repository: https://github.com/abanoubtalaatr/grocery-training-project-round-2

## Overview

This is a Laravel backend for a grocery and meal-delivery application, exposing mobile API and web flows. The principal customer journey is account access, catalog discovery, cart management, delivery-address selection, order placement, payment, and order tracking. Other documented capabilities include favorites, reviews, smart lists, notifications, and AI chat; Filament provides administration. Relationships below use the README or SOURCE INDEX references; unsampled route wiring and most subsystem internals are not asserted.

Main entry points: [`app/Http/Controllers/Api/OrderController.php`](https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Http/Controllers/Api/OrderController.php) (Order processing), [`app/Services/AuthService.php`](https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Services/AuthService.php) (Authentication API), [`app/Models/Cart.php`](https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Models/Cart.php) (Cart and items), [`app/Models/Meal.php`](https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Models/Meal.php) (Meals and categories)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and profile"]
  node_auth_api["Authentication API<br/>[AuthService.php]"]
  node_user_data[("User accounts<br/>[User.php]")]
  node_address_api["Address management"]
  node_address_data[("Delivery addresses<br/>[Address.php]")]
end

subgraph group_shopping["Catalog and shopping"]
  node_catalog["Catalog discovery"]
  node_product_data[("Meals and categories<br/>[Meal.php]")]
  node_cart_api["Shopping cart<br/>[CartController.php]"]
  node_cart_data[("Cart and items<br/>[Cart.php]")]
  node_offers[("Offers<br/>[Offer.php]")]
end

subgraph group_fulfillment["Orders and delivery"]
  node_order_api["Order processing"]
  node_order_data[("Orders and items<br/>[Order.php]")]
  node_shipping["Shipping calculation"]
  node_payment["Stripe payments"]
end

subgraph group_engagement["Customer engagement"]
  node_reviews["Meal reviews"]
  node_review_data[("Review records<br/>[Review.php]")]
  node_smart_lists["Smart lists"]
  node_notifications["Notifications"]
  node_chatbot["AI meal chatbot"]
end

subgraph group_operations["Administration"]
  node_admin["Filament administration<br/>[ReviewResource.php]"]
end

node_customer(("Customer"))

node_customer -->|"registers or logs in"| node_auth_api
node_auth_api -->|"authenticates users"| node_user_data
node_auth_api -->|"issues access token"| node_customer
node_customer -->|"browses products"| node_catalog
node_catalog -.->|"queries catalog"| node_product_data
node_customer -->|"manages cart"| node_cart_api
node_cart_api -->|"reads and updates"| node_cart_data
node_cart_data -->|"uses offers"| node_offers
node_customer -->|"manages addresses"| node_address_api
node_address_api -.->|"manages records"| node_address_data
node_customer -->|"places and tracks orders"| node_order_api
node_order_api -->|"reads cart"| node_cart_data
node_order_api -->|"checks meals"| node_product_data
node_order_api -->|"creates orders"| node_order_data
node_order_api -->|"calculates shipping"| node_shipping
node_order_api -.->|"starts checkout"| node_payment
node_customer -->|"pays by card"| node_payment
node_customer -->|"submits reviews"| node_reviews
node_reviews -->|"creates and queries"| node_review_data
node_customer -->|"manages lists"| node_smart_lists
node_customer -->|"manages notifications"| node_notifications
node_customer -->|"asks meal questions"| node_chatbot
node_chatbot -.->|"uses meal context"| node_product_data
node_admin -->|"moderates reviews"| node_review_data

click node_auth_api "https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Services/AuthService.php"
click node_user_data "https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Models/User.php"
click node_address_api "https://github.com/abanoubtalaatr/grocery-training-project-round-2/tree/main/app/Actions/Address"
click node_address_data "https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Models/Address.php"
click node_catalog "https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Http/Controllers/Api/CategoryController.php"
click node_product_data "https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Models/Meal.php"
click node_cart_api "https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Http/Controllers/Web/CartController.php"
click node_cart_data "https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Models/Cart.php"
click node_offers "https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Models/Offer.php"
click node_order_api "https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Http/Controllers/Api/OrderController.php"
click node_order_data "https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Models/Order.php"
click node_shipping "https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Services/ShippingService.php"
click node_payment "https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Services/StripeCheckoutService.php"
click node_reviews "https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Http/Controllers/Api/ReviewController.php"
click node_review_data "https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Models/Review.php"
click node_smart_lists "https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Http/Controllers/Api/SmartListController.php"
click node_notifications "https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Services/NotificationService.php"
click node_chatbot "https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Http/Controllers/Api/ChatbotController.php"
click node_admin "https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Filament/Resources/ReviewResource.php"

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_auth_api,node_user_data,node_address_api,node_address_data toneBlue
class node_catalog,node_product_data,node_cart_api,node_cart_data,node_offers toneAmber
class node_order_api,node_order_data,node_shipping,node_payment toneMint
class node_reviews,node_review_data,node_smart_lists,node_notifications,node_chatbot toneRose
class node_admin,node_customer toneIndigo
```

## Components

### Identity and profile

- [Authentication API](https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Services/AuthService.php): `app/Services/AuthService.php`
- [User accounts](https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Models/User.php): `app/Models/User.php`
- [Address management](https://github.com/abanoubtalaatr/grocery-training-project-round-2/tree/main/app/Actions/Address): `app/Actions/Address`
- [Delivery addresses](https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Models/Address.php): `app/Models/Address.php`

### Catalog and shopping

- [Catalog discovery](https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Http/Controllers/Api/CategoryController.php): `app/Http/Controllers/Api/CategoryController.php`
- [Meals and categories](https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Models/Meal.php): `app/Models/Meal.php`
- [Shopping cart](https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Http/Controllers/Web/CartController.php): `app/Http/Controllers/Web/CartController.php`
- [Cart and items](https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Models/Cart.php): `app/Models/Cart.php`
- [Offers](https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Models/Offer.php): `app/Models/Offer.php`

### Orders and delivery

- [Order processing](https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Http/Controllers/Api/OrderController.php): `app/Http/Controllers/Api/OrderController.php`
- [Orders and items](https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Models/Order.php): `app/Models/Order.php`
- [Shipping calculation](https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Services/ShippingService.php): `app/Services/ShippingService.php`
- [Stripe payments](https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Services/StripeCheckoutService.php): `app/Services/StripeCheckoutService.php`

### Customer engagement

- [Meal reviews](https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Http/Controllers/Api/ReviewController.php): `app/Http/Controllers/Api/ReviewController.php`
- [Review records](https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Models/Review.php): `app/Models/Review.php`
- [Smart lists](https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Http/Controllers/Api/SmartListController.php): `app/Http/Controllers/Api/SmartListController.php`
- [Notifications](https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Services/NotificationService.php): `app/Services/NotificationService.php`
- [AI meal chatbot](https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Http/Controllers/Api/ChatbotController.php): `app/Http/Controllers/Api/ChatbotController.php`

### Administration

- [Filament administration](https://github.com/abanoubtalaatr/grocery-training-project-round-2/blob/main/app/Filament/Resources/ReviewResource.php): `app/Filament/Resources/ReviewResource.php`

### Other components

- **Customer**

## Connections

- Customer → Authentication API: registers or logs in (evidence: `README.md`)
- Authentication API → User accounts: authenticates users (evidence: `app/Services/AuthService.php`)
- Authentication API → Customer: issues access token (evidence: `app/Services/AuthService.php`)
- Customer → Catalog discovery: browses products (evidence: `README.md`)
- Catalog discovery → Meals and categories: queries catalog
- Customer → Shopping cart: manages cart (evidence: `README.md`)
- Shopping cart → Cart and items: reads and updates (evidence: `app/Http/Controllers/Web/CartController.php`)
- Cart and items → Offers: uses offers (evidence: `app/Models/Cart.php`)
- Customer → Address management: manages addresses (evidence: `README.md`)
- Address management → Delivery addresses: manages records
- Customer → Order processing: places and tracks orders (evidence: `README.md`)
- Order processing → Cart and items: reads cart (evidence: `app/Http/Controllers/Api/OrderController.php`)
- Order processing → Meals and categories: checks meals (evidence: `app/Http/Controllers/Api/OrderController.php`)
- Order processing → Orders and items: creates orders (evidence: `app/Http/Controllers/Api/OrderController.php`)
- Order processing → Shipping calculation: calculates shipping (evidence: `app/Http/Controllers/Api/OrderController.php`)
- Order processing → Stripe payments: starts checkout
- Customer → Stripe payments: pays by card (evidence: `README.md`)
- Customer → Meal reviews: submits reviews (evidence: `README.md`)
- Meal reviews → Review records: creates and queries (evidence: `app/Http/Controllers/Api/ReviewController.php`)
- Customer → Smart lists: manages lists (evidence: `README.md`)
- Customer → Notifications: manages notifications (evidence: `README.md`)
- Customer → AI meal chatbot: asks meal questions (evidence: `README.md`)
- AI meal chatbot → Meals and categories: uses meal context
- Filament administration → Review records: moderates reviews (evidence: `app/Filament/Resources/ReviewResource.php`)
