Digital Labour Bazar — Platform Flow Architecture

Live · lebarbazar.com

Digital Labour Bazar

कामगार खोजें, काम पाएं

Find Workers · Get Work · Build India

WorkersकामगारLabour Force
Employersनियोक्ताJob Givers
Adminप्रशासकModerators
Super Adminसुपर एडमिनPlatform Owner
Live Platform
lebarbazar.com
Mobile-First
React + TypeScript
Database
MySQL + Drizzle ORM
Auth
OTP-Based Login
Revenue Model
Commission per Hire
OTP Verification
Work Start & End

Platform Highlights

What makes Digital Labour Bazar unique

End-to-end hiring pipeline with OTP-verified work start & completion
Admin approval workflow — every worker verified before activation
Real-time commission tracking & monthly revenue analytics
Super Admin database manager with SQL query runner
Roadmap: SMS gateway, Razorpay/UPI payments, Google Business Profile

Platform Architecture Overview

How all four user roles connect to the platform core

Workerकामगार
Employerनियोक्ता
Adminप्रशासक
Super Adminसुपर एडमिन
Platform Core
Digital Labour Bazar
React FrontendMobile-first UI
MySQL Database7 tables, Drizzle ORM
Express REST APIAll business logic
SMS GatewayMSG91 / Fast2SMS⚠️ Pending
Payment GatewayRazorpay / UPI⚠️ Pending
OTP SystemWork Start & End✓ Live
1

Worker Journey

Registration → Approval → Jobs → OTP Work Flow → Payment Received

कामगार
Phase 1Registration & Phone Verification
1
Visit Sitelebarbazar.com
2
Fill FormName, Phone, Skill, Village
3
Upload SelfieCompressed base64
OTP
4
Phone Verified4-digit OTP
Phase 2Admin Approval Gate
5
Pending ReviewAwaiting admin
6
Admin ReviewsSelfie + details
Admin Decision?
✓Approve✗Reject
Approved
admin_approved = true
Worker can now login
Rejected
Cannot Login
Registration denied
Phase 3Login & Dashboard Access
7
Worker Login/worker-login
OTP
8
Session CreatedsessionStorage
9
DashboardStats, Jobs, Wallet
10
Browse Jobs/worker/jobs
Apply
11
Application Sentjob_applications table
Phase 4Hire Request Status Pipeline
Requested
Accepted
Confirmed
Work Started
Completed
Payment Done
Payment Received
Phase 5OTP Work Start Verification
12
Worker Triggers OTPPOST /api/hire-request/otp
13
Employer Sees OTPAuto-refresh 8s
Tells OTP
14
Employer VerifiesPOST /otp/verify
15
Work Started ✓work_start_otp saved
DB: work_start_otp + work_start_otp_at saved in hire_requests
Phase 6OTP Work Completion Verification
16
Worker Triggers Completion OTPSame API, type=completion
17
Employer Sees OTPAuto-refresh 8s
Tells OTP
18
Employer VerifiesStatus: Completed
DB: completion_otp + completion_otp_at saved
Phase 7Payment & Wallet Update
19
Employer PaysUPI / Online / Cash
20
Status: Payment Donepayment_mode saved
21
Worker ConfirmsPayment Received ✓
22
Wallet Updateddaily_rate × days
Key DB Fields — labour_registrations
namephoneskillvillageexperienceselfie_urladmin_approvedbadgesavailabilityblocked
2

Employer Journey

Registration → Login → Post Job → Hire → OTP → Payment Done

नियोक्ता
Phase 1Registration & Login
1
Register/register-employer
2
Fill DetailsCompany, Phone, GST
OTP
3
Phone Verified4-digit OTP
4
Login/employer-login
5
DashboardStats + Requests
Session stored in sessionStorage — phone + company name
Phase 2Post Job OR Search & Hire Workers

Path A — Post a Job

6
Post Job/employer/post-job
7
Workers Applyjob_applications
8
Review & HireAccept applicant

Path B — Direct Search

6
Search Workers/employer/search
7
View ProfileSelfie, rating, skill
Hire
8
Send Hire RequestStatus: Requested
Phase 3Manage Hire Request — /employer/hire-worker
9
RequestedWaiting for worker
Worker Accepts
10
AcceptedWorker agreed
Employer Confirms
11
ConfirmedBoth agreed
Phase 4OTP Work Start — Employer Side
12
OTP Panel AppearsAuto-refresh every 8s
Worker tells OTP
13
Employer Enters OTPPOST /otp/verify
14
Work Started ✓Status updated
fetchHires uses useCallback · setSelected uses functional update to avoid stale closures
Phase 5Work Completion & Payment
15
Completion OTPWorker triggers
Verify
16
Completed ✓Status: Completed
17
Payment PanelUPI / Online / Cash
18
Mark PaidStatus: Payment Done
payment_mode saved in hire_requests · Worker confirms → payment_received

Key DB Fields — employer_registrations

phonecompany_namegstverification_badgeblocked
3

Admin Panel Flow

Login → Verify Users → Manage Jobs → Monitor Requests → Revenue

प्रशासक
Step 1Admin Login & Dashboard
1
Go to /adminEnter credentials
2
Admin Panel8 stat cards
Click any card
3
Navigate to TabCards are clickable
Auto-refresh every 30 seconds · Pending badge = combined labour + employer pending count
Step 2Admin Panel — 8 Tabs
Dashboard
8 stat cards
Workers
Approve / Block
Employers
Verify / Block
Verification
Pending queue
Jobs
Monitor listings
Hire Requests
Full pipeline view
Payments
Transaction log
Revenue
Monthly bar chart

🔴 Red dot = tab has live badge/count indicator

Step 3Worker & Employer Verification
4
View Pending WorkersSelfie + details
5
Review ProfileSkill, village, exp
✓ Approve
admin_approved = true
✗ Reject
Cannot login
🔒 Block
blocked = true
🗑 Delete
Permanent removal
API: POST /api/admin/approve · POST /api/admin/user-action
Step 4Revenue & Commission Tracking
6
Revenue TabMonthly bar chart
7
Commission RategetSettings().jobPlacementCommission
Calc
8
CommissionRate × daily_rate
API: GET /api/admin/stats?commissionRate=10 — real data from completed hire_requests
4

Super Admin Panel Flow

Platform Settings → DB Manager → SQL Runner → Full Control

सुपर एडमिन
TabsSuper Admin Panel — 8 Tabs
Dashboard
Workers
Employers
Jobs
Hire Requests
Revenue
Settings
Database Manager
SettingsPlatform Settings
Commission Rate %
Platform Fee
SMS Gateway Config
Payment Gateway
Support Contact
Support Email
Razorpay Keys
MSG91 / Fast2SMS
⚠️ Settings currently persist to localStorage only — DB persistence is a planned next step
Database Manager
7 tables, 20 rows/page
Client-side search
View / Edit modals
Delete with confirm
labour_registrationsemployer_registrationshire_requestsjob_applicationsjobsotp_logssettings
SQL Query Runner
›SELECT only (security enforced)
›Ctrl+Enter to execute
›7 pre-built quick queries
›Copy results as TSV
›Execution time in ms
All pending workersAll active hire requestsMonthly revenueTop workers by ratingBlocked usersRecent registrationsPayment summary
POST /api/super-admin/db/query → { rows, columns, elapsedMs }
User ControlPlatform-wide User Management
Unblock Userblocked = false
Block Userblocked = true
Delete UserPermanent
Verify Employerverification_badge = true
API: POST /api/admin/user-action { action, phone, role }

Database Schema

6 core tables powering the platform (+ otp_logs)

labour_registrations
idINT PK
nameVARCHAR
phoneVARCHAR
skillVARCHAR
villageVARCHAR
experienceVARCHAR
selfie_urlMEDIUMTEXT
admin_approvedBOOLEAN
badgesJSON
availabilityVARCHAR
blockedBOOLEAN
hire_requests
idINT PK
employer_phoneVARCHAR
worker_phoneVARCHAR
statusENUM
daily_rateDECIMAL
payment_modeVARCHAR
work_start_otpVARCHAR
work_start_otp_atDATETIME
completion_otpVARCHAR
completion_otp_atDATETIME
employer_registrations
idINT PK
phoneVARCHAR
company_nameVARCHAR
gstVARCHAR
verification_badgeBOOLEAN
blockedBOOLEAN
job_applications
idINT PK
worker_phoneVARCHAR
job_idINT FK
statusENUM
applied_atDATETIME
jobs
idINT PK
employer_phoneVARCHAR
titleVARCHAR
skill_requiredVARCHAR
locationVARCHAR
daily_rateDECIMAL
statusENUM
settings
idINT PK
keyVARCHAR
valueTEXT
updated_atDATETIME

Key Relationships

hire_requests.worker_phonelabour_registrations.phone
hire_requests.employer_phoneemployer_registrations.phone
job_applications.job_idjobs.id
job_applications.worker_phonelabour_registrations.phone

Technology Stack

Full-stack architecture powering Digital Labour Bazar

Frontend
React 19 + TypeScript
Vite, Tailwind CSS, shadcn UI, Motion
Backend
Express.js + Node.js
REST API, SSR, route handlers
Database
MySQL + Drizzle ORM
7 tables, migrations, raw SQL support
Auth
OTP-Based Login
sessionStorage, custom events (SMS pending)
Revenue
Commission Model
Rate% × daily_rate per hire request
OTP System
Work Start & End
Random 4-digit, SMS gateway pending

Roadmap & Next Steps

Planned features for production readiness

SMS GatewayPlanned

MSG91 / Fast2SMS for real OTP delivery

Payment IntegrationPlanned

Razorpay / UPI → commission cut → worker payout

Persist Settings to DBPlanned

Super Admin settings currently in localStorage

Google Business ProfilePlanned

Category: Employment Agency

Social Media AccountsPlanned

Facebook, Instagram, LinkedIn — update Footer URLs

Agriculture & Shopkeeper APIsPlanned

UI exists — backend APIs pending

Digital Labour Bazar

Platform Architecture — Board of Directors Presentation

Confidential · August 2026 · lebarbazar.com