Skip to content

Latest commit

 

History

417 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📦 DevLink Backend

DevLink is a freelance job marketplace built with the MERN stack. This repository contains the backend (server) side of the application, including APIs, authentication, job management, real-time chat, and user role management.

🔧 Tech Stack

  • Node.js
  • Express.js
  • MongoDB & Mongoose
  • JWT Authentication
  • Socket.IO (for real-time chat)
  • Cloudinary (for file/image uploads)
  • Docker (for containerization)
  • dotenv (for environment configs)
  • CORS
  • Winston (logger)
  • 📁 Folder Structure

    /devlink-backend
    
    ├── .github/
    │   └── workflows/            
    │
    └── src/                      
        │
        ├── application/          
        │   └── usecases/         
        │
        ├── domain/               
        ├── helper/               
        ├── infrastructure/       
        ├── logger/              
        ├── presentation/        
        ├── types/                
        ├── utils/                 
        │
        ├── app.ts               
        └── server.ts             
    │
    ├── .dockerignore            
    ├── .gitignore                
    ├── Dockerfile                
    ├── ReadMe.md                
    ├── package.json              
    ├── tsconfig.json            
    ├── yarn.lock                 
    │
    

    This layout follows Clean Architecture principles, making your backend modular, testable, and scalable.

    🔑 Features

    • 🔐 JWT-based Role Authentication (User, Client, Admin)
    • 📤 Job Posting & Bidding System
    • 🧑‍💼 User Profile Management (with verification)
    • 📩 Real-Time Chat (Socket.IO)
    • 📊 Admin Dashboard & Analytics (API only)
    • 🌐 Secure REST API with rate limiting, CORS
    • 📦 File upload using Cloudinary
    • 🐳 Docker support for simplified development & deployment

    🚀 Getting Started

    📋 Prerequisites

    • Node.js (v18+)
    • MongoDB Atlas or Local MongoDB
    • Cloudinary Account
    • Docker (for containerized setup, optional but recommended)

    📥 1. Clone the Repository

    git clone https://github.com/yourusername/devlink-backend.git
    cd devlink-backend
    

    📦 2. Install Dependencies

    
    yarn install
    

    ⚙️ 3. Create .env File

    touch .env
    

    Add the following variables:

    
    PORT=3000 
    MONGO_URI=your_mongo_db_connection_string
    FRONTEND_ORIGIN=https://your-frontend-url.com
    BACKEND_ORIGIN=http://localhost:3000
    STRIPE_CUSTOMER_EMAIL=your_stripe_customer_email
    GMAIL_USER=your_gmail_address
    GMAIL_APP_PASSWORD=your_gmail_app_password
    GROQ_API_KEY=your_groq_api_key
    ADMIN_OBJECT_ID=your_admin_mongodb_object_id
    ADMIN_USERNAME=admin@example.com
    ADMIN_PASSWORD=your_admin_password
    BCRYPT_SALT=10
    REFRESH_TOKEN_SECRET=your_refresh_token_secret
    ACCESS_TOKEN_SECRET=your_access_token_secret
    

    ▶️ 4. Run the Development Server (Non-Docker)

    yarn dev
    

    🐳 Running with Docker

    Make sure your .env file is correctly set up.

    1. Build the Docker Image

    docker build -t devlink-backend .
    

    2. Run the Container

    docker run -d -p 5000:5000 --env-file .env devlink-backend
    

    ⚙️ Optional: Using Docker Compose

    Add this docker-compose.yml:

    version: '3.8'
    
    services:
      devlink-backend:
        build: .
        ports:
          - '5000:5000'
        env_file:
          - .env
        volumes:
          - .:/app
        restart: unless-stopped
    

    Then run:

    docker-compose up --build
    

    Note: Make sure MongoDB is hosted on Atlas or accessible via MONGO_URI in your .env file.

    Licence

    MIT Licence

    About

    Businesses and individuals can connect through this platform to conduct business. Clients post a description of their job and a price range they are willing to pay for a freelancer to complete it. The client may invite specific freelancers to apply for their jobs, or post the job for any freelancer who is willinig to do the work

    Topics

    Resources

    Stars

    2 stars

    Watchers

    1 watching

    Forks

    Releases

    Packages

    Used by

    Contributors

    Languages