# ehsanulhaque1/home-service-hub architecture

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

- Interactive diagram: https://gitdiagram.com/ehsanulhaque1/home-service-hub
- Repository: https://github.com/ehsanulhaque1/home-service-hub

## Overview

Home Service Hub is a two-sided home-services marketplace: customers post jobs, workers discover and apply, customers select a worker and follow progress, then pay after completion. The graph preserves the documented account, worker, task, messaging, feedback/reporting, admin, and AI-assistant capabilities. Some feature routes and their wiring are unsampled; those branches are represented at the supported directory level without speculative call chains.

Main entry points: [`packages/frontend/src/App.jsx`](https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/frontend/src/App.jsx) (Route application), [`packages/backend/routes/api.php`](https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/routes/api.php) (API routing), [`packages/backend/config/database.php`](https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/config/database.php) (Application database), [`packages/backend/app/Services/RagService.php`](https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/app/Services/RagService.php) (RAG assistant service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_app["Route application<br/>[App.jsx]"]
  node_taskboard["Browse and post tasks<br/>[BrowseTasks.jsx]"]
  node_dashboard["Task dashboards<br/>[Dashboard.jsx]"]
  node_workersui["Worker directory<br/>[Workers.jsx]"]
  node_chatui["Chat interface<br/>[Chat.jsx]"]
  node_authui["Account screens<br/>[SignIn.jsx]"]
  node_profileui["Profile screens<br/>[Profile.jsx]"]
  node_adminui["Admin panel<br/>[AdminPanel.jsx]"]
  node_feedbackui["Feedback and reports<br/>[Feedback.jsx]"]
  node_aichatui["AI assistant<br/>[AIChatbot.jsx]"]
end

subgraph group_marketplace["Marketplace operations"]
  node_tasks["Task management<br/>[TaskController.php]"]
  node_applications["Worker applications"]
  node_payments["Payments"]
  node_gateway["SSLCommerz service<br/>[SslCommerz.php]"]
  node_workers["Worker services"]
end

subgraph group_support["Support and intelligence"]
  node_chat["Messaging<br/>[ChatController.php]"]
  node_feedback["Feedback and complaints"]
  node_complaints["Worker complaints"]
  node_rag["RAG assistant service<br/>[RagService.php]"]
  node_knowledge[("Knowledge chunks")]
  node_ingest["Knowledge ingestion<br/>[AiIngest.php]"]
end

subgraph group_platform["Accounts and persistence"]
  node_api["HTTP client<br/>[api.js]"]
  node_authstate["Authentication state<br/>[AuthContext.jsx]"]
  node_routes["API routing<br/>[api.php]"]
  node_auth["Authentication<br/>[AuthController.php]"]
  node_account["Account and profile"]
  node_database[("Application database<br/>[database.php]")]
end

node_customer(("Customer"))
node_worker(("Service worker"))
node_admin(("Administrator"))
node_gemini["Google Gemini"]
node_paymentservice["SSLCommerz gateway"]
node_visitor(("Marketplace visitor"))

node_visitor -->|"opens"| node_app
node_customer -->|"uses"| node_app
node_worker -->|"uses"| node_app
node_admin -->|"uses"| node_app
node_app -->|"routes to"| node_taskboard
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_workersui
node_app -->|"routes to"| node_chatui
node_app -->|"routes to"| node_authui
node_app -->|"routes to"| node_profileui
node_app -->|"routes to"| node_adminui
node_app -->|"routes to"| node_feedbackui
node_app -->|"renders"| node_aichatui
node_authui -->|"uses"| node_authstate
node_app -->|"checks role"| node_authstate
node_taskboard -->|"requests tasks"| node_api
node_api -->|"sends API requests"| node_routes
node_routes -->|"dispatches task routes"| node_tasks
node_routes -->|"dispatches application routes"| node_applications
node_routes -->|"dispatches auth routes"| node_auth
node_routes -->|"dispatches payment routes"| node_payments
node_routes -->|"dispatches worker routes"| node_workers
node_routes -->|"dispatches chat routes"| node_chat
node_routes -->|"dispatches account routes"| node_account
node_routes -->|"dispatches feedback routes"| node_feedback
node_routes -->|"dispatches complaint routes"| node_complaints
node_tasks -->|"reads applicants"| node_applications
node_tasks -->|"reads and writes"| node_database
node_applications -->|"reads and writes"| node_database
node_payments -->|"reads and writes"| node_database
node_payments -->|"initiates and validates"| node_gateway
node_gateway -->|"requests payment"| node_paymentservice
node_workers -->|"reads worker data"| node_database
node_chat -->|"reads and writes"| node_database
node_account -->|"reads and writes"| node_database
node_auth -->|"reads and writes"| node_database
node_feedback -->|"writes feedback"| node_database
node_complaints -->|"writes complaints"| node_database
node_aichatui -->|"sends questions"| node_api
node_routes -->|"dispatches AI requests"| node_rag
node_rag -->|"retrieves chunks"| node_knowledge
node_rag -->|"embeds and generates"| node_gemini
node_knowledge -->|"stores embeddings"| node_database
node_ingest -->|"chunks and ingests"| node_rag
node_rag -->|"stores chunks"| node_knowledge

click node_app "https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/frontend/src/App.jsx"
click node_taskboard "https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/frontend/src/pages/BrowseTasks.jsx"
click node_dashboard "https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/frontend/src/pages/Dashboard.jsx"
click node_workersui "https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/frontend/src/pages/Workers.jsx"
click node_chatui "https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/frontend/src/pages/Chat.jsx"
click node_authui "https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/frontend/src/pages/SignIn.jsx"
click node_profileui "https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/frontend/src/pages/Profile.jsx"
click node_adminui "https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/frontend/src/pages/AdminPanel.jsx"
click node_feedbackui "https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/frontend/src/pages/Feedback.jsx"
click node_aichatui "https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/frontend/src/components/AIChatbot.jsx"
click node_api "https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/frontend/src/lib/api.js"
click node_authstate "https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/frontend/src/context/AuthContext.jsx"
click node_routes "https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/routes/api.php"
click node_auth "https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/app/Http/Controllers/AuthController.php"
click node_tasks "https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/app/Http/Controllers/TaskController.php"
click node_applications "https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/app/Http/Controllers/TaskApplicationController.php"
click node_payments "https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/app/Http/Controllers/PaymentController.php"
click node_gateway "https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/app/Services/SslCommerz.php"
click node_chat "https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/app/Http/Controllers/ChatController.php"
click node_workers "https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/app/Http/Controllers/WorkerController.php"
click node_account "https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/app/Http/Controllers/AccountController.php"
click node_feedback "https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/app/Http/Controllers/FeedbackController.php"
click node_complaints "https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/app/Http/Controllers/ComplaintController.php"
click node_rag "https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/app/Services/RagService.php"
click node_knowledge "https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/app/Models/AiKnowledgeChunk.php"
click node_ingest "https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/app/Console/Commands/AiIngest.php"
click node_database "https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/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_app,node_taskboard,node_dashboard,node_workersui,node_chatui,node_authui,node_profileui,node_adminui,node_feedbackui,node_aichatui toneBlue
class node_tasks,node_applications,node_payments,node_gateway,node_workers toneAmber
class node_chat,node_feedback,node_complaints,node_rag,node_knowledge,node_ingest toneMint
class node_api,node_authstate,node_routes,node_auth,node_account,node_database,node_worker toneRose
class node_customer,node_admin,node_gemini,node_paymentservice,node_visitor toneIndigo
```

## Components

### Web experience

- [Route application](https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/frontend/src/App.jsx): `packages/frontend/src/App.jsx`
- [Browse and post tasks](https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/frontend/src/pages/BrowseTasks.jsx): `packages/frontend/src/pages/BrowseTasks.jsx`
- [Task dashboards](https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/frontend/src/pages/Dashboard.jsx): `packages/frontend/src/pages/Dashboard.jsx`
- [Worker directory](https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/frontend/src/pages/Workers.jsx): `packages/frontend/src/pages/Workers.jsx`
- [Chat interface](https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/frontend/src/pages/Chat.jsx): `packages/frontend/src/pages/Chat.jsx`
- [Account screens](https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/frontend/src/pages/SignIn.jsx): `packages/frontend/src/pages/SignIn.jsx`
- [Profile screens](https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/frontend/src/pages/Profile.jsx): `packages/frontend/src/pages/Profile.jsx`
- [Admin panel](https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/frontend/src/pages/AdminPanel.jsx): `packages/frontend/src/pages/AdminPanel.jsx`
- [Feedback and reports](https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/frontend/src/pages/Feedback.jsx): `packages/frontend/src/pages/Feedback.jsx`
- [AI assistant](https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/frontend/src/components/AIChatbot.jsx): `packages/frontend/src/components/AIChatbot.jsx`

### Marketplace operations

- [Task management](https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/app/Http/Controllers/TaskController.php): `packages/backend/app/Http/Controllers/TaskController.php`
- [Worker applications](https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/app/Http/Controllers/TaskApplicationController.php): `packages/backend/app/Http/Controllers/TaskApplicationController.php`
- [Payments](https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/app/Http/Controllers/PaymentController.php): `packages/backend/app/Http/Controllers/PaymentController.php`
- [SSLCommerz service](https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/app/Services/SslCommerz.php): `packages/backend/app/Services/SslCommerz.php`
- [Worker services](https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/app/Http/Controllers/WorkerController.php): `packages/backend/app/Http/Controllers/WorkerController.php`

### Support and intelligence

- [Messaging](https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/app/Http/Controllers/ChatController.php): `packages/backend/app/Http/Controllers/ChatController.php`
- [Feedback and complaints](https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/app/Http/Controllers/FeedbackController.php): `packages/backend/app/Http/Controllers/FeedbackController.php`
- [Worker complaints](https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/app/Http/Controllers/ComplaintController.php): `packages/backend/app/Http/Controllers/ComplaintController.php`
- [RAG assistant service](https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/app/Services/RagService.php): `packages/backend/app/Services/RagService.php`
- [Knowledge chunks](https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/app/Models/AiKnowledgeChunk.php): `packages/backend/app/Models/AiKnowledgeChunk.php`
- [Knowledge ingestion](https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/app/Console/Commands/AiIngest.php): `packages/backend/app/Console/Commands/AiIngest.php`

### Accounts and persistence

- [HTTP client](https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/frontend/src/lib/api.js): `packages/frontend/src/lib/api.js`
- [Authentication state](https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/frontend/src/context/AuthContext.jsx): `packages/frontend/src/context/AuthContext.jsx`
- [API routing](https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/routes/api.php): `packages/backend/routes/api.php`
- [Authentication](https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/app/Http/Controllers/AuthController.php): `packages/backend/app/Http/Controllers/AuthController.php`
- [Account and profile](https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/app/Http/Controllers/AccountController.php): `packages/backend/app/Http/Controllers/AccountController.php`
- [Application database](https://github.com/ehsanulhaque1/home-service-hub/blob/main/packages/backend/config/database.php): `packages/backend/config/database.php`

### Other components

- **Customer**
- **Service worker**
- **Administrator**
- **Google Gemini**
- **SSLCommerz gateway**
- **Marketplace visitor**

## Connections

- Marketplace visitor → Route application: opens
- Customer → Route application: uses
- Service worker → Route application: uses
- Administrator → Route application: uses
- Route application → Browse and post tasks: routes to
- Route application → Task dashboards: routes to
- Route application → Worker directory: routes to
- Route application → Chat interface: routes to
- Route application → Account screens: routes to
- Route application → Profile screens: routes to
- Route application → Admin panel: routes to
- Route application → Feedback and reports: routes to
- Route application → AI assistant: renders
- Account screens → Authentication state: uses
- Route application → Authentication state: checks role
- Browse and post tasks → HTTP client: requests tasks
- HTTP client → API routing: sends API requests
- API routing → Task management: dispatches task routes
- API routing → Worker applications: dispatches application routes
- API routing → Authentication: dispatches auth routes
- API routing → Payments: dispatches payment routes
- API routing → Worker services: dispatches worker routes
- API routing → Messaging: dispatches chat routes
- API routing → Account and profile: dispatches account routes
- API routing → Feedback and complaints: dispatches feedback routes
- API routing → Worker complaints: dispatches complaint routes
- Task management → Worker applications: reads applicants
- Task management → Application database: reads and writes
- Worker applications → Application database: reads and writes
- Payments → Application database: reads and writes
- Payments → SSLCommerz service: initiates and validates
- SSLCommerz service → SSLCommerz gateway: requests payment
- Worker services → Application database: reads worker data
- Messaging → Application database: reads and writes
- Account and profile → Application database: reads and writes
- Authentication → Application database: reads and writes
- Feedback and complaints → Application database: writes feedback
- Worker complaints → Application database: writes complaints
- AI assistant → HTTP client: sends questions
- API routing → RAG assistant service: dispatches AI requests
- RAG assistant service → Knowledge chunks: retrieves chunks
- RAG assistant service → Google Gemini: embeds and generates
- Knowledge chunks → Application database: stores embeddings
- Knowledge ingestion → RAG assistant service: chunks and ingests
- RAG assistant service → Knowledge chunks: stores chunks
