MicroTask Platform

Three-sided task marketplace with server-enforced lifecycle and Stripe disbursement.

Screenshot of MicroTask Platform

Overview

Worker, Buyer, and Admin each operate in a role-scoped dashboard with context-appropriate data fetching and navigation. Task status transitions — draft → published → submitted → approved/rejected → paid — are validated server-side on every mutation; the client cannot skip states by crafting direct API calls. Stripe payment credits are triggered by webhook confirmation, not client callback, preventing double-credit on network retries. JWT payloads carry the user role; all API routes validate the claim before processing.

What it does

  • Full task lifecycle enforced at the API layer — status transitions validated server-side, not client-driven
  • Stripe webhook-based payment confirmation — worker balances credited only after event verification
  • Separate dashboard UX per role: Worker, Buyer, Admin — each with role-scoped data fetching
  • Submission approval workflow with optional rejection reason returned to the worker
  • Admin dispute resolution panel with override capability on approved/rejected outcomes

Problems and how I solved them

Problem

Preventing double payment on network retry when Stripe webhooks arrive out of order

Fix

Stripe webhook handler checks an idempotency key before processing; already-handled events are logged and exited early

Problem

Keeping three separate frontend experiences maintainable without significant code duplication

Fix

Dashboard layouts share a common shell component; only the data-fetching hooks and route guards differ per role

Problem

Role changes needing to reflect immediately without forcing re-login

Fix

On role change, a silent token refresh endpoint issues a new JWT with the updated role claim; the frontend swaps the stored token without redirecting