# rajshekharbind/workforce architecture

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

- Interactive diagram: https://gitdiagram.com/rajshekharbind/workforce
- Repository: https://github.com/rajshekharbind/workforce

## Overview

Kaam Karao is a labor-booking and dispatch marketplace. Customers discover trades and estimate costs, submit a service request, and view its status; dispatchers review requests and update their status, while workers execute the job and customers inspect and pay on completion. The sampled routes show booking persistence, tracking, and authentication backed by MongoDB. README-documented dispatch, warranty, and informational capabilities are included, but worker assignment and execution have no implementation path in the supplied tree; those links are documented rather than verified in source.

Main entry points: [`src/lib/mongodb.js`](https://github.com/rajshekharbind/workforce/blob/main/src/lib/mongodb.js) (MongoDB), [`src/app/api/bookings/route.js`](https://github.com/rajshekharbind/workforce/blob/main/src/app/api/bookings/route.js) (Booking API), [`src/app/admin/page.js`](https://github.com/rajshekharbind/workforce/blob/main/src/app/admin/page.js) (Dispatcher console), [`src/app/api/bookings/[id]/route.js`](https://github.com/rajshekharbind/workforce/blob/main/src/app/api/bookings/%5Bid%5D/route.js) (Booking operations API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Service discovery"]
  node_landing["Home discovery<br/>[page.js]"]
  node_services["Trade catalog<br/>[page.js]"]
  node_service_info["Service information<br/>[page.js]"]
  node_help_info["Help and contact<br/>[page.js]"]
  node_contact["Contact support<br/>[page.js]"]
end

subgraph group_booking["Booking lifecycle"]
  node_booking_page["Booking page<br/>[page.js]"]
  node_booking_form["Estimate and request<br/>[form.js]"]
  node_booking_api["Booking API<br/>[route.js]"]
  node_tracking["Booking tracker<br/>[page.js]"]
end

subgraph group_dispatch["Dispatch and execution"]
  node_booking_admin["Booking operations API<br/>[route.js]"]
  node_admin["Dispatcher console<br/>[page.js]"]
  node_worker(("Assigned worker"))
  node_work["Work and warranty"]
end

subgraph group_identity["Account access"]
  node_login_page["Sign-in page<br/>[page.js]"]
  node_signup_page["Registration page<br/>[page.js]"]
  node_login_api["Login API<br/>[route.js]"]
  node_signup_api["Signup API<br/>[route.js]"]
end

subgraph group_platform["Shared platform"]
  node_mongo[("MongoDB<br/>[mongodb.js]")]
  node_shell["Site shell<br/>[layout.js]"]
  node_navbar["Navigation<br/>[Navbar.js]"]
  node_footer["Footer<br/>[Footer.js]"]
end

node_customer(("Customer"))

node_customer -->|"browses"| node_landing
node_customer -->|"browses"| node_services
node_landing -->|"starts booking"| node_booking_page
node_services -->|"starts booking"| node_booking_page
node_booking_page -->|"renders"| node_booking_form
node_booking_form -->|"submits request"| node_booking_api
node_booking_api -->|"inserts and lists"| node_mongo
node_booking_api -.->|"returns booking ID"| node_tracking
node_tracking -->|"reads booking"| node_mongo
node_admin -.->|"reviews bookings"| node_booking_api
node_admin -.->|"updates status"| node_booking_admin
node_booking_admin -->|"updates and deletes"| node_mongo
node_booking_admin -.->|"status appears"| node_tracking
node_admin -.->|"matches worker"| node_worker
node_worker -.->|"executes job"| node_work
node_work -.->|"inspection and payment"| node_customer
node_customer -.->|"signs in"| node_login_page
node_customer -.->|"registers"| node_signup_page
node_login_page -.->|"authenticates"| node_login_api
node_signup_page -.->|"registers"| node_signup_api
node_login_api -->|"reads users"| node_mongo
node_signup_api -->|"stores users"| node_mongo
node_shell -->|"renders"| node_navbar
node_shell -->|"renders"| node_footer

click node_landing "https://github.com/rajshekharbind/workforce/blob/main/src/app/page.js"
click node_services "https://github.com/rajshekharbind/workforce/blob/main/src/app/services/page.js"
click node_service_info "https://github.com/rajshekharbind/workforce/blob/main/src/app/about/page.js"
click node_help_info "https://github.com/rajshekharbind/workforce/blob/main/src/app/faq/page.js"
click node_contact "https://github.com/rajshekharbind/workforce/blob/main/src/app/contact/page.js"
click node_booking_page "https://github.com/rajshekharbind/workforce/blob/main/src/app/bookings/page.js"
click node_booking_form "https://github.com/rajshekharbind/workforce/blob/main/src/app/bookings/form.js"
click node_booking_api "https://github.com/rajshekharbind/workforce/blob/main/src/app/api/bookings/route.js"
click node_tracking "https://github.com/rajshekharbind/workforce/blob/main/src/app/bookings/%5Bid%5D/page.js"
click node_booking_admin "https://github.com/rajshekharbind/workforce/blob/main/src/app/api/bookings/%5Bid%5D/route.js"
click node_admin "https://github.com/rajshekharbind/workforce/blob/main/src/app/admin/page.js"
click node_login_page "https://github.com/rajshekharbind/workforce/blob/main/src/app/login/page.js"
click node_signup_page "https://github.com/rajshekharbind/workforce/blob/main/src/app/signup/page.js"
click node_login_api "https://github.com/rajshekharbind/workforce/blob/main/src/app/api/auth/login/route.js"
click node_signup_api "https://github.com/rajshekharbind/workforce/blob/main/src/app/api/auth/signup/route.js"
click node_mongo "https://github.com/rajshekharbind/workforce/blob/main/src/lib/mongodb.js"
click node_shell "https://github.com/rajshekharbind/workforce/blob/main/src/app/layout.js"
click node_navbar "https://github.com/rajshekharbind/workforce/blob/main/src/components/Navbar.js"
click node_footer "https://github.com/rajshekharbind/workforce/blob/main/src/components/Footer.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_landing,node_services,node_service_info,node_help_info,node_contact toneBlue
class node_booking_page,node_booking_form,node_booking_api,node_tracking toneAmber
class node_booking_admin,node_admin,node_worker,node_work toneMint
class node_login_page,node_signup_page,node_login_api,node_signup_api toneRose
class node_mongo,node_shell,node_navbar,node_footer,node_customer toneIndigo
```

## Components

### Service discovery

- [Home discovery](https://github.com/rajshekharbind/workforce/blob/main/src/app/page.js): `src/app/page.js`
- [Trade catalog](https://github.com/rajshekharbind/workforce/blob/main/src/app/services/page.js): `src/app/services/page.js`
- [Service information](https://github.com/rajshekharbind/workforce/blob/main/src/app/about/page.js): `src/app/about/page.js`
- [Help and contact](https://github.com/rajshekharbind/workforce/blob/main/src/app/faq/page.js): `src/app/faq/page.js`
- [Contact support](https://github.com/rajshekharbind/workforce/blob/main/src/app/contact/page.js): `src/app/contact/page.js`

### Booking lifecycle

- [Booking page](https://github.com/rajshekharbind/workforce/blob/main/src/app/bookings/page.js): `src/app/bookings/page.js`
- [Estimate and request](https://github.com/rajshekharbind/workforce/blob/main/src/app/bookings/form.js): `src/app/bookings/form.js`
- [Booking API](https://github.com/rajshekharbind/workforce/blob/main/src/app/api/bookings/route.js): `src/app/api/bookings/route.js`
- [Booking tracker](https://github.com/rajshekharbind/workforce/blob/main/src/app/bookings/%5Bid%5D/page.js): `src/app/bookings/[id]/page.js`

### Dispatch and execution

- [Booking operations API](https://github.com/rajshekharbind/workforce/blob/main/src/app/api/bookings/%5Bid%5D/route.js): `src/app/api/bookings/[id]/route.js`
- [Dispatcher console](https://github.com/rajshekharbind/workforce/blob/main/src/app/admin/page.js): `src/app/admin/page.js`
- **Assigned worker**
- **Work and warranty**

### Account access

- [Sign-in page](https://github.com/rajshekharbind/workforce/blob/main/src/app/login/page.js): `src/app/login/page.js`
- [Registration page](https://github.com/rajshekharbind/workforce/blob/main/src/app/signup/page.js): `src/app/signup/page.js`
- [Login API](https://github.com/rajshekharbind/workforce/blob/main/src/app/api/auth/login/route.js): `src/app/api/auth/login/route.js`
- [Signup API](https://github.com/rajshekharbind/workforce/blob/main/src/app/api/auth/signup/route.js): `src/app/api/auth/signup/route.js`

### Shared platform

- [MongoDB](https://github.com/rajshekharbind/workforce/blob/main/src/lib/mongodb.js): `src/lib/mongodb.js`
- [Site shell](https://github.com/rajshekharbind/workforce/blob/main/src/app/layout.js): `src/app/layout.js`
- [Navigation](https://github.com/rajshekharbind/workforce/blob/main/src/components/Navbar.js): `src/components/Navbar.js`
- [Footer](https://github.com/rajshekharbind/workforce/blob/main/src/components/Footer.js): `src/components/Footer.js`

### Other components

- **Customer**

## Connections

- Customer → Home discovery: browses (evidence: `README.md`)
- Customer → Trade catalog: browses (evidence: `README.md`)
- Home discovery → Booking page: starts booking (evidence: `README.md`)
- Trade catalog → Booking page: starts booking (evidence: `README.md`)
- Booking page → Estimate and request: renders (evidence: `src/app/bookings/page.js`)
- Estimate and request → Booking API: submits request (evidence: `src/app/bookings/form.js`)
- Booking API → MongoDB: inserts and lists (evidence: `src/app/api/bookings/route.js`)
- Booking API → Booking tracker: returns booking ID (evidence: `README.md`)
- Booking tracker → MongoDB: reads booking (evidence: `src/app/bookings/[id]/page.js`)
- Dispatcher console → Booking API: reviews bookings (evidence: `README.md`)
- Dispatcher console → Booking operations API: updates status (evidence: `README.md`)
- Booking operations API → MongoDB: updates and deletes (evidence: `src/app/api/bookings/[id]/route.js`)
- Booking operations API → Booking tracker: status appears (evidence: `README.md`)
- Dispatcher console → Assigned worker: matches worker (evidence: `README.md`)
- Assigned worker → Work and warranty: executes job (evidence: `README.md`)
- Work and warranty → Customer: inspection and payment (evidence: `README.md`)
- Customer → Sign-in page: signs in (evidence: `README.md`)
- Customer → Registration page: registers (evidence: `README.md`)
- Sign-in page → Login API: authenticates
- Registration page → Signup API: registers
- Login API → MongoDB: reads users (evidence: `src/app/api/auth/login/route.js`)
- Signup API → MongoDB: stores users (evidence: `src/app/api/auth/signup/route.js`)
- Site shell → Navigation: renders (evidence: `src/app/layout.js`)
- Site shell → Footer: renders (evidence: `src/app/layout.js`)
