A production-style SaaS platform connecting Buyers who need small online tasks done with Workers who earn coins by completing them. Features a full coin economy, Stripe payments, real-time Socket.io messaging & notifications, and role-based dashboards β built to demonstrate real-world full-stack architecture.
TaskHub is a comprehensive micro-task marketplace where Buyers post tasks (watch a video, write a review, test an app, do research) and Workers earn coins by completing them. Workers and Buyers can communicate directly through a built-in real-time chat system powered by Socket.io β conversations are scoped to tasks, with typing indicators, read receipts, and persistent message history.
The platform runs on a transparent coin economy β Buyers purchase coins to fund tasks, Workers earn coins on approval and cash out via withdrawal requests.
Unlike a basic CRUD app, TaskHub is designed as a production-style SaaS:
- 3 distinct user roles with real-world responsibilities and separate dashboards
- Real-time messaging β Socket.io direct chat between Workers and Buyers, scoped to tasks, with typing indicators and read receipts
- Live notifications β bell icon with unread badge, action routing, and server-side triggers on key events
- Coin economy with monetization logic β buy rate vs withdrawal rate spread is the platform's revenue
- Secure auth with Google OAuth and email/password via NextAuth v5
- Real payment integration via Stripe Checkout with webhook verification
- Admin panel with advanced analytics, charts, and full platform management
- Public leaderboard showing top earners ranked by approved coins
- Fully responsive β mobile, tablet, and desktop layouts throughout
- π Browse and filter tasks by keyword, payout amount, category, and deadline
- π Submit proof with text details, multiple proof links, and optional image upload via imgBB
- π Track all submissions by status β pending, approved, rejected β with paginated history
- π° View available coin balance, pending clearance coins, and lifetime earnings in USD
- π§ Request withdrawals once balance hits 200 coins minimum (β $10 USD)
- π Personal earnings portal with full transaction history (earnings + withdrawals combined)
- π¬ Direct real-time messaging with Buyers, linked to specific tasks
- π Live notification bell with unread count β get notified on approvals, rejections, and withdrawal status
- π Appear on the public leaderboard ranked by total approved coins
- π€ Profile page with stats, badges, and submission history
- βοΈ Settings page for account preferences
- π Create tasks with title, description, category, required worker count, coin payout per worker, deadline, submission instructions, and task image
- π‘ Automatic coin deduction on task creation β total cost = requiredWorkers Γ payableAmount
- π Review worker submissions one by one β view full proof details, links, and images
- β Approve submissions to credit worker coins instantly
- β Reject submissions to free up the worker slot for re-submission
- π Dashboard with task activity chart (7-day bar chart), approval rate, and submission breakdown
- πͺ Purchase coins via Stripe, bKash, or SSLCommerz with 4 package tiers
- π Full payment history with gateway, coins, amount, and transaction ID
- π¬ Direct real-time messaging with Workers, linked to task context
- π Notifications for new submissions and platform events
- βοΈ Edit task title, description, and instructions after creation
- ποΈ Delete open tasks with automatic coin refund for unfilled slots
- π₯ Manage all users β view, update roles, suspend/activate, delete accounts
- π Manage all tasks β view details, block fraudulent or inappropriate tasks
- π¬ Process withdrawal requests β approve (deducts worker coins) or reject with notification
- π΅ View all platform payments with gateway breakdown and transaction details
- π Advanced analytics dashboard with date range filtering (7d, 30d, 90d, custom)
- π Revenue trend line chart, task volume bar chart, category split donut chart
- π Submission funnel visualization (submitted β approved β rejected β pending)
- π³ Payment gateway breakdown showing revenue split across Stripe, bKash, SSLCommerz
- π Top workers by earnings in selected period
- π§Ύ Recent payments feed with user, gateway, coins, and amount
- ποΈ Category management
- π Activity log for platform-wide event tracking
- π©Ί Platform health panel β coin circulation, pending withdrawals, pending submissions
- Framework: Next.js 16 (App Router, Server Components, Route Handlers)
- Language: TypeScript (strict mode throughout)
- Styling: Tailwind CSS v4 + DaisyUI component library
- State Management: TanStack Query v5 (server/async state) + Redux Toolkit (UI state β sidebar, notification panel, modals)
- Forms: React Hook Form + Zod validation (client and server)
- Animations: Framer Motion (sidebar slide, page transitions) + GSAP (homepage scroll animations) + Lenis (smooth scroll)
- Charts: Recharts (revenue line chart in admin analytics)
- Real-time: Socket.io client (
socket.io-client) - Notifications: React Hot Toast + SweetAlert2 (confirmation dialogs)
- Date utilities: date-fns
- Marquee: react-fast-marquee (trusted brands section on homepage)
- HTTP client: Axios
- Database: MongoDB Atlas + Mongoose ODM
- Authentication: NextAuth.js v5 beta β Credentials provider (email/password) + Google OAuth
- Session: JWT sessions with custom callbacks to embed
id,role,coinsinto session - Payment: Stripe Checkout Sessions + Stripe Webhooks for payment confirmation
- File Upload: imgBB API (proxied through Next.js route handler)
- Email: Resend
- Real-time server: Separate Express + Socket.io server (deployed on Render)
- API: Next.js Route Handlers under
/api/v1/ - Password hashing: bcryptjs
- ESLint (Next.js config)
- TypeScript strict mode
- Vercel deployment (frontend)
- Render deployment (Socket.io server)
taskhub/
βββ src/
β βββ app/
β β βββ (public)/
β β β βββ page.tsx # Homepage (server component)
β β β βββ tasks/page.tsx # Public task listing teaser
β β β βββ leaderboard/page.tsx # Top earners leaderboard
β β β βββ how-it-works/page.tsx # Platform explainer
β β β βββ about/page.tsx
β β β βββ faq/page.tsx
β β β βββ terms/page.tsx
β β β βββ privacy/page.tsx
β β β βββ support/page.tsx
β β β βββ layout.tsx # Public layout (Navbar + Footer)
β β βββ (auth)/
β β β βββ login/page.tsx
β β β βββ register/page.tsx
β β β βββ forgot-password/page.tsx
β β β βββ reset-password/page.tsx
β β β βββ layout.tsx
β β βββ (worker)/
β β β βββ worker/dashboard/page.tsx # Stats, earnings chart, recent submissions
β β β βββ worker/tasks/page.tsx # Browse & filter tasks
β β β βββ worker/tasks/[id]/page.tsx # Task detail + submission form
β β β βββ worker/submissions/page.tsx # My submissions (paginated, filterable)
β β β βββ worker/earnings/page.tsx # Earnings portal + transaction history
β β β βββ worker/withdrawals/page.tsx # Withdrawal form + history
β β β βββ worker/messages/page.tsx # Real-time chat
β β β βββ worker/profile/page.tsx # Profile + stats + badges
β β β βββ worker/settings/page.tsx
β β β βββ layout.tsx # Worker shell + auth guard
β β βββ (buyer)/
β β β βββ buyer/dashboard/page.tsx # Stats, task chart, pending submissions
β β β βββ buyer/tasks/page.tsx # My tasks table
β β β βββ buyer/tasks/new/page.tsx # Create task form
β β β βββ buyer/tasks/[id]/page.tsx # Task detail
β β β βββ buyer/tasks/[id]/edit/page.tsx # Edit task
β β β βββ buyer/tasks/[id]/success/page.tsx
β β β βββ buyer/submissions/page.tsx # Review submissions (approve/reject)
β β β βββ buyer/coins/page.tsx # Purchase coins (Stripe/bKash/SSLCommerz)
β β β βββ buyer/payments/page.tsx # Payment history
β β β βββ buyer/messages/page.tsx # Real-time chat
β β β βββ buyer/profile/page.tsx
β β β βββ layout.tsx # Buyer shell + auth guard
β β βββ (admin)/
β β β βββ admin/dashboard/page.tsx # Platform overview
β β β βββ admin/users/page.tsx # Manage users
β β β βββ admin/tasks/page.tsx # Manage tasks
β β β βββ admin/submissions/page.tsx # All submissions
β β β βββ admin/withdrawals/page.tsx # Process withdrawals
β β β βββ admin/payments/page.tsx # Platform payments
β β β βββ admin/stats/page.tsx # Advanced analytics
β β β βββ admin/categories/page.tsx # Category management
β β β βββ admin/activity/page.tsx # Activity log
β β β βββ layout.tsx # Admin shell + auth guard
β β βββ api/v1/
β β βββ auth/[...nextauth]/route.ts
β β βββ tasks/route.ts
β β βββ tasks/[id]/route.ts
β β βββ submissions/route.ts
β β βββ submissions/[id]/status/route.ts
β β βββ payments/packages/route.ts
β β βββ payments/create-session/route.ts
β β βββ payments/confirm/route.ts
β β βββ payments/stripe/webhook/route.ts
β β βββ withdrawals/route.ts
β β βββ withdrawals/[id]/approve/route.ts
β β βββ notifications/route.ts
β β βββ notifications/read-all/route.ts
β β βββ messages/route.ts
β β βββ messages/[conversationId]/route.ts
β β βββ admin/stats/route.ts
β β βββ admin/users/route.ts
β β βββ admin/users/[id]/route.ts
β β βββ admin/tasks/route.ts
β β βββ uploads/imgbb/route.ts
β βββ components/
β β βββ layout/
β β β βββ Navbar.tsx # Public navbar
β β β βββ Footer.tsx # Public footer
β β β βββ Sidebar.tsx # Dashboard sidebar (worker/buyer/admin nav)
β β β βββ DashboardShell.tsx # Dashboard wrapper with topbar
β β βββ ui/
β β β βββ Badge.tsx # Status badge (pending/approved/rejected)
β β β βββ Spinner.tsx
β β β βββ Logo.tsx
β β β βββ CountUp.tsx # Animated number counter
β β β βββ StatsSection.tsx # Homepage platform stats
β β β βββ CoinPackageCards.tsx # Homepage coin pricing cards
β β β βββ MarqueeBrands.tsx # Trusted by marquee
β β βββ admin/
β β β βββ StatsDateFilter.tsx # Date range preset selector
β β β βββ RevenueLineChart.tsx # Recharts line chart
β β β βββ ...
β β βββ messages/
β β β βββ MessagesUI.tsx # Full chat UI (conversation list + chat panel)
β β βββ notifications/
β β β βββ NotificationBell.tsx # Bell icon with unread badge + dropdown panel
β β βββ shared/
β β βββ StatCard.tsx # Reusable dashboard stat card
β βββ lib/
β β βββ db.ts # Mongoose connection helper
β β βββ auth.ts # NextAuth config + session callbacks
β β βββ coins.ts # coinsToUsdWithdraw() utility
β β βββ constants.ts # COIN_PACKAGES, PAYMENT_GATEWAYS, MIN_WITHDRAWAL_COINS
β β βββ notifications.ts # createNotification() helper
β β βββ statsDateRange.ts # Date range resolver for admin analytics
β β βββ validators/ # Zod schemas (task, submission, withdrawal)
β βββ models/
β β βββ User.ts
β β βββ Task.ts
β β βββ Submission.ts
β β βββ Payment.ts
β β βββ Withdrawal.ts
β β βββ Notification.ts
β β βββ Message.ts
β βββ store/
β β βββ index.ts # Redux store
β β βββ uiSlice.ts # sidebarOpen, notificationPanelOpen
β βββ hooks/
β β βββ useSocket.ts # Socket.io hook (send, receive, typing)
β β βββ ...
β βββ types/
β βββ index.ts # IUser, ITask, ISubmission, IPayment, IWithdrawal, INotification, IMessage, IConversation
βββ server/
β βββ index.js # Express + Socket.io server
βββ requirements/
β βββ requirement.md # Full feature spec
β βββ design.txt # HTML/Tailwind design mockups
βββ public/
TaskHub includes a full Socket.io powered messaging system between Workers and Buyers, scoped to individual tasks.
Architecture:
- A separate Express + Socket.io server runs independently (deployed on Render)
- The Next.js frontend connects via
socket.io-clientusing a customuseSockethook - Conversations are identified by a
conversationIdderived fromtaskId + buyerId + workerId
Features:
- Conversation list sidebar showing all active chats with last message preview and unread count badge
- Real-time message delivery without page refresh
- Typing indicators β animated bouncing dots appear while the other user is typing, with 1.5s debounce
- Read receipts β single β for sent, double ββ for read
- Messages persist in MongoDB and are fetched via TanStack Query on conversation open
- Auto-scroll to latest message on new incoming messages
- Mobile-responsive β single panel toggle between conversation list and chat view
- Deep-link support β open a specific conversation directly via URL query params (
?conv=&taskId=&otherId=&otherName=) - Workers can open a chat from a task detail page; Buyers can open a chat from a submission review
Socket events:
send_messageβ emit new messagereceive_messageβ receive incoming messagetyping_start/typing_stopβ typing indicator eventsmark_readβ mark conversation messages as read
Notifications are created server-side whenever key events occur and delivered to the user's bell icon in the dashboard topbar.
Triggers:
- Worker submits proof β Buyer receives "New submission on [task]"
- Buyer approves submission β Worker receives "Your submission was approved, +X coins"
- Buyer rejects submission β Worker receives "Your submission was rejected"
- Admin approves withdrawal β Worker receives "Your withdrawal of X coins has been approved"
- Admin rejects withdrawal β Worker receives "Your withdrawal request was rejected"
UI behaviour:
- Bell icon shows red badge with unread count (capped at 9+)
- Clicking the bell opens a fixed dropdown panel positioned relative to the button
- Panel shows all notifications sorted newest first, unread items highlighted
- "Mark all read" button clears the badge
- Panel closes on outside click
- Polls every 30 seconds via TanStack Query
refetchInterval - Redux manages the open/close state of the panel (
notificationPanelOpeninuiSlice)
The coin system is the core business model of TaskHub. It is intentionally asymmetric to generate platform revenue.
| Action | Rate |
|---|---|
| Buyer purchases coins | 10 coins = $1 USD |
| Worker withdraws coins | 20 coins = $1 USD |
| Minimum withdrawal threshold | 200 coins (β $10 USD) |
| New Worker signup bonus | 10 coins |
| New Buyer signup bonus | 50 coins |
How the platform earns: The spread between the buy rate and the withdrawal rate is the platform fee. Example: a Buyer funds a task with 100 coins ($10). A Worker earns those 100 coins and withdraws them for $5. TaskHub keeps the $5 difference β no hidden fees, no commission taken from individual transactions.
Coin Packages (Buyer purchase):
| Package | Coins | Price |
|---|---|---|
| Starter | 10 | $1 |
| Basic | 150 | $10 |
| Standard | 500 | $20 |
| Pro | 1000 | $35 |
Withdrawal flow:
- Worker navigates to
/worker/withdrawals - Enters coin amount (min 200, max = current balance)
- USD equivalent shown read-only (auto-calculated)
- Selects payment method (Stripe / bKash / SSLCommerz)
- Enters account/card number
- SweetAlert2 confirmation dialog before submit
- Withdrawal record created with
status: pending - Admin reviews and approves/rejects from
/admin/withdrawals - On approval: coins deducted from worker, notification sent
- On rejection: notification sent with optional reason
- Buyer selects a coin package on
/buyer/coins - Selects payment gateway (Stripe, bKash, or SSLCommerz)
- POST to
/api/v1/payments/create-sessioncreates a Stripe Checkout Session - Buyer is redirected to Stripe's hosted checkout page
- On success, Stripe redirects back to
/buyer/coins?success=true&paymentId=... - Frontend POSTs to
/api/v1/payments/confirmto credit coins - Stripe webhook at
/api/v1/payments/stripe/webhookalso handles confirmation (idempotent) - Payment record saved to MongoDB with gateway, coins, amount, transaction ID, and status
- Session updated to reflect new coin balance
User
name, email, passwordHash, photoUrl
role: "worker" | "buyer" | "admin"
coins: Number
status: "active" | "suspended"
createdAt, updatedAt
Task
title, details, category
buyerId, buyerName, buyerEmail
requiredWorkers, filledWorkers
payableAmount (coins per worker)
completionDate
submissionInfo (instructions)
imageUrl
status: "open" | "closed" | "blocked" | "archived"
createdAt, updatedAt
Submission
taskId, taskTitle, taskBuyerId, taskBuyerName
workerId, workerName, workerEmail
payableAmount
details, proofLinks[], proofImageUrl
status: "pending" | "approved" | "rejected"
createdAt, updatedAt
Payment
userId, userEmail
gateway: "stripe" | "bkash" | "sslcommerz"
coinsPurchased, amount, currency
status: "pending" | "success" | "failed"
gatewayTransactionId, meta
createdAt, updatedAt
Withdrawal
workerId, workerName, workerEmail
coinRequested, amount (USD)
paymentSystem, accountNumber
status: "pending" | "approved" | "rejected"
processedAt
createdAt, updatedAt
Notification
toUserId, toEmail
message, actionRoute
type: "info" | "success" | "warning"
isRead: Boolean
createdAt
Message
conversationId, taskId
senderId, senderName
receiverId, receiverName
content
isRead: Boolean
createdAt
Providers:
- Google OAuth β one-click login for all roles
- Credentials β email + bcryptjs hashed password
Session:
- NextAuth v5 JWT sessions
- Custom
jwtandsessioncallbacks embedid,role, andcoinsintosession.user - Session updated after coin purchases and withdrawals via
update()fromuseSession
Route protection:
- Each role layout (
(worker),(buyer),(admin)) callsauth()server-side and redirects unauthorized users - All API route handlers verify session and enforce role checks before any DB operation
- Authenticated users are redirected away from
/loginand/register
Registration flow:
- User selects role (Worker or Buyer) on step 1
- Fills name, email, password, optional profile photo URL on step 2
- Zod validates on client; server re-validates before writing to DB
- User created with role-appropriate coin bonus (Worker: 10, Buyer: 50)
- NextAuth auto-signs in and redirects to the correct dashboard
POST /api/auth/[...nextauth] NextAuth handler (login, OAuth callback, session)
GET /api/v1/tasks List tasks (public browse, with filters)
POST /api/v1/tasks Create task (buyer only, deducts coins)
GET /api/v1/tasks/[id] Get single task
PUT /api/v1/tasks/[id] Update task (buyer only)
DELETE /api/v1/tasks/[id] Delete task + refund coins (buyer only)
GET /api/v1/submissions List submissions (worker: mine | buyer: for my tasks)
POST /api/v1/submissions Create submission (worker only)
POST /api/v1/submissions/[id]/status Approve or reject (buyer only)
GET /api/v1/payments/packages List coin packages
POST /api/v1/payments/create-session Create Stripe Checkout session
POST /api/v1/payments/confirm Confirm payment and credit coins
POST /api/v1/payments/stripe/webhook Stripe webhook handler
GET /api/v1/withdrawals List my withdrawals (worker)
POST /api/v1/withdrawals Create withdrawal request (worker)
POST /api/v1/withdrawals/[id]/approve Approve or reject (admin)
GET /api/v1/notifications List my notifications
POST /api/v1/notifications/read-all Mark all as read
GET /api/v1/messages List my conversations
GET /api/v1/messages/[conversationId] Get messages in a conversation
POST /api/v1/messages Send a message
GET /api/v1/admin/stats Platform analytics (date-range filterable)
GET /api/v1/admin/users List all users
PUT /api/v1/admin/users/[id] Update user role or status
DELETE /api/v1/admin/users/[id] Delete user
GET /api/v1/admin/tasks List all tasks
POST /api/v1/uploads/imgbb Proxy image upload to imgBB API
| Route | Description |
|---|---|
/ |
Homepage β hero, how it works, stats, coin economy, top workers, testimonials, FAQ, CTA |
/tasks |
Public task listing teaser |
/leaderboard |
Top 20 workers by approved coins β podium for top 3, full rankings table |
/how-it-works |
Step-by-step guide for Workers and Buyers, coin economy explainer, payment methods |
/about |
About the platform |
/faq |
Frequently asked questions |
/terms |
Terms of service |
/privacy |
Privacy policy |
/support |
Support contact |
| Route | Description |
|---|---|
/login |
Email/password + Google OAuth login |
/register |
2-step registration β choose role, then fill details |
/forgot-password |
Request password reset email |
/reset-password |
Set new password via token |
| Route | Description |
|---|---|
/worker/dashboard |
Stats cards, 7-day earnings bar chart, performance panel, recent submissions, quick links |
/worker/tasks |
Browse tasks with search, category filter, min payout filter, sort by payout/deadline |
/worker/tasks/[id] |
Task detail β full description, buyer info, slots remaining, deadline, submission form |
/worker/submissions |
All my submissions β paginated, filterable by status, with status badges |
/worker/earnings |
Earnings portal β balance cards, full transaction history (earnings + withdrawals) |
/worker/withdrawals |
Withdrawal form + history table |
/worker/messages |
Real-time chat β conversation list + chat panel |
/worker/profile |
Profile with stats and badges |
/worker/settings |
Account settings |
| Route | Description |
|---|---|
/buyer/dashboard |
Stats cards, 7-day task activity chart, overview panel, pending submissions list, quick links |
/buyer/tasks |
My tasks table β title, status, workers, payout, deadline, actions |
/buyer/tasks/new |
Create task form β all fields with coin cost preview |
/buyer/tasks/[id] |
Task detail view |
/buyer/tasks/[id]/edit |
Edit task fields |
/buyer/tasks/[id]/success |
Post-creation success page |
/buyer/submissions |
Review pending submissions β view proof, approve or reject |
/buyer/coins |
Purchase coins β gateway selector + 4 package cards |
/buyer/payments |
Payment history table |
/buyer/messages |
Real-time chat β conversation list + chat panel |
/buyer/profile |
Profile page |
| Route | Description |
|---|---|
/admin/dashboard |
Platform overview β user counts, task counts, revenue, recent activity |
/admin/users |
Manage all users β filter by role/status, update role, suspend, delete |
/admin/tasks |
Manage all tasks β filter, view, block |
/admin/submissions |
All platform submissions |
/admin/withdrawals |
Pending withdrawal requests β approve or reject |
/admin/payments |
All platform payments |
/admin/stats |
Advanced analytics β KPI cards, revenue chart, task volume, category split, submission funnel, gateway breakdown, top workers, recent payments |
/admin/categories |
Category management |
/admin/activity |
Platform activity log |