# ahmadojavaid/cubagroceries architecture

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

- Interactive diagram: https://gitdiagram.com/ahmadojavaid/cubagroceries
- Repository: https://github.com/ahmadojavaid/cubagroceries

## Overview

Cuba Groceries is a grocery-delivery platform with a Laravel REST API and Filament administration; the README also identifies a Flutter customer and rider app. The principal workflow is browsing the catalog, authenticating, placing and tracking an order, and completing delivery. The graph preserves supporting account, wallet, fulfillment, feedback, and admin capabilities. The Flutter business-logic sources are absent from the supplied tree, so mobile-to-API behavior is not asserted; API dispatch and sampled controller-to-model relationships are shown where supported.

Main entry points: [`backend/routes/api.php`](https://github.com/ahmadojavaid/cubagroceries/blob/main/backend/routes/api.php) (REST routes), [`backend/app/Http/Controllers/Api/V1/OrderController.php`](https://github.com/ahmadojavaid/cubagroceries/blob/main/backend/app/Http/Controllers/Api/V1/OrderController.php) (Order checkout), [`backend/app/Filament`](https://github.com/ahmadojavaid/cubagroceries/tree/main/backend/app/Filament) (Admin workflows), [`backend/app/Models/Order.php`](https://github.com/ahmadojavaid/cubagroceries/blob/main/backend/app/Models/Order.php) (Orders and status)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Clients"]
  node_customer(("Customer"))
  node_rider(("Rider"))
  node_admin(("Admin staff"))
end

subgraph group_api["API access"]
  node_api_routes["REST routes<br/>[api.php]"]
  node_auth["Authentication<br/>[AuthController.php]"]
end

subgraph group_commerce["Commerce workflow"]
  node_catalog["Catalog browsing"]
  node_accounts["Customer account"]
  node_checkout["Order checkout"]
  node_feedback["Reviews and surveys"]
end

subgraph group_operations["Store operations"]
  node_rider_ops["Rider fulfillment"]
  node_store_config["Store information"]
  node_admin_panel["Admin workflows"]
  node_notifications["Push notifications<br/>[FcmService.php]"]
end

subgraph group_persistence["Domain data"]
  node_orders[("Orders and status<br/>[Order.php]")]
  node_customer_data[("Customer and wallet<br/>[User.php]")]
  node_catalog_data[("Products and pricing<br/>[Product.php]")]
  node_support_data[("Addresses and support<br/>[Address.php]")]
  node_postgres[("PostgreSQL")]
end

node_customer -->|"uses API"| node_api_routes
node_rider -->|"uses API"| node_api_routes
node_admin -.->|"manages"| node_admin_panel
node_api_routes -->|"dispatches auth"| node_auth
node_api_routes -->|"dispatches catalog"| node_catalog
node_api_routes -->|"dispatches account"| node_accounts
node_api_routes -->|"dispatches orders"| node_checkout
node_api_routes -->|"dispatches rider"| node_rider_ops
node_api_routes -->|"dispatches feedback"| node_feedback
node_api_routes -->|"dispatches store info"| node_store_config
node_auth -->|"creates users"| node_customer_data
node_checkout -->|"creates and updates"| node_orders
node_checkout -->|"checks price and stock"| node_catalog_data
node_checkout -->|"updates wallet"| node_customer_data
node_checkout -->|"reads address"| node_support_data
node_feedback -->|"checks delivery"| node_orders
node_admin_panel -->|"manages orders"| node_orders
node_admin_panel -->|"manages customers"| node_customer_data
node_orders -->|"persists in"| node_postgres
node_customer_data -->|"persists in"| node_postgres
node_catalog_data -->|"persists in"| node_postgres
node_support_data -->|"persists in"| node_postgres
node_admin_panel -.->|"sends push"| node_notifications

click node_api_routes "https://github.com/ahmadojavaid/cubagroceries/blob/main/backend/routes/api.php"
click node_auth "https://github.com/ahmadojavaid/cubagroceries/blob/main/backend/app/Http/Controllers/Api/V1/AuthController.php"
click node_catalog "https://github.com/ahmadojavaid/cubagroceries/tree/main/backend/app/Http/Controllers/Api/V1"
click node_accounts "https://github.com/ahmadojavaid/cubagroceries/tree/main/backend/app/Http/Controllers/Api/V1"
click node_checkout "https://github.com/ahmadojavaid/cubagroceries/blob/main/backend/app/Http/Controllers/Api/V1/OrderController.php"
click node_rider_ops "https://github.com/ahmadojavaid/cubagroceries/tree/main/backend/app/Http/Controllers/Api/V1"
click node_feedback "https://github.com/ahmadojavaid/cubagroceries/blob/main/backend/app/Http/Controllers/Api/V1/ReviewController.php"
click node_store_config "https://github.com/ahmadojavaid/cubagroceries/tree/main/backend/app/Http/Controllers/Api/V1"
click node_admin_panel "https://github.com/ahmadojavaid/cubagroceries/tree/main/backend/app/Filament"
click node_notifications "https://github.com/ahmadojavaid/cubagroceries/blob/main/backend/app/Services/FcmService.php"
click node_orders "https://github.com/ahmadojavaid/cubagroceries/blob/main/backend/app/Models/Order.php"
click node_customer_data "https://github.com/ahmadojavaid/cubagroceries/blob/main/backend/app/Models/User.php"
click node_catalog_data "https://github.com/ahmadojavaid/cubagroceries/blob/main/backend/app/Models/Product.php"
click node_support_data "https://github.com/ahmadojavaid/cubagroceries/blob/main/backend/app/Models/Address.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_customer,node_rider,node_admin toneBlue
class node_api_routes,node_auth toneAmber
class node_catalog,node_accounts,node_checkout,node_feedback toneMint
class node_rider_ops,node_store_config,node_admin_panel,node_notifications toneRose
class node_orders,node_customer_data,node_catalog_data,node_support_data,node_postgres toneIndigo
```

## Components

### Clients

- **Customer**
- **Rider**
- **Admin staff**

### API access

- [REST routes](https://github.com/ahmadojavaid/cubagroceries/blob/main/backend/routes/api.php): `backend/routes/api.php`
- [Authentication](https://github.com/ahmadojavaid/cubagroceries/blob/main/backend/app/Http/Controllers/Api/V1/AuthController.php): `backend/app/Http/Controllers/Api/V1/AuthController.php`

### Commerce workflow

- [Catalog browsing](https://github.com/ahmadojavaid/cubagroceries/tree/main/backend/app/Http/Controllers/Api/V1): `backend/app/Http/Controllers/Api/V1`
- [Customer account](https://github.com/ahmadojavaid/cubagroceries/tree/main/backend/app/Http/Controllers/Api/V1): `backend/app/Http/Controllers/Api/V1`
- [Order checkout](https://github.com/ahmadojavaid/cubagroceries/blob/main/backend/app/Http/Controllers/Api/V1/OrderController.php): `backend/app/Http/Controllers/Api/V1/OrderController.php`
- [Reviews and surveys](https://github.com/ahmadojavaid/cubagroceries/blob/main/backend/app/Http/Controllers/Api/V1/ReviewController.php): `backend/app/Http/Controllers/Api/V1/ReviewController.php`

### Store operations

- [Rider fulfillment](https://github.com/ahmadojavaid/cubagroceries/tree/main/backend/app/Http/Controllers/Api/V1): `backend/app/Http/Controllers/Api/V1`
- [Store information](https://github.com/ahmadojavaid/cubagroceries/tree/main/backend/app/Http/Controllers/Api/V1): `backend/app/Http/Controllers/Api/V1`
- [Admin workflows](https://github.com/ahmadojavaid/cubagroceries/tree/main/backend/app/Filament): `backend/app/Filament`
- [Push notifications](https://github.com/ahmadojavaid/cubagroceries/blob/main/backend/app/Services/FcmService.php): `backend/app/Services/FcmService.php`

### Domain data

- [Orders and status](https://github.com/ahmadojavaid/cubagroceries/blob/main/backend/app/Models/Order.php): `backend/app/Models/Order.php`
- [Customer and wallet](https://github.com/ahmadojavaid/cubagroceries/blob/main/backend/app/Models/User.php): `backend/app/Models/User.php`
- [Products and pricing](https://github.com/ahmadojavaid/cubagroceries/blob/main/backend/app/Models/Product.php): `backend/app/Models/Product.php`
- [Addresses and support](https://github.com/ahmadojavaid/cubagroceries/blob/main/backend/app/Models/Address.php): `backend/app/Models/Address.php`
- **PostgreSQL**

## Connections

- Customer → REST routes: uses API (evidence: `README.md`)
- Rider → REST routes: uses API (evidence: `README.md`)
- Admin staff → Admin workflows: manages
- REST routes → Authentication: dispatches auth (evidence: `backend/routes/api.php`)
- REST routes → Catalog browsing: dispatches catalog (evidence: `backend/routes/api.php`)
- REST routes → Customer account: dispatches account (evidence: `backend/routes/api.php`)
- REST routes → Order checkout: dispatches orders (evidence: `backend/routes/api.php`)
- REST routes → Rider fulfillment: dispatches rider (evidence: `backend/routes/api.php`)
- REST routes → Reviews and surveys: dispatches feedback (evidence: `backend/routes/api.php`)
- REST routes → Store information: dispatches store info (evidence: `backend/routes/api.php`)
- Authentication → Customer and wallet: creates users (evidence: `backend/app/Http/Controllers/Api/V1/AuthController.php`)
- Order checkout → Orders and status: creates and updates (evidence: `backend/app/Http/Controllers/Api/V1/OrderController.php`)
- Order checkout → Products and pricing: checks price and stock (evidence: `backend/app/Http/Controllers/Api/V1/OrderController.php`)
- Order checkout → Customer and wallet: updates wallet (evidence: `backend/app/Http/Controllers/Api/V1/OrderController.php`)
- Order checkout → Addresses and support: reads address (evidence: `backend/app/Http/Controllers/Api/V1/OrderController.php`)
- Reviews and surveys → Orders and status: checks delivery (evidence: `backend/app/Http/Controllers/Api/V1/ReviewController.php`)
- Admin workflows → Orders and status: manages orders (evidence: `backend/app/Filament/Resources/OrderResource.php`)
- Admin workflows → Customer and wallet: manages customers (evidence: `backend/app/Filament/Resources/CustomerResource.php`)
- Orders and status → PostgreSQL: persists in (evidence: `README.md`)
- Customer and wallet → PostgreSQL: persists in (evidence: `README.md`)
- Products and pricing → PostgreSQL: persists in (evidence: `README.md`)
- Addresses and support → PostgreSQL: persists in (evidence: `README.md`)
- Admin workflows → Push notifications: sends push
