# ihsanwar/seapedia-full architecture

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

- Interactive diagram: https://gitdiagram.com/ihsanwar/seapedia-full
- Repository: https://github.com/ihsanwar/seapedia-full

## Overview

SEApedia is a multi-role marine-products marketplace with a React client and Laravel API. The principal flow runs from buyer catalogue browsing and cart checkout through seller order processing, driver delivery, and order completion; admins monitor the marketplace and handle overdue orders. Authentication and role switching support all actors. The README documents these capabilities, while sampled source confirms selected controller-to-model and client-to-auth relationships; unsampled feature links are shown only where the README describes the workflow.

Main entry points: [`frontend/src/App.jsx`](https://github.com/ihsanwar/seapedia-full/blob/master/frontend/src/App.jsx) (React application), [`SEApediaBackend/app/Http/Controllers/Api/Buyer/CartController.php`](https://github.com/ihsanwar/seapedia-full/blob/master/SEApediaBackend/app/Http/Controllers/Api/Buyer/CartController.php) (Shopping cart), [`SEApediaBackend/app/Services/CheckoutService.php`](https://github.com/ihsanwar/seapedia-full/blob/master/SEApediaBackend/app/Services/CheckoutService.php) (Checkout), [`SEApediaBackend/app/Http/Controllers/Api/Seller`](https://github.com/ihsanwar/seapedia-full/tree/master/SEApediaBackend/app/Http/Controllers/Api/Seller) (Seller operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_webapp["React application<br/>[App.jsx]"]
  node_api_client["HTTP client<br/>[axiosInstance.js]"]
end

subgraph group_identity["Identity and access"]
  node_web_auth["Auth context<br/>[AuthContext.jsx]"]
  node_auth_api["Authentication API<br/>[auth.js]"]
  node_auth_controller["Auth endpoints<br/>[AuthController.php]"]
  node_role_gate["Role authorization<br/>[RoleMiddleware.php]"]
end

subgraph group_commerce["Buyer commerce"]
  node_catalogue["Product catalogue"]
  node_cart["Shopping cart<br/>[CartController.php]"]
  node_checkout["Checkout"]
  node_discounts["Promos and vouchers"]
  node_wallet["Wallet<br/>[Wallet.php]"]
end

subgraph group_fulfillment["Marketplace operations"]
  node_seller_ops["Seller operations"]
  node_delivery_ops["Driver delivery"]
  node_admin_ops["Admin monitoring"]
  node_overdue["Overdue handling"]
end

subgraph group_platform["API and domain"]
  node_orders["Order domain<br/>[Order.php]"]
  node_store["Store domain<br/>[Store.php]"]
  node_product["Product domain<br/>[Product.php]"]
  node_reviews["Public reviews"]
  node_response["API responses<br/>[ApiResponse.php]"]
  node_database[("MySQL data<br/>[database.php]")]
end

node_buyer(("Buyer"))
node_seller(("Seller"))
node_driver(("Driver"))
node_admin(("Admin"))

node_buyer -->|"uses"| node_webapp
node_seller -->|"uses"| node_webapp
node_driver -->|"uses"| node_webapp
node_admin -->|"uses"| node_webapp
node_webapp -->|"provides context"| node_web_auth
node_web_auth -->|"calls"| node_auth_api
node_auth_api -->|"uses"| node_api_client
node_auth_api -->|"requests auth"| node_auth_controller
node_auth_controller -.->|"issues role tokens"| node_role_gate
node_buyer -->|"browses"| node_catalogue
node_buyer -->|"manages cart"| node_cart
node_cart -->|"checks stock"| node_product
node_cart -->|"checks out"| node_checkout
node_checkout -.->|"applies discounts"| node_discounts
node_checkout -.->|"uses wallet"| node_wallet
node_checkout -.->|"creates order"| node_orders
node_seller -->|"processes orders"| node_seller_ops
node_seller_ops -.->|"updates orders"| node_orders
node_seller_ops -.->|"manages store"| node_store
node_seller_ops -.->|"manages products"| node_product
node_driver -->|"accepts jobs"| node_delivery_ops
node_delivery_ops -->|"updates status"| node_orders
node_admin -->|"monitors marketplace"| node_admin_ops
node_admin -->|"handles overdue"| node_overdue
node_overdue -->|"refunds orders"| node_orders
node_overdue -->|"credits refunds"| node_wallet
node_catalogue -.->|"reads products"| node_product
node_reviews -.->|"reads and writes"| node_database
node_cart -.->|"persists cart"| node_database
node_response -.->|"formats API output"| node_database

click node_webapp "https://github.com/ihsanwar/seapedia-full/blob/master/frontend/src/App.jsx"
click node_web_auth "https://github.com/ihsanwar/seapedia-full/blob/master/frontend/src/contexts/AuthContext.jsx"
click node_api_client "https://github.com/ihsanwar/seapedia-full/blob/master/frontend/src/api/axiosInstance.js"
click node_auth_api "https://github.com/ihsanwar/seapedia-full/blob/master/frontend/src/api/auth.js"
click node_auth_controller "https://github.com/ihsanwar/seapedia-full/blob/master/SEApediaBackend/app/Http/Controllers/Api/AuthController.php"
click node_role_gate "https://github.com/ihsanwar/seapedia-full/blob/master/SEApediaBackend/app/Http/Middleware/RoleMiddleware.php"
click node_catalogue "https://github.com/ihsanwar/seapedia-full/blob/master/SEApediaBackend/app/Http/Controllers/Api/Page/CatalogueController.php"
click node_cart "https://github.com/ihsanwar/seapedia-full/blob/master/SEApediaBackend/app/Http/Controllers/Api/Buyer/CartController.php"
click node_checkout "https://github.com/ihsanwar/seapedia-full/blob/master/SEApediaBackend/app/Services/CheckoutService.php"
click node_discounts "https://github.com/ihsanwar/seapedia-full/blob/master/SEApediaBackend/app/Services/DiscountService.php"
click node_wallet "https://github.com/ihsanwar/seapedia-full/blob/master/SEApediaBackend/app/Models/Wallet.php"
click node_seller_ops "https://github.com/ihsanwar/seapedia-full/tree/master/SEApediaBackend/app/Http/Controllers/Api/Seller"
click node_delivery_ops "https://github.com/ihsanwar/seapedia-full/blob/master/SEApediaBackend/app/Http/Controllers/Api/Driver/DeliveryController.php"
click node_admin_ops "https://github.com/ihsanwar/seapedia-full/tree/master/SEApediaBackend/app/Http/Controllers/Api/Admin"
click node_overdue "https://github.com/ihsanwar/seapedia-full/blob/master/SEApediaBackend/app/Http/Controllers/Api/Admin/OverdueController.php"
click node_orders "https://github.com/ihsanwar/seapedia-full/blob/master/SEApediaBackend/app/Models/Order.php"
click node_store "https://github.com/ihsanwar/seapedia-full/blob/master/SEApediaBackend/app/Models/Store.php"
click node_product "https://github.com/ihsanwar/seapedia-full/blob/master/SEApediaBackend/app/Models/Product.php"
click node_reviews "https://github.com/ihsanwar/seapedia-full/blob/master/SEApediaBackend/app/Http/Controllers/Api/Page/ReviewController.php"
click node_response "https://github.com/ihsanwar/seapedia-full/blob/master/SEApediaBackend/app/Helpers/ApiResponse.php"
click node_database "https://github.com/ihsanwar/seapedia-full/blob/master/SEApediaBackend/config/database.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_webapp,node_api_client toneBlue
class node_web_auth,node_auth_api,node_auth_controller,node_role_gate toneAmber
class node_catalogue,node_cart,node_checkout,node_discounts,node_wallet toneMint
class node_seller_ops,node_delivery_ops,node_admin_ops,node_overdue toneRose
class node_orders,node_store,node_product,node_reviews,node_response,node_database,node_buyer,node_seller,node_driver,node_admin toneIndigo
```

## Components

### Web client

- [React application](https://github.com/ihsanwar/seapedia-full/blob/master/frontend/src/App.jsx): `frontend/src/App.jsx`
- [HTTP client](https://github.com/ihsanwar/seapedia-full/blob/master/frontend/src/api/axiosInstance.js): `frontend/src/api/axiosInstance.js`

### Identity and access

- [Auth context](https://github.com/ihsanwar/seapedia-full/blob/master/frontend/src/contexts/AuthContext.jsx): `frontend/src/contexts/AuthContext.jsx`
- [Authentication API](https://github.com/ihsanwar/seapedia-full/blob/master/frontend/src/api/auth.js): `frontend/src/api/auth.js`
- [Auth endpoints](https://github.com/ihsanwar/seapedia-full/blob/master/SEApediaBackend/app/Http/Controllers/Api/AuthController.php): `SEApediaBackend/app/Http/Controllers/Api/AuthController.php`
- [Role authorization](https://github.com/ihsanwar/seapedia-full/blob/master/SEApediaBackend/app/Http/Middleware/RoleMiddleware.php): `SEApediaBackend/app/Http/Middleware/RoleMiddleware.php`

### Buyer commerce

- [Product catalogue](https://github.com/ihsanwar/seapedia-full/blob/master/SEApediaBackend/app/Http/Controllers/Api/Page/CatalogueController.php): `SEApediaBackend/app/Http/Controllers/Api/Page/CatalogueController.php`
- [Shopping cart](https://github.com/ihsanwar/seapedia-full/blob/master/SEApediaBackend/app/Http/Controllers/Api/Buyer/CartController.php): `SEApediaBackend/app/Http/Controllers/Api/Buyer/CartController.php`
- [Checkout](https://github.com/ihsanwar/seapedia-full/blob/master/SEApediaBackend/app/Services/CheckoutService.php): `SEApediaBackend/app/Services/CheckoutService.php`
- [Promos and vouchers](https://github.com/ihsanwar/seapedia-full/blob/master/SEApediaBackend/app/Services/DiscountService.php): `SEApediaBackend/app/Services/DiscountService.php`
- [Wallet](https://github.com/ihsanwar/seapedia-full/blob/master/SEApediaBackend/app/Models/Wallet.php): `SEApediaBackend/app/Models/Wallet.php`

### Marketplace operations

- [Seller operations](https://github.com/ihsanwar/seapedia-full/tree/master/SEApediaBackend/app/Http/Controllers/Api/Seller): `SEApediaBackend/app/Http/Controllers/Api/Seller`
- [Driver delivery](https://github.com/ihsanwar/seapedia-full/blob/master/SEApediaBackend/app/Http/Controllers/Api/Driver/DeliveryController.php): `SEApediaBackend/app/Http/Controllers/Api/Driver/DeliveryController.php`
- [Admin monitoring](https://github.com/ihsanwar/seapedia-full/tree/master/SEApediaBackend/app/Http/Controllers/Api/Admin): `SEApediaBackend/app/Http/Controllers/Api/Admin`
- [Overdue handling](https://github.com/ihsanwar/seapedia-full/blob/master/SEApediaBackend/app/Http/Controllers/Api/Admin/OverdueController.php): `SEApediaBackend/app/Http/Controllers/Api/Admin/OverdueController.php`

### API and domain

- [Order domain](https://github.com/ihsanwar/seapedia-full/blob/master/SEApediaBackend/app/Models/Order.php): `SEApediaBackend/app/Models/Order.php`
- [Store domain](https://github.com/ihsanwar/seapedia-full/blob/master/SEApediaBackend/app/Models/Store.php): `SEApediaBackend/app/Models/Store.php`
- [Product domain](https://github.com/ihsanwar/seapedia-full/blob/master/SEApediaBackend/app/Models/Product.php): `SEApediaBackend/app/Models/Product.php`
- [Public reviews](https://github.com/ihsanwar/seapedia-full/blob/master/SEApediaBackend/app/Http/Controllers/Api/Page/ReviewController.php): `SEApediaBackend/app/Http/Controllers/Api/Page/ReviewController.php`
- [API responses](https://github.com/ihsanwar/seapedia-full/blob/master/SEApediaBackend/app/Helpers/ApiResponse.php): `SEApediaBackend/app/Helpers/ApiResponse.php`
- [MySQL data](https://github.com/ihsanwar/seapedia-full/blob/master/SEApediaBackend/config/database.php): `SEApediaBackend/config/database.php`

### Other components

- **Buyer**
- **Seller**
- **Driver**
- **Admin**

## Connections

- Buyer → React application: uses (evidence: `README.md`)
- Seller → React application: uses (evidence: `README.md`)
- Driver → React application: uses (evidence: `README.md`)
- Admin → React application: uses (evidence: `README.md`)
- React application → Auth context: provides context (evidence: `frontend/src/App.jsx`)
- Auth context → Authentication API: calls (evidence: `frontend/src/contexts/AuthContext.jsx`)
- Authentication API → HTTP client: uses (evidence: `frontend/src/contexts/AuthContext.jsx`)
- Authentication API → Auth endpoints: requests auth
- Auth endpoints → Role authorization: issues role tokens
- Buyer → Product catalogue: browses (evidence: `README.md`)
- Buyer → Shopping cart: manages cart (evidence: `README.md`)
- Shopping cart → Product domain: checks stock (evidence: `SEApediaBackend/app/Http/Controllers/Api/Buyer/CartController.php`)
- Shopping cart → Checkout: checks out (evidence: `README.md`)
- Checkout → Promos and vouchers: applies discounts
- Checkout → Wallet: uses wallet
- Checkout → Order domain: creates order
- Seller → Seller operations: processes orders (evidence: `README.md`)
- Seller operations → Order domain: updates orders
- Seller operations → Store domain: manages store (evidence: `SEApediaBackend/app/Http/Controllers/Api/Seller/ProductController.php`)
- Seller operations → Product domain: manages products (evidence: `SEApediaBackend/app/Http/Controllers/Api/Seller/ProductController.php`)
- Driver → Driver delivery: accepts jobs (evidence: `README.md`)
- Driver delivery → Order domain: updates status (evidence: `SEApediaBackend/app/Http/Controllers/Api/Driver/DeliveryController.php`)
- Admin → Admin monitoring: monitors marketplace (evidence: `README.md`)
- Admin → Overdue handling: handles overdue (evidence: `README.md`)
- Overdue handling → Order domain: refunds orders (evidence: `SEApediaBackend/app/Http/Controllers/Api/Admin/OverdueController.php`)
- Overdue handling → Wallet: credits refunds (evidence: `SEApediaBackend/app/Http/Controllers/Api/Admin/OverdueController.php`)
- Product catalogue → Product domain: reads products
- Public reviews → MySQL data: reads and writes
- Shopping cart → MySQL data: persists cart
- API responses → MySQL data: formats API output
