Skip to content

codeby-shubh/Skill-Hiive

Repository files navigation

SkillHive - Freelance Services Marketplace

SkillHive is a full-stack MERN application inspired by Fiverr, designed to connect freelancers (sellers) with clients (buyers). It features a robust microservices-ready architecture, secure authentication, and a modern React frontend.

🚀 Features

  • Authentication & Security:
    • JWT-based Auth with Refresh Token Rotation.
    • HttpOnly Cookies for secure token storage.
    • Role-Based Access Control (RBAC) for Buyers, Sellers, and Admins.
    • BCrypt password hashing.
  • Gigs & Marketplace:
    • Create, Edit, Delete Gigs (Sellers only).
    • Advanced Filtering (Category, Price, Sorting) & Search.
    • Lazy Loading & Skeleton Loaders for performance.
    • React Query for efficient data fetching and caching.
  • Orders & Payments:
    • Stripe Integration (Payment Intents).
    • Order lifecycle management.
  • Communication:
    • Real-time messaging system (ready for Socket.io integration).
  • Reviews:
    • Star ratings and text reviews.
  • DevOps & tooling:
    • Docker support for containerized deployment.
    • CI/CD with GitHub Actions.
    • Swagger API Documentation.
    • Jest Unit Testing.

🛠️ Tech Stack

Frontend

  • React.js (Vite)
  • SASS for styling
  • TanStack Query (React Query) for state management
  • Axios with Interceptors
  • React Router DOM (Lazy Loading implemented)

Backend

  • Node.js & Express.js
  • MongoDB & Mongoose
  • JWT (JSON Web Tokens)
  • Joi Validation
  • Winston Logger

DevOps

  • Docker & Docker Compose
  • GitHub Actions
  • Nginx (Frontend serving)

📦 Getting Started

Prerequisites

  • Node.js v18+
  • MongoDB (Local or Atlas)
  • Docker (Optional)

Local Setup

  1. Clone the repository

    git clone https://github.com/yourusername/skillhive.git
    cd skillhive
  2. Backend Setup

    cd api
    npm install
    # Rename .env.example to .env and configure variables
    npm start
  3. Frontend Setup

    cd frontened
    npm install
    npm run dev

🐳 Docker Setup

Run the entire stack with a single command:

docker-compose up --build

Access the app at http://localhost:5173.

📚 API Documentation

Swagger UI is available at: http://localhost:8800/api/v1/docs

🧪 Testing

Run backend unit tests:

cd api
npm test

🚢 CI/CD

The project includes a GitHub Actions workflow (pipeline.yml) that automatically:

  1. Installs dependencies.
  2. Builds the Frontend.
  3. Runs Backend tests.

🔐 Authentication Flow

  1. Login: User sends credentials. Server validates and instantiates accessToken (short-lived) and refreshToken (long-lived). Both are sent as HttpOnly Cookies.
  2. Access: Frontend uses axiosClient to attach credentials automatically.
  3. Refresh: If accessToken expires (401), the frontend interceptor calls /auth/refresh. Server verifies refreshToken, rotates it, and issues new tokens transparently.
  4. Persistence: On app load, AuthContext calls /auth/me to restore session.

📄 License

ISC

About

A full-stack freelance marketplace built with React, Node.js, Express, and MongoDB. Features include user roles, gig creation, payments (Stripe), chat, orders, and Cloudinary uploads.

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors