https://github.com/tanvermax/micro-task-earning
The Micro-Task and Earning Platform provides an innovative way for users to complete small tasks and earn rewards
https://github.com/tanvermax/micro-task-earning
css dasyui firebase html5 jwt-authentication mongodb nodejs react reacticons reactjs tailwind
Last synced: 2 months ago
JSON representation
The Micro-Task and Earning Platform provides an innovative way for users to complete small tasks and earn rewards
- Host: GitHub
- URL: https://github.com/tanvermax/micro-task-earning
- Owner: tanvermax
- Created: 2025-02-05T07:26:17.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-18T08:45:48.000Z (over 1 year ago)
- Last Synced: 2025-02-18T09:28:48.689Z (over 1 year ago)
- Topics: css, dasyui, firebase, html5, jwt-authentication, mongodb, nodejs, react, reacticons, reactjs, tailwind
- Language: JavaScript
- Homepage: https://earnly-f35f1.web.app/
- Size: 6.81 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Micro Tasking and Earning Platform
## π Overview
The **Micro Tasking and Earning Platform** enables users to complete small tasks and earn money. Inspired by platforms like **Picoworkers**, **Clickworker**, and **SEOClerks** (without copying designs), the system supports **three user roles** with role-specific dashboards and functionalities:
- **Worker** β Completes tasks, earns coins, withdraws money, and receives notifications.
- **Buyer** β Creates tasks, reviews submissions, pays Workers, purchases coins, and reports issues.
- **Admin** β Manages users, handles reports, approves withdrawals, and oversees system integrity.
---
## π Table of Contents
1. [Features](#-features)
2. [Role Functionalities](#-role-functionalities)
3. [Layout Structure](#-layout-structure)
4. [Authentication System](#-authentication-system)
5. [Dashboard Functionalities](#-dashboard-functionalities)
6. [Business Logic](#-business-logic)
7. [Payment & Withdrawal](#-payment--withdrawal)
8. [Notifications](#-notifications)
9. [Image Upload](#-image-upload)
10. [API Documentation](#-api-documentation)
11. [Installation](#-installation)
12. [Configuration](#-configuration)
13. [Troubleshooting](#-troubleshooting)
14. [License](#-license)
---
## β¨ Features
- **Three distinct roles** (Worker, Buyer, Admin) with role-based access.
- **Responsive design** with animations and sliders.
- **Secure authentication** (email/password + Google Sign-In).
- **Stripe payment integration** for coin purchases.
- **Withdrawals** with currency conversion logic.
- **Role-based authorization middleware**.
- **Notification system** for approvals, rejections, withdrawals, and submissions.
- **Pagination** for submission lists.
- **Image uploads via imgBB**.
---
## π€ Role Functionalities
### Worker
- View available tasks and submit proof.
- Track approved submissions and earnings.
- Withdraw coins for cash.
- View personalized notifications.
### Buyer
- Create, update, delete, and manage tasks.
- Review submissions (approve/reject).
- Purchase coins via Stripe.
- View payment history.
### Admin
- Manage all users (edit roles, remove).
- Approve or reject withdrawal requests.
- Manage all tasks.
- View platform-wide statistics.
---
## π₯ Layout Structure
### Basic Layout
- **Navbar**
- Not logged in: Logo, Login, Register, Join as Developer (links to GitHub repo).
- Logged in: Logo (home), Dashboard, Available Coins, Profile + Logout, Join as Developer.
- **Footer**
- Logo, clickable social icons (LinkedIn, Facebook, GitHub).
### Home Page
- **Hero Section** β Animated slider or background video (3 banners).
- **Best Workers** β Top 6 Workers by coins.
- **Testimonial Section** β Static Swiper slider with user feedback.
- **Extra Sections** β At least 3 additional creative content areas.
---
## π Authentication System
### Registration
- Fields: Name, Email, Profile Picture URL, Password, Role (Worker/Buyer).
- Default Coins: 10 for Workers, 50 for Buyers.
- Email format & password strength validation.
- Store user info + coins in database.
### Login
- Email/password or Google Sign-In.
- Validation for incorrect credentials.
- Store **JWT token** in browser local storage.
- Redirect to role-specific dashboard after login.
---
## π Dashboard Functionalities
### Worker Dashboard
- View stats (total submissions, pending, total earnings).
- Approved Submissions table.
- Task List with details & submission form.
- My Submissions (with pagination).
- Withdrawals with coin-to-dollar conversion.
### Buyer Dashboard
- View stats (task count, pending tasks, total paid).
- Review submissions (approve/reject with coin updates).
- Add New Tasks (with image upload, budget validation).
- My Tasks (update/delete with coin refunds for unfinished tasks).
- Purchase Coins via Stripe.
- Payment History.
### Admin Dashboard
- View stats (total workers, buyers, coins, payments).
- Manage withdrawal requests.
- Manage all users (role updates, removal).
- Manage all tasks (delete if needed).
---
## π° Business Logic
- **Coin Purchase**:
- 10 coins = $1
- 150 coins = $10
- 500 coins = $20
- 1000 coins = $35
- **Withdrawal Rate**:
- 20 coins = $1 (minimum withdrawal = 200 coins / $10).
- **Platform Earnings**:
- Buyers buy coins at 10 coins = $1, Workers withdraw at 20 coins = $1.
---
## π³ Payment & Withdrawal
- **Stripe Payment Gateway** (or dummy payment if unavailable).
- Buyer coin top-up after successful payment.
- Worker withdrawal request with status tracking (pending β approved).
---
## π Notifications
- Triggered on:
- Submission approval/rejection.
- Withdrawal approval.
- New submission to Buyer.
- Stored in database and displayed in popup format.
- Clickable to navigate to relevant dashboard section.
---
## πΌ Image Upload
- **imgBB Integration**:
- For profile pictures during registration.
- For task images in Add New Task form.
---
## π‘ API Documentation
### **Base URL**
```
https://your-domain.com/api
```
### **Authentication & User Management**
| Method | Endpoint | Description |
|--------|----------------------|-------------|
| POST | `/auth/register` | Register new user (Worker/Buyer). Returns JWT token. |
| POST | `/auth/login` | Login with email/password. Returns JWT token. |
| POST | `/auth/google` | Google OAuth login. Returns JWT token. |
| GET | `/auth/me` | Get current user info (requires token). |
| PUT | `/users/:id` | Update user profile info. |
| DELETE | `/users/:id` | Delete user account (Admin only). |
### **Task Management (Buyer)**
| Method | Endpoint | Description |
|--------|--------------------------------|-------------|
| POST | `/tasks` | Create new task (validates coin balance). |
| GET | `/tasks` | Get all tasks (public or filtered). |
| GET | `/tasks/my` | Get tasks created by logged-in Buyer. |
| GET | `/tasks/:id` | Get task details by ID. |
| PUT | `/tasks/:id` | Update Buyerβs own task details. |
| DELETE | `/tasks/:id` | Delete task (refund coins if applicable). |
### **Task Browsing & Submission (Worker)**
| Method | Endpoint | Description |
|--------|-----------------------------------|-------------|
| GET | `/tasks/available` | Get tasks where `required_workers > 0`. |
| POST | `/submissions` | Submit proof for a task. |
| GET | `/submissions/my` | Get submissions by current Worker (with pagination). |
| GET | `/submissions/approved` | Get approved submissions for Worker. |
### **Submission Review (Buyer)**
| Method | Endpoint | Description |
|--------|-----------------------------------|-------------|
| GET | `/submissions/to-review` | Get submissions pending review for Buyerβs tasks. |
| PUT | `/submissions/:id/approve` | Approve submission (update Worker coins). |
| PUT | `/submissions/:id/reject` | Reject submission (refill Buyerβs `required_workers`). |
### **Coin Purchase & Payments**
| Method | Endpoint | Description |
|--------|--------------------------|-------------|
| POST | `/payments/create` | Create Stripe payment session. |
| POST | `/payments/webhook` | Stripe webhook endpoint. |
| GET | `/payments/history` | Get Buyerβs payment history. |
### **Withdrawals (Worker & Admin)**
| Method | Endpoint | Description |
|--------|----------------------------|-------------|
| POST | `/withdrawals` | Request withdrawal (Worker). |
| GET | `/withdrawals/my` | Get Workerβs withdrawal requests. |
| GET | `/withdrawals/pending` | Get all pending withdrawal requests (Admin). |
| PUT | `/withdrawals/:id/approve` | Approve withdrawal and deduct Worker coins (Admin). |
### **Admin Management**
| Method | Endpoint | Description |
|--------|---------------------|-------------|
| GET | `/admin/stats` | Get platform-wide statistics. |
| GET | `/admin/users` | Get all users. |
| PUT | `/admin/users/:id` | Update user role. |
| DELETE | `/admin/users/:id` | Remove a user. |
| GET | `/admin/tasks` | Get all tasks. |
| DELETE | `/admin/tasks/:id` | Delete any task. |
### **Notifications**
| Method | Endpoint | Description |
|--------|--------------------------|-------------|
| GET | `/notifications` | Get notifications for current user (sorted DESC). |
| POST | `/notifications` | Create new notification (system-triggered). |
| PUT | `/notifications/:id` | Mark notification as read. |
---
## β Installation
```bash
# Clone repository
git clone
# Install dependencies
npm install
# Setup environment variables
cp .env.example .env
# Run development server
npm run dev
```
---
## π§ Configuration
```
PORT=5000
MONGO_URI=
JWT_SECRET=
STRIPE_SECRET_KEY=
IMGBB_API_KEY=
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
```
---
## π Troubleshooting
- JWT errors β Check token storage & middleware logic.
- Stripe issues β Verify API keys & test mode setup.
- Image uploads failing β Check imgBB API key.
- Notifications missing β Ensure database queries filter by `toEmail`.
---
## π License
This project is licensed under the **MIT License**.