Skip to content

A full-stack platform that connects clients with skilled freelancers for project outsourcing. Handles task assignment, project tracking, and secure delivery in one place.

Notifications You must be signed in to change notification settings

ggauravky/TaskNexus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TaskNexus - Managed Task Outsourcing Platform

A production-grade SaaS platform where clients submit tasks and receive deliverables without managing freelancers.

🎯 Product Overview

Core Value Proposition:

  • Clients submit tasks and receive final deliverables (ZERO freelancer coordination)
  • Platform handles assignment, tracking, quality assurance, and delivery
  • Freelancers get clear tasks and steady work
  • Admin controls quality, flow, and fairness

This is NOT a freelancer marketplace.

πŸ—οΈ System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      CLIENT LAYER                            β”‚
β”‚  React + Vite + Tailwind CSS (Role-based Dashboards)        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    API GATEWAY LAYER                         β”‚
β”‚     Express.js RESTful API + JWT Auth Middleware            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   BUSINESS LOGIC LAYER                       β”‚
β”‚  Controllers + Services + State Machine + Validators        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   DATA ACCESS LAYER                          β”‚
β”‚              MongoDB + Mongoose ODM                          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ” Security Architecture

Authentication Flow

1. User Login β†’ POST /api/auth/login
2. Server validates credentials (bcrypt)
3. Generate JWT access token (15min) + refresh token (7days)
4. Store refresh token in httpOnly cookie
5. Access token sent in response body
6. Client stores access token in memory (not localStorage)
7. Include access token in Authorization header
8. Refresh token rotation on renewal

Authorization (RBAC)

  • Client: Can only access own tasks, submit requests, approve deliverables
  • Freelancer: Can only see assigned tasks, submit work, view earnings
  • Admin: Full platform access, task assignment, QA, user management

Security Measures

  • bcrypt password hashing (salt rounds: 12)
  • JWT with short expiration
  • Refresh token rotation
  • Rate limiting on auth endpoints
  • Input validation and sanitization
  • MongoDB injection prevention
  • CORS configuration
  • Helmet.js security headers
  • Environment variable protection

πŸ“Š Database Design

Collections

Users

{
  _id: ObjectId,
  email: String (unique, indexed),
  password: String (hashed),
  role: Enum ['client', 'freelancer', 'admin'],
  profile: {
    firstName: String,
    lastName: String,
    phone: String,
    avatar: String
  },
  // Freelancer-specific
  freelancerProfile: {
    skills: [String],
    experience: Number,
    availability: String,
    performanceScore: Number (0-100),
    completedTasks: Number,
    rating: Number
  },
  // Client-specific
  clientProfile: {
    company: String,
    totalTasksSubmitted: Number
  },
  status: Enum ['active', 'suspended', 'blocked'],
  refreshToken: String,
  createdAt: Date,
  updatedAt: Date
}

Tasks

{
  _id: ObjectId,
  taskId: String (unique, auto-generated),
  client: ObjectId (ref: User),
  freelancer: ObjectId (ref: User),
  assignedBy: ObjectId (ref: User - admin),

  taskDetails: {
    title: String,
    type: Enum ['video-editing', 'web-development', 'design', 'writing', 'other'],
    description: String,
    requirements: String,
    attachments: [String], // URLs
    deadline: Date,
    budget: Number,
    revisionLimit: Number (default: 2)
  },

  status: Enum [
    'submitted',       // Client submitted
    'under_review',    // Admin reviewing
    'assigned',        // Assigned to freelancer
    'in_progress',     // Freelancer working
    'submitted_work',  // Freelancer submitted
    'qa_review',       // Admin QA
    'revision_requested', // Need changes
    'delivered',       // Sent to client
    'client_revision', // Client wants changes
    'completed',       // Client approved
    'cancelled',       // Cancelled
    'disputed'         // In dispute
  ],

  workflow: {
    submittedAt: Date,
    reviewedAt: Date,
    assignedAt: Date,
    startedAt: Date,
    submittedWorkAt: Date,
    qaCompletedAt: Date,
    deliveredAt: Date,
    completedAt: Date
  },

  metrics: {
    revisionsUsed: Number,
    reassignmentCount: Number,
    actualCompletionTime: Number // hours
  },

  priority: Enum ['low', 'medium', 'high', 'urgent'],
  tags: [String],

  createdAt: Date,
  updatedAt: Date
}

Submissions

{
  _id: ObjectId,
  task: ObjectId (ref: Task),
  freelancer: ObjectId (ref: User),
  submissionType: Enum ['initial', 'revision'],

  content: {
    description: String,
    deliverables: [String], // URLs
    notes: String
  },

  qaReview: {
    reviewer: ObjectId (ref: User - admin),
    status: Enum ['pending', 'approved', 'rejected'],
    feedback: String,
    reviewedAt: Date
  },

  clientReview: {
    status: Enum ['pending', 'approved', 'revision_requested'],
    feedback: String,
    reviewedAt: Date
  },

  version: Number,
  createdAt: Date,
  updatedAt: Date
}

Payments

{
  _id: ObjectId,
  paymentId: String (unique),
  task: ObjectId (ref: Task),
  client: ObjectId (ref: User),
  freelancer: ObjectId (ref: User),

  amounts: {
    taskBudget: Number,
    platformCommission: Number, // percentage
    platformFee: Number, // calculated
    freelancerPayout: Number // calculated
  },

  status: Enum ['pending', 'escrowed', 'released', 'refunded'],

  escrow: {
    heldAt: Date,
    releaseScheduled: Date,
    releasedAt: Date
  },

  transactionDetails: {
    paymentMethod: String,
    transactionId: String,
    gateway: String // future: 'stripe'
  },

  createdAt: Date,
  updatedAt: Date
}

Reviews

{
  _id: ObjectId,
  task: ObjectId (ref: Task),
  reviewer: ObjectId (ref: User),
  reviewee: ObjectId (ref: User),
  reviewType: Enum ['client_to_platform', 'platform_to_freelancer'],

  rating: Number (1-5),
  feedback: String,

  createdAt: Date,
  updatedAt: Date
}

Notifications

{
  _id: ObjectId,
  recipient: ObjectId (ref: User),
  type: Enum [
    'task_assigned',
    'task_submitted',
    'qa_feedback',
    'client_approval',
    'revision_requested',
    'payment_released',
    'deadline_reminder'
  ],

  content: {
    title: String,
    message: String,
    actionUrl: String
  },

  relatedTask: ObjectId (ref: Task),

  status: Enum ['unread', 'read'],
  priority: Enum ['low', 'medium', 'high'],

  createdAt: Date,
  readAt: Date
}

AuditLogs

{
  _id: ObjectId,
  user: ObjectId (ref: User),
  action: String,
  resource: String,
  resourceId: ObjectId,
  changes: Object,
  ipAddress: String,
  userAgent: String,
  timestamp: Date
}

Indexes

// Users
- email (unique)
- role
- status
- 'freelancerProfile.performanceScore' (for assignment logic)

// Tasks
- taskId (unique)
- client
- freelancer
- status
- 'taskDetails.deadline'
- createdAt

// Submissions
- task
- freelancer
- 'qaReview.status'

// Payments
- paymentId (unique)
- task
- status

// Notifications
- recipient + status (compound)
- createdAt

πŸ”„ Task Workflow State Machine

                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚   SUBMITTED  β”‚ (Client creates task)
                    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
                           β–Ό
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚ UNDER_REVIEW β”‚ (Admin reviews task)
                    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚                     β”‚
                β–Ό                     β–Ό
         [Reject/Cancel]      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                              β”‚   ASSIGNED   β”‚ (Admin assigns to freelancer)
                              β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                                     β”‚
                                     β–Ό
                              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                              β”‚ IN_PROGRESS  β”‚ (Freelancer working)
                              β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                                     β”‚
                                     β–Ό
                              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                              β”‚SUBMITTED_WORKβ”‚ (Freelancer submits)
                              β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                                     β”‚
                                     β–Ό
                              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                              β”‚  QA_REVIEW   β”‚ (Admin quality check)
                              β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                                     β”‚
                        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                        β”‚                         β”‚
                        β–Ό                         β–Ό
                 [QA Rejected]            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                  (Revision or            β”‚  DELIVERED   β”‚ (Sent to client)
                   Reassign)              β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚                        β”‚
                        β”‚                        β–Ό
                        β”‚                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                        β”‚                 β”‚Client Reviewsβ”‚
                        β”‚                 β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚                        β”‚
                        β”‚              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                        β”‚              β”‚                   β”‚
                        β”‚              β–Ό                   β–Ό
                        β”‚      [Client Approves]   [Revision Request]
                        β”‚              β”‚                   β”‚
                        β”‚              β–Ό                   β–Ό
                        β”‚      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                        β”‚      β”‚  COMPLETED   β”‚   β”‚CLIENT_REVISIONβ”‚
                        β”‚      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚                                β”‚
                        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                (Back to IN_PROGRESS)

State Transition Rules

Current State Allowed Next States Who Can Transition
submitted under_review, cancelled Admin
under_review assigned, cancelled Admin
assigned in_progress, reassigned Freelancer, Admin
in_progress submitted_work Freelancer
submitted_work qa_review System (automatic)
qa_review delivered, revision_requested, reassigned Admin
revision_requested in_progress System (automatic)
delivered completed, client_revision, disputed Client
client_revision in_progress System (automatic)
completed - Final State
cancelled - Final State
disputed qa_review Admin

πŸ›£οΈ API Route Structure

Authentication Routes

POST   /api/auth/register           - Register new user
POST   /api/auth/login              - Login (returns access + refresh token)
POST   /api/auth/refresh            - Refresh access token
POST   /api/auth/logout             - Logout (invalidate refresh token)
POST   /api/auth/forgot-password    - Request password reset
POST   /api/auth/reset-password     - Reset password with token
GET    /api/auth/me                 - Get current user info

Client Routes

GET    /api/client/dashboard        - Client dashboard stats
POST   /api/client/tasks            - Create new task
GET    /api/client/tasks            - Get all client's tasks
GET    /api/client/tasks/:id        - Get specific task details
PATCH  /api/client/tasks/:id/approve - Approve final delivery
PATCH  /api/client/tasks/:id/revision - Request revision
GET    /api/client/payments         - Get payment history
GET    /api/client/invoices         - Get invoices
POST   /api/client/reviews          - Submit platform review

Freelancer Routes

GET    /api/freelancer/dashboard    - Freelancer dashboard stats
GET    /api/freelancer/profile      - Get freelancer profile
PUT    /api/freelancer/profile      - Update freelancer profile
GET    /api/freelancer/tasks        - Get assigned tasks
GET    /api/freelancer/tasks/:id    - Get task details
PATCH  /api/freelancer/tasks/:id/accept - Accept task
PATCH  /api/freelancer/tasks/:id/reject - Reject task
POST   /api/freelancer/tasks/:id/submit - Submit work
GET    /api/freelancer/earnings     - Get earnings history
GET    /api/freelancer/performance  - Get performance metrics

Admin Routes

GET    /api/admin/dashboard         - Admin dashboard with analytics
GET    /api/admin/tasks             - Get all tasks (with filters)
GET    /api/admin/tasks/:id         - Get task details
PATCH  /api/admin/tasks/:id/review  - Review submitted task
POST   /api/admin/tasks/:id/assign  - Assign task to freelancer
POST   /api/admin/tasks/:id/reassign - Reassign task
PATCH  /api/admin/submissions/:id/qa - QA review submission
GET    /api/admin/users             - Get all users (with filters)
GET    /api/admin/users/:id         - Get user details
PATCH  /api/admin/users/:id/status  - Update user status (suspend/block)
GET    /api/admin/freelancers       - Get all freelancers with metrics
GET    /api/admin/analytics         - Platform analytics
POST   /api/admin/disputes/:id/resolve - Resolve dispute
GET    /api/admin/payments          - Get all payments
PATCH  /api/admin/settings          - Update platform settings

Shared Routes

GET    /api/notifications           - Get user notifications
PATCH  /api/notifications/:id/read  - Mark notification as read
PATCH  /api/notifications/read-all  - Mark all as read
POST   /api/upload                  - Upload file (task attachments/deliverables)

🏭 Business Logic Rules

Task Assignment Logic

  1. Skill Matching: Match task type with freelancer skills
  2. Performance Score: Prioritize freelancers with score > 70
  3. Availability: Check freelancer's current workload
  4. Past Performance: Consider completion rate and ratings
  5. Workload Balancing: Distribute tasks fairly
Assignment Priority Score =
  (Performance Score * 0.4) +
  (Skill Match * 0.3) +
  (Availability * 0.2) +
  (Past Completion Rate * 0.1)

Payment & Escrow Logic

Platform Commission: 15% (configurable by admin)

Task Budget: $100
Platform Fee: $15
Freelancer Payout: $85

Payment Flow:
1. Client pays $100 β†’ Escrowed
2. Task completed β†’ Admin releases payment
3. Platform keeps $15
4. Freelancer receives $85

Revision Rules

  • Default revision limit: 2 per task
  • Each revision extends deadline by 48 hours
  • After revision limit: admin intervention required
  • Unlimited revisions incur additional charges

Deadline Management

  • Deadline warning: 24 hours before
  • Overdue penalty: -5 performance score
  • 3 missed deadlines: temporary suspension
  • Client can extend deadline (one-time, max 48 hours)

Performance Score Calculation

Performance Score (0-100) =
  (On-time Completion Rate * 40) +
  (First-time Approval Rate * 30) +
  (Client Satisfaction * 20) +
  (Admin QA Pass Rate * 10)

Quality Assurance Rules

  • All submissions go through admin QA
  • QA must complete within 12 hours
  • 3 failed QA = task reassignment
  • Auto-reassignment after 2nd revision failure

Dispute Handling

  1. Client or freelancer raises dispute
  2. Task status β†’ 'disputed'
  3. Payment held in escrow
  4. Admin investigates (48-hour SLA)
  5. Admin decision is final
  6. Payment released or refunded based on decision

πŸ“ Project Structure

TaskNexus/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ config/
β”‚   β”‚   β”‚   β”œβ”€β”€ database.js
β”‚   β”‚   β”‚   β”œβ”€β”€ jwt.js
β”‚   β”‚   β”‚   └── constants.js
β”‚   β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”‚   β”œβ”€β”€ User.js
β”‚   β”‚   β”‚   β”œβ”€β”€ Task.js
β”‚   β”‚   β”‚   β”œβ”€β”€ Submission.js
β”‚   β”‚   β”‚   β”œβ”€β”€ Payment.js
β”‚   β”‚   β”‚   β”œβ”€β”€ Review.js
β”‚   β”‚   β”‚   β”œβ”€β”€ Notification.js
β”‚   β”‚   β”‚   └── AuditLog.js
β”‚   β”‚   β”œβ”€β”€ middleware/
β”‚   β”‚   β”‚   β”œβ”€β”€ auth.js
β”‚   β”‚   β”‚   β”œβ”€β”€ roleCheck.js
β”‚   β”‚   β”‚   β”œβ”€β”€ validation.js
β”‚   β”‚   β”‚   β”œβ”€β”€ errorHandler.js
β”‚   β”‚   β”‚   └── rateLimiter.js
β”‚   β”‚   β”œβ”€β”€ controllers/
β”‚   β”‚   β”‚   β”œβ”€β”€ authController.js
β”‚   β”‚   β”‚   β”œβ”€β”€ clientController.js
β”‚   β”‚   β”‚   β”œβ”€β”€ freelancerController.js
β”‚   β”‚   β”‚   β”œβ”€β”€ adminController.js
β”‚   β”‚   β”‚   └── notificationController.js
β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”‚   β”œβ”€β”€ taskService.js
β”‚   β”‚   β”‚   β”œβ”€β”€ assignmentService.js
β”‚   β”‚   β”‚   β”œβ”€β”€ paymentService.js
β”‚   β”‚   β”‚   β”œβ”€β”€ notificationService.js
β”‚   β”‚   β”‚   β”œβ”€β”€ performanceService.js
β”‚   β”‚   β”‚   └── emailService.js
β”‚   β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”‚   β”œβ”€β”€ auth.routes.js
β”‚   β”‚   β”‚   β”œβ”€β”€ client.routes.js
β”‚   β”‚   β”‚   β”œβ”€β”€ freelancer.routes.js
β”‚   β”‚   β”‚   β”œβ”€β”€ admin.routes.js
β”‚   β”‚   β”‚   └── notification.routes.js
β”‚   β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”‚   β”œβ”€β”€ validators.js
β”‚   β”‚   β”‚   β”œβ”€β”€ helpers.js
β”‚   β”‚   β”‚   └── logger.js
β”‚   β”‚   └── app.js
β”‚   β”œβ”€β”€ .env.example
β”‚   β”œβ”€β”€ .gitignore
β”‚   β”œβ”€β”€ package.json
β”‚   └── server.js
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ assets/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ common/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Navbar.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Sidebar.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Button.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Input.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Modal.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Table.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Badge.jsx
β”‚   β”‚   β”‚   β”‚   └── Card.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ auth/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ LoginForm.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ RegisterForm.jsx
β”‚   β”‚   β”‚   β”‚   └── ProtectedRoute.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ client/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ClientDashboard.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ CreateTask.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ TaskList.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ TaskDetails.jsx
β”‚   β”‚   β”‚   β”‚   └── PaymentHistory.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ freelancer/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ FreelancerDashboard.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ProfileSetup.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ AssignedTasks.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ SubmitWork.jsx
β”‚   β”‚   β”‚   β”‚   └── Earnings.jsx
β”‚   β”‚   β”‚   └── admin/
β”‚   β”‚   β”‚       β”œβ”€β”€ AdminDashboard.jsx
β”‚   β”‚   β”‚       β”œβ”€β”€ TaskManagement.jsx
β”‚   β”‚   β”‚       β”œβ”€β”€ AssignTask.jsx
β”‚   β”‚   β”‚       β”œβ”€β”€ QAReview.jsx
β”‚   β”‚   β”‚       β”œβ”€β”€ UserManagement.jsx
β”‚   β”‚   β”‚       β”œβ”€β”€ Analytics.jsx
β”‚   β”‚   β”‚       └── PlatformSettings.jsx
β”‚   β”‚   β”œβ”€β”€ context/
β”‚   β”‚   β”‚   β”œβ”€β”€ AuthContext.jsx
β”‚   β”‚   β”‚   └── NotificationContext.jsx
β”‚   β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”‚   β”œβ”€β”€ useAuth.js
β”‚   β”‚   β”‚   β”œβ”€β”€ useTask.js
β”‚   β”‚   β”‚   └── useNotification.js
β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”‚   β”œβ”€β”€ api.js
β”‚   β”‚   β”‚   β”œβ”€β”€ authService.js
β”‚   β”‚   β”‚   β”œβ”€β”€ taskService.js
β”‚   β”‚   β”‚   └── uploadService.js
β”‚   β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”‚   β”œβ”€β”€ constants.js
β”‚   β”‚   β”‚   β”œβ”€β”€ helpers.js
β”‚   β”‚   β”‚   └── validators.js
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”‚   β”œβ”€β”€ LandingPage.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Login.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Register.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ClientDashboard.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ FreelancerDashboard.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ AdminDashboard.jsx
β”‚   β”‚   β”‚   └── NotFound.jsx
β”‚   β”‚   β”œβ”€β”€ App.jsx
β”‚   β”‚   β”œβ”€β”€ main.jsx
β”‚   β”‚   └── index.css
β”‚   β”œβ”€β”€ .env.example
β”‚   β”œβ”€β”€ .gitignore
β”‚   β”œβ”€β”€ index.html
β”‚   β”œβ”€β”€ package.json
β”‚   β”œβ”€β”€ tailwind.config.js
β”‚   β”œβ”€β”€ postcss.config.js
β”‚   └── vite.config.js
β”‚
└── README.md

πŸš€ MVP vs Phase-2 Features

MVP (Launch Ready)

βœ… User authentication (all 3 roles) βœ… Client: Create task, track status, approve delivery βœ… Freelancer: View assigned tasks, submit work βœ… Admin: Assign tasks, QA review, user management βœ… Task workflow state machine βœ… Mock escrow payment system βœ… Basic notifications βœ… Performance scoring βœ… Revision handling (up to 2) βœ… File upload/download βœ… Role-based dashboards

Phase-2 (Growth)

πŸ”„ Real Stripe payment integration πŸ”„ Advanced AI task assignment (ML model) πŸ”„ Real-time chat (Socket.io) πŸ”„ Video call integration for disputes πŸ”„ Advanced analytics & reporting πŸ”„ Freelancer application system πŸ”„ Multi-currency support πŸ”„ Mobile app (React Native) πŸ”„ Email notifications (SendGrid) πŸ”„ SMS alerts (Twilio) πŸ”„ Advanced search & filters πŸ”„ Bulk task upload πŸ”„ API for third-party integrations πŸ”„ White-label solution

πŸ€– Future AI Integration Points

  1. Smart Task Assignment

    • ML model trained on past assignments
    • Predict best freelancer match
    • Optimize for completion time + quality
  2. Quality Prediction

    • Analyze submission before admin QA
    • Flag potential quality issues
    • Suggest improvements
  3. Dynamic Pricing

    • AI-based budget recommendations
    • Market rate analysis
    • Demand-based pricing
  4. Fraud Detection

    • Detect suspicious patterns
    • Flag duplicate submissions
    • Identify fake accounts
  5. Automated QA Assistance

    • Pre-screen deliverables
    • Check for completeness
    • Validate against requirements

πŸ”’ Security Checklist

  • Environment variables for sensitive data
  • bcrypt password hashing (salt rounds: 12)
  • JWT with short expiration (15min access, 7d refresh)
  • Refresh token rotation
  • httpOnly cookies for refresh tokens
  • CORS whitelist
  • Helmet.js security headers
  • Rate limiting (express-rate-limit)
  • Input validation (Joi/express-validator)
  • MongoDB injection prevention
  • XSS protection
  • CSRF tokens (for state-changing operations)
  • File upload validation (size, type, scan)
  • API request logging
  • Audit trail for critical actions
  • Role-based access control enforcement
  • Session management
  • SQL injection prevention (N/A - using MongoDB)

πŸ“ˆ Scalability Considerations

Database

  • Implement database connection pooling
  • Use MongoDB indexes strategically
  • Consider sharding for horizontal scaling
  • Archive old completed tasks
  • Implement caching layer (Redis)

API

  • Implement API versioning (/api/v1/)
  • Use load balancer (Nginx)
  • Implement CDN for static assets
  • API response pagination
  • Background job queue (Bull/Redis)

Frontend

  • Code splitting and lazy loading
  • Optimize bundle size
  • Implement service worker (PWA)
  • Image optimization
  • Skeleton loaders for better UX

Monitoring

  • Application Performance Monitoring (APM)
  • Error tracking (Sentry)
  • Log aggregation (Winston + CloudWatch)
  • Uptime monitoring
  • Database query performance tracking

πŸ§ͺ Testing Strategy

Backend

  • Unit tests (Jest)
  • Integration tests (Supertest)
  • API contract tests
  • Load testing (Artillery)

Frontend

  • Component tests (React Testing Library)
  • E2E tests (Playwright)
  • Accessibility tests
  • Visual regression tests

πŸ“¦ Deployment Strategy

Development

- Local MongoDB
- Node.js dev server (nodemon)
- Vite dev server (HMR)

Staging

- MongoDB Atlas
- Heroku/Railway (backend)
- Vercel (frontend)
- Environment: staging

Production

- MongoDB Atlas (Production cluster)
- AWS EC2/ECS (backend)
- Cloudflare + S3 (frontend)
- CI/CD: GitHub Actions
- Monitoring: Datadog

πŸŽ“ Resume Highlight Points

✨ Built production-grade SaaS platform with 100K+ users potential ✨ Implemented secure JWT authentication with refresh token rotation ✨ Designed complex state machine for task workflow management ✨ Built escrow payment system ready for Stripe integration ✨ Implemented role-based access control (RBAC) across 3 user types ✨ Created intelligent task assignment algorithm with ML readiness ✨ Architected scalable MongoDB schema with proper indexing ✨ Built RESTful API with 30+ endpoints following best practices ✨ Implemented comprehensive audit logging and security measures ✨ Designed responsive SaaS UI with Tailwind CSS


Built by a senior startup CTO mindset | Production-ready | Scalable | Secure

About

A full-stack platform that connects clients with skilled freelancers for project outsourcing. Handles task assignment, project tracking, and secure delivery in one place.

Topics

Resources

Stars

Watchers

Forks