This is a decentralized job marketplace where employers can post jobs, and freelancers can apply to them. The platform facilitates job posting, freelancer application, employer selection, job completion, and conflict resolution in case of disputes. The actors involved in the platform include employers, freelancers, and voters.
-
Posting a Job (Employer):
• An employer posts a job by providing a title, description, and an escrow payment (ETH).
• The job is initially set to the “OPEN” status.
Method:
postJob(string memory _description, string memory _title)
-
Applying for a Job (Freelancer):
• A freelancer who is registered on the platform can apply for any open job.
• When applying, the freelancer submits a description of their application.
• The freelancer’s address is recorded, and the job’s status remains “OPEN”.
Method:
applyForJob(uint _jobId, string memory _applicationDescription)
-
Choosing a Freelancer (Employer):
• The employer reviews the applications and selects a freelancer for the job.
• Once the freelancer is selected, the job’s status is updated to “IN_PROGRESS”.
Method:
acceptFreelancer(uint _jobId, address payable _freelancer)
-
Completing a Job (Freelancer & Employer):
• Once the freelancer completes the job, they can mark the job as “IN_REVIEW”.
• The employer then reviews the work. If satisfied, the employer marks the job as “COMPLETE” and the payment is released to the freelancer.
Method (Freelancer):
markJobInReview(uint _jobId)
Method (Employer):
completeJob(uint _jobId)
-
Raising a Conflict (Employer)
• If the employer is dissatisfied with the work, they can raise a conflict by providing a description of the issue.
• The job status is then updated to “IN_CONFLICT”, allowing community voting.
Method:
markJobInConflict(uint _jobId, string memory _ownerConflictDescription)
-
Resolving a Conflict (Voters)
• When a job is in conflict, voters (other platform users who are not the employer or freelancer) are called upon to vote.
• Voters can either support the freelancer or the employer. Once 11 votes are collected, the conflict is resolved based on the majority.
• The winning party (freelancer or employer) gets 95% of the payment, and 5% of the payment is distributed to the voters who supported the winning side.
Methods:
•
reviewJobInConflict(uint _jobId, bool voteForFreelancer)
•
resolveConflict(uint _jobId) (automatically called after 11 votes)
• Smart Contracts: Written in Solidity 0.8.9
• Blockchain Framework: Hardhat used for deploying and testing smart contracts on a local blockchain network.
• Frontend: Developed using React and JavaScript.
• UI Components: Leveraged shadcn for user interface components.
• Node.js (Ensure you have Node.js 16+ installed)
• Hardhat: A development environment for compiling, testing, and deploying Solidity smart contracts (https://hardhat.org/hardhat-runner/docs/getting-started#installation)
• MetaMask (browser extension) installed on your browser.
- Clone the repository:
git clone [email protected]:Thuan2000/web3-freelancing-platform.git
cd web3-freelancing-platform
- Install dependencies:
npm install
-
Set up your environment by configuring MetaMask to connect to your local Hardhat network. (https://support.metamask.io/networks-and-sidechains/managing-networks/how-to-add-a-custom-network-rpc/)
-
Deploy the contract:
npx hardhat run ./scripts/initialize.js --network localhost
Note: Remember to replace the dummy addresses for the faucet to your own wallet address(es).
- Start the server:
npm install
npm run start
• Name: Thuan Nguyen
• Email: [email protected]
• Phone (Telegram): +84 70 2845158
Feel free to reach out for any questions or collaboration opportunities!
This project is licensed under the MIT License.