# rifatsakib/grand-gateway-cilent architecture

> Architecture diagram of the GitHub repository rifatsakib/grand-gateway-cilent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rifatsakib/grand-gateway-cilent
- Repository: https://github.com/rifatsakib/grand-gateway-cilent

## Overview

Grand-Gateway is a parcel-booking and delivery-management web app with user, delivery-person, and administrator roles. Users register or sign in, book parcels, and track or manage their bookings; administrators manage users and parcels and assign deliveries; delivery people view assigned work and update its status. The React client routes these experiences through shared layouts and role guards, with Firebase authentication and a remote API for application data. The README documents the main capabilities; some feature implementations were not sampled, so their internal API interactions are not detailed here.

Main entry points: [`src/Routes/Routes.jsx`](https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Routes/Routes.jsx) (Route map), [`src/Pages/SignUp/SignUp.jsx`](https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Pages/SignUp/SignUp.jsx) (Registration), [`src/Providers/AuthProvider.jsx`](https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Providers/AuthProvider.jsx) (Auth provider), [`src/Components/SocialLogin/SocialLogin.jsx`](https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Components/SocialLogin/SocialLogin.jsx) (Google sign-in)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Client entry and routing"]
  node_app["App shell<br/>[App.jsx]"]
  node_routes["Route map<br/>[Routes.jsx]"]
  node_mainlayout["Main layout<br/>[Main.jsx]"]
  node_dashboard["Dashboard layout<br/>[Dashboard.jsx]"]
  node_home["Home experience<br/>[Home.jsx]"]
  node_navbar["Role-aware navigation<br/>[Navbar.jsx]"]
end

subgraph group_identity["Identity and access"]
  node_authprovider["Auth provider<br/>[AuthProvider.jsx]"]
  node_firebase(("Firebase Auth"))
  node_login["Login<br/>[Login.jsx]"]
  node_signup["Registration<br/>[SignUp.jsx]"]
  node_social["Google sign-in<br/>[SocialLogin.jsx]"]
  node_authhook["Auth context hook<br/>[UseAuth.jsx]"]
  node_privateguard["Signed-in guard<br/>[PrivateRoute.jsx]"]
  node_adminguard["Admin guard<br/>[AdminRoute.jsx]"]
  node_deliveryguard["Delivery guard"]
  node_admincheck["Admin role check<br/>[UseAdmin.jsx]"]
  node_deliverycheck["Delivery role check<br/>[UseDeliveryman.jsx]"]
end

subgraph group_parcel["Parcel workflows"]
  node_book["Book a parcel<br/>[BookAParcel.jsx]"]
  node_myparcels["My parcels<br/>[MyParcels.jsx]"]
  node_items["Parcel data hook<br/>[UseItems.jsx]"]
  node_payment["Parcel payment<br/>[Payment.jsx]"]
end

subgraph group_operations["Delivery operations"]
  node_adminparcels["Manage all parcels<br/>[AllParcels.jsx]"]
  node_users["Manage users<br/>[AllUsers.jsx]"]
  node_deliverypeople["Manage delivery people<br/>[AllDeliveryMan.jsx]"]
  node_deliverylist["Assigned deliveries<br/>[MyDeliveryList.jsx]"]
  node_reviews["Delivery reviews<br/>[MyReviews.jsx]"]
  node_statistics["Admin statistics"]
  node_profile["User profile<br/>[MyProfile.jsx]"]
  node_update["Update parcel<br/>[UpdateItems.jsx]"]
end

node_visitor(("Visitor or user"))
node_publicapi(("Grand-Gateway API"))
node_imagehost(("Image hosting"))

node_visitor -->|"opens"| node_app
node_app -.->|"renders routes"| node_routes
node_routes -->|"routes public pages"| node_mainlayout
node_routes -->|"routes dashboard"| node_dashboard
node_routes -->|"routes home"| node_home
node_mainlayout -->|"renders"| node_navbar
node_routes -->|"routes login"| node_login
node_routes -->|"routes signup"| node_signup
node_routes -->|"protects dashboard"| node_privateguard
node_routes -->|"protects admin pages"| node_adminguard
node_authprovider -->|"authenticates users"| node_firebase
node_authprovider -->|"requests JWT"| node_publicapi
node_login -->|"uses auth"| node_authprovider
node_signup -->|"creates account"| node_authprovider
node_signup -->|"offers social login"| node_social
node_social -->|"starts Google sign-in"| node_authprovider
node_social -->|"registers user"| node_publicapi
node_signup -->|"uploads image"| node_imagehost
node_signup -->|"creates user record"| node_publicapi
node_privateguard -->|"checks session"| node_authhook
node_adminguard -->|"checks role"| node_admincheck
node_deliveryguard -->|"checks role"| node_deliverycheck
node_admincheck -->|"reads user"| node_authhook
node_deliverycheck -->|"reads user"| node_authhook
node_book -->|"submits booking"| node_publicapi
node_myparcels -->|"loads bookings"| node_items
node_items -->|"fetches parcels"| node_publicapi
node_routes -->|"routes payment"| node_payment
node_adminparcels -->|"loads parcel data"| node_items
node_adminparcels -->|"manages parcels"| node_publicapi
node_users -->|"manages users"| node_publicapi
node_deliverypeople -->|"manages delivery roles"| node_publicapi
node_deliverylist -->|"loads assignments"| node_publicapi
node_reviews -->|"loads reviews"| node_publicapi
node_statistics -->|"loads statistics"| node_publicapi
node_profile -->|"loads profile data"| node_publicapi
node_update -->|"updates parcel"| node_publicapi

click node_app "https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/App.jsx"
click node_routes "https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Routes/Routes.jsx"
click node_mainlayout "https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Layout/Main.jsx"
click node_dashboard "https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Layout/Dashboard.jsx"
click node_home "https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Pages/Home/Home/Home.jsx"
click node_navbar "https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Pages/Shared/Navbar/Navbar.jsx"
click node_authprovider "https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Providers/AuthProvider.jsx"
click node_login "https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Pages/Login/Login.jsx"
click node_signup "https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Pages/SignUp/SignUp.jsx"
click node_social "https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Components/SocialLogin/SocialLogin.jsx"
click node_authhook "https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Hooks/UseAuth.jsx"
click node_privateguard "https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Routes/PrivateRoute.jsx"
click node_adminguard "https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Routes/AdminRoute.jsx"
click node_deliveryguard "https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Routes/DeliverymanRoute.jsx"
click node_admincheck "https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Hooks/UseAdmin.jsx"
click node_deliverycheck "https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Hooks/UseDeliveryman.jsx"
click node_book "https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Pages/Dashboard/BookAParcel/BookAParcel.jsx"
click node_myparcels "https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Pages/Dashboard/MyParcels/MyParcels.jsx"
click node_items "https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Hooks/UseItems.jsx"
click node_payment "https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Pages/Dashboard/Payment/Payment.jsx"
click node_adminparcels "https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Pages/Dashboard/AllParcels/AllParcels.jsx"
click node_users "https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Pages/Dashboard/AllUsers/AllUsers.jsx"
click node_deliverypeople "https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Pages/Dashboard/AllDeliveryMan/AllDeliveryMan.jsx"
click node_deliverylist "https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Pages/Dashboard/MyDeliveryList/MyDeliveryList.jsx"
click node_reviews "https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Pages/Dashboard/MyReviews/MyReviews.jsx"
click node_statistics "https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Pages/Dashboard/Statistics/AdminStatistics.jsx"
click node_profile "https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Pages/Dashboard/MyProfile/MyProfile.jsx"
click node_update "https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Pages/Dashboard/UpdateItems/UpdateItems.jsx"

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_routes,node_mainlayout,node_dashboard,node_home,node_navbar,node_visitor toneBlue
class node_authprovider,node_firebase,node_login,node_signup,node_social,node_authhook,node_privateguard,node_adminguard,node_deliveryguard,node_admincheck,node_deliverycheck toneAmber
class node_book,node_myparcels,node_items,node_payment,node_publicapi toneMint
class node_adminparcels,node_users,node_deliverypeople,node_deliverylist,node_reviews,node_statistics,node_profile,node_update toneRose
class node_imagehost toneIndigo
```

## Components

### Client entry and routing

- [App shell](https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/App.jsx): `src/App.jsx`
- [Route map](https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Routes/Routes.jsx): `src/Routes/Routes.jsx`
- [Main layout](https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Layout/Main.jsx): `src/Layout/Main.jsx`
- [Dashboard layout](https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Layout/Dashboard.jsx): `src/Layout/Dashboard.jsx`
- [Home experience](https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Pages/Home/Home/Home.jsx): `src/Pages/Home/Home/Home.jsx`
- [Role-aware navigation](https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Pages/Shared/Navbar/Navbar.jsx): `src/Pages/Shared/Navbar/Navbar.jsx`

### Identity and access

- [Auth provider](https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Providers/AuthProvider.jsx): `src/Providers/AuthProvider.jsx`
- **Firebase Auth**
- [Login](https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Pages/Login/Login.jsx): `src/Pages/Login/Login.jsx`
- [Registration](https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Pages/SignUp/SignUp.jsx): `src/Pages/SignUp/SignUp.jsx`
- [Google sign-in](https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Components/SocialLogin/SocialLogin.jsx): `src/Components/SocialLogin/SocialLogin.jsx`
- [Auth context hook](https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Hooks/UseAuth.jsx): `src/Hooks/UseAuth.jsx`
- [Signed-in guard](https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Routes/PrivateRoute.jsx): `src/Routes/PrivateRoute.jsx`
- [Admin guard](https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Routes/AdminRoute.jsx): `src/Routes/AdminRoute.jsx`
- [Delivery guard](https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Routes/DeliverymanRoute.jsx): `src/Routes/DeliverymanRoute.jsx`
- [Admin role check](https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Hooks/UseAdmin.jsx): `src/Hooks/UseAdmin.jsx`
- [Delivery role check](https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Hooks/UseDeliveryman.jsx): `src/Hooks/UseDeliveryman.jsx`

### Parcel workflows

- [Book a parcel](https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Pages/Dashboard/BookAParcel/BookAParcel.jsx): `src/Pages/Dashboard/BookAParcel/BookAParcel.jsx`
- [My parcels](https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Pages/Dashboard/MyParcels/MyParcels.jsx): `src/Pages/Dashboard/MyParcels/MyParcels.jsx`
- [Parcel data hook](https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Hooks/UseItems.jsx): `src/Hooks/UseItems.jsx`
- [Parcel payment](https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Pages/Dashboard/Payment/Payment.jsx): `src/Pages/Dashboard/Payment/Payment.jsx`

### Delivery operations

- [Manage all parcels](https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Pages/Dashboard/AllParcels/AllParcels.jsx): `src/Pages/Dashboard/AllParcels/AllParcels.jsx`
- [Manage users](https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Pages/Dashboard/AllUsers/AllUsers.jsx): `src/Pages/Dashboard/AllUsers/AllUsers.jsx`
- [Manage delivery people](https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Pages/Dashboard/AllDeliveryMan/AllDeliveryMan.jsx): `src/Pages/Dashboard/AllDeliveryMan/AllDeliveryMan.jsx`
- [Assigned deliveries](https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Pages/Dashboard/MyDeliveryList/MyDeliveryList.jsx): `src/Pages/Dashboard/MyDeliveryList/MyDeliveryList.jsx`
- [Delivery reviews](https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Pages/Dashboard/MyReviews/MyReviews.jsx): `src/Pages/Dashboard/MyReviews/MyReviews.jsx`
- [Admin statistics](https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Pages/Dashboard/Statistics/AdminStatistics.jsx): `src/Pages/Dashboard/Statistics/AdminStatistics.jsx`
- [User profile](https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Pages/Dashboard/MyProfile/MyProfile.jsx): `src/Pages/Dashboard/MyProfile/MyProfile.jsx`
- [Update parcel](https://github.com/rifatsakib/grand-gateway-cilent/blob/main/src/Pages/Dashboard/UpdateItems/UpdateItems.jsx): `src/Pages/Dashboard/UpdateItems/UpdateItems.jsx`

### Other components

- **Visitor or user**
- **Grand-Gateway API**
- **Image hosting**

## Connections

- Visitor or user → App shell: opens
- App shell → Route map: renders routes
- Route map → Main layout: routes public pages (evidence: `src/Routes/Routes.jsx`)
- Route map → Dashboard layout: routes dashboard (evidence: `src/Routes/Routes.jsx`)
- Route map → Home experience: routes home (evidence: `src/Routes/Routes.jsx`)
- Main layout → Role-aware navigation: renders (evidence: `src/Layout/Main.jsx`)
- Route map → Login: routes login (evidence: `src/Routes/Routes.jsx`)
- Route map → Registration: routes signup (evidence: `src/Routes/Routes.jsx`)
- Route map → Signed-in guard: protects dashboard (evidence: `src/Routes/Routes.jsx`)
- Route map → Admin guard: protects admin pages (evidence: `src/Routes/Routes.jsx`)
- Auth provider → Firebase Auth: authenticates users (evidence: `src/Providers/AuthProvider.jsx`)
- Auth provider → Grand-Gateway API: requests JWT (evidence: `src/Providers/AuthProvider.jsx`)
- Login → Auth provider: uses auth (evidence: `src/Pages/Login/Login.jsx`)
- Registration → Auth provider: creates account (evidence: `src/Pages/SignUp/SignUp.jsx`)
- Registration → Google sign-in: offers social login (evidence: `src/Pages/SignUp/SignUp.jsx`)
- Google sign-in → Auth provider: starts Google sign-in (evidence: `src/Components/SocialLogin/SocialLogin.jsx`)
- Google sign-in → Grand-Gateway API: registers user (evidence: `src/Components/SocialLogin/SocialLogin.jsx`)
- Registration → Image hosting: uploads image (evidence: `src/Pages/SignUp/SignUp.jsx`)
- Registration → Grand-Gateway API: creates user record (evidence: `src/Pages/SignUp/SignUp.jsx`)
- Signed-in guard → Auth context hook: checks session (evidence: `src/Routes/PrivateRoute.jsx`)
- Admin guard → Admin role check: checks role (evidence: `src/Routes/AdminRoute.jsx`)
- Delivery guard → Delivery role check: checks role (evidence: `src/Routes/DeliverymanRoute.jsx`)
- Admin role check → Auth context hook: reads user (evidence: `src/Hooks/UseAdmin.jsx`)
- Delivery role check → Auth context hook: reads user (evidence: `src/Hooks/UseDeliveryman.jsx`)
- Book a parcel → Grand-Gateway API: submits booking (evidence: `src/Pages/Dashboard/BookAParcel/BookAParcel.jsx`)
- My parcels → Parcel data hook: loads bookings (evidence: `src/Pages/Dashboard/MyParcels/MyParcels.jsx`)
- Parcel data hook → Grand-Gateway API: fetches parcels (evidence: `src/Hooks/UseItems.jsx`)
- Route map → Parcel payment: routes payment (evidence: `src/Routes/Routes.jsx`)
- Manage all parcels → Parcel data hook: loads parcel data (evidence: `src/Pages/Dashboard/AllParcels/AllParcels.jsx`)
- Manage all parcels → Grand-Gateway API: manages parcels (evidence: `src/Pages/Dashboard/AllParcels/AllParcels.jsx`)
- Manage users → Grand-Gateway API: manages users (evidence: `src/Pages/Dashboard/AllUsers/AllUsers.jsx`)
- Manage delivery people → Grand-Gateway API: manages delivery roles (evidence: `src/Pages/Dashboard/AllDeliveryMan/AllDeliveryMan.jsx`)
- Assigned deliveries → Grand-Gateway API: loads assignments (evidence: `src/Pages/Dashboard/MyDeliveryList/MyDeliveryList.jsx`)
- Delivery reviews → Grand-Gateway API: loads reviews (evidence: `src/Pages/Dashboard/MyReviews/MyReviews.jsx`)
- Admin statistics → Grand-Gateway API: loads statistics (evidence: `src/Pages/Dashboard/Statistics/AdminStatistics.jsx`)
- User profile → Grand-Gateway API: loads profile data (evidence: `src/Pages/Dashboard/MyProfile/MyProfile.jsx`)
- Update parcel → Grand-Gateway API: updates parcel (evidence: `src/Pages/Dashboard/UpdateItems/UpdateItems.jsx`)
