├── src ├── App.css ├── demo ├── Contracts │ ├── .gitkeep │ ├── demo │ ├── Migrations.sol │ ├── OrganizationEndorser.sol │ ├── Skills.sol │ ├── Admin.sol │ └── Employee.sol ├── components │ ├── demo │ ├── LoadComp.css │ ├── ChatBody.css │ ├── NoChats.js │ ├── OrgEndCard.css │ ├── SkillCard.css │ ├── LineChart.js │ ├── GenererateQR.js │ ├── Search.css │ ├── EmployeeCard.css │ ├── OrgEndCard.js │ ├── CodeforcesGraph.js │ ├── Modals.css │ ├── LoadComp.js │ ├── SearchEmp.js │ ├── ScanQR.js │ ├── SearchBar.js │ ├── GetSkillsModals.js │ ├── SkillCard.js │ ├── GetEmployeeModal.js │ ├── GetEditFieldModal.js │ ├── GetCertificationModal.js │ ├── GetEducationModal.js │ ├── GetWorkExpModal.js │ ├── ChatBody.js │ ├── Navbar.js │ └── EmployeeCard.js ├── pages │ ├── Admin │ │ ├── demo │ │ ├── AllEmployees.js │ │ ├── AllOrganizationEndorser.js │ │ ├── Admin.css │ │ ├── Notifications.js │ │ └── CreateUser.js │ ├── Employee │ │ ├── demo │ │ ├── Employee.css │ │ ├── UpdateProfile.css │ │ └── Notifications.js │ ├── No Role │ │ ├── demo │ │ ├── Notifications.css │ │ ├── NoRole.css │ │ ├── Notifications.js │ │ └── NoRole.js │ ├── Get Routes │ │ ├── demo │ │ ├── GetOrg.css │ │ ├── Employee.css │ │ └── GetOrg.js │ └── Organization Endorser │ │ ├── demo │ │ ├── EndorsePage.css │ │ ├── Organization.css │ │ ├── Organization.js │ │ ├── Notifications.js │ │ ├── EndorseSkill.js │ │ └── EndorseSection.js ├── setupTests.js ├── App.test.js ├── reportWebVitals.js ├── index.css ├── index.js ├── MetaMaskGuide.js └── App.js ├── migrations ├── .gitkeep ├── 1_initial_migration.js └── 2_deploy_contracts.js ├── .babelrc ├── dotenv ├── .env ├── .gitignore ├── package.json ├── README.md └── truffle-config.js /src/App.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/demo: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /migrations/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Contracts/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Contracts/demo: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/components/demo: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/pages/Admin/demo: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/pages/Employee/demo: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/pages/No Role/demo: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/pages/Get Routes/demo: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/pages/Organization Endorser/demo: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["@babel/preset-es2015", "stage-2", "stage-3"] 3 | } -------------------------------------------------------------------------------- /migrations/1_initial_migration.js: -------------------------------------------------------------------------------- 1 | const Migrations = artifacts.require("Migrations"); 2 | 3 | module.exports = function (deployer) { 4 | deployer.deploy(Migrations); 5 | }; -------------------------------------------------------------------------------- /dotenv: -------------------------------------------------------------------------------- 1 | INFURA_API_KEY = "https://goerli.infura.io/v3/22035631f58a401f92c35fc534df3af4" 2 | MNEMONIC = "rhythm excuse judge rebuild frost code surge month horror isolate wool brain" -------------------------------------------------------------------------------- /.env: -------------------------------------------------------------------------------- 1 | INFURA_API_KEY = "https://goerli.infura.io/v3/22035631f58a401f92c35fc534df3af4" 2 | MNEMONIC = "rhythm excuse judge rebuild frost code surge month horror isolate wool brain" 3 | GENERATE_SOURCEMAP=false -------------------------------------------------------------------------------- /src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /src/components/LoadComp.css: -------------------------------------------------------------------------------- 1 | .load-comp { 2 | position: fixed; 3 | top: 50%; 4 | left: 50%; 5 | transform: translate(-50%, -50%); 6 | -webkit-transform: translate(-50%, -50%); 7 | -moz-transform: translate(-50%, -50%); 8 | -o-transform: translate(-50%, -50%); 9 | -ms-transform: translate(-50%, -50%); 10 | margin-top: 30px; 11 | } -------------------------------------------------------------------------------- /migrations/2_deploy_contracts.js: -------------------------------------------------------------------------------- 1 | const Admin = artifacts.require("Admin"); 2 | const Skills = artifacts.require("Skills"); 3 | 4 | module.exports = async function (deployer, network, accounts) { 5 | await deployer.deploy(Admin); 6 | const admin = await Admin.deployed(); 7 | await deployer.deploy(Skills); 8 | const skills = await Skills.deployed(); 9 | console.log(admin.address, skills.address); 10 | }; -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /src/Contracts/Migrations.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.5.0 <0.9.0; 3 | 4 | contract Migrations { 5 | address public owner = msg.sender; 6 | uint256 public last_completed_migration; 7 | 8 | modifier restricted() { 9 | require( 10 | msg.sender == owner, 11 | "This function is restricted to the contract's owner" 12 | ); 13 | _; 14 | } 15 | 16 | function setCompleted(uint256 completed) public restricted { 17 | last_completed_migration = completed; 18 | } 19 | } -------------------------------------------------------------------------------- /src/components/ChatBody.css: -------------------------------------------------------------------------------- 1 | .design-chat-input > input { 2 | background: rgba(31, 30, 30, 0.581) !important; 3 | border: 1px solid white !important; 4 | box-shadow: inset 0 0 3px #c5c6c7 !important; 5 | color: white !important; 6 | } 7 | 8 | .design-chat-input > button { 9 | background: rgba(31, 30, 30, 0.581) !important; 10 | color: white !important; 11 | border: 1px solid white !important; 12 | box-shadow: inset 0 0 8px #c5c6c7 !important; 13 | } 14 | 15 | .design-chat-input > button:hover { 16 | box-shadow: inset 0 0 15px #c5c6c7 !important; 17 | transform: scale(1.03, 1.03); 18 | } -------------------------------------------------------------------------------- /src/index.css: -------------------------------------------------------------------------------- 1 | @import url("https://fonts.googleapis.com/css2?family=Grand+Hotel&display=swap"); 2 | @import url("https://fonts.googleapis.com/css2?family=Arvo&display=swap"); 3 | 4 | body { 5 | margin: 0; 6 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", 7 | "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", 8 | sans-serif; 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | background: #0b0c10ea !important; 12 | color: #c5c6c7 !important; 13 | } 14 | 15 | code { 16 | font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", 17 | monospace; 18 | } -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import ReactDOM from "react-dom/client"; 3 | import "./index.css"; 4 | import App from "./App"; 5 | import reportWebVitals from "./reportWebVitals"; 6 | import "semantic-ui-css/semantic.min.css"; 7 | import "react-circular-progressbar/dist/styles.css"; 8 | 9 | const root= ReactDOM.createRoot(document.getElementById("root")); 10 | root.render( 11 | // 12 | 13 | // 14 | 15 | ); 16 | 17 | // If you want to start measuring performance in your app, pass a function 18 | // to log results (for example: reportWebVitals(console.log)) 19 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 20 | reportWebVitals(); -------------------------------------------------------------------------------- /src/components/NoChats.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import { Image } from "semantic-ui-react"; 3 | 4 | export default class Nochats extends Component { 5 | render() { 6 | return ( 7 |
16 | 20 |

No Chats

21 |

22 | Feel free to discuss any matters the chats are end to end encrypted. 23 |

24 |
25 | ); 26 | } 27 | } -------------------------------------------------------------------------------- /src/components/OrgEndCard.css: -------------------------------------------------------------------------------- 1 | .organization-card { 2 | width: 70% !important; 3 | margin-left: auto !important; 4 | margin-right: auto !important; 5 | background: #393b3fa6 !important; 6 | border-radius: 7px !important; 7 | border: 1px solid white !important; 8 | box-shadow: 0px 0px 1px 0px white !important; 9 | color: white !important; 10 | margin-bottom: 2rem !important; 11 | } 12 | 13 | .organization-card:hover { 14 | transform: scale(1.03, 1.03); 15 | } 16 | 17 | .organization-card > .content > .header { 18 | display: flex !important; 19 | justify-content: space-between !important; 20 | flex-wrap: wrap !important; 21 | color: white !important; 22 | } 23 | 24 | .organization-card > .content > .header > small { 25 | font-size: 12px !important; 26 | font-weight: 600 !important; 27 | font-style: italic; 28 | } 29 | 30 | @media only screen and (max-width: 800px) { 31 | .organization-card { 32 | width: 100% !important; 33 | } 34 | } -------------------------------------------------------------------------------- /src/pages/No Role/Notifications.css: -------------------------------------------------------------------------------- 1 | .sidechat-container { 2 | margin-top: 2rem; 3 | margin-left: 1rem; 4 | } 5 | 6 | .notifications { 7 | background: rgba(31, 30, 30, 0.581); 8 | width: 85%; 9 | margin-left: auto; 10 | margin-right: auto; 11 | height: 80vh; 12 | margin-top: 40px; 13 | border-radius: 10px; 14 | border: 1px solid white; 15 | box-shadow: inset 0 0 3px 0 white; 16 | } 17 | 18 | .sidechat-body { 19 | overflow: auto !important; 20 | } 21 | 22 | .notification-sidechat { 23 | color: white !important; 24 | } 25 | 26 | .notification-sidechat-subheading { 27 | color: #c5c6c7 !important; 28 | } 29 | 30 | .header-row > th { 31 | border-bottom: 1px solid white !important; 32 | } 33 | 34 | .row-cell-container { 35 | cursor: pointer; 36 | } 37 | 38 | .header-row-cell { 39 | border-bottom: 1px solid #c5c6c7 !important; 40 | } 41 | 42 | .row-cell-container :hover { 43 | transform: scale(1.01, 1.01); 44 | background: rgba(31, 30, 30, 0.1); 45 | } -------------------------------------------------------------------------------- /src/components/SkillCard.css: -------------------------------------------------------------------------------- 1 | .delete-button-skill { 2 | position: absolute; 3 | right: 0; 4 | margin-top: 10px; 5 | margin-right: 10px; 6 | height: 30px; 7 | width: 30px; 8 | display: grid; 9 | justify-content: center; 10 | align-items: center; 11 | justify-items: center; 12 | cursor: pointer; 13 | } 14 | 15 | .delete-button-skill:hover { 16 | transform: scale(1.1, 1.1); 17 | } 18 | 19 | .skill-des { 20 | background: #393b3fa6 !important; 21 | border-radius: 7px !important; 22 | border: 1px solid white !important; 23 | color: white !important; 24 | width: 100% !important; 25 | margin-bottom: 12px !important; 26 | } 27 | 28 | .skill-des > .content > div > .header { 29 | display: flex !important; 30 | justify-content: space-between !important; 31 | flex-wrap: wrap !important; 32 | color: white !important; 33 | } 34 | 35 | .skillcard_container { 36 | display: flex; 37 | justify-content: space-between; 38 | } 39 | 40 | .skillcard_container > div:nth-child(2) { 41 | margin-top: 25px; 42 | } -------------------------------------------------------------------------------- /src/pages/Get Routes/GetOrg.css: -------------------------------------------------------------------------------- 1 | .org-card { 2 | width: 70% !important; 3 | margin-left: auto !important; 4 | margin-right: auto !important; 5 | background: #393b3fa6 !important; 6 | border-radius: 7px !important; 7 | border: 1px solid white !important; 8 | box-shadow: 2px 0px 3px 1px white !important; 9 | color: white !important; 10 | } 11 | 12 | .add-employee { 13 | padding: 10px; 14 | float: right; 15 | display: grid; 16 | justify-items: center; 17 | align-items: center; 18 | border: 2px solid rgb(255, 255, 255); 19 | background-color: #393b3fa6; 20 | border-radius: 10px; 21 | box-shadow: inset 0px 0px 10px #c5c6c7; 22 | cursor: pointer; 23 | margin-top: 16px; 24 | color: white; 25 | padding-bottom: 12px; 26 | margin-top: -5px; 27 | } 28 | 29 | .add-employee:hover { 30 | transform: scale(1.1, 1.1); 31 | box-shadow: inset 0px 0px 20px white; 32 | } 33 | 34 | .org-card-heading { 35 | font-family: "Arvo", serif !important; 36 | color: white; 37 | font-size: 25px; 38 | font-weight: 500; 39 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "copy-app", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^5.16.5", 7 | "@testing-library/react": "^13.4.0", 8 | "@testing-library/user-event": "^13.5.0", 9 | "@truffle/hdwallet-provider": "^2.1.9", 10 | "dotenv": "^16.0.3", 11 | "ganache": "^7.7.7", 12 | "react": ">=16.8.0", 13 | "react-dom": ">=16.8.8", 14 | "react-scripts": "5.0.1", 15 | "web-vitals": "^2.1.4" 16 | }, 17 | "peerDependencies": { 18 | "react": ">=16.8.0", 19 | "react-dom": ">=16.8.8" 20 | }, 21 | "scripts": { 22 | "start": "react-scripts start", 23 | "build": "GENERATE_SOURCEMAP=false react-scripts build", 24 | "test": "react-scripts test", 25 | "eject": "react-scripts eject" 26 | }, 27 | "eslintConfig": { 28 | "extends": [ 29 | "react-app", 30 | "react-app/jest" 31 | ] 32 | }, 33 | "browserslist": { 34 | "production": [ 35 | ">0.2%", 36 | "not dead", 37 | "not op_mini all" 38 | ], 39 | "development": [ 40 | "last 1 chrome version", 41 | "last 1 firefox version", 42 | "last 1 safari version" 43 | ] 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/components/LineChart.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import { Line } from "react-chartjs-2"; 3 | 4 | export default class LineChart extends Component { 5 | state = { 6 | data: {}, 7 | options: {}, 8 | newdata: {}, 9 | }; 10 | 11 | componentDidMount = () => { 12 | setTimeout(() => { 13 | var data = { 14 | labels: [...Array(this.props.overallEndorsement?.length).keys()], 15 | datasets: [ 16 | { 17 | label: "Endorse Rating Spread", 18 | data: this.props.overallEndorsement, 19 | fill: false, 20 | backgroundColor: "white", 21 | borderColor: "rgba(255,255,255,0.3)", 22 | }, 23 | ], 24 | }; 25 | 26 | var options = { 27 | scales: { 28 | yAxes: [ 29 | { 30 | ticks: { 31 | beginAtZero: true, 32 | }, 33 | }, 34 | ], 35 | }, 36 | }; 37 | this.setState({ 38 | data, 39 | options, 40 | }); 41 | }, 1000); 42 | }; 43 | render() { 44 | return ; 45 | } 46 | } -------------------------------------------------------------------------------- /src/MetaMaskGuide.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import { Segment, Button, Image } from "semantic-ui-react"; 3 | 4 | export default class MetaMaskGuide extends Component { 5 | render() { 6 | return ( 7 | 19 | 24 | 25 |

Oops!.. Seems like you do not have metamask extension.

26 |

Please download it to proceed.

27 |

28 | After the metamask set-up , create an account on Rinkeby test 29 | network. 30 |

31 | 32 | 33 | 34 |
35 | ); 36 | } 37 | } -------------------------------------------------------------------------------- /src/Contracts/OrganizationEndorser.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.5.0 <0.9.0; 3 | 4 | contract OrganizationEndorser { 5 | address admin; 6 | string name; 7 | address organization_address; 8 | string description; 9 | string location; 10 | 11 | constructor( 12 | address _admin, 13 | address _organization_address, 14 | string memory _name, 15 | string memory _description, 16 | string memory _location 17 | ) public { 18 | admin = _admin; 19 | name = _name; 20 | organization_address = _organization_address; 21 | description = _description; 22 | location = _location; 23 | } 24 | 25 | function getOrganizationInfo() 26 | public 27 | view 28 | returns ( 29 | string memory, 30 | address, 31 | string memory, 32 | string memory 33 | ) 34 | { 35 | return (name, organization_address, description, location); 36 | } 37 | 38 | address[] allEmployees; 39 | 40 | function addEmployees(address employee_address) public { 41 | require(msg.sender == organization_address); 42 | allEmployees.push(employee_address); 43 | } 44 | 45 | function totalEmployees() public view returns (uint256) { 46 | return allEmployees.length; 47 | } 48 | 49 | function getEmployeeByIndex(uint256 index) public view returns (address) { 50 | return allEmployees[index]; 51 | } 52 | } -------------------------------------------------------------------------------- /src/Contracts/Skills.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.5.0 <0.9.0; 3 | 4 | contract Skills { 5 | mapping(string => address[]) skillmap; 6 | string[] skill; 7 | 8 | function addEmployeeToSkill(string memory _name, address _employee) public { 9 | if (skillmap[_name].length == 0) { 10 | skill.push(_name); 11 | } 12 | skillmap[_name].push(_employee); 13 | } 14 | 15 | function getSkillLength() public view returns (uint256) { 16 | return skill.length; 17 | } 18 | 19 | function getSkillsByIndex(uint256 index) public view returns (string memory) { 20 | return skill[index]; 21 | } 22 | 23 | function getTotalEmployeeInSkillByIndex(uint256 index) 24 | public 25 | view 26 | returns (uint256) 27 | { 28 | return skillmap[skill[index]].length; 29 | } 30 | 31 | function getTotalEmployeeInSkillByName(string memory _name) 32 | public 33 | view 34 | returns (uint256) 35 | { 36 | return skillmap[_name].length; 37 | } 38 | 39 | function getEmployeeInSkillByIndex(uint256 skill_index, uint256 emp_index) 40 | public 41 | view 42 | returns (address) 43 | { 44 | return skillmap[skill[skill_index]][emp_index]; 45 | } 46 | 47 | function getEmployeeBySkillName(string memory _name, uint256 emp_index) 48 | public 49 | view 50 | returns (address) 51 | { 52 | return skillmap[_name][emp_index]; 53 | } 54 | } -------------------------------------------------------------------------------- /src/components/GenererateQR.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import QRCode from "qrcode.react"; 3 | 4 | import "./Modals.css"; 5 | import { Button, Header, Modal } from "semantic-ui-react"; 6 | 7 | export default class GenererateQR extends Component { 8 | state = { 9 | qr: "", 10 | }; 11 | 12 | componentDidMount = async () => { 13 | const web3 = window.web3; 14 | const accounts = await web3.eth.getAccounts(); 15 | try { 16 | const res = await QRCode.toDataURL(accounts[0]); 17 | this.setState({ qr: res }); 18 | } catch (err) { 19 | console.log(err); 20 | } 21 | }; 22 | 23 | render() { 24 | return ( 25 | 26 |
32 | 33 | 34 | qr 35 | 36 | 37 | 38 |