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.
/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.
- 🔐 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
- Node.js (v18+)
- MongoDB Atlas or Local MongoDB
- Cloudinary Account
- Docker (for containerized setup, optional but recommended)
git clone https://github.com/yourusername/devlink-backend.git
cd devlink-backend
yarn install
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 [email protected] ADMIN_PASSWORD=your_admin_password BCRYPT_SALT=10 REFRESH_TOKEN_SECRET=your_refresh_token_secret ACCESS_TOKEN_SECRET=your_access_token_secret
yarn dev
Make sure your .env
file is correctly set up.
docker build -t devlink-backend .
docker run -d -p 5000:5000 --env-file .env devlink-backend
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.