# khushijagga21/hp-powerlab architecture

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

- Interactive diagram: https://gitdiagram.com/khushijagga21/hp-powerlab
- Repository: https://github.com/khushijagga21/hp-powerlab

## Overview

HP Fuel Order Management System is a role-based web platform for rural fuel procurement. Farmers register or sign in, submit an order with fuel, quantity, and delivery location, and drivers manage received orders; admins oversee operations. The README also describes real-time tracking and payment, represented as documented capabilities, though their implementation is not in the sampled source. Supabase handles authentication and user/order data in the inspected flows. The graph reflects observed routing and calls; unsampled feature wiring is intentionally left unspecified.

Main entry points: [`src/App.jsx`](https://github.com/khushijagga21/hp-powerlab/blob/main/src/App.jsx) (App and routes), [`src/utils/supabaseClient.js`](https://github.com/khushijagga21/hp-powerlab/blob/main/src/utils/supabaseClient.js) (Supabase client), [`src/Page/FarmerOrder.jsx`](https://github.com/khushijagga21/hp-powerlab/blob/main/src/Page/FarmerOrder.jsx) (Place fuel order), [`src/Page/DriverDeliver.jsx`](https://github.com/khushijagga21/hp-powerlab/blob/main/src/Page/DriverDeliver.jsx) (Manage deliveries)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and routing"]
  node_app["App and routes<br/>[App.jsx]"]
  node_navbar["Role navigation<br/>[Navbar.jsx]"]
  node_login["Sign in<br/>[Login.jsx]"]
  node_signup["Registration<br/>[SignUp.jsx]"]
  node_user_context["User and role state<br/>[UserContext.jsx]"]
end

subgraph group_farmer["Farmer services"]
  node_home["Home and ordering info<br/>[Home.jsx]"]
  node_farmer_order["Place fuel order<br/>[FarmerOrder.jsx]"]
  node_farmer_profile["Farmer profile<br/>[FarmerProfile.jsx]"]
  node_community["Farmer community"]
  node_tips["Farmer tips<br/>[Tips.jsx]"]
  node_prices["Fuel prices<br/>[Prices.jsx]"]
end

subgraph group_operations["Delivery operations"]
  node_driver_delivery["Manage deliveries<br/>[DriverDeliver.jsx]"]
  node_tracking["Order tracking"]
  node_payment["Payment"]
  node_admin_dashboard["Operations dashboard<br/>[AdminDashboard.jsx]"]
  node_admin_management["Admin management<br/>[AdminMangement.jsx]"]
end

subgraph group_platform["Backend services"]
  node_supabase_client["Supabase client<br/>[supabaseClient.js]"]
  node_supabase_auth["Supabase Auth"]
  node_supabase_data[("Supabase data")]
end

node_farmer_actor(("Farmer"))
node_driver_actor(("Driver"))
node_admin_actor(("Admin"))

node_farmer_actor -->|"opens"| node_app
node_driver_actor -->|"opens"| node_app
node_admin_actor -->|"opens"| node_app
node_app -->|"routes"| node_home
node_app -->|"routes"| node_login
node_app -->|"routes"| node_signup
node_app -->|"routes"| node_farmer_order
node_app -->|"routes"| node_farmer_profile
node_app -->|"routes"| node_community
node_app -->|"routes"| node_tips
node_app -->|"routes"| node_prices
node_app -->|"routes"| node_driver_delivery
node_app -->|"routes"| node_admin_dashboard
node_app -->|"routes"| node_admin_management
node_app -->|"renders"| node_navbar
node_app -->|"provides role"| node_user_context
node_login -->|"signs in"| node_supabase_client
node_signup -->|"registers"| node_supabase_client
node_user_context -->|"loads session and role"| node_supabase_client
node_navbar -->|"signs out"| node_supabase_client
node_farmer_order -->|"loads user and inserts order"| node_supabase_client
node_supabase_client -->|"auth requests"| node_supabase_auth
node_supabase_client -->|"data requests"| node_supabase_data
node_farmer_actor -->|"submits request"| node_farmer_order
node_driver_actor -->|"manages orders"| node_driver_delivery
node_admin_actor -->|"oversees operations"| node_admin_dashboard
node_driver_delivery -.->|"supports"| node_tracking
node_farmer_order -.->|"payment stage"| node_payment

click node_app "https://github.com/khushijagga21/hp-powerlab/blob/main/src/App.jsx"
click node_navbar "https://github.com/khushijagga21/hp-powerlab/blob/main/src/Components/Navbar.jsx"
click node_login "https://github.com/khushijagga21/hp-powerlab/blob/main/src/Page/Login.jsx"
click node_signup "https://github.com/khushijagga21/hp-powerlab/blob/main/src/Page/SignUp.jsx"
click node_user_context "https://github.com/khushijagga21/hp-powerlab/blob/main/src/Context/UserContext.jsx"
click node_home "https://github.com/khushijagga21/hp-powerlab/blob/main/src/Page/Home.jsx"
click node_farmer_order "https://github.com/khushijagga21/hp-powerlab/blob/main/src/Page/FarmerOrder.jsx"
click node_farmer_profile "https://github.com/khushijagga21/hp-powerlab/blob/main/src/Page/FarmerProfile.jsx"
click node_community "https://github.com/khushijagga21/hp-powerlab/blob/main/src/Page/FarmerCommunity.jsx"
click node_tips "https://github.com/khushijagga21/hp-powerlab/blob/main/src/Page/Tips.jsx"
click node_prices "https://github.com/khushijagga21/hp-powerlab/blob/main/src/Page/Prices.jsx"
click node_driver_delivery "https://github.com/khushijagga21/hp-powerlab/blob/main/src/Page/DriverDeliver.jsx"
click node_tracking "https://github.com/khushijagga21/hp-powerlab/tree/main/src/Page"
click node_payment "https://github.com/khushijagga21/hp-powerlab/tree/main/src/Page"
click node_admin_dashboard "https://github.com/khushijagga21/hp-powerlab/blob/main/src/Page/AdminDashboard.jsx"
click node_admin_management "https://github.com/khushijagga21/hp-powerlab/blob/main/src/Page/AdminMangement.jsx"
click node_supabase_client "https://github.com/khushijagga21/hp-powerlab/blob/main/src/utils/supabaseClient.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_navbar,node_login,node_signup,node_user_context toneBlue
class node_home,node_farmer_order,node_farmer_profile,node_community,node_tips,node_prices toneAmber
class node_driver_delivery,node_tracking,node_payment,node_admin_dashboard,node_admin_management toneMint
class node_supabase_client,node_supabase_auth,node_supabase_data toneRose
class node_farmer_actor,node_driver_actor,node_admin_actor toneIndigo
```

## Components

### Access and routing

- [App and routes](https://github.com/khushijagga21/hp-powerlab/blob/main/src/App.jsx): `src/App.jsx`
- [Role navigation](https://github.com/khushijagga21/hp-powerlab/blob/main/src/Components/Navbar.jsx): `src/Components/Navbar.jsx`
- [Sign in](https://github.com/khushijagga21/hp-powerlab/blob/main/src/Page/Login.jsx): `src/Page/Login.jsx`
- [Registration](https://github.com/khushijagga21/hp-powerlab/blob/main/src/Page/SignUp.jsx): `src/Page/SignUp.jsx`
- [User and role state](https://github.com/khushijagga21/hp-powerlab/blob/main/src/Context/UserContext.jsx): `src/Context/UserContext.jsx`

### Farmer services

- [Home and ordering info](https://github.com/khushijagga21/hp-powerlab/blob/main/src/Page/Home.jsx): `src/Page/Home.jsx`
- [Place fuel order](https://github.com/khushijagga21/hp-powerlab/blob/main/src/Page/FarmerOrder.jsx): `src/Page/FarmerOrder.jsx`
- [Farmer profile](https://github.com/khushijagga21/hp-powerlab/blob/main/src/Page/FarmerProfile.jsx): `src/Page/FarmerProfile.jsx`
- [Farmer community](https://github.com/khushijagga21/hp-powerlab/blob/main/src/Page/FarmerCommunity.jsx): `src/Page/FarmerCommunity.jsx`
- [Farmer tips](https://github.com/khushijagga21/hp-powerlab/blob/main/src/Page/Tips.jsx): `src/Page/Tips.jsx`
- [Fuel prices](https://github.com/khushijagga21/hp-powerlab/blob/main/src/Page/Prices.jsx): `src/Page/Prices.jsx`

### Delivery operations

- [Manage deliveries](https://github.com/khushijagga21/hp-powerlab/blob/main/src/Page/DriverDeliver.jsx): `src/Page/DriverDeliver.jsx`
- [Order tracking](https://github.com/khushijagga21/hp-powerlab/tree/main/src/Page): `src/Page`
- [Payment](https://github.com/khushijagga21/hp-powerlab/tree/main/src/Page): `src/Page`
- [Operations dashboard](https://github.com/khushijagga21/hp-powerlab/blob/main/src/Page/AdminDashboard.jsx): `src/Page/AdminDashboard.jsx`
- [Admin management](https://github.com/khushijagga21/hp-powerlab/blob/main/src/Page/AdminMangement.jsx): `src/Page/AdminMangement.jsx`

### Backend services

- [Supabase client](https://github.com/khushijagga21/hp-powerlab/blob/main/src/utils/supabaseClient.js): `src/utils/supabaseClient.js`
- **Supabase Auth**
- **Supabase data**

### Other components

- **Farmer**
- **Driver**
- **Admin**

## Connections

- Farmer → App and routes: opens
- Driver → App and routes: opens
- Admin → App and routes: opens
- App and routes → Home and ordering info: routes
- App and routes → Sign in: routes
- App and routes → Registration: routes
- App and routes → Place fuel order: routes
- App and routes → Farmer profile: routes
- App and routes → Farmer community: routes
- App and routes → Farmer tips: routes
- App and routes → Fuel prices: routes
- App and routes → Manage deliveries: routes
- App and routes → Operations dashboard: routes
- App and routes → Admin management: routes
- App and routes → Role navigation: renders
- App and routes → User and role state: provides role
- Sign in → Supabase client: signs in
- Registration → Supabase client: registers
- User and role state → Supabase client: loads session and role
- Role navigation → Supabase client: signs out
- Place fuel order → Supabase client: loads user and inserts order
- Supabase client → Supabase Auth: auth requests
- Supabase client → Supabase data: data requests
- Farmer → Place fuel order: submits request
- Driver → Manage deliveries: manages orders
- Admin → Operations dashboard: oversees operations
- Manage deliveries → Order tracking: supports
- Place fuel order → Payment: payment stage
