# hasanpp/worklaza architecture

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

- Interactive diagram: https://gitdiagram.com/hasanpp/worklaza
- Repository: https://github.com/hasanpp/worklaza

## Overview

WorkLaza connects customers seeking local services with registered workers, with administrators managing platform activity. Customers sign up or sign in, browse worker profiles and availability, submit bookings, communicate with workers, and can review completed services; workers manage profiles, schedules, bookings, chats, and fee payments. The Django API supports these flows, while a separate admin interface monitors users, workers, bookings, and fees. Real-time messaging and notifications are documented capabilities; their detailed wiring is not fully shown in the sampled source.

Main entry points: [`backend/worker/views.py`](https://github.com/hasanpp/worklaza/blob/main/backend/worker/views.py) (Worker endpoints), [`frontend/src/Worker/Worker.jsx`](https://github.com/hasanpp/worklaza/blob/main/frontend/src/Worker/Worker.jsx) (Worker portal), [`frontend/src/App.jsx`](https://github.com/hasanpp/worklaza/blob/main/frontend/src/App.jsx) (App and routes), [`backend/user/views.py`](https://github.com/hasanpp/worklaza/blob/main/backend/user/views.py) (User and booking endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer experience"]
  node_app["App and routes<br/>[App.jsx]"]
  node_auth["Authentication state<br/>[authSlice.jsx]"]
  node_api["API client<br/>[api.js]"]
  node_customer_pages["Browse and book<br/>[Worker_details.jsx]"]
  node_customer_layout["Customer pages<br/>[Layout.jsx]"]
end

subgraph group_worker["Worker experience"]
  node_worker_registration["Worker registration<br/>[WorkerRegister.jsx]"]
  node_worker_portal["Worker portal<br/>[Worker.jsx]"]
  node_worker_pages["Worker workspace"]
end

subgraph group_backend["Platform API and domain"]
  node_worker_api["Worker endpoints<br/>[views.py]"]
  node_worker_domain[("Worker profiles and availability<br/>[models.py]")]
  node_user_api["User and booking endpoints<br/>[views.py]"]
  node_user_domain[("User accounts<br/>[models.py]")]
  node_booking_domain[("Bookings and reviews<br/>[models.py]")]
  node_booking_serializers["Booking API data<br/>[serializers.py]"]
end

subgraph group_operations["Admin and realtime"]
  node_admin_ui["Admin dashboard<br/>[Admin.jsx]"]
  node_admin_workers["Worker management<br/>[Workers.jsx]"]
  node_admin_api["Admin endpoints<br/>[views.py]"]
  node_admin_domain[("Admin records<br/>[models.py]")]
  node_realtime["Chat and notifications<br/>[consumers.py]"]
end

node_customer(("Customer"))

node_customer -->|"uses"| node_app
node_app -->|"restores session"| node_auth
node_app -->|"routes to"| node_customer_layout
node_customer_layout -->|"renders"| node_customer_pages
node_customer_pages -->|"requests profile and booking"| node_api
node_worker_registration -->|"submits registration"| node_api
node_worker_registration -.->|"registers with"| node_worker_api
node_worker_portal -->|"renders"| node_worker_pages
node_worker_portal -->|"updates worker location"| node_worker_api
node_api -.->|"calls API"| node_user_api
node_user_api -->|"uses accounts"| node_user_domain
node_user_api -->|"handles bookings"| node_booking_domain
node_worker_api -->|"uses worker data"| node_worker_domain
node_worker_api -->|"handles bookings"| node_booking_domain
node_booking_serializers -->|"serializes"| node_booking_domain
node_admin_ui -->|"renders"| node_admin_workers
node_admin_workers -->|"manages workers"| node_admin_api
node_admin_api -->|"uses admin records"| node_admin_domain
node_admin_api -->|"returns booking data"| node_booking_serializers
node_customer -.->|"chats and receives updates"| node_realtime
node_worker_portal -.->|"chats and receives updates"| node_realtime

click node_app "https://github.com/hasanpp/worklaza/blob/main/frontend/src/App.jsx"
click node_auth "https://github.com/hasanpp/worklaza/blob/main/frontend/src/authSlice.jsx"
click node_api "https://github.com/hasanpp/worklaza/blob/main/frontend/src/api.js"
click node_customer_pages "https://github.com/hasanpp/worklaza/blob/main/frontend/src/Pages/Worker_details/Worker_details.jsx"
click node_customer_layout "https://github.com/hasanpp/worklaza/blob/main/frontend/src/Layout/Layout.jsx"
click node_worker_registration "https://github.com/hasanpp/worklaza/blob/main/frontend/src/routes/WorkerRegister.jsx"
click node_worker_portal "https://github.com/hasanpp/worklaza/blob/main/frontend/src/Worker/Worker.jsx"
click node_worker_pages "https://github.com/hasanpp/worklaza/tree/main/frontend/src/Worker/Pages"
click node_worker_api "https://github.com/hasanpp/worklaza/blob/main/backend/worker/views.py"
click node_worker_domain "https://github.com/hasanpp/worklaza/blob/main/backend/worker/models.py"
click node_user_api "https://github.com/hasanpp/worklaza/blob/main/backend/user/views.py"
click node_user_domain "https://github.com/hasanpp/worklaza/blob/main/backend/user/models.py"
click node_booking_domain "https://github.com/hasanpp/worklaza/blob/main/backend/booking/models.py"
click node_booking_serializers "https://github.com/hasanpp/worklaza/blob/main/backend/booking/serializers.py"
click node_admin_ui "https://github.com/hasanpp/worklaza/blob/main/frontend/src/Admin/Admin.jsx"
click node_admin_workers "https://github.com/hasanpp/worklaza/blob/main/frontend/src/Admin/Pages/Workers.jsx"
click node_admin_api "https://github.com/hasanpp/worklaza/blob/main/backend/admin_panel/views.py"
click node_admin_domain "https://github.com/hasanpp/worklaza/blob/main/backend/admin_panel/models.py"
click node_realtime "https://github.com/hasanpp/worklaza/blob/main/backend/notifications/consumers.py"

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_auth,node_api,node_customer_pages,node_customer_layout toneBlue
class node_worker_registration,node_worker_portal,node_worker_pages toneAmber
class node_worker_api,node_worker_domain,node_user_api,node_user_domain,node_booking_domain,node_booking_serializers toneMint
class node_admin_ui,node_admin_workers,node_admin_api,node_admin_domain,node_realtime toneRose
class node_customer toneIndigo
```

## Components

### Customer experience

- [App and routes](https://github.com/hasanpp/worklaza/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Authentication state](https://github.com/hasanpp/worklaza/blob/main/frontend/src/authSlice.jsx): `frontend/src/authSlice.jsx`
- [API client](https://github.com/hasanpp/worklaza/blob/main/frontend/src/api.js): `frontend/src/api.js`
- [Browse and book](https://github.com/hasanpp/worklaza/blob/main/frontend/src/Pages/Worker_details/Worker_details.jsx): `frontend/src/Pages/Worker_details/Worker_details.jsx`
- [Customer pages](https://github.com/hasanpp/worklaza/blob/main/frontend/src/Layout/Layout.jsx): `frontend/src/Layout/Layout.jsx`

### Worker experience

- [Worker registration](https://github.com/hasanpp/worklaza/blob/main/frontend/src/routes/WorkerRegister.jsx): `frontend/src/routes/WorkerRegister.jsx`
- [Worker portal](https://github.com/hasanpp/worklaza/blob/main/frontend/src/Worker/Worker.jsx): `frontend/src/Worker/Worker.jsx`
- [Worker workspace](https://github.com/hasanpp/worklaza/tree/main/frontend/src/Worker/Pages): `frontend/src/Worker/Pages`

### Platform API and domain

- [Worker endpoints](https://github.com/hasanpp/worklaza/blob/main/backend/worker/views.py): `backend/worker/views.py`
- [Worker profiles and availability](https://github.com/hasanpp/worklaza/blob/main/backend/worker/models.py): `backend/worker/models.py`
- [User and booking endpoints](https://github.com/hasanpp/worklaza/blob/main/backend/user/views.py): `backend/user/views.py`
- [User accounts](https://github.com/hasanpp/worklaza/blob/main/backend/user/models.py): `backend/user/models.py`
- [Bookings and reviews](https://github.com/hasanpp/worklaza/blob/main/backend/booking/models.py): `backend/booking/models.py`
- [Booking API data](https://github.com/hasanpp/worklaza/blob/main/backend/booking/serializers.py): `backend/booking/serializers.py`

### Admin and realtime

- [Admin dashboard](https://github.com/hasanpp/worklaza/blob/main/frontend/src/Admin/Admin.jsx): `frontend/src/Admin/Admin.jsx`
- [Worker management](https://github.com/hasanpp/worklaza/blob/main/frontend/src/Admin/Pages/Workers.jsx): `frontend/src/Admin/Pages/Workers.jsx`
- [Admin endpoints](https://github.com/hasanpp/worklaza/blob/main/backend/admin_panel/views.py): `backend/admin_panel/views.py`
- [Admin records](https://github.com/hasanpp/worklaza/blob/main/backend/admin_panel/models.py): `backend/admin_panel/models.py`
- [Chat and notifications](https://github.com/hasanpp/worklaza/blob/main/backend/notifications/consumers.py): `backend/notifications/consumers.py`

### Other components

- **Customer**

## Connections

- Customer → App and routes: uses
- App and routes → Authentication state: restores session
- App and routes → Customer pages: routes to
- Customer pages → Browse and book: renders (evidence: `frontend/src/Layout/Layout.jsx`)
- Browse and book → API client: requests profile and booking (evidence: `frontend/src/Pages/Worker_details/Worker_details.jsx`)
- Worker registration → API client: submits registration (evidence: `frontend/src/routes/WorkerRegister.jsx`)
- Worker registration → Worker endpoints: registers with
- Worker portal → Worker workspace: renders (evidence: `frontend/src/Worker/Worker.jsx`)
- Worker portal → Worker endpoints: updates worker location (evidence: `frontend/src/Worker/Worker.jsx`)
- API client → User and booking endpoints: calls API
- User and booking endpoints → User accounts: uses accounts (evidence: `backend/user/views.py`)
- User and booking endpoints → Bookings and reviews: handles bookings (evidence: `backend/user/views.py`)
- Worker endpoints → Worker profiles and availability: uses worker data (evidence: `backend/worker/views.py`)
- Worker endpoints → Bookings and reviews: handles bookings (evidence: `backend/worker/views.py`)
- Booking API data → Bookings and reviews: serializes (evidence: `backend/booking/serializers.py`)
- Admin dashboard → Worker management: renders (evidence: `frontend/src/Admin/Admin.jsx`)
- Worker management → Admin endpoints: manages workers (evidence: `frontend/src/Admin/Pages/Workers.jsx`)
- Admin endpoints → Admin records: uses admin records (evidence: `backend/admin_panel/views.py`)
- Admin endpoints → Booking API data: returns booking data (evidence: `backend/admin_panel/views.py`)
- Customer → Chat and notifications: chats and receives updates
- Worker portal → Chat and notifications: chats and receives updates
