A basic yet feature rich freelance bidding platform, built with React frontend and Node.js/Express backend with MongoDB.
- Registration & Login: Separate authentication for clients, freelancers, and admins
- Role-based Access: Different dashboards and permissions based on user role
- User Profiles: Detailed profiles with skills, rates, and portfolio information
- Project Posting: Clients can post detailed projects with budgets and required skills
- Project Browsing: Search and filter projects by skills, status, and keywords
- Project Details: Comprehensive project information with bidding interface
- Place Bids: Freelancers can bid on projects with proposed amounts and timelines
- Bid Management: Clients can view, accept, or reject bids
- Bid Status Tracking: Real-time status updates for all bids
- User Management: View and suspend user accounts
- Project Oversight: Monitor all projects and their status
- Platform Administration: Complete control over the platform
- Private Messaging: Communication between clients and freelancers
- LocalStorage Based: Messages stored locally for simplicity
- Real-time Interface: Manual refresh required for new messages
- Node.js with Express.js framework
- MongoDB with Mongoose ODM
- JWT for authentication
- bcrypt for password hashing
- CORS for cross-origin requests
- Multer for file uploads
- Uniqid for unique ID generation
- React with JavaScript (no TypeScript)
- Vite build tool for fast development
- React Router for navigation
- Axios for API calls
- CSS3 for styling
This project includes an escrow workflow to align incentives and reduce payment risk.
- Client-side utilities in
frontend/src/utils/escrowManager.js - Backend project lifecycle endpoints support completion, settlement requests, acceptance, and admin close:
- Client requests settlement:
PUT /api/projects/:id/settle(completed projects only) - Freelancer accepts settlement:
PUT /api/projects/:id/accept-payment - Admin close (e.g., after funds released):
PUT /api/projects/:id/admin-close
- Client requests settlement:
- Node.js (v18 or higher) and npm (v9 or higher)
- MongoDB Community Server (6.x) locally on port 27017, or MongoDB Atlas
- npm or yarn package manager
- Install all dependencies:
npm run install:all- Create a
.envfile in the server directory:
PORT=5000
JWT_SECRET=your_jwt_secret_key_here_change_this_in_production
MONGODB_URI=mongodb://localhost:27017/freelance
- Start both frontend and backend:
npm run dev:allThis will start:
- Backend server on
http://localhost:5000 - Frontend on
http://localhost:5173
- (Optional) Configure environment files:
- Backend: create
server/.env(see below) - Frontend: create
frontend/.envwithVITE_API_BASE_URLif you want to change the API URL
- Navigate to server directory:
cd server- Install dependencies:
npm install- Create a
.envfile in the server directory:
PORT=5000
JWT_SECRET=your_jwt_secret_key_here_change_this_in_production
MONGODB_URI=mongodb://localhost:27017/freelance
- Start the backend server:
npm run devThe server will run on http://localhost:5000
- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Start the development server:
npm run devThe frontend will run on http://localhost:5173
- (Optional) Frontend environment file:
Create
frontend/.envto override the default API base URL (defaults tohttp://localhost:5000in code):
VITE_API_BASE_URL=http://localhost:5000
If you set this, ensure your Axios configuration reads it (e.g., import.meta.env.VITE_API_BASE_URL).
Main Project/
├── package.json (Root package with scripts)
├── README.md (Complete setup guide)
├── server/ (Express backend)
│ ├── server.js (Main server file)
│ ├── routes/
│ │ ├── auth-routes.js
│ │ ├── projects-routes.js
│ │ ├── bids-routes.js
│ │ ├── reviews-routes.js
│ │ └── admin-routes.js
│ ├── db/models/ (Mongoose schemas)
│ ├── middleware/auth.js
│ ├── package.json (Backend dependencies)
│ └── public/img/
└── frontend/ (React frontend)
├── src/
│ ├── App.jsx (Main app component)
│ ├── contexts/AuthContext.jsx (Authentication)
│ ├── utils/axiosConfig.js (API client)
│ ├── utils/escrowManager.js (client-side escrow utilities)
│ ├── components/
│ │ └── Navbar/, MessagingSystem/
│ └── pages/
│ ├── Login/, Register/, Dashboard/
│ ├── Projects/, ProjectDetail/, CreateProject/
│ ├── BidDetail/
│ ├── EscrowPage/
│ ├── FreelancerProfile/
│ ├── AdminLogin/, AdminRegister/, AdminPanel/
├── package.json (Frontend dependencies)
├── vite.config.js (Vite configuration)
└── node_modules/
The application expects a MongoDB database named "freelance" with the following collections:
admin- Admin user accountsusers- Client and freelancer accountsprojects- Project listingsbids- Freelancer bids on projectsreviews- Client reviews of freelancers
Note: Client-side, non-persistent storage is used for certain features in this project (e.g., authentication tokens, lightweight messaging state, and other storage-related features). Specifically, sessionStorage and localStorage are used in the frontend where appropriate. This means some data (like messages in the current implementation) may be device/browser-scoped and not stored in MongoDB.
- Create Admin Account: First, create an admin account by registering through the admin login page
- Register Users: Clients and freelancers can register through the main registration page
- Post Projects: Clients can post projects with detailed descriptions and budgets
- Place Bids: Freelancers can browse and bid on projects
- Manage Projects: Clients can accept bids and manage their projects
- Communicate: Use the messaging system for project communication
- Client: Can post projects, view bids, accept freelancers, and leave reviews
- Freelancer: Can browse projects, place bids, and manage their portfolio
- Admin: Can manage users, oversee projects, and handle platform administration
POST /api/auth/register- User registrationPOST /api/auth/login- User loginPOST /api/admin/register- Admin registrationPOST /api/admin/login- Admin login
GET /api/projects- Get all projects (filters:status,skills,search)POST /api/projects- Create new project (client only)GET /api/projects/:id- Get project detailsPUT /api/projects/:id- Update project (client owner only)DELETE /api/projects/:id- Delete project (client owner only; not in progress/completed/closed)PUT /api/projects/:id/cancel- Cancel project (client owner only)PUT /api/projects/:id/reopen- Reopen cancelled project (client owner only)PUT /api/projects/:id/complete- Mark project completed (assigned freelancer only)PUT /api/projects/:id/unmark-completed- Revert completion (assigned freelancer only)PUT /api/projects/:id/settle- Request payment settlement (client owner; completed projects)PUT /api/projects/:id/accept-payment- Accept payment settlement (assigned freelancer; completed projects)PUT /api/projects/:id/admin-close- Close project (admin only; when funds are released)GET /api/projects/freelancer/:freelancerId- Projects by freelancerGET /api/projects/client/:clientId- Projects by clientGET /api/projects/client/:clientId/freelancer/:freelancerId/completed- Has closed projects together
POST /api/bids- Place a bid (freelancer only; amount validated against project budget)GET /api/bids/projects/:projectId- Get bids for a project- Project owner sees all bids
- Freelancer sees only their bid for that project
GET /api/bids/detail/:bidId- Get individual bid details (project owner or bid owner)PUT /api/bids/:bidId- Edit a pending bid (bid owner only)PUT /api/bids/:bidId/accept- Accept a bid (project owner only)DELETE /api/bids/:bidId- Cancel pending/accepted bid (bid owner only; updates project if accepted)
POST /api/reviews- Create review (client only; rating 1–5; updates freelancer average)GET /api/reviews/freelancer/:freelancerId- Get reviews for a freelancer
GET /api/admin/users- Get all usersPUT /api/admin/users/:id/suspend- Suspend userPUT /api/admin/users/:id/unsuspend- Unsuspend userGET /api/admin/projects- Get all projectsGET /api/admin/profile/:id- Get admin profile
GET /api/user/dashboard- Get user dashboard data
- JWT-based authentication
- Password hashing with bcrypt
- Role-based access control
- Input validation and sanitization
- CORS protection
Backend:
npm run devFrontend:
cd frontend && npm run devFrontend:
cd frontend && npm run build- Serve frontend build assets via a static host or reverse proxy (e.g., Nginx)
- Run backend with a process manager (e.g., PM2) behind a reverse proxy with HTTPS
- Configure environment variables for production (
JWT_SECRET,MONGODB_URI,PORT, allowed CORS origins) - Point frontend
VITE_API_BASE_URLto the backend public URL
- Tests: (TBD) Add unit/integration tests for routes and components
- Linting/Formatting: (If using ESLint/Prettier) document scripts and run them in CI
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License.
For support and questions, please create an issue in the repository or contact the development team.
- There is no on-chain or third-party payment gateway integration in the backend yet; funds are not actually moved. The current flow simulates the escrow lifecycle for demo purposes. If you require real payment handling, consider integrating a provider (Stripe Connect/PayPal) and persisting escrow transactions server-side with webhooks.
- Add server-side escrow ledger and transaction states (funded, in_escrow, released, disputed)
- Integrate payment provider with webhooks to transition project status automatically
- Dispute resolution and admin adjudication tools