├── .gitignore ├── README.md ├── blockchain-hardhat ├── .env.example ├── .npmignore ├── assets │ └── test-deploy-data.json ├── contracts │ └── EVault_Main.sol ├── hardhat.config.js ├── package.json ├── scripts │ ├── deploy_fetchCaseDetailsByAClient.js │ └── script-functions │ │ ├── function_client.js │ │ ├── function_judge.js │ │ ├── function_lawyer.js │ │ └── function_legalcase.js ├── tasks │ └── block-number.js └── test │ └── test-eVaultMain.js ├── frontend-vite ├── .env.example ├── .eslintrc.cjs ├── .gitignore ├── components.json ├── index.html ├── jsconfig.json ├── package.json ├── postcss.config.js ├── public │ ├── dummy-image.jpg │ ├── indian_judiciry_svg.svg │ └── vite.svg ├── src │ ├── App.css │ ├── App.jsx │ ├── assets │ │ ├── indianJudiciaryLogo.png │ │ └── react.svg │ ├── backend-config.json │ ├── blockchain-api │ │ ├── getCaseDetailsByCaseID.jsx │ │ ├── getCasesForClientByUID.jsx │ │ ├── getCasesForJudgeByUID.jsx │ │ ├── getCasesForLawyerByUID.jsx │ │ ├── getClientDetailsByUID.jsx │ │ ├── getJudgeDetailsByUID.jsx │ │ ├── getLawyerDetailsByUID.jsx │ │ ├── loginAsAClient.jsx │ │ ├── loginAsAJudge.jsx │ │ ├── loginAsALawyer.jsx │ │ ├── registerNewCase.jsx │ │ ├── registerToEVault.jsx │ │ ├── updateCaseProgressWithCaseId.jsx │ │ ├── uploadCaseDocument.jsx │ │ └── uploadCaseDocumentUsingVerbwire.jsx │ ├── components │ │ ├── AdminDashboardComponent.jsx │ │ ├── CaseDetailsComponent.jsx │ │ ├── Footer.jsx │ │ ├── HeroSection.jsx │ │ ├── Loader.jsx │ │ ├── LoginComponent.jsx │ │ ├── Navbar.jsx │ │ ├── ProjectStatistics.jsx │ │ ├── RegisterANewCaseComponent.jsx │ │ ├── SearchCaseDetailsComponent.jsx │ │ ├── SignUpComponent.jsx │ │ └── ui │ │ │ └── dialog.jsx │ ├── index.css │ ├── lib │ │ └── utils.js │ ├── main.jsx │ └── pages │ │ ├── AdminPage.jsx │ │ ├── CaseDetailsPage.jsx │ │ ├── GetCaseDetailsPage.jsx │ │ ├── HomePage.jsx │ │ ├── LoginPage.jsx │ │ ├── RegisterNewLegalCasePage.jsx │ │ ├── SignUpPage.jsx │ │ └── TestPage.jsx ├── tailwind.config.js ├── vite.config.js └── vite.config.js.timestamp-1711906103182-8a096b5df01d3.mjs └── project-assets ├── SC_COVER.png ├── demo_car_accident_image.jpg ├── demo_fir.jpg ├── demo_fir.png ├── sc_admin_dashboard.png ├── sc_case_details.png ├── sc_case_document.png ├── sc_case_search.png ├── sc_home.png ├── sc_login.png ├── sc_logo.PNG ├── sc_registration.png └── sc_upload_case_document.png /.gitignore: -------------------------------------------------------------------------------- 1 | .encryptedKey.json 2 | node_modules 3 | .env 4 | coverage 5 | coverage.json 6 | typechain 7 | 8 | #Hardhat files 9 | cache 10 | artifacts 11 | gas-report.txt 12 | typechain-types 13 | gas-report.txt 14 | package-lock.json 15 | 16 | 17 | #myFiles 18 | /readMeRohit 19 | readMeRohit 20 | ProblemStatementPicture.JPG -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

Project E-Vault (EVM Based)

2 | 3 |

A modernized blockchain(EVM) based eVault storage solution for the Indian Judiciary made using ViteJS and powered by IPFS.

4 | 5 |

Snapshots from the project :

6 | 7 | 8 |
9 | 10 | 11 |
12 | 13 | 14 | 15 | Currently, the app can be tested on Localhost (Hardhat), Sepolia (EVM)& Polygin Amoy test network using Alchemy endpoints. 16 | 17 |

E-Vault Features :

18 | 19 | 30 | 31 |

Tech Stack :

32 | 33 | Frontend : 34 | 35 | 42 | 43 | Backend : 44 | 45 | 53 | 54 | Deployed Chains : 55 | 56 | 62 | 63 |

Guide for testing on local hardhat network :

64 | 65 | Environment variables : 66 | 67 | 70 | 71 | Backend : 72 | 73 | Terminal 1: 74 | 75 | 80 | 81 | Terminal 2: 82 | 83 | 89 | 90 | Update the [backend-config.json] file inside /frontend-vite with the updated contract-address under "31337" "address" feild fetched from Terminal 2. 91 | 92 | [OPTIONAL -> ONLY FOR SEPOLIA] Update the [backend-config.json] file inside /frontend-vite with the updated contract-address under "11155111" "address" feild fetched from Terminal 2. 93 | 94 | Frontend : 95 | 96 | Terminal 1: 97 | 98 | 103 | 104 |

Working:

105 | 106 | https://www.loom.com/share/b1b9d7de34a343a6891bae4fa0b99471?sid=27c699d7-8106-4973-90bc-6594e710147c 107 | 108 | The project is complete but I'm open to suggestions & modifications for this project. Please don't forget to put a ⭐ if you're feeling generous 😊 109 | -------------------------------------------------------------------------------- /blockchain-hardhat/.env.example: -------------------------------------------------------------------------------- 1 | # https://www.alchemy.com/dapps/sepolia 2 | SEPOLIA_ALCHEMY_RPC_URL="paste-URL-here" 3 | 4 | # https://www.alchemy.com/blog/polygon-amoy-is-live 5 | AMOY_ALCHEMY_RPC_URL="paste-URL-here" 6 | 7 | # https://docs.morphl2.io/docs/build-on-morph/build-on-morph/development-setup 8 | MORPH_TESTNET_RPC_URL="https://rpc-testnet.morphl2.io" 9 | 10 | METAMASK_PRIVATE_KEY=paste-key-here 11 | 12 | # https://docs.etherscan.io/getting-started/viewing-api-usage-statistics 13 | ETHERSCAN_API_KEY=paste-key-here 14 | 15 | # https://www.npmjs.com/package/hardhat-gas-reporter 16 | # [Optional: Turn "true" if necessary] 17 | REPORT_GAS_USAGE="false" 18 | 19 | # https://coinmarketcap.com/api/ 20 | # [Optional] 21 | COINMARKETCAP_API_KEY=paste-key-here -------------------------------------------------------------------------------- /blockchain-hardhat/.npmignore: -------------------------------------------------------------------------------- 1 | hardhat.config.js 2 | scripts 3 | test 4 | -------------------------------------------------------------------------------- /blockchain-hardhat/assets/test-deploy-data.json: -------------------------------------------------------------------------------- 1 | { 2 | "lawyer1": { 3 | "name": "Lawyer1", 4 | "dateOfBirth": "2001-12-30", 5 | "religion": "Hinduism", 6 | "nationality": "Indian", 7 | "sex": "Male", 8 | "contactNumber": "9051179305", 9 | "UID": 791619819989, 10 | "PAN": "EQJPR7681F", 11 | "associatedCaseIds": [1, 2, 3], 12 | "walletAddress": "0x70997970c51812dc3a010c7d01b50e0d17dc79c8" 13 | }, 14 | "lawyer2": { 15 | "name": "Lawyer2", 16 | "dateOfBirth": "1985-07-15", 17 | "religion": "Islam", 18 | "nationality": "Indian", 19 | "sex": "Female", 20 | "contactNumber": "9876543210", 21 | "UID": 791619819987, 22 | "PAN": "ABCDEF1234G", 23 | "associatedCaseIds": [], 24 | "walletAddress": "0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc" 25 | }, 26 | "lawyer3": { 27 | "name": "Lawyer3", 28 | "dateOfBirth": "1990-03-20", 29 | "religion": "Christianity", 30 | "nationality": "Indian", 31 | "sex": "Female", 32 | "contactNumber": "9988776655", 33 | "UID": 987654321098, 34 | "PAN": "WXYZ1234H", 35 | "associatedCaseIds": [], 36 | "walletAddress": "0x90f79bf6eb2c4f870365e785982e1f101e93b906" 37 | }, 38 | "judge1": { 39 | "name": "Judge1", 40 | "dateOfBirth": "2001-12-30", 41 | "religion": "Hinduism", 42 | "nationality": "Indian", 43 | "sex": "Male", 44 | "contactNumber": "9051179305", 45 | "UID": 791619819970, 46 | "PAN": "EQJPR7681F", 47 | "associatedCaseIds": [], 48 | "walletAddress": "0x15d34aaf54267db7d7c367839aaf71a00a2c6a65" 49 | }, 50 | "judge2": { 51 | "name": "Judge2", 52 | "dateOfBirth": "1975-06-15", 53 | "religion": "Christianity", 54 | "nationality": "American", 55 | "sex": "Female", 56 | "contactNumber": "555-123-4567", 57 | "UID": 123456789012, 58 | "PAN": "ABCPD1234E", 59 | "associatedCaseIds": [], 60 | "walletAddress": "0x9965507d1a55bcc2695c58ba16fb37d819b0a4dc" 61 | }, 62 | "judge3": { 63 | "name": "Judge3", 64 | "dateOfBirth": "1980-03-25", 65 | "religion": "Islam", 66 | "nationality": "Pakistani", 67 | "sex": "Male", 68 | "contactNumber": "+92 300 1234567", 69 | "UID": 987654321000, 70 | "PAN": "PQRXY5678Z", 71 | "associatedCaseIds": [], 72 | "walletAddress": "0x976ea74026e726554db657fa54763abd0c3a0aa9" 73 | }, 74 | "judge4": { 75 | "name": "Judge4", 76 | "dateOfBirth": "1990-08-20", 77 | "religion": "Buddhism", 78 | "nationality": "Japanese", 79 | "sex": "Male", 80 | "contactNumber": "+81 90-1234-5678", 81 | "UID": 456789012345, 82 | "PAN": "JKLQT6789W", 83 | "associatedCaseIds": [], 84 | "walletAddress": "0xbcd4042de499d14e55001ccbb24a551f3b954096" 85 | }, 86 | "judge5": { 87 | "name": "Judge5", 88 | "dateOfBirth": "1988-04-10", 89 | "religion": "Judaism", 90 | "nationality": "Israeli", 91 | "sex": "Female", 92 | "contactNumber": "+972 50-123-4567", 93 | "UID": 654321098765, 94 | "PAN": "MNOPQ5678T", 95 | "associatedCaseIds": [], 96 | "walletAddress": "0x6f46cf5569aefa1acc1009290c8e043747172d89" 97 | }, 98 | "judge6": { 99 | "name": "Judge6", 100 | "dateOfBirth": "1973-11-05", 101 | "religion": "Sikhism", 102 | "nationality": "Canadian", 103 | "sex": "Male", 104 | "contactNumber": "+1 416-555-6789", 105 | "UID": 234567890123, 106 | "PAN": "STUVR1234U", 107 | "associatedCaseIds": [], 108 | "walletAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2" 109 | }, 110 | "client1": { 111 | "name": "Client1", 112 | "dateOfBirth": "2001-12-30", 113 | "religion": "Hinduism", 114 | "nationality": "Indian", 115 | "sex": "Male", 116 | "contactNumber": "9051179307", 117 | "UID": 791619819984, 118 | "PAN": "EQJPR7681M", 119 | "associatedLawyers": [], 120 | "associatedCaseIds": [], 121 | "walletAddress": "0x14dc79964da2c08b23698b3d3cc7ca32193d9955" 122 | }, 123 | "client2": { 124 | "name": "Client2", 125 | "dateOfBirth": "2001-12-30", 126 | "religion": "Hinduism", 127 | "nationality": "Indian", 128 | "sex": "Male", 129 | "contactNumber": "9051179308", 130 | "UID": 791619819988, 131 | "PAN": "EQJPR7681N", 132 | "associatedLawyers": [], 133 | "associatedCaseIds": [], 134 | "walletAddress": "0x23618e81e3f5cdf7f54c3d65f7fbc0abf5b21e8f" 135 | }, 136 | "client3": { 137 | "name": "Client3", 138 | "dateOfBirth": "2001-12-30", 139 | "religion": "Hinduism", 140 | "nationality": "Indian", 141 | "sex": "Male", 142 | "contactNumber": "9051179308", 143 | "UID": 791619819986, 144 | "PAN": "EQJPR7681N", 145 | "associatedLawyers": [], 146 | "associatedCaseIds": [], 147 | "walletAddress": "0xa0ee7a142d267c1f36714e4a8f75612f20a79720" 148 | }, 149 | "legalCase1": { 150 | "UIDOfParty1": 791619819984, 151 | "UIDOfParty2": 791619819988, 152 | "associatedLawyers": [791619819989, 791619819987], 153 | "caseSubject": "Hit and Run", 154 | "caseId": 1, 155 | "progress2": "Clients, Lawyers & Judge Notified.", 156 | "progress3": "First hearing completed.", 157 | "progress4": "Second hearing postponed.", 158 | "progress5": "Second hearing completed.", 159 | "progress6": "Verdict announced." 160 | }, 161 | "legalCase2": { 162 | "UIDOfParty1": 791619819988, 163 | "UIDOfParty2": 791619819984, 164 | "associatedLawyers": [791619819989, 987654321098], 165 | "caseSubject": "Car Accident", 166 | "caseId": 2, 167 | "progress2": "Clients, Lawyers & Judge Notified." 168 | }, 169 | "legalCase3": { 170 | "UIDOfParty1": 791619819986, 171 | "UIDOfParty2": 791619819984, 172 | "associatedLawyers": [791619819989, 987654321098], 173 | "caseSubject": "Property Dispute", 174 | "caseId": 3, 175 | "progress2": "Clients, Lawyers & Judge Notified." 176 | } 177 | } 178 | -------------------------------------------------------------------------------- /blockchain-hardhat/contracts/EVault_Main.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.10; 3 | 4 | contract EVault_Main { 5 | address public contractOwner; 6 | string public contractName; 7 | 8 | // forStoringNumberOfCasesFiled&Indexing 9 | uint256 public caseIdCounter = 1; 10 | // forKeepingACountOfTheNumberOfJudges 11 | uint256 public judgesCount = 0; 12 | // index -> UID 13 | mapping(uint256 => uint256) internal judgeIndexUIDMapping; 14 | 15 | struct LegalCase { 16 | uint256 UIDOfParty1; 17 | uint256 UIDOfParty2; 18 | uint256 filedOnDate; 19 | uint256[] associatedLawyers; 20 | uint256 associatedJudge; 21 | uint256 caseId; 22 | string caseSubject; 23 | string[] caseProgress; 24 | address[] caseProgressIssuer; 25 | string[] caseDocumentHash; 26 | address[] caseDocumentUploader; 27 | } 28 | 29 | struct Client { 30 | string name; 31 | string dateOfBirth; 32 | string religion; 33 | string nationality; 34 | string sex; 35 | string contactNumber; 36 | uint256 UID; 37 | string PAN; 38 | uint256[] associatedCaseIds; 39 | address walletAddress; 40 | } 41 | 42 | struct Lawyer { 43 | string name; 44 | string dateOfBirth; 45 | string religion; 46 | string nationality; 47 | string sex; 48 | string contactNumber; 49 | uint256 UID; 50 | string PAN; 51 | uint256[] associatedCaseIds; 52 | address walletAddress; 53 | } 54 | 55 | struct Judge { 56 | string name; 57 | string dateOfBirth; 58 | string religion; 59 | string nationality; 60 | string sex; 61 | string contactNumber; 62 | uint256 UID; 63 | string PAN; 64 | uint256[] associatedCaseIds; 65 | address walletAddress; 66 | } 67 | 68 | // storeAllTheClients 69 | mapping(uint256 => Client) public clients; 70 | 71 | // storeAlltheLegalCasesFiledInTheCourt 72 | mapping(uint256 => LegalCase) public legalCases; 73 | 74 | // Create a mapping to store lawyers 75 | mapping(uint256 => Lawyer) public lawyers; 76 | 77 | // Create a mapping to store judges 78 | mapping(uint256 => Judge) public judges; 79 | 80 | event ClientRegistered(uint256 UID); 81 | event CaseRegistered(uint256 caseId); 82 | event LawyerRegistered(uint256 UID); 83 | event JudgeRegistered(uint256 UID); 84 | 85 | constructor() { 86 | contractName = "EVault_Main"; 87 | contractOwner = msg.sender; 88 | } 89 | 90 | modifier onlyOwner() { 91 | require( 92 | msg.sender == contractOwner, 93 | "Only the owner can call this function" 94 | ); 95 | _; 96 | } 97 | 98 | // functionToRegisterANewClient 99 | function registerClient( 100 | string memory _name, 101 | string memory _dateOfBirth, 102 | string memory _religion, 103 | string memory _nationality, 104 | string memory _sex, 105 | string memory _contactNumber, 106 | uint256 _UID, 107 | string memory _PAN, 108 | address _walletAddress 109 | ) external { 110 | require(bytes(_name).length > 0, "Name cannot be empty"); 111 | require( 112 | bytes(_dateOfBirth).length > 0, 113 | "Date of Birth cannot be empty" 114 | ); 115 | require(bytes(_religion).length > 0, "Religion cannot be empty"); 116 | require(bytes(_nationality).length > 0, "Nationality cannot be empty"); 117 | require(bytes(_sex).length > 0, "Sex cannot be empty"); 118 | require( 119 | bytes(_contactNumber).length > 0, 120 | "Contact Number cannot be empty" 121 | ); 122 | require(_UID > 0 && _UID <= 999999999999, "Invalid UID"); 123 | 124 | uint256[] memory caseIds = new uint256[](0); 125 | 126 | clients[_UID] = Client({ 127 | name: _name, 128 | dateOfBirth: _dateOfBirth, 129 | religion: _religion, 130 | nationality: _nationality, 131 | sex: _sex, 132 | contactNumber: _contactNumber, 133 | UID: _UID, 134 | PAN: _PAN, 135 | associatedCaseIds: caseIds, 136 | walletAddress: _walletAddress 137 | }); 138 | 139 | emit ClientRegistered(_UID); 140 | } 141 | 142 | // functionToRegisterANewJudge 143 | function registerJudge( 144 | string memory _name, 145 | string memory _dateOfBirth, 146 | string memory _religion, 147 | string memory _nationality, 148 | string memory _sex, 149 | string memory _contactNumber, 150 | uint256 _UID, 151 | string memory _PAN, 152 | address _walletAddress 153 | ) external onlyOwner { 154 | require(bytes(_name).length > 0, "Name cannot be empty"); 155 | require( 156 | bytes(_dateOfBirth).length > 0, 157 | "Date of Birth cannot be empty" 158 | ); 159 | require(bytes(_religion).length > 0, "Religion cannot be empty"); 160 | require(bytes(_nationality).length > 0, "Nationality cannot be empty"); 161 | require(bytes(_sex).length > 0, "Sex cannot be empty"); 162 | require( 163 | bytes(_contactNumber).length > 0, 164 | "Contact Number cannot be empty" 165 | ); 166 | require(_UID > 0 && _UID <= 999999999999, "Invalid UID"); 167 | 168 | uint256[] memory caseIds = new uint256[](0); // Initialize the associatedCaseIds array 169 | 170 | judges[_UID] = Judge({ 171 | name: _name, 172 | dateOfBirth: _dateOfBirth, 173 | religion: _religion, 174 | nationality: _nationality, 175 | sex: _sex, 176 | contactNumber: _contactNumber, 177 | UID: _UID, 178 | PAN: _PAN, 179 | associatedCaseIds: caseIds, 180 | walletAddress: _walletAddress 181 | }); 182 | 183 | judgeIndexUIDMapping[judgesCount] = _UID; 184 | judgesCount++; 185 | 186 | emit JudgeRegistered(_UID); 187 | } 188 | 189 | // Function to register a new lawyer 190 | function registerLawyer( 191 | string memory _name, 192 | string memory _dateOfBirth, 193 | string memory _religion, 194 | string memory _nationality, 195 | string memory _sex, 196 | string memory _contactNumber, 197 | uint256 _UID, 198 | string memory _PAN, 199 | address _walletAddress 200 | ) external { 201 | require(bytes(_name).length > 0, "Name cannot be empty"); 202 | require( 203 | bytes(_dateOfBirth).length > 0, 204 | "Date of Birth cannot be empty" 205 | ); 206 | require(bytes(_religion).length > 0, "Religion cannot be empty"); 207 | require(bytes(_nationality).length > 0, "Nationality cannot be empty"); 208 | require(bytes(_sex).length > 0, "Sex cannot be empty"); 209 | require( 210 | bytes(_contactNumber).length > 0, 211 | "Contact Number cannot be empty" 212 | ); 213 | require(_UID > 0 && _UID <= 999999999999, "Invalid UID"); 214 | 215 | uint256[] memory caseIds = new uint256[](0); // Initialize the associatedCaseIds array 216 | 217 | lawyers[_UID] = Lawyer({ 218 | name: _name, 219 | walletAddress: _walletAddress, 220 | dateOfBirth: _dateOfBirth, 221 | religion: _religion, 222 | nationality: _nationality, 223 | sex: _sex, 224 | contactNumber: _contactNumber, 225 | UID: _UID, 226 | PAN: _PAN, 227 | associatedCaseIds: caseIds 228 | }); 229 | 230 | emit LawyerRegistered(_UID); 231 | } 232 | 233 | // Function to get lawyer details by UID 234 | function getLawyerDetailsByUID( 235 | uint256 _UID 236 | ) 237 | external 238 | view 239 | returns ( 240 | string memory name, 241 | string memory dateOfBirth, 242 | string memory religion, 243 | string memory nationality, 244 | string memory sex, 245 | string memory contactNumber, 246 | uint256 UID, 247 | string memory PAN, 248 | uint256[] memory associatedCaseIds, 249 | address walletAddress 250 | ) 251 | { 252 | Lawyer memory lawyer = lawyers[_UID]; 253 | require( 254 | bytes(lawyer.name).length > 0, 255 | "Lawyer with this UID does not exist" 256 | ); 257 | 258 | return ( 259 | lawyer.name, 260 | lawyer.dateOfBirth, 261 | lawyer.religion, 262 | lawyer.nationality, 263 | lawyer.sex, 264 | lawyer.contactNumber, 265 | lawyer.UID, 266 | lawyer.PAN, 267 | lawyer.associatedCaseIds, 268 | lawyer.walletAddress 269 | ); 270 | } 271 | 272 | // Function to get Judge details by UID 273 | function getJudgeDetailsByUID( 274 | uint256 _UID 275 | ) 276 | external 277 | view 278 | returns ( 279 | string memory name, 280 | string memory dateOfBirth, 281 | string memory religion, 282 | string memory nationality, 283 | string memory sex, 284 | string memory contactNumber, 285 | uint256 UID, 286 | string memory PAN, 287 | uint256[] memory associatedCaseIds, 288 | address walletAddress 289 | ) 290 | { 291 | Judge memory judge = judges[_UID]; 292 | require( 293 | bytes(judge.name).length > 0, 294 | "Judge with this UID does not exist" 295 | ); 296 | 297 | return ( 298 | judge.name, 299 | judge.dateOfBirth, 300 | judge.religion, 301 | judge.nationality, 302 | judge.sex, 303 | judge.contactNumber, 304 | judge.UID, 305 | judge.PAN, 306 | judge.associatedCaseIds, 307 | judge.walletAddress 308 | ); 309 | } 310 | 311 | // functionToViewClientInformation 312 | function getClientDetailsByUID( 313 | uint256 _UID 314 | ) 315 | external 316 | view 317 | returns ( 318 | string memory name, 319 | string memory dateOfBirth, 320 | string memory religion, 321 | string memory nationality, 322 | string memory sex, 323 | string memory contactNumber, 324 | uint256 UID, 325 | string memory PAN, 326 | uint256[] memory associatedCaseIds, 327 | address walletAddress 328 | ) 329 | { 330 | Client memory client = clients[_UID]; 331 | require( 332 | bytes(client.name).length > 0, 333 | "Client with this UID does not exist" 334 | ); 335 | 336 | return ( 337 | client.name, 338 | client.dateOfBirth, 339 | client.religion, 340 | client.nationality, 341 | client.sex, 342 | client.contactNumber, 343 | client.UID, 344 | client.PAN, 345 | client.associatedCaseIds, 346 | client.walletAddress 347 | ); 348 | } 349 | 350 | // function to add a legal case for two clients 351 | function registerLegalCase( 352 | uint256 _UIDOfParty1, 353 | uint256 _UIDOfParty2, 354 | string memory _caseSubject, 355 | uint256[] memory _associatedLawyers 356 | ) external { 357 | Client storage client1 = clients[_UIDOfParty1]; 358 | Client storage client2 = clients[_UIDOfParty2]; 359 | 360 | require( 361 | bytes(client1.name).length > 0 && bytes(client2.name).length > 0, 362 | "Both clients must exist" 363 | ); 364 | 365 | // Increment the caseIdCounter and use it as the caseId 366 | uint256 _caseId = caseIdCounter; 367 | 368 | // Get a random judge UID 369 | uint256 selectedJudgeUID = getRandomJudgeUID(); 370 | 371 | legalCases[_caseId] = LegalCase({ 372 | UIDOfParty1: _UIDOfParty1, 373 | UIDOfParty2: _UIDOfParty2, 374 | filedOnDate: block.timestamp, 375 | associatedLawyers: _associatedLawyers, 376 | associatedJudge: selectedJudgeUID, 377 | caseId: _caseId, 378 | caseSubject: _caseSubject, 379 | caseProgress: new string[](0), 380 | caseProgressIssuer: new address[](0), 381 | caseDocumentHash: new string[](0), 382 | caseDocumentUploader: new address[](0) 383 | }); 384 | 385 | // AddingInitialStatusToTheCaseProgressList 386 | legalCases[_caseId].caseProgress.push("Case registered with E-Vault."); 387 | legalCases[_caseId].caseProgressIssuer.push(address(this)); 388 | 389 | // Add the legal case to the clients' associatedCaseIds 390 | client1.associatedCaseIds.push(_caseId); 391 | client2.associatedCaseIds.push(_caseId); 392 | 393 | // Update the associatedCaseIds of the judge 394 | Judge storage judge = judges[selectedJudgeUID]; 395 | judge.associatedCaseIds.push(_caseId); 396 | 397 | // Update associatedCaseIds of lawyers 398 | for (uint256 i = 0; i < _associatedLawyers.length; i++) { 399 | Lawyer storage lawyer = lawyers[_associatedLawyers[i]]; 400 | lawyer.associatedCaseIds.push(_caseId); 401 | } 402 | 403 | caseIdCounter++; 404 | 405 | emit CaseRegistered(_caseId); 406 | } 407 | 408 | // Function to update the case progress by caseId 409 | function updateCaseProgressWithCaseId( 410 | uint256 _caseId, 411 | string memory _progress 412 | ) external returns (bool) { 413 | LegalCase storage legalCase = legalCases[_caseId]; 414 | require( 415 | bytes(legalCase.caseSubject).length > 0, 416 | "Legal case with this caseId does not exist" 417 | ); 418 | 419 | // Append the new status to the caseProgress array 420 | legalCase.caseProgress.push(_progress); 421 | legalCase.caseProgressIssuer.push(msg.sender); 422 | 423 | return true; 424 | } 425 | 426 | // Function to update case documents with caseId 427 | function updateCaseDocumentsWithCaseId( 428 | uint256 _caseId, 429 | string memory _ipfsHash 430 | ) external returns (bool) { 431 | LegalCase storage legalCase = legalCases[_caseId]; 432 | require( 433 | bytes(legalCase.caseSubject).length > 0, 434 | "Legal case with this caseId does not exist" 435 | ); 436 | 437 | // Append the IPFS hash and uploader address to the respective arrays 438 | legalCase.caseDocumentHash.push(_ipfsHash); 439 | legalCase.caseDocumentUploader.push(msg.sender); 440 | 441 | return true; 442 | } 443 | 444 | // function to get the filed legal cases for a client 445 | function getFiledLegalCasesForAClient( 446 | uint256 _UID 447 | ) external view returns (LegalCase[] memory) { 448 | Client memory client = clients[_UID]; 449 | require( 450 | bytes(client.name).length > 0, 451 | "Client with this UID does not exist" 452 | ); 453 | 454 | uint256[] memory caseIds = client.associatedCaseIds; 455 | // makingAnArrayOfStructObjects 456 | LegalCase[] memory filedCases = new LegalCase[](caseIds.length); 457 | 458 | for (uint256 i = 0; i < caseIds.length; i++) { 459 | filedCases[i] = legalCases[caseIds[i]]; 460 | } 461 | 462 | return filedCases; 463 | } 464 | 465 | // function to get the filed legal cases for a lawyer 466 | function getFiledLegalCasesForALawyer( 467 | uint256 _UID 468 | ) external view returns (LegalCase[] memory) { 469 | Lawyer memory lawyer = lawyers[_UID]; 470 | require( 471 | bytes(lawyer.name).length > 0, 472 | "Lawyer with this UID does not exist" 473 | ); 474 | 475 | uint256[] memory caseIds = lawyer.associatedCaseIds; 476 | // makingAnArrayOfStructObjects 477 | LegalCase[] memory filedCases = new LegalCase[](caseIds.length); 478 | 479 | for (uint256 i = 0; i < caseIds.length; i++) { 480 | filedCases[i] = legalCases[caseIds[i]]; 481 | } 482 | 483 | return filedCases; 484 | } 485 | 486 | // function to get the filed legal cases for a lawyer 487 | function getFiledLegalCasesForAJudge( 488 | uint256 _UID 489 | ) external view returns (LegalCase[] memory) { 490 | Judge memory judge = judges[_UID]; 491 | require( 492 | bytes(judge.name).length > 0, 493 | "Lawyer with this UID does not exist" 494 | ); 495 | 496 | uint256[] memory caseIds = judge.associatedCaseIds; 497 | // makingAnArrayOfStructObjects 498 | LegalCase[] memory filedCases = new LegalCase[](caseIds.length); 499 | 500 | for (uint256 i = 0; i < caseIds.length; i++) { 501 | filedCases[i] = legalCases[caseIds[i]]; 502 | } 503 | 504 | return filedCases; 505 | } 506 | 507 | // function to view details of a legal case by caseId 508 | function getCaseDetailsByCaseId( 509 | uint256 _caseId 510 | ) 511 | external 512 | view 513 | returns ( 514 | uint256 UIDOfParty1, 515 | uint256 UIDOfParty2, 516 | uint256 filedOnDate, 517 | uint256[] memory associatedLawyers, 518 | uint256 associatedJudge, 519 | uint256 caseId, 520 | string memory caseSubject, 521 | string[] memory caseProgress, 522 | address[] memory caseProgressIssuer, 523 | string[] memory caseDocumentHash, 524 | address[] memory caseDocumentUploader 525 | ) 526 | { 527 | LegalCase memory registeredLegalCase = legalCases[_caseId]; 528 | require( 529 | bytes(registeredLegalCase.caseSubject).length > 0, 530 | "Legal case with this caseId does not exist" 531 | ); 532 | 533 | return ( 534 | registeredLegalCase.UIDOfParty1, 535 | registeredLegalCase.UIDOfParty2, 536 | registeredLegalCase.filedOnDate, 537 | registeredLegalCase.associatedLawyers, 538 | registeredLegalCase.associatedJudge, 539 | registeredLegalCase.caseId, 540 | registeredLegalCase.caseSubject, 541 | registeredLegalCase.caseProgress, 542 | registeredLegalCase.caseProgressIssuer, 543 | registeredLegalCase.caseDocumentHash, 544 | registeredLegalCase.caseDocumentUploader 545 | ); 546 | } 547 | 548 | // Function to get a random judge UID 549 | function getRandomJudgeUID() internal view returns (uint256) { 550 | // Get the count of judges 551 | uint256 _judgesCount = getJudgesCount(); 552 | 553 | // Generate a random index within the range of judges 554 | uint256 randomIndex = uint256( 555 | keccak256(abi.encodePacked(block.timestamp)) 556 | ) % _judgesCount; 557 | 558 | // Retrieve the judge's UID using the generated index 559 | return getJudgeUIDAtIndex(randomIndex); 560 | } 561 | 562 | // Function to get the count of judges 563 | function getJudgesCount() internal view returns (uint256) { 564 | return judgesCount; 565 | } 566 | 567 | // Function to retrieve judge's UID at a specific index 568 | function getJudgeUIDAtIndex( 569 | uint256 _index 570 | ) internal view returns (uint256) { 571 | return judgeIndexUIDMapping[_index]; 572 | } 573 | 574 | // LoginFunctionalities 575 | 576 | // login : client 577 | function loginAsAClient(uint256 _UID) external view returns (bool) { 578 | // Check if the client with the given UID exists in the clients mapping 579 | return bytes(clients[_UID].name).length > 0; 580 | } 581 | 582 | // login : lawyer 583 | function loginAsALawyer(uint256 _UID) external view returns (bool) { 584 | // Check if the lawyer with the given UID exists in the lawyers mapping 585 | return bytes(lawyers[_UID].name).length > 0; 586 | } 587 | 588 | // login : judge 589 | function loginAsAJudge(uint256 _UID) external view returns (bool) { 590 | // Check if the lawyer with the given UID exists in the lawyers mapping 591 | return bytes(judges[_UID].name).length > 0; 592 | } 593 | } 594 | -------------------------------------------------------------------------------- /blockchain-hardhat/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomiclabs/hardhat-waffle"); 2 | 3 | require("@nomiclabs/hardhat-etherscan"); 4 | require("dotenv").config(); 5 | // require("solidity-coverage"); 6 | 7 | // https://www.npmjs.com/package/hardhat-gas-reporter 8 | require("hardhat-gas-reporter"); 9 | 10 | // importingCustomDefinedTasks 11 | require("./tasks/block-number"); 12 | 13 | const SEPOLIA_ALCHEMY_RPC_URL = process.env.SEPOLIA_ALCHEMY_RPC_URL; 14 | const METAMASK_PRIVATE_KEY = process.env.METAMASK_PRIVATE_KEY; 15 | const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY; 16 | const COINMARKETCAP_API_KEY = process.env.COINMARKETCAP_API_KEY 17 | ? process.env.COINMARKETCAP_API_KEY 18 | : null; 19 | 20 | const AMOY_ALCHEMY_RPC_URL = process.env.AMOY_ALCHEMY_RPC_URL; 21 | const MORPH_TESTNET_RPC_URL = process.env.MORPH_TESTNET_RPC_URL; 22 | 23 | /** @type import('hardhat/config').HardhatUserConfig */ 24 | module.exports = { 25 | solidity: { 26 | version: "0.8.10", 27 | settings: { 28 | optimizer: { 29 | enabled: true, 30 | runs: 1000, 31 | }, 32 | }, 33 | }, 34 | defaultNetwork: "hardhat", 35 | allowUnlimitedContractSize: true, 36 | networks: { 37 | // default 38 | hardhat: {}, 39 | 40 | // https://polygon.technology/blog/introducing-the-amoy-testnet-for-polygon-pos 41 | amoy: { 42 | url: AMOY_ALCHEMY_RPC_URL, 43 | accounts: [METAMASK_PRIVATE_KEY], 44 | chainId: 80002, 45 | }, 46 | 47 | // https://docs.morphl2.io/docs/build-on-morph/build-on-morph/development-setup 48 | morph: { 49 | url: process.env.MORPH_TESTNET_RPC_URL, 50 | accounts: [METAMASK_PRIVATE_KEY], 51 | chainId: 2710, 52 | }, 53 | 54 | sepolia: { 55 | url: SEPOLIA_ALCHEMY_RPC_URL, 56 | accounts: [METAMASK_PRIVATE_KEY], 57 | chainId: 11155111, 58 | }, 59 | 60 | // forHardhatLocalRuntimeEnvironment(Node) 61 | localhost: { 62 | url: "http://127.0.0.1:8545/", 63 | chainId: 31337, 64 | gas: 2100000, 65 | gasPrice: 8000000000, 66 | }, 67 | }, 68 | etherscan: { 69 | apiKey: { 70 | sepolia: ETHERSCAN_API_KEY, 71 | morph: ETHERSCAN_API_KEY, 72 | }, 73 | customChains: [ 74 | { 75 | network: "morph", 76 | chainId: 2710, 77 | urls: { 78 | apiURL: "https://explorer-api-testnet.morphl2.io/api", 79 | browserURL: "https://explorer-testnet.morphl2.io", 80 | }, 81 | }, 82 | ], 83 | }, 84 | 85 | gasReporter: { 86 | // -> toggleAccordingToNeedToKnowGasConsumptionOfContract 87 | enabled: process.env.REPORT_GAS_USAGE == "false" ? false : true, 88 | 89 | noColors: true, 90 | 91 | // -> currencyYouWantTheEstimationsIn(COINMARKETCAP) 92 | currency: "INR", 93 | 94 | // -> TOKENYouWantTheEstimationsIn(ETH ByDefault) 95 | token: "ETH", 96 | 97 | // -> ifYouWantOutputInASeparateFile 98 | // outputFile: "gas-report.txt", 99 | 100 | // -> APICallForFetchingCurrentPrice 101 | coinmarketcap: COINMARKETCAP_API_KEY, 102 | }, 103 | }; 104 | -------------------------------------------------------------------------------- /blockchain-hardhat/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hardhat-simple-storage-fcc", 3 | "devDependencies": { 4 | "@nomiclabs/hardhat-ethers": "^2.0.4", 5 | "@nomiclabs/hardhat-etherscan": "^3.0.0", 6 | "@nomiclabs/hardhat-waffle": "^2.0.2", 7 | "chai": "^4.3.4", 8 | "ethereum-waffle": "^3.4.0", 9 | "ethers": "^5.5.3", 10 | "hardhat": "^2.8.3", 11 | "hardhat-gas-reporter": "^1.0.7", 12 | "solidity-coverage": "^0.7.18" 13 | }, 14 | "dependencies": { 15 | "dotenv": "^14.2.0" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /blockchain-hardhat/scripts/deploy_fetchCaseDetailsByAClient.js: -------------------------------------------------------------------------------- 1 | const {ethers, run, network} = require("hardhat"); 2 | 3 | const { 4 | judge1, 5 | judge2, 6 | judge3, 7 | judge4, 8 | judge5, 9 | judge6, 10 | lawyer1, 11 | lawyer2, 12 | lawyer3, 13 | client1, 14 | client2, 15 | client3, 16 | legalCase1, 17 | legalCase2, 18 | legalCase3, 19 | } = require("../assets/test-deploy-data.json"); 20 | 21 | const {registerJudge} = require("./script-functions/function_judge"); 22 | const { 23 | registerLawyer, 24 | verifyLawyerRegistration, 25 | } = require("./script-functions/function_lawyer"); 26 | const { 27 | registerClient, 28 | verifyClientRegistration, 29 | getLegalCasesForClient, 30 | } = require("./script-functions/function_client"); 31 | const { 32 | registerLegalCase, 33 | getLegalCaseDetails, 34 | updateCaseProgressWithCaseId, 35 | } = require("./script-functions/function_legalcase"); 36 | 37 | async function main() { 38 | console.log("- - - - - - - - - - - - - - - - - - - - -"); 39 | console.log("- - - - - - - - - - - - - - - - - - - - -"); 40 | console.log(`Contract deployment ⌛`); 41 | console.log("- - - - - - - - - - - - - - - - - - - - -"); 42 | 43 | const EvaultMainContract = await ethers.getContractFactory("EVault_Main"); 44 | const eVaultMain = await EvaultMainContract.deploy(); 45 | await eVaultMain.deployed(); 46 | 47 | console.log("Contract deployed successfully \u2705"); 48 | 49 | console.log(`Contract name: ${await eVaultMain.contractName()}`); 50 | console.log(`Contract address : ${eVaultMain.address}`); 51 | console.log(`Contract owner: ${await eVaultMain.contractOwner()}`); 52 | console.log(`Deployment chainID: [ ${network.config.chainId} ]`); 53 | 54 | if (network.config.chainId === 11155111) { 55 | console.log(`Deployment network: Sepolia Testnet`); 56 | console.log("Confirming blocks ... \u23F3"); 57 | await eVaultMain.deployTransaction.wait(6); 58 | await verify(eVaultMain.address, []); 59 | } else if (network.config.chainId === 31337) { 60 | console.log(`Deployment network: Localhost [ Hardhat ]`); 61 | } else if (network.config.chainId === 80002) { 62 | console.log(`Deployment network: Polygon Amoy Testnet`); 63 | console.log("Confirming blocks ... \u23F3"); 64 | await eVaultMain.deployTransaction.wait(3); 65 | console.log("3 block confirmations done \u2705"); 66 | } else if (network.config.chainId === 2710) { 67 | console.log(`Deployment network: Morph Testnet`); 68 | console.log("Confirming blocks ... \u23F3"); 69 | await eVaultMain.deployTransaction.wait(2); 70 | console.log("2 block confirmations done \u2705"); 71 | await verify(eVaultMain.address, []); 72 | } 73 | 74 | if (network.config.chainId === 31337) { 75 | console.log("- - - - - - - - - - - - - - - - - - - - -"); 76 | console.log(`Contract interactions ⌛`); 77 | console.log("- - - - - - - - - - - - - - - - - - - - -"); 78 | 79 | const [deployer] = await ethers.getSigners(); 80 | 81 | console.log("Registering 3 new clients now ... \u23F3"); 82 | 83 | await registerClient(deployer, eVaultMain, client1); 84 | await registerClient(deployer, eVaultMain, client2); 85 | await registerClient(deployer, eVaultMain, client3); 86 | 87 | console.log("- - - - - - - - - - - - - - - - - - - - -"); 88 | 89 | console.log("Verifying 3 newly added clients \u23F3"); 90 | 91 | await verifyClientRegistration(eVaultMain, client1); 92 | await verifyClientRegistration(eVaultMain, client2); 93 | await verifyClientRegistration(eVaultMain, client3); 94 | 95 | console.log("All 3 clients are verified successfully. \u2705"); 96 | 97 | console.log("- - - - - - - - - - - - - - - - - - - - -"); 98 | 99 | console.log("Registering 3 new lawyers now ... \u23F3"); 100 | 101 | await registerLawyer(deployer, eVaultMain, lawyer1); 102 | await registerLawyer(deployer, eVaultMain, lawyer2); 103 | await registerLawyer(deployer, eVaultMain, lawyer3); 104 | 105 | console.log("- - - - - - - - - - - - - - - - - - - - -"); 106 | 107 | console.log("Verifying 3 new lawyers now ... \u23F3"); 108 | 109 | await verifyLawyerRegistration(eVaultMain, lawyer1); 110 | await verifyLawyerRegistration(eVaultMain, lawyer2); 111 | await verifyLawyerRegistration(eVaultMain, lawyer3); 112 | 113 | console.log("- - - - - - - - - - - - - - - - - - - - -"); 114 | 115 | console.log("Registering 3 new judges now ... \u23F3"); 116 | 117 | await registerJudge(deployer, eVaultMain, judge1); 118 | await registerJudge(deployer, eVaultMain, judge2); 119 | await registerJudge(deployer, eVaultMain, judge3); 120 | await registerJudge(deployer, eVaultMain, judge4); 121 | // await registerJudge(deployer, eVaultMain, judge5); 122 | // await registerJudge(deployer, eVaultMain, judge6); 123 | 124 | console.log("- - - - - - - - - - - - - - - - - - - - -"); 125 | 126 | console.log( 127 | `Filing 3 new legal cases between client : ${client1.UID} and 2 other clients ... \u23F3` 128 | ); 129 | 130 | await registerLegalCase(deployer, eVaultMain, legalCase1); 131 | await registerLegalCase(deployer, eVaultMain, legalCase2); 132 | await registerLegalCase(deployer, eVaultMain, legalCase3); 133 | 134 | console.log("Legal cases added to blockchain \u2705"); 135 | 136 | console.log("- - - - - - - - - - - - - - - - - - - - -"); 137 | 138 | console.log("Verifying 3 newly added cases ... \u23F3"); 139 | 140 | await getLegalCaseDetails(eVaultMain, 1); 141 | await getLegalCaseDetails(eVaultMain, 2); 142 | await getLegalCaseDetails(eVaultMain, 3); 143 | 144 | console.log("- - - - - - - - - - - - - - - - - - - - -"); 145 | 146 | console.log( 147 | `Updating progress for case [ ${legalCase1.caseId} | ${legalCase1.caseSubject} ] ... \u23F3` 148 | ); 149 | 150 | await updateCaseProgressWithCaseId( 151 | deployer, 152 | eVaultMain, 153 | 1, 154 | legalCase1.progress2 155 | ); 156 | await updateCaseProgressWithCaseId( 157 | deployer, 158 | eVaultMain, 159 | 1, 160 | legalCase1.progress3 161 | ); 162 | await updateCaseProgressWithCaseId( 163 | deployer, 164 | eVaultMain, 165 | 1, 166 | legalCase1.progress4 167 | ); 168 | await updateCaseProgressWithCaseId( 169 | deployer, 170 | eVaultMain, 171 | 1, 172 | legalCase1.progress5 173 | ); 174 | await updateCaseProgressWithCaseId( 175 | deployer, 176 | eVaultMain, 177 | 1, 178 | legalCase1.progress6 179 | ); 180 | 181 | console.log( 182 | `Case [ ${legalCase1.caseId} | ${legalCase1.caseSubject} ] progress updated \u2705` 183 | ); 184 | 185 | console.log("- - - - - - - - - - - - - - - - - - - - -"); 186 | 187 | // fetchingCasesForAClient? 188 | await getLegalCasesForClient(eVaultMain, client1.UID); 189 | } 190 | 191 | console.log("- - - - - - - - - - - - - - - - - - - - -"); 192 | console.log("- - - - - - - - - - - - - - - - - - - - -"); 193 | } 194 | 195 | // async function verify(contractAddress, args) { 196 | const verify = async (contractAddress, args) => { 197 | console.log("Verifying contract \u23F3"); 198 | try { 199 | await run("verify:verify", { 200 | address: contractAddress, 201 | constructorArguments: args, 202 | }); 203 | } catch (e) { 204 | if (e.message.toLowerCase().includes("already verified")) { 205 | console.log("Already Verified!"); 206 | } else { 207 | console.log(e); 208 | } 209 | } 210 | }; 211 | 212 | main().catch((error) => { 213 | console.error(error); 214 | process.exitCode = 1; 215 | }); 216 | 217 | // run >>> npx hardhat run scripts/deploy_fetchCaseDetailsByAClient.js --network 218 | // run >>> npx hardhat run scripts/deploy_fetchCaseDetailsByAClient.js --network localhost 219 | // run >>> npx hardhat run scripts/deploy_fetchCaseDetailsByAClient.js --network sepolia 220 | 221 | // run >>> npx hardhat run scripts/deploy_fetchCaseDetailsByAClient.js --network amoy 222 | // run >>> npx hardhat run scripts/deploy_fetchCaseDetailsByAClient.js --network morph 223 | -------------------------------------------------------------------------------- /blockchain-hardhat/scripts/script-functions/function_client.js: -------------------------------------------------------------------------------- 1 | async function registerClient(deployer, contract, clientData) { 2 | const { 3 | name, 4 | dateOfBirth, 5 | religion, 6 | nationality, 7 | sex, 8 | contactNumber, 9 | UID, 10 | PAN, 11 | walletAddress, 12 | } = clientData; 13 | 14 | // console.log(`Registering client : [ ${name} ] ... \u23F3`); 15 | 16 | const registerClientTX = await contract 17 | .connect(deployer) 18 | .registerClient( 19 | name, 20 | dateOfBirth, 21 | religion, 22 | nationality, 23 | sex, 24 | contactNumber, 25 | UID, 26 | PAN, 27 | walletAddress 28 | ); 29 | 30 | await registerClientTX.wait(); 31 | 32 | console.log(`Client : [ ${name} | ${UID} ] added to blockchain. \u2705`); 33 | } 34 | 35 | async function verifyClientRegistration(contract, clientData) { 36 | try { 37 | const isClientRegistered = await contract.loginAsAClient(clientData.UID); 38 | 39 | if (isClientRegistered) { 40 | console.log( 41 | `Lawyer : [ ${clientData.name} | ${clientData.UID} ] verified. \u2705` 42 | ); 43 | } else { 44 | console.log( 45 | `Lawyer : [ ${clientData.name} | ${clientData.UID} ] not found. \0x274C` 46 | ); 47 | } 48 | } catch (error) { 49 | console.log(`Error while verifying client : [ ${UID} ] : ${error}`); 50 | } 51 | } 52 | 53 | async function getLegalCasesForClient(contract, UID) { 54 | console.log( 55 | `Serching for the cases associated with client : [ ${UID} ] \u23F3` 56 | ); 57 | const filedCases = await contract.getFiledLegalCasesForAClient(UID); 58 | 59 | console.log(`${filedCases.length} Case files fetched successfully. \u2705`); 60 | } 61 | 62 | module.exports = { 63 | registerClient, 64 | verifyClientRegistration, 65 | getLegalCasesForClient, 66 | }; 67 | -------------------------------------------------------------------------------- /blockchain-hardhat/scripts/script-functions/function_judge.js: -------------------------------------------------------------------------------- 1 | async function registerJudge(deployer, contract, judgeData) { 2 | const { 3 | name, 4 | dateOfBirth, 5 | religion, 6 | nationality, 7 | sex, 8 | contactNumber, 9 | UID, 10 | PAN, 11 | walletAddress, 12 | } = judgeData; 13 | 14 | // console.log(`Registering Judge : [ ${name} ] ... \u23F3`); 15 | 16 | const registerJudgeTx = await contract 17 | .connect(deployer) 18 | .registerJudge( 19 | name, 20 | dateOfBirth, 21 | religion, 22 | nationality, 23 | sex, 24 | contactNumber, 25 | UID, 26 | PAN, 27 | walletAddress 28 | ); 29 | 30 | await registerJudgeTx.wait(); 31 | 32 | console.log(`Judge [ ${name} | ${UID} ] added to blockchain. \u2705`); 33 | } 34 | 35 | module.exports = {registerJudge}; 36 | -------------------------------------------------------------------------------- /blockchain-hardhat/scripts/script-functions/function_lawyer.js: -------------------------------------------------------------------------------- 1 | async function registerLawyer(deployer, contract, lawyerData) { 2 | const { 3 | name, 4 | dateOfBirth, 5 | religion, 6 | nationality, 7 | sex, 8 | contactNumber, 9 | UID, 10 | PAN, 11 | walletAddress, 12 | } = lawyerData; 13 | 14 | // console.log(`Registering lawyer : [ ${name} ] ... \u23F3`); 15 | 16 | const registerLawyerTx = await contract 17 | .connect(deployer) 18 | .registerLawyer( 19 | name, 20 | dateOfBirth, 21 | religion, 22 | nationality, 23 | sex, 24 | contactNumber, 25 | UID, 26 | PAN, 27 | walletAddress 28 | ); 29 | 30 | await registerLawyerTx.wait(); 31 | 32 | console.log(`Lawyer [ ${name} | ${UID} ] added to blockchain. \u2705`); 33 | } 34 | 35 | async function verifyLawyerRegistration(contract, lawyerData) { 36 | try { 37 | const isLawyerRegistered = await contract.loginAsALawyer(lawyerData.UID); 38 | 39 | if (isLawyerRegistered) { 40 | console.log( 41 | `Lawyer : [ ${lawyerData.name} | ${lawyerData.UID} ] verified. \u2705` 42 | ); 43 | } else { 44 | console.log( 45 | `Lawyer : [ ${lawyerData.name} | ${lawyerData.UID} ] not found. \0x274C` 46 | ); 47 | } 48 | } catch (error) { 49 | console.log(`Error while verifying lawyer : [ ${UID} ] : ${error}`); 50 | } 51 | } 52 | 53 | module.exports = {registerLawyer, verifyLawyerRegistration}; 54 | -------------------------------------------------------------------------------- /blockchain-hardhat/scripts/script-functions/function_legalcase.js: -------------------------------------------------------------------------------- 1 | async function registerLegalCase(deployer, contract, caseData) { 2 | const {UIDOfParty1, UIDOfParty2, caseSubject, associatedLawyers} = caseData; 3 | 4 | console.log(`Registering Case : [ ${caseSubject} ] ... \u23F3`); 5 | 6 | const registerCaseTX = await contract.connect(deployer).registerLegalCase( 7 | UIDOfParty1, 8 | UIDOfParty2, 9 | caseSubject, 10 | associatedLawyers.map((lawyerUID) => lawyerUID) 11 | ); 12 | 13 | await registerCaseTX.wait(); 14 | 15 | console.log(`Case [ ${caseSubject} ] added to blockchain. \u2705`); 16 | } 17 | 18 | async function getLegalCaseDetails(contract, caseId) { 19 | const caseDetails = await contract.getCaseDetailsByCaseId(caseId); 20 | 21 | // console.log("UID of Party 1:", caseDetails.UIDOfParty1); 22 | // console.log("UID of Party 2:", caseDetails.UIDOfParty2); 23 | // console.log( 24 | // "Filed On Date:", 25 | // new Date(caseDetails.filedOnDate.toNumber() * 1000) 26 | // ); 27 | // console.log( 28 | // "Associated Lawyers:", 29 | // caseDetails[3].map((address) => address.toString()) 30 | // ); 31 | // console.log("Associated Judge:", caseDetails.associatedJudge); 32 | 33 | // console.log("Case ID:", caseDetails.caseId.toString()); 34 | console.log( 35 | `Case subject : [ ${caseId} | ${caseDetails.caseSubject} ] verfied. \u2705` 36 | ); 37 | } 38 | 39 | async function updateCaseProgressWithCaseId( 40 | deployer, 41 | contract, 42 | caseID, 43 | progress 44 | ) { 45 | const updateCaseProgressTX = await contract 46 | .connect(deployer) 47 | .updateCaseProgressWithCaseId(caseID, progress); 48 | 49 | await updateCaseProgressTX.wait(); 50 | 51 | console.log(`Case progress : [ ${caseID} | ${progress} ]. \u2705`); 52 | } 53 | 54 | module.exports = { 55 | registerLegalCase, 56 | getLegalCaseDetails, 57 | updateCaseProgressWithCaseId, 58 | }; 59 | -------------------------------------------------------------------------------- /blockchain-hardhat/tasks/block-number.js: -------------------------------------------------------------------------------- 1 | // FILE -> Writing/DefiningHardhatTasks 2 | 3 | const {task} = require("hardhat/config"); 4 | 5 | task("block-number", "Prints the current block number").setAction( 6 | // const blockTask = async function() => {} 7 | // async function blockTask() {} 8 | async (taskArgs, hre) => { 9 | const blockNumber = await hre.ethers.provider.getBlockNumber(); 10 | console.log(`Current block number: ${blockNumber}`); 11 | } 12 | ); 13 | 14 | module.exports = {}; 15 | 16 | // https://hardhat.org/hardhat-runner/docs/advanced/create-task 17 | 18 | // ToExecute -> npx hardhat (Example -> npx hardhat block-number) 19 | -------------------------------------------------------------------------------- /blockchain-hardhat/test/test-eVaultMain.js: -------------------------------------------------------------------------------- 1 | const {ethers} = require("hardhat"); 2 | const {expect, assert} = require("chai"); 3 | const {BigNumber} = require("ethers"); 4 | 5 | const client1 = { 6 | name: "Client1", 7 | dateOfBirth: "2001-12-30", 8 | religion: "Hinduism", 9 | nationality: "Indian", 10 | sex: "Male", 11 | contactNumber: "9051179307", 12 | UID: 791619819984, 13 | PAN: "EQJPR7681M", 14 | associatedCaseIds: [], 15 | walletAddress: "0x976ea74026e726554db657fa54763abd0c3a0aa9", 16 | }; 17 | 18 | const client2 = { 19 | name: "Client2", 20 | dateOfBirth: "2001-12-30", 21 | religion: "Hinduism", 22 | nationality: "Indian", 23 | sex: "Male", 24 | contactNumber: "9051179308", 25 | UID: 791619819988, 26 | PAN: "EQJPR7681N", 27 | associatedCaseIds: [], 28 | walletAddress: "0x14dc79964da2c08b23698b3d3cc7ca32193d9955", 29 | }; 30 | 31 | const client3 = { 32 | name: "Client3", 33 | dateOfBirth: "2001-12-30", 34 | religion: "Hinduism", 35 | nationality: "Indian", 36 | sex: "Male", 37 | contactNumber: "9051179308", 38 | UID: 791619819986, 39 | PAN: "EQJPR7681N", 40 | associatedCaseIds: [], 41 | walletAddress: "0x23618e81e3f5cdf7f54c3d65f7fbc0abf5b21e8f", 42 | }; 43 | 44 | const lawyer1 = { 45 | name: "Lawyer1", 46 | dateOfBirth: "2001-12-30", 47 | religion: "Hinduism", 48 | nationality: "Indian", 49 | sex: "Male", 50 | contactNumber: "9051179305", 51 | UID: 791619819989, 52 | PAN: "EQJPR7681F", 53 | associatedCaseIds: [1, 2, 3], 54 | walletAddress: "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", 55 | }; 56 | 57 | const lawyer2 = { 58 | name: "Lawyer2", 59 | dateOfBirth: "1985-07-15", 60 | religion: "Islam", 61 | nationality: "Indian", 62 | sex: "Female", 63 | contactNumber: "9876543210", 64 | UID: 791619819987, 65 | PAN: "ABCDEF1234G", 66 | associatedCaseIds: [], 67 | walletAddress: "0x70997970c51812dc3a010c7d01b50e0d17dc79c8", 68 | }; 69 | 70 | const lawyer3 = { 71 | name: "Lawyer3", 72 | dateOfBirth: "1990-03-20", 73 | religion: "Christianity", 74 | nationality: "Indian", 75 | sex: "Female", 76 | contactNumber: "9988776655", 77 | UID: 987654321098, 78 | PAN: "WXYZ1234H", 79 | associatedCaseIds: [], 80 | walletAddress: "0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc", 81 | }; 82 | 83 | const judge1 = { 84 | name: "Judge1", 85 | dateOfBirth: "2001-12-30", 86 | religion: "Hinduism", 87 | nationality: "Indian", 88 | sex: "Male", 89 | contactNumber: "9051179305", 90 | UID: 791619819970, 91 | PAN: "EQJPR7681F", 92 | associatedCaseIds: [], 93 | walletAddress: "0x90f79bf6eb2c4f870365e785982e1f101e93b906", 94 | }; 95 | 96 | const judge2 = { 97 | name: "Judge2", 98 | dateOfBirth: "1975-06-15", 99 | religion: "Christianity", 100 | nationality: "American", 101 | sex: "Female", 102 | contactNumber: "555-123-4567", 103 | UID: 123456789012, 104 | PAN: "ABCPD1234E", 105 | associatedCaseIds: [], 106 | walletAddress: "0x15d34aaf54267db7d7c367839aaf71a00a2c6a65", 107 | }; 108 | 109 | const judge3 = { 110 | name: "Judge3", 111 | dateOfBirth: "1980-03-25", 112 | religion: "Islam", 113 | 114 | nationality: "Pakistani", 115 | sex: "Male", 116 | contactNumber: "+92 300 1234567", 117 | UID: 987654321000, 118 | PAN: "PQRXY5678Z", 119 | associatedCaseIds: [], 120 | walletAddress: "0x9965507d1a55bcc2695c58ba16fb37d819b0a4dc", 121 | }; 122 | 123 | const legalCase1 = { 124 | UIDOfParty1: 791619819984, 125 | UIDOfParty2: 791619819988, 126 | associatedLawyers: [791619819989, 791619819987], 127 | caseSubject: "Hit and Run", 128 | caseId: 1, 129 | progress2: "Clients, Lawyers & Judge Notified.", 130 | progress3: "First hearing completed.", 131 | progress4: "Second hearing postponed.", 132 | progress5: "Second hearing completed.", 133 | progress6: "Verdict announced.", 134 | }; 135 | 136 | const legalCase2 = { 137 | UIDOfParty1: 791619819988, 138 | UIDOfParty2: 791619819986, 139 | associatedLawyers: [791619819989, 987654321098], 140 | caseSubject: "Car Accident", 141 | caseId: 2, 142 | progress2: "Clients, Lawyers & Judge Notified.", 143 | }; 144 | 145 | const legalCase3 = { 146 | UIDOfParty1: 791619819986, 147 | UIDOfParty2: 791619819984, 148 | associatedLawyers: [791619819989, 987654321098], 149 | caseSubject: "Property Dispute", 150 | caseId: 3, 151 | progress2: "Clients, Lawyers & Judge Notified.", 152 | }; 153 | 154 | describe("eVaultMain", () => { 155 | let eVaultMain; 156 | let deployer; 157 | 158 | beforeEach(async () => { 159 | // settingUpAccounts 160 | [deployer, user1, user2] = await ethers.getSigners(); 161 | // contractDeployment 162 | const EVAULTMAIN = await ethers.getContractFactory("EVault_Main"); 163 | eVaultMain = await EVAULTMAIN.deploy(); 164 | }); 165 | 166 | describe("Contructor Management", () => { 167 | // setsOwner 168 | it("contract has an owner", async () => { 169 | expect(await eVaultMain.contractOwner()).to.equal(deployer.address); 170 | }); 171 | 172 | // setsName 173 | it("contract has an name", async () => { 174 | expect(await eVaultMain.contractName()).to.equal("EVault_Main"); 175 | }); 176 | }); 177 | 178 | describe("Client Management", () => { 179 | beforeEach(async () => { 180 | await eVaultMain.registerClient( 181 | client1.name, 182 | client1.dateOfBirth, 183 | client1.religion, 184 | client1.nationality, 185 | client1.sex, 186 | client1.contactNumber, 187 | client1.UID, 188 | client1.PAN, 189 | client1.walletAddress 190 | ); 191 | }); 192 | 193 | it("should register a new client & verify it's details", async () => { 194 | const storedClient = await eVaultMain.getClientDetailsByUID(client1.UID); 195 | 196 | expect(storedClient.name).to.equal(client1.name); 197 | expect(storedClient.dateOfBirth).to.equal(client1.dateOfBirth); 198 | expect(storedClient.religion).to.equal(client1.religion); 199 | expect(storedClient.nationality).to.equal(client1.nationality); 200 | expect(storedClient.sex).to.equal(client1.sex); 201 | expect(storedClient.contactNumber).to.equal(client1.contactNumber); 202 | expect(storedClient.UID).to.equal(client1.UID); 203 | expect(storedClient.PAN).to.equal(client1.PAN); 204 | expect(storedClient.associatedCaseIds).to.eql(client1.associatedCaseIds); 205 | expect(storedClient.walletAddress.toLowerCase()).to.equal( 206 | client1.walletAddress.toLowerCase() 207 | ); 208 | 209 | // console.log(`Client name : ${storedClient.name}`); 210 | }); 211 | 212 | it("should not retrieve details of a non-existing client", async () => { 213 | const nonExistentUID = 9876543210; 214 | 215 | try { 216 | await eVaultMain.getClientDetailsByUID(nonExistentUID); 217 | } catch (error) { 218 | expect(error.message).to.include("Client with this UID does not exist"); 219 | return; 220 | } 221 | 222 | expect.fail("Expected an error for non-existing client"); 223 | }); 224 | }); 225 | 226 | describe("Lawyer Management", () => { 227 | beforeEach(async () => { 228 | await eVaultMain.registerLawyer( 229 | lawyer1.name, 230 | lawyer1.dateOfBirth, 231 | lawyer1.religion, 232 | lawyer1.nationality, 233 | lawyer1.sex, 234 | lawyer1.contactNumber, 235 | lawyer1.UID, 236 | lawyer1.PAN, 237 | lawyer1.walletAddress 238 | ); 239 | }); 240 | it("should register a new lawyer & verify it's details", async () => { 241 | const storedLawyer = await eVaultMain.getLawyerDetailsByUID(lawyer1.UID); 242 | 243 | expect(storedLawyer.name).to.equal(lawyer1.name); 244 | expect(storedLawyer.dateOfBirth).to.equal(lawyer1.dateOfBirth); 245 | expect(storedLawyer.religion).to.equal(lawyer1.religion); 246 | expect(storedLawyer.nationality).to.equal(lawyer1.nationality); 247 | expect(storedLawyer.sex).to.equal(lawyer1.sex); 248 | expect(storedLawyer.contactNumber).to.equal(lawyer1.contactNumber); 249 | expect(storedLawyer.UID).to.equal(lawyer1.UID); 250 | expect(storedLawyer.PAN).to.equal(lawyer1.PAN); 251 | expect(storedLawyer.associatedCaseIds).to.eql([]); // sinceArrayInitiallyInitializedTo0 252 | expect(storedLawyer.walletAddress.toLowerCase()).to.equal( 253 | lawyer1.walletAddress.toLowerCase() 254 | ); 255 | 256 | // console.log(`Registered lawyer name : ${storedLawyer.name}`); 257 | }); 258 | 259 | it("should not retrieve details of a non-existing lawyer", async () => { 260 | const nonExistentUID = 9876543210; 261 | 262 | try { 263 | await eVaultMain.getLawyerDetailsByUID(nonExistentUID); 264 | } catch (error) { 265 | expect(error.message).to.include("Lawyer with this UID does not exist"); 266 | return; 267 | } 268 | 269 | expect.fail("Expected an error for non-existing lawyer"); 270 | }); 271 | }); 272 | 273 | describe("Judge Management", () => { 274 | beforeEach(async () => { 275 | await eVaultMain.registerJudge( 276 | judge1.name, 277 | judge1.dateOfBirth, 278 | judge1.religion, 279 | judge1.nationality, 280 | judge1.sex, 281 | judge1.contactNumber, 282 | judge1.UID, 283 | judge1.PAN, 284 | judge1.walletAddress 285 | ); 286 | }); 287 | 288 | it("should register a new judge & verify it's details", async () => { 289 | const storedJudge = await eVaultMain.getJudgeDetailsByUID(judge1.UID); 290 | 291 | expect(storedJudge.name).to.equal(judge1.name); 292 | expect(storedJudge.dateOfBirth).to.equal(judge1.dateOfBirth); 293 | expect(storedJudge.religion).to.equal(judge1.religion); 294 | expect(storedJudge.nationality).to.equal(judge1.nationality); 295 | expect(storedJudge.sex).to.equal(judge1.sex); 296 | expect(storedJudge.contactNumber).to.equal(judge1.contactNumber); 297 | expect(storedJudge.UID).to.equal(judge1.UID); 298 | expect(storedJudge.PAN).to.equal(judge1.PAN); 299 | expect(storedJudge.associatedCaseIds).to.eql(judge1.associatedCaseIds); 300 | expect(storedJudge.walletAddress.toLowerCase()).to.equal( 301 | judge1.walletAddress.toLowerCase() 302 | ); 303 | 304 | // Additional checks can be added as needed 305 | }); 306 | 307 | it("should not retrieve details of a non-existing judge", async () => { 308 | const nonExistentUID = 9876543210; 309 | 310 | try { 311 | await eVaultMain.getJudgeDetailsByUID(nonExistentUID); 312 | } catch (error) { 313 | expect(error.message).to.include("Judge with this UID does not exist"); 314 | return; 315 | } 316 | 317 | expect.fail("Expected an error for non-existing judge"); 318 | }); 319 | 320 | // it("should retrieve the correct count of judges", async () => { 321 | // const actualCount = await eVaultMain.getJudgesCount(); 322 | // const expectedCount = 1; 323 | 324 | // expect(actualCount).to.equal(expectedCount); 325 | // }); 326 | }); 327 | 328 | describe("Legal Case Management", () => { 329 | beforeEach(async () => { 330 | // register2Clients 331 | // client1 332 | await eVaultMain.registerClient( 333 | client1.name, 334 | client1.dateOfBirth, 335 | client1.religion, 336 | client1.nationality, 337 | client1.sex, 338 | client1.contactNumber, 339 | client1.UID, 340 | client1.PAN, 341 | client1.walletAddress 342 | ); 343 | // client2 344 | await eVaultMain.registerClient( 345 | client2.name, 346 | client2.dateOfBirth, 347 | client2.religion, 348 | client2.nationality, 349 | client2.sex, 350 | client2.contactNumber, 351 | client2.UID, 352 | client2.PAN, 353 | client2.walletAddress 354 | ); 355 | // lawyer1 356 | await eVaultMain.registerLawyer( 357 | lawyer1.name, 358 | lawyer1.dateOfBirth, 359 | lawyer1.religion, 360 | lawyer1.nationality, 361 | lawyer1.sex, 362 | lawyer1.contactNumber, 363 | lawyer1.UID, 364 | lawyer1.PAN, 365 | lawyer1.walletAddress 366 | ); 367 | // judge1 368 | await eVaultMain.registerJudge( 369 | judge1.name, 370 | judge1.dateOfBirth, 371 | judge1.religion, 372 | judge1.nationality, 373 | judge1.sex, 374 | judge1.contactNumber, 375 | judge1.UID, 376 | judge1.PAN, 377 | judge1.walletAddress 378 | ); 379 | // judge2 380 | await eVaultMain.registerJudge( 381 | judge2.name, 382 | judge2.dateOfBirth, 383 | judge2.religion, 384 | judge2.nationality, 385 | judge2.sex, 386 | judge2.contactNumber, 387 | judge2.UID, 388 | judge2.PAN, 389 | judge2.walletAddress 390 | ); 391 | // judge3 392 | await eVaultMain.registerJudge( 393 | judge3.name, 394 | judge3.dateOfBirth, 395 | judge3.religion, 396 | judge3.nationality, 397 | judge3.sex, 398 | judge3.contactNumber, 399 | judge3.UID, 400 | judge3.PAN, 401 | judge3.walletAddress 402 | ); 403 | // register2NewLegalCase 404 | // case1 405 | await eVaultMain.registerLegalCase( 406 | client1.UID, 407 | client2.UID, 408 | legalCase1.caseSubject, 409 | legalCase1.associatedLawyers 410 | ); 411 | 412 | // updatingCaseProgess 413 | await eVaultMain 414 | .connect(user1) 415 | .updateCaseProgressWithCaseId( 416 | legalCase1.caseId, 417 | "Clients, Lawyers & Judge notified." 418 | ); 419 | }); 420 | 421 | it("should add a legal case between two clients & verify details", async () => { 422 | // register2Clients 423 | // codeIn[beforeEach]block 424 | 425 | // let clientParty1 = await eVaultMain.getClientDetailsByUID(client.UID); 426 | // let clientParty2 = await eVaultMain.getClientDetailsByUID(client2.UID); 427 | // console.log( 428 | // `Case details before deploying >>> Client 1 : ${clientParty1.name}, Client 2 : ${clientParty2.name}, Judge = ${legalCase.associatedJudge} , Subject = ${legalCase.caseSubject}, Lawyers = ${legalCase.associatedLawyers}` 429 | // ); 430 | 431 | // registerTheNewLegalCase 432 | // codeIn[beforeEach]block 433 | 434 | // fetchCaseIdFromGlobalCounter 435 | // const caseId = await eVaultMain.caseIdCounter(); 436 | // expect(caseId - 1).to.equal(legalCase.caseId); 437 | 438 | // fetchDetailsOfAddedLegalCase 439 | const storedLegalCase = await eVaultMain.getCaseDetailsByCaseId( 440 | legalCase1.caseId 441 | ); 442 | 443 | expect(storedLegalCase.UIDOfParty1).to.equal(client1.UID); 444 | expect(storedLegalCase.UIDOfParty2).to.equal(client2.UID); 445 | expect(storedLegalCase.caseSubject).to.equal(legalCase1.caseSubject); 446 | expect(storedLegalCase.caseProgress).to.eql([ 447 | "Case registered with E-Vault.", 448 | "Clients, Lawyers & Judge notified.", 449 | ]); 450 | expect(storedLegalCase.caseProgressIssuer[1]).to.eql(user1.address); 451 | 452 | // BigNumber ---> Number 453 | const updatedTypeLawyers = storedLegalCase.associatedLawyers.map( 454 | (lawyer) => BigNumber.from(lawyer).toNumber() 455 | ); 456 | 457 | expect(updatedTypeLawyers).to.eql(legalCase1.associatedLawyers); 458 | 459 | // console.log("Case progress :", storedLegalCase.caseProgress); 460 | }); 461 | 462 | it("should update judge's [associatedCaseIds] array on registering a case", async () => { 463 | const storedLegalCase = await eVaultMain.getCaseDetailsByCaseId( 464 | legalCase1.caseId 465 | ); 466 | 467 | const storedJudge = await eVaultMain.getJudgeDetailsByUID( 468 | storedLegalCase.associatedJudge 469 | ); 470 | 471 | expect(storedJudge.associatedCaseIds.length).to.equal(1); 472 | }); 473 | 474 | it("should retrieve filed legal cases for a client", async () => { 475 | // register2Clients 476 | // register2NewLegalCase 477 | // codeIn[beforeEach]block 478 | 479 | // Retrieve filed legal cases for the client 480 | const filedCases = await eVaultMain.getFiledLegalCasesForAClient( 481 | client1.UID 482 | ); 483 | 484 | // console.log( 485 | // `Case 1 >>> Case ID : ${filedCases[0].caseId}, Subject : ${filedCases[0].caseSubject}` 486 | // ); 487 | // console.log( 488 | // `Case 2 >>> Case ID : ${filedCases[1].caseId}, Subject : ${filedCases[1].caseSubject}` 489 | // ); 490 | 491 | // since2CasesAreRegisteredUnder[Client 1 : "client"] 492 | expect(filedCases.length).to.equal(1); 493 | 494 | // // additionalChecks 495 | // expect(filedCases[0].UIDOfParty1).to.equal(client.UID); 496 | // expect(filedCases[0].UIDOfParty2).to.equal(client2.UID); 497 | // expect(filedCases[0].associatedJudge).to.equal(legalCase.associatedJudge); 498 | // expect(filedCases[0].caseSubject).to.equal(legalCase.caseSubject); 499 | }); 500 | 501 | it("should retrieve filed legal cases for a lawyer", async () => { 502 | const filedCases = await eVaultMain.getFiledLegalCasesForALawyer( 503 | lawyer1.UID 504 | ); 505 | 506 | expect(filedCases.length).to.equal(1); 507 | 508 | // // additionalChecks 509 | // expect(filedCases[0].UIDOfParty1).to.equal(client1.UID); 510 | // expect(filedCases[0].UIDOfParty2).to.equal(client2.UID); 511 | // expect(filedCases[0].associatedJudge).to.equal( 512 | // legalCase1.associatedJudge 513 | // ); 514 | // expect(filedCases[0].caseSubject).to.equal(legalCase1.caseSubject); 515 | }); 516 | 517 | // it("should retrieve filed legal cases for a judge", async () => { 518 | // const filedCases = await eVaultMain.getFiledLegalCasesForAJudge( 519 | // judge1.UID 520 | // ); 521 | 522 | // expect(filedCases.length).to.equal(2); 523 | 524 | // // // additionalChecks 525 | // // expect(filedCases[0].UIDOfParty1).to.equal(client.UID); 526 | // // expect(filedCases[0].UIDOfParty2).to.equal(client2.UID); 527 | // // expect(filedCases[0].associatedJudge).to.equal(legalCase.associatedJudge); 528 | // // expect(filedCases[0].caseSubject).to.equal(legalCase.caseSubject); 529 | // }); 530 | 531 | it("should update case documents with case ID", async () => { 532 | await eVaultMain 533 | .connect(user1) 534 | .updateCaseDocumentsWithCaseId( 535 | legalCase1.caseId, 536 | "111222333444555666777888999" 537 | ); 538 | 539 | const storedLegalCase = await eVaultMain.getCaseDetailsByCaseId( 540 | legalCase1.caseId 541 | ); 542 | 543 | expect(storedLegalCase.caseDocumentHash).to.eql([ 544 | "111222333444555666777888999", 545 | ]); 546 | 547 | expect(storedLegalCase.caseDocumentUploader[0]).to.eql(user1.address); 548 | }); 549 | 550 | it("should not update case documents for a non-existing case ID", async () => { 551 | const nonExistentCaseId = 999; 552 | 553 | await expect( 554 | eVaultMain.updateCaseDocumentsWithCaseId( 555 | nonExistentCaseId, 556 | "111222333444555666777888999" 557 | ) 558 | ).to.be.revertedWith("Legal case with this caseId does not exist"); 559 | }); 560 | }); 561 | 562 | // LoginFunctionalitiesTest 563 | 564 | describe("Login Functionalities", () => { 565 | // clientLogin 566 | it("should login as a client", async () => { 567 | // Register a new client 568 | await eVaultMain.registerClient( 569 | client1.name, 570 | client1.dateOfBirth, 571 | client1.religion, 572 | client1.nationality, 573 | client1.sex, 574 | client1.contactNumber, 575 | client1.UID, 576 | client1.PAN, 577 | client1.walletAddress 578 | ); 579 | 580 | // Check if the client is registered by calling the loginAsAClient function 581 | const isClientRegistered = await eVaultMain.loginAsAClient(client1.UID); 582 | 583 | // Assert that the client is registered (should return true) 584 | expect(isClientRegistered).to.equal(true); 585 | }); 586 | 587 | // lawyerLogin 588 | it("should login as a lawyer", async () => { 589 | // Register a new lawyer 590 | await eVaultMain.registerLawyer( 591 | lawyer1.name, 592 | lawyer1.dateOfBirth, 593 | lawyer1.religion, 594 | lawyer1.nationality, 595 | lawyer1.sex, 596 | lawyer1.contactNumber, 597 | lawyer1.UID, 598 | lawyer1.PAN, 599 | lawyer1.walletAddress 600 | ); 601 | 602 | // Check if the client is registered by calling the loginAsAClient function 603 | const isLawyerRegistered = await eVaultMain.loginAsALawyer(lawyer1.UID); 604 | 605 | // Assert that the client is registered (should return true) 606 | expect(isLawyerRegistered).to.equal(true); 607 | }); 608 | 609 | // judgeLogin 610 | it("should login as a judge", async () => { 611 | // Register a new judge 612 | await eVaultMain.registerJudge( 613 | judge1.name, 614 | judge1.dateOfBirth, 615 | judge1.religion, 616 | judge1.nationality, 617 | judge1.sex, 618 | judge1.contactNumber, 619 | judge1.UID, 620 | judge1.PAN, 621 | judge1.walletAddress 622 | ); 623 | 624 | // Check if the client is registered by calling the loginAsAClient function 625 | const isJudgeRegistered = await eVaultMain.loginAsAJudge(judge1.UID); 626 | 627 | // Assert that the client is registered (should return true) 628 | expect(isJudgeRegistered).to.equal(true); 629 | }); 630 | 631 | it("should not login as a non-existing client", async () => { 632 | // Attempt to check login for a non-existing client UID 633 | const nonExistentUID = 9876543210; 634 | 635 | // Check if the client is registered by calling the loginAsAClient function 636 | const isClientRegistered = await eVaultMain.loginAsAClient( 637 | nonExistentUID 638 | ); 639 | 640 | // Assert that the client is not registered (should return false) 641 | expect(isClientRegistered).to.equal(false); 642 | }); 643 | }); 644 | }); 645 | -------------------------------------------------------------------------------- /frontend-vite/.env.example: -------------------------------------------------------------------------------- 1 | VITE_PINATA_API_KEY=paste-key-here 2 | 3 | VITE_PINATA_API_SECRET_KEY=paste-key-here 4 | 5 | VITE_PINATA_JWT_KEY=paste-key-here 6 | 7 | # VITE_VERBWIRE_PRIVATE_KEY=paste-key-here -------------------------------------------------------------------------------- /frontend-vite/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { browser: true, es2020: true }, 4 | extends: [ 5 | 'eslint:recommended', 6 | 'plugin:react/recommended', 7 | 'plugin:react/jsx-runtime', 8 | 'plugin:react-hooks/recommended', 9 | ], 10 | ignorePatterns: ['dist', '.eslintrc.cjs'], 11 | parserOptions: { ecmaVersion: 'latest', sourceType: 'module' }, 12 | settings: { react: { version: '18.2' } }, 13 | plugins: ['react-refresh'], 14 | rules: { 15 | 'react-refresh/only-export-components': [ 16 | 'warn', 17 | { allowConstantExport: true }, 18 | ], 19 | }, 20 | } 21 | -------------------------------------------------------------------------------- /frontend-vite/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /frontend-vite/components.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://ui.shadcn.com/schema.json", 3 | "style": "default", 4 | "rsc": true, 5 | "tsx": false, 6 | "tailwind": { 7 | "config": "tailwind.config.js", 8 | "css": "src/index.css", 9 | "baseColor": "slate", 10 | "cssVariables": true, 11 | "prefix": "" 12 | }, 13 | "aliases": { 14 | "components": "@/components", 15 | "utils": "@/lib/utils" 16 | } 17 | } -------------------------------------------------------------------------------- /frontend-vite/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Project E-Vault 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /frontend-vite/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | // ... 4 | "baseUrl": ".", 5 | "paths": { 6 | "@/*": ["./src/*"] 7 | } 8 | // ... 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /frontend-vite/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "frontend-vite", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vite build", 9 | "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", 10 | "preview": "vite preview" 11 | }, 12 | "dependencies": { 13 | "axios": "^1.6.2", 14 | "@radix-ui/react-dialog": "^1.0.5", 15 | "class-variance-authority": "^0.7.0", 16 | "clsx": "^2.1.0", 17 | "lucide-react": "^0.364.0", 18 | "react": "^18.2.0", 19 | "react-datepicker": "^4.17.0", 20 | "react-dom": "^18.2.0", 21 | "react-router-dom": "^6.22.0", 22 | "react-toastify": "^10.0.5", 23 | "recharts": "^2.12.3", 24 | "tailwind-merge": "^2.2.2", 25 | "tailwindcss-animate": "^1.0.7", 26 | "form-data": "^4.0.0" 27 | }, 28 | "devDependencies": { 29 | "@nomicfoundation/hardhat-toolbox": "^2.0.0", 30 | "@types/react": "^18.2.15", 31 | "@types/react-dom": "^18.2.7", 32 | "@vitejs/plugin-react": "^4.0.3", 33 | "autoprefixer": "^10.4.15", 34 | "eslint": "^8.45.0", 35 | "eslint-plugin-react": "^7.32.2", 36 | "eslint-plugin-react-hooks": "^4.6.0", 37 | "eslint-plugin-react-refresh": "^0.4.3", 38 | "hardhat": "^2.12.2", 39 | "postcss": "^8.4.29", 40 | "tailwindcss": "^3.3.3", 41 | "vite": "^4.4.5" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /frontend-vite/postcss.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /frontend-vite/public/dummy-image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitroy-github/vite-project-evault/d07168a329a7b3b7676fb532aeb9714840329a96/frontend-vite/public/dummy-image.jpg -------------------------------------------------------------------------------- /frontend-vite/public/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /frontend-vite/src/App.css: -------------------------------------------------------------------------------- 1 | /* ---- blinkingAnimationForCaseProgressBlocks ----- */ 2 | @keyframes blink { 3 | 0%, 4 | 100% { 5 | opacity: 1; 6 | } 7 | 50% { 8 | opacity: 0; 9 | } 10 | } 11 | 12 | .animate-blink { 13 | animation: blink 2s infinite; 14 | } 15 | 16 | /* ---- blinkingAnimationForHeroSection ----- */ 17 | 18 | @keyframes flicker { 19 | 0% { 20 | opacity: 1; 21 | } 22 | 25% { 23 | opacity: 0.8; 24 | } 25 | 50% { 26 | opacity: 0.6; 27 | } 28 | 75% { 29 | opacity: 0.8; 30 | } 31 | 100% { 32 | opacity: 1; 33 | } 34 | } 35 | 36 | .flicker-animation { 37 | animation: flicker 0.8s infinite alternate; 38 | } 39 | 40 | /* ---- blinkingAnimationForCaseProgressBlocks ----- */ 41 | -------------------------------------------------------------------------------- /frontend-vite/src/App.jsx: -------------------------------------------------------------------------------- 1 | import {Routes, Route} from "react-router-dom"; 2 | 3 | import Navbar from "./components/Navbar"; 4 | import Footer from "./components/Footer"; 5 | 6 | import HomePage from "./pages/HomePage"; 7 | import SignUpPage from "./pages/SignUpPage"; 8 | import LoginPage from "./pages/LoginPage"; 9 | import AdminPage from "./pages/AdminPage"; 10 | import TestPage from "./pages/TestPage"; 11 | import GetCaseDetailsPage from "./pages/GetCaseDetailsPage"; 12 | import CaseDetailsPage from "./pages/CaseDetailsPage"; 13 | import RegisterNewLegalCasePage from "./pages/RegisterNewLegalCasePage"; 14 | 15 | // import MixedSignUpComponent from "./components/MixedSignUpComponent"; 16 | 17 | function App() { 18 | return ( 19 | <> 20 |
21 | 22 | 23 | 24 | }> 25 | }> 26 | } 29 | > 30 | 31 | }> 32 | }> 33 | }> 34 | } /> 35 | {/* }> */} 36 | }> 37 | } 40 | > 41 | }> 42 | } 45 | > 46 | 47 | 48 |
49 |
50 | 51 | ); 52 | } 53 | 54 | export default App; 55 | -------------------------------------------------------------------------------- /frontend-vite/src/assets/indianJudiciaryLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitroy-github/vite-project-evault/d07168a329a7b3b7676fb532aeb9714840329a96/frontend-vite/src/assets/indianJudiciaryLogo.png -------------------------------------------------------------------------------- /frontend-vite/src/assets/react.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /frontend-vite/src/backend-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "31337": { 3 | "contract": { 4 | "address": "0x5FbDB2315678afecb367f032d93F642f64180aa3" 5 | } 6 | }, 7 | "11155111": { 8 | "contract": { 9 | "address": "" 10 | } 11 | }, 12 | "80002": { 13 | "contract": { 14 | "address": "" 15 | } 16 | }, 17 | "2710": { 18 | "contract": { 19 | "address": "0x7a9a379394C9E0b4b869aCF56fAA88214a5D3900" 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /frontend-vite/src/blockchain-api/getCaseDetailsByCaseID.jsx: -------------------------------------------------------------------------------- 1 | import {ethers} from "ethers"; 2 | import config from "../backend-config.json"; 3 | import {abi as eVaultMain} from "../../../blockchain-hardhat/artifacts/contracts/EVault_Main.sol/EVault_Main.json"; 4 | 5 | const getCaseDetailsByCaseID = async (caseID) => { 6 | try { 7 | const provider = new ethers.providers.Web3Provider(window.ethereum); 8 | 9 | const connectedNetwork = await provider.getNetwork(); 10 | 11 | const eVaultContract = new ethers.Contract( 12 | config[connectedNetwork.chainId].contract.address, 13 | eVaultMain, 14 | provider 15 | ); 16 | 17 | const caseDetails = await eVaultContract.getCaseDetailsByCaseId(caseID); 18 | 19 | const associatedLawyers = caseDetails[3].map((lawyer) => 20 | parseInt(lawyer.toString()) 21 | ); 22 | 23 | return { 24 | UIDOfParty1: caseDetails[0].toString(), 25 | UIDOfParty2: caseDetails[1].toString(), 26 | filedOnDate: new Date(caseDetails[2].toNumber() * 1000), // Assuming filedOnDate is in Unix timestamp format 27 | associatedLawyers: associatedLawyers, 28 | associatedJudge: caseDetails[4].toString(), 29 | caseId: caseDetails[5].toNumber(), 30 | caseSubject: caseDetails[6], 31 | caseProgress: caseDetails[7], 32 | caseProgressIssuer: caseDetails[8], 33 | caseDocumentHash: caseDetails[9], 34 | caseDocumentUploader: caseDetails[10], 35 | }; 36 | } catch (error) { 37 | console.error("Error while fetching case details:", error); 38 | throw error; 39 | } 40 | }; 41 | 42 | export default getCaseDetailsByCaseID; 43 | -------------------------------------------------------------------------------- /frontend-vite/src/blockchain-api/getCasesForClientByUID.jsx: -------------------------------------------------------------------------------- 1 | import {ethers} from "ethers"; 2 | import config from "../backend-config.json"; 3 | import {abi as eVaultMain} from "../../../blockchain-hardhat/artifacts/contracts/EVault_Main.sol/EVault_Main.json"; 4 | 5 | const getClientCases = async (clientUID) => { 6 | try { 7 | const provider = new ethers.providers.Web3Provider(window.ethereum); 8 | 9 | const connectedNetwork = await provider.getNetwork(); 10 | 11 | const eVaultContract = new ethers.Contract( 12 | config[connectedNetwork.chainId].contract.address, 13 | eVaultMain, 14 | provider 15 | ); 16 | 17 | // fethcingAllTheCasesFromBlockchain 18 | const fetchedCases = await eVaultContract.getFiledLegalCasesForAClient( 19 | clientUID 20 | ); 21 | 22 | const formattedCases = fetchedCases.map((details) => ({ 23 | UIDOfParty1: details[0].toNumber(), 24 | UIDOfParty2: details[1].toNumber(), 25 | filedOnDate: new Date(details[2].toNumber() * 1000), 26 | associatedLawyers: details[3], 27 | associatedJudge: details[4].toNumber(), 28 | caseId: details[5].toNumber(), 29 | caseSubject: details[6], 30 | caseProgress: details[7], 31 | })); 32 | 33 | // console.log("Last 3 fetched cases : ", formattedCases); 34 | return formattedCases; 35 | } catch (error) { 36 | console.error("Error while fetching cases:", error); 37 | throw error; 38 | } 39 | }; 40 | 41 | export default getClientCases; 42 | -------------------------------------------------------------------------------- /frontend-vite/src/blockchain-api/getCasesForJudgeByUID.jsx: -------------------------------------------------------------------------------- 1 | import {ethers} from "ethers"; 2 | import config from "../backend-config.json"; 3 | import {abi as eVaultMain} from "../../../blockchain-hardhat/artifacts/contracts/EVault_Main.sol/EVault_Main.json"; 4 | 5 | const getCasesForJudgeByUID = async (aadharUID) => { 6 | try { 7 | const provider = new ethers.providers.Web3Provider(window.ethereum); 8 | 9 | const connectedNetwork = await provider.getNetwork(); 10 | 11 | const eVaultContract = new ethers.Contract( 12 | config[connectedNetwork.chainId].contract.address, 13 | eVaultMain, 14 | provider 15 | ); 16 | 17 | // fethcingAllTheCasesFromBlockchain 18 | const fetchedCases = await eVaultContract.getFiledLegalCasesForAJudge( 19 | aadharUID 20 | ); 21 | 22 | const formattedCases = fetchedCases.map((details) => ({ 23 | UIDOfParty1: details[0].toNumber(), 24 | UIDOfParty2: details[1].toNumber(), 25 | filedOnDate: new Date(details[2].toNumber() * 1000), 26 | associatedLawyers: details[3], 27 | associatedJudge: details[4].toNumber(), 28 | caseId: details[5].toNumber(), 29 | caseSubject: details[6], 30 | caseProgress: details[7], 31 | })); 32 | 33 | // console.log("Last 3 fetched cases : ", formattedCases); 34 | return formattedCases; 35 | } catch (error) { 36 | console.error("Error while fetching cases:", error); 37 | throw error; 38 | } 39 | }; 40 | 41 | export default getCasesForJudgeByUID; 42 | -------------------------------------------------------------------------------- /frontend-vite/src/blockchain-api/getCasesForLawyerByUID.jsx: -------------------------------------------------------------------------------- 1 | import {ethers} from "ethers"; 2 | import config from "../backend-config.json"; 3 | import {abi as eVaultMain} from "../../../blockchain-hardhat/artifacts/contracts/EVault_Main.sol/EVault_Main.json"; 4 | 5 | const getCasesForLawyerByUID = async (aadharUID) => { 6 | try { 7 | const provider = new ethers.providers.Web3Provider(window.ethereum); 8 | 9 | const connectedNetwork = await provider.getNetwork(); 10 | 11 | const eVaultContract = new ethers.Contract( 12 | config[connectedNetwork.chainId].contract.address, 13 | eVaultMain, 14 | provider 15 | ); 16 | 17 | // fethcingAllTheCasesFromBlockchain 18 | const fetchedCases = await eVaultContract.getFiledLegalCasesForALawyer( 19 | aadharUID 20 | ); 21 | 22 | const formattedCases = fetchedCases.map((details) => ({ 23 | UIDOfParty1: details[0].toNumber(), 24 | UIDOfParty2: details[1].toNumber(), 25 | filedOnDate: new Date(details[2].toNumber() * 1000), 26 | associatedLawyers: details[3], 27 | associatedJudge: details[4].toNumber(), 28 | caseId: details[5].toNumber(), 29 | caseSubject: details[6], 30 | caseProgress: details[7], 31 | })); 32 | 33 | // console.log("Last 3 fetched cases : ", formattedCases); 34 | return formattedCases; 35 | } catch (error) { 36 | console.error("Error while fetching cases:", error); 37 | throw error; 38 | } 39 | }; 40 | 41 | export default getCasesForLawyerByUID; 42 | -------------------------------------------------------------------------------- /frontend-vite/src/blockchain-api/getClientDetailsByUID.jsx: -------------------------------------------------------------------------------- 1 | import {ethers} from "ethers"; 2 | import config from "../backend-config.json"; 3 | import {abi as eVaultMain} from "../../../blockchain-hardhat/artifacts/contracts/EVault_Main.sol/EVault_Main.json"; 4 | 5 | const getClientDetailsByUID = async (UID, detailsNeeded) => { 6 | try { 7 | const provider = new ethers.providers.Web3Provider(window.ethereum); 8 | 9 | const connectedNetwork = await provider.getNetwork(); 10 | 11 | const eVaultContract = new ethers.Contract( 12 | config[connectedNetwork.chainId].contract.address, 13 | eVaultMain, 14 | provider 15 | ); 16 | 17 | const clientDetails = await eVaultContract.getClientDetailsByUID(UID); 18 | 19 | if (detailsNeeded == "all") { 20 | return { 21 | name: clientDetails[0], 22 | dateOfBirth: clientDetails[1], 23 | religion: clientDetails[2], 24 | nationality: clientDetails[3], 25 | sex: clientDetails[4], 26 | contactNumber: clientDetails[5], 27 | UID: clientDetails[6].toString(), 28 | PAN: clientDetails[7], 29 | associatedLawyers: clientDetails[8], 30 | // associatedCaseIds: clientDetails[9].map((id) => id.toNumber()), 31 | walletAddress: clientDetails[9], 32 | }; 33 | } else if (detailsNeeded == "walletAddress") { 34 | return { 35 | walletAddress: clientDetails[9], 36 | }; 37 | } else if (detailsNeeded == "name_UID_walletAddress") { 38 | return { 39 | name: clientDetails[0], 40 | UID: clientDetails[6].toString(), 41 | walletAddress: clientDetails[9], 42 | }; 43 | } 44 | } catch (error) { 45 | console.error("Error while fetching client details:", error); 46 | throw error; 47 | } 48 | }; 49 | 50 | export default getClientDetailsByUID; 51 | -------------------------------------------------------------------------------- /frontend-vite/src/blockchain-api/getJudgeDetailsByUID.jsx: -------------------------------------------------------------------------------- 1 | import {ethers} from "ethers"; 2 | import config from "../backend-config.json"; 3 | import {abi as eVaultMain} from "../../../blockchain-hardhat/artifacts/contracts/EVault_Main.sol/EVault_Main.json"; 4 | 5 | const getJudgeDetailsByUID = async (UID, detailsNeeded) => { 6 | try { 7 | const provider = new ethers.providers.Web3Provider(window.ethereum); 8 | 9 | const connectedNetwork = await provider.getNetwork(); 10 | 11 | const eVaultContract = new ethers.Contract( 12 | config[connectedNetwork.chainId].contract.address, 13 | eVaultMain, 14 | provider 15 | ); 16 | 17 | const judgeDetails = await eVaultContract.getJudgeDetailsByUID(UID); 18 | 19 | if (detailsNeeded == "all") { 20 | return { 21 | name: judgeDetails[0], 22 | dateOfBirth: judgeDetails[1], 23 | religion: judgeDetails[2], 24 | nationality: judgeDetails[3], 25 | sex: judgeDetails[4], 26 | contactNumber: judgeDetails[5], 27 | UID: judgeDetails[6].toString(), 28 | PAN: judgeDetails[7], 29 | // associatedCaseIds: lawyerDetails[8].map((id) => id.toNumber()), 30 | walletAddress: judgeDetails[9], 31 | }; 32 | } else if (detailsNeeded == "name_UID") { 33 | return {name: judgeDetails[0], UID: judgeDetails[6].toString()}; 34 | } else if (detailsNeeded == "name_UID_walletAddress") { 35 | return { 36 | name: judgeDetails[0], 37 | UID: judgeDetails[6].toString(), 38 | walletAddress: judgeDetails[9], 39 | }; 40 | } else if (detailsNeeded == "walletAddress") { 41 | return { 42 | walletAddress: judgeDetails[9], 43 | }; 44 | } 45 | } catch (error) { 46 | console.error("Error while fetching client details:", error); 47 | throw error; 48 | } 49 | }; 50 | 51 | export default getJudgeDetailsByUID; 52 | -------------------------------------------------------------------------------- /frontend-vite/src/blockchain-api/getLawyerDetailsByUID.jsx: -------------------------------------------------------------------------------- 1 | import {ethers} from "ethers"; 2 | import config from "../backend-config.json"; 3 | import {abi as eVaultMain} from "../../../blockchain-hardhat/artifacts/contracts/EVault_Main.sol/EVault_Main.json"; 4 | 5 | const getLawyerDetailsByUID = async (UID, detailsNeeded) => { 6 | try { 7 | const provider = new ethers.providers.Web3Provider(window.ethereum); 8 | 9 | const connectedNetwork = await provider.getNetwork(); 10 | 11 | const eVaultContract = new ethers.Contract( 12 | config[connectedNetwork.chainId].contract.address, 13 | eVaultMain, 14 | provider 15 | ); 16 | 17 | const lawyerDetails = await eVaultContract.getLawyerDetailsByUID(UID); 18 | 19 | if (detailsNeeded == "all") { 20 | return { 21 | name: lawyerDetails[0], 22 | dateOfBirth: lawyerDetails[1], 23 | religion: lawyerDetails[2], 24 | nationality: lawyerDetails[3], 25 | sex: lawyerDetails[4], 26 | contactNumber: lawyerDetails[5], 27 | UID: lawyerDetails[6].toString(), 28 | PAN: lawyerDetails[7], 29 | // associatedCaseIds: clientDetails[9].map((id) => id.toNumber()), 30 | walletAddress: lawyerDetails[9], 31 | }; 32 | } else if (detailsNeeded == "name") { 33 | return {name: lawyerDetails[0]}; 34 | } else if (detailsNeeded == "name_UID") { 35 | return {name: lawyerDetails[0], UID: lawyerDetails[6].toString()}; 36 | } else if (detailsNeeded == "name_UID_walletAddress") { 37 | return { 38 | name: lawyerDetails[0], 39 | UID: lawyerDetails[6].toString(), 40 | walletAddress: lawyerDetails[9], 41 | }; 42 | } else if (detailsNeeded == "walletAddress") { 43 | return { 44 | walletAddress: lawyerDetails[9], 45 | }; 46 | } 47 | } catch (error) { 48 | console.error("Error while fetching client details:", error); 49 | throw error; 50 | } 51 | }; 52 | 53 | export default getLawyerDetailsByUID; 54 | -------------------------------------------------------------------------------- /frontend-vite/src/blockchain-api/loginAsAClient.jsx: -------------------------------------------------------------------------------- 1 | import {ethers} from "ethers"; 2 | 3 | import {abi as eVaultMain} from "../../../blockchain-hardhat/artifacts/contracts/EVault_Main.sol/EVault_Main.json"; 4 | 5 | import config from "../backend-config.json"; 6 | 7 | // Define the loginAsAClient function 8 | const loginAsAClient = async (aadharUID) => { 9 | const provider = new ethers.providers.Web3Provider(window.ethereum); 10 | 11 | const connectedNetwork = await provider.getNetwork(); 12 | 13 | // Create a contract instance 14 | const eVaultContract = new ethers.Contract( 15 | config[connectedNetwork.chainId].contract.address, 16 | eVaultMain, 17 | provider.getSigner() 18 | ); 19 | 20 | try { 21 | // Ensure that the user has connected their wallet with MetaMask or other provider 22 | if (!provider || !provider.getSigner) { 23 | throw new Error("Please connect your wallet."); 24 | } 25 | 26 | // Call your contract's loginAsAClient function 27 | const isClientRegistered = await eVaultContract.loginAsAClient(aadharUID); 28 | 29 | // You may want to do additional checks or processing here 30 | 31 | return isClientRegistered; // Return the result 32 | } catch (error) { 33 | console.error("Error during client login :(", error); 34 | throw error; 35 | } 36 | }; 37 | 38 | export default loginAsAClient; 39 | -------------------------------------------------------------------------------- /frontend-vite/src/blockchain-api/loginAsAJudge.jsx: -------------------------------------------------------------------------------- 1 | import {ethers} from "ethers"; 2 | 3 | import {abi as eVaultMain} from "../../../blockchain-hardhat/artifacts/contracts/EVault_Main.sol/EVault_Main.json"; 4 | 5 | import config from "../backend-config.json"; 6 | 7 | // Define the loginAsAClient function 8 | const loginAsAJudge = async (aadharUID) => { 9 | const provider = new ethers.providers.Web3Provider(window.ethereum); 10 | 11 | const connectedNetwork = await provider.getNetwork(); 12 | 13 | // Create a contract instance 14 | const eVaultContract = new ethers.Contract( 15 | config[connectedNetwork.chainId].contract.address, 16 | eVaultMain, 17 | provider.getSigner() 18 | ); 19 | 20 | try { 21 | // Ensure that the user has connected their wallet with MetaMask or other provider 22 | if (!provider || !provider.getSigner) { 23 | throw new Error("Please connect your wallet."); 24 | } 25 | 26 | // Call your contract's loginAsAClient function 27 | const isJudgeRegistered = await eVaultContract.loginAsAJudge(aadharUID); 28 | 29 | // You may want to do additional checks or processing here 30 | 31 | return isJudgeRegistered; // Return the result 32 | } catch (error) { 33 | console.error("Error during lawyer login :(", error); 34 | throw error; 35 | } 36 | }; 37 | 38 | export default loginAsAJudge; 39 | -------------------------------------------------------------------------------- /frontend-vite/src/blockchain-api/loginAsALawyer.jsx: -------------------------------------------------------------------------------- 1 | import {ethers} from "ethers"; 2 | 3 | import {abi as eVaultMain} from "../../../blockchain-hardhat/artifacts/contracts/EVault_Main.sol/EVault_Main.json"; 4 | 5 | import config from "../backend-config.json"; 6 | 7 | // Define the loginAsAClient function 8 | const loginAsALawyer = async (aadharUID) => { 9 | const provider = new ethers.providers.Web3Provider(window.ethereum); 10 | 11 | const connectedNetwork = await provider.getNetwork(); 12 | 13 | // Create a contract instance 14 | const eVaultContract = new ethers.Contract( 15 | config[connectedNetwork.chainId].contract.address, 16 | eVaultMain, 17 | provider.getSigner() 18 | ); 19 | 20 | try { 21 | // Ensure that the user has connected their wallet with MetaMask or other provider 22 | if (!provider || !provider.getSigner) { 23 | throw new Error("Please connect your wallet."); 24 | } 25 | 26 | // Call your contract's loginAsAClient function 27 | const isLawyerRegistered = await eVaultContract.loginAsALawyer(aadharUID); 28 | 29 | // You may want to do additional checks or processing here 30 | 31 | return isLawyerRegistered; // Return the result 32 | } catch (error) { 33 | console.error("Error during lawyer login :(", error); 34 | throw error; 35 | } 36 | }; 37 | 38 | export default loginAsALawyer; 39 | -------------------------------------------------------------------------------- /frontend-vite/src/blockchain-api/registerNewCase.jsx: -------------------------------------------------------------------------------- 1 | import {ethers} from "ethers"; 2 | import {abi as eVaultMain} from "../../../blockchain-hardhat/artifacts/contracts/EVault_Main.sol/EVault_Main.json"; 3 | 4 | import config from "../backend-config.json"; 5 | 6 | const registerNewCase = async ({ 7 | UIDOfParty1, 8 | UIDOfParty2, 9 | caseSubject, 10 | associatedLawyers, 11 | }) => { 12 | const provider = new ethers.providers.Web3Provider(window.ethereum); 13 | const connectedNetwork = await provider.getNetwork(); 14 | 15 | const eVaultContract = new ethers.Contract( 16 | config[connectedNetwork.chainId].contract.address, 17 | eVaultMain, 18 | provider.getSigner() 19 | ); 20 | 21 | // const lawyerAddresses = associatedLawyers 22 | // .split(",") 23 | // .map((address) => address.trim()); 24 | 25 | const parsedLawyers = associatedLawyers.map((lawyer) => parseInt(lawyer, 10)); 26 | 27 | try { 28 | const tx = await eVaultContract.registerLegalCase( 29 | parseInt(UIDOfParty1, 10), 30 | parseInt(UIDOfParty2, 10), 31 | caseSubject, 32 | parsedLawyers 33 | ); 34 | 35 | const receipt = await tx.wait(); 36 | const caseRegisteredEvent = receipt.events.find( 37 | (event) => event.event === "CaseRegistered" 38 | ); 39 | 40 | if (caseRegisteredEvent) { 41 | const caseId = caseRegisteredEvent.args.caseId.toNumber(); 42 | return `Case registered with ID: ${caseId} ✅`; 43 | } else { 44 | throw new Error( 45 | "Case registration event not found in the transaction receipt" 46 | ); 47 | } 48 | } catch (error) { 49 | console.error("Error registering the legal case: ", error); 50 | throw error; 51 | } 52 | }; 53 | 54 | export default registerNewCase; 55 | -------------------------------------------------------------------------------- /frontend-vite/src/blockchain-api/registerToEVault.jsx: -------------------------------------------------------------------------------- 1 | import {ethers} from "ethers"; 2 | 3 | import {abi as eVaultMain} from "../../../blockchain-hardhat/artifacts/contracts/EVault_Main.sol/EVault_Main.json"; 4 | 5 | import config from "../backend-config.json"; 6 | 7 | // Define the loginAsAClient function 8 | const registerToEVault = async ({ 9 | fullName, 10 | religion, 11 | nationality, 12 | sex, 13 | dob, 14 | contactNumber, 15 | aadharUID, 16 | pan, 17 | walletAddress, 18 | signingUpAs, 19 | }) => { 20 | const provider = new ethers.providers.Web3Provider(window.ethereum); 21 | const connectedNetwork = await provider.getNetwork(); 22 | // Create a contract instance 23 | const eVaultContract = new ethers.Contract( 24 | config[connectedNetwork.chainId].contract.address, 25 | eVaultMain, 26 | provider.getSigner() 27 | ); 28 | 29 | let registrationTransaction; 30 | 31 | try { 32 | if (signingUpAs == "client") { 33 | // contractInteraction 34 | registrationTransaction = await eVaultContract.registerClient( 35 | fullName, 36 | dob, 37 | religion, 38 | nationality, 39 | sex, 40 | contactNumber, 41 | parseInt(aadharUID, 10), 42 | pan, 43 | walletAddress 44 | ); 45 | } else if (signingUpAs == "judge") { 46 | // contractInteraction 47 | registrationTransaction = await eVaultContract.registerJudge( 48 | fullName, 49 | dob, 50 | religion, 51 | nationality, 52 | sex, 53 | contactNumber, 54 | parseInt(aadharUID, 10), 55 | pan, 56 | walletAddress 57 | ); 58 | } else if (signingUpAs == "lawyer") { 59 | // contractInteraction 60 | registrationTransaction = await eVaultContract.registerLawyer( 61 | fullName, 62 | dob, 63 | religion, 64 | nationality, 65 | sex, 66 | contactNumber, 67 | parseInt(aadharUID, 10), 68 | pan, 69 | walletAddress 70 | ); 71 | } 72 | 73 | await registrationTransaction.wait(); 74 | 75 | // console.log("Transaction hash:", registrationTransaction.hash); 76 | // return `Successfully registred as a ${signingUpAs}`; 77 | return "Registration successfull ✅"; 78 | } catch (error) { 79 | console.error(`Can't register as a ${signingUpAs} : `, error); 80 | throw error; 81 | } 82 | }; 83 | 84 | export default registerToEVault; 85 | -------------------------------------------------------------------------------- /frontend-vite/src/blockchain-api/updateCaseProgressWithCaseId.jsx: -------------------------------------------------------------------------------- 1 | import {ethers} from "ethers"; 2 | 3 | import {abi as eVaultMain} from "../../../blockchain-hardhat/artifacts/contracts/EVault_Main.sol/EVault_Main.json"; 4 | 5 | import config from "../backend-config.json"; 6 | import getCaseDetailsByCaseID from "./getCaseDetailsByCaseID"; 7 | 8 | // Define the loginAsAClient function 9 | const updateCaseProgressWithCaseId = async (caseID, progress) => { 10 | const provider = new ethers.providers.Web3Provider(window.ethereum); 11 | 12 | const connectedNetwork = await provider.getNetwork(); 13 | 14 | // Create a contract instance 15 | const eVaultContract = new ethers.Contract( 16 | config[connectedNetwork.chainId].contract.address, 17 | eVaultMain, 18 | provider.getSigner() 19 | ); 20 | 21 | try { 22 | if (!provider || !provider.getSigner) { 23 | throw new Error("Please connect your wallet."); 24 | } 25 | 26 | const tx = await eVaultContract.updateCaseProgressWithCaseId( 27 | caseID, 28 | progress 29 | ); 30 | 31 | const receipt = await tx.wait(); 32 | 33 | const caseDetails = await getCaseDetailsByCaseID(caseID); 34 | 35 | // checkingIfLatestUpdateSavedOrNot? 36 | if ( 37 | caseDetails.caseProgress[caseDetails.caseProgress.length - 1] === progress 38 | ) { 39 | return `Progress updated successfully ✅ `; 40 | } else { 41 | return `Couldn't update case progress.`; 42 | } 43 | } catch (error) { 44 | console.error("Error updating case progress:", error); 45 | throw error; 46 | } 47 | }; 48 | 49 | export default updateCaseProgressWithCaseId; 50 | -------------------------------------------------------------------------------- /frontend-vite/src/blockchain-api/uploadCaseDocument.jsx: -------------------------------------------------------------------------------- 1 | import {ethers} from "ethers"; 2 | import axios from "axios"; 3 | 4 | import {abi as eVaultMain} from "../../../blockchain-hardhat/artifacts/contracts/EVault_Main.sol/EVault_Main.json"; 5 | 6 | import config from "../backend-config.json"; 7 | import getCaseDetailsByCaseID from "./getCaseDetailsByCaseID"; 8 | 9 | // Define the loginAsAClient function 10 | const uploadCaseDocument = async (caseID, formData) => { 11 | const provider = new ethers.providers.Web3Provider(window.ethereum); 12 | const connectedNetwork = await provider.getNetwork(); 13 | const eVaultContract = new ethers.Contract( 14 | config[connectedNetwork.chainId].contract.address, 15 | eVaultMain, 16 | provider.getSigner() 17 | ); 18 | 19 | try { 20 | if (!provider || !provider.getSigner) { 21 | throw new Error("Please connect your wallet."); 22 | } 23 | 24 | const pinataIPFSResponse = await axios({ 25 | method: "post", 26 | url: "https://api.pinata.cloud/pinning/pinFileToIPFS", 27 | data: formData, 28 | headers: { 29 | pinata_api_key: `${import.meta.env.VITE_PINATA_API_KEY}`, 30 | pinata_secret_api_key: `${import.meta.env.VITE_PINATA_API_SECRET_KEY}`, 31 | "Content-Type": "multipart/form-data", 32 | }, 33 | }); 34 | 35 | // const IMG_IPFS_URL = `https://gateway.pinata.cloud/ipfs/${pinataIPFSResponse.data.IpfsHash}`; 36 | 37 | const tx = await eVaultContract.updateCaseDocumentsWithCaseId( 38 | caseID, 39 | `${pinataIPFSResponse.data.IpfsHash}` 40 | ); 41 | const txReceipt = await tx.wait(); 42 | 43 | // checkingIfLatestUpdateSavedOrNot? 44 | const caseDetails = await eVaultContract.getCaseDetailsByCaseId(caseID); 45 | 46 | console.log("Check", caseDetails); 47 | 48 | // console.log( 49 | // caseDetails.caseDocuments[caseDetails.caseDocuments.length - 1] 50 | // ); 51 | 52 | if ( 53 | caseDetails.caseDocumentHash[caseDetails.caseDocumentHash.length - 1] === 54 | pinataIPFSResponse.data.IpfsHash 55 | ) { 56 | return `File added successfully ✅ `; 57 | } else { 58 | return `Couldn't add case file.`; 59 | } 60 | } catch (error) { 61 | console.error("Error adding case file: ", error); 62 | throw error; 63 | } 64 | }; 65 | 66 | export default uploadCaseDocument; 67 | -------------------------------------------------------------------------------- /frontend-vite/src/blockchain-api/uploadCaseDocumentUsingVerbwire.jsx: -------------------------------------------------------------------------------- 1 | import {ethers} from "ethers"; 2 | import axios from "axios"; 3 | 4 | import {abi as eVaultMain} from "../../../blockchain-hardhat/artifacts/contracts/EVault_Main.sol/EVault_Main.json"; 5 | 6 | import config from "../backend-config.json"; 7 | import getCaseDetailsByCaseID from "./getCaseDetailsByCaseID"; 8 | 9 | // Define the loginAsAClient function 10 | const uploadCaseDocument = async (caseID, formData) => { 11 | const provider = new ethers.providers.Web3Provider(window.ethereum); 12 | const connectedNetwork = await provider.getNetwork(); 13 | const eVaultContract = new ethers.Contract( 14 | config[connectedNetwork.chainId].contract.address, 15 | eVaultMain, 16 | provider.getSigner() 17 | ); 18 | 19 | try { 20 | if (!provider || !provider.getSigner) { 21 | throw new Error("Please connect your wallet."); 22 | } 23 | 24 | const pinataIPFSResponse = await axios({ 25 | method: "post", 26 | url: "https://api.pinata.cloud/pinning/pinFileToIPFS", 27 | data: formData, 28 | headers: { 29 | pinata_api_key: `${import.meta.env.VITE_PINATA_API_KEY}`, 30 | pinata_secret_api_key: `${import.meta.env.VITE_PINATA_API_SECRET_KEY}`, 31 | "Content-Type": "multipart/form-data", 32 | }, 33 | }); 34 | 35 | // // https://docs.verbwire.com/reference/post_nft-store-file 36 | // const verbwireIPFSResponse = await axios({ 37 | // method: "POST", 38 | // url: "https://api.verbwire.com/v1/nft/store/file", 39 | // headers: { 40 | // accept: "application/json", 41 | // "content-type": "multipart/form-data", 42 | // "X-API-Key": `${import.meta.env.VITE_VERBWIRE_PRIVATE_KEY}`, 43 | // }, 44 | // data: formData, 45 | // }); 46 | 47 | // const IMG_IPFS_URL = `https://gateway.pinata.cloud/ipfs/${pinataIPFSResponse.data.IpfsHash}`; 48 | 49 | const tx = await eVaultContract.updateCaseDocumentsWithCaseId( 50 | caseID, 51 | `${pinataIPFSResponse.data.IpfsHash}` 52 | ); 53 | const txReceipt = await tx.wait(); 54 | 55 | // checkingIfLatestUpdateSavedOrNot? 56 | const caseDetails = await eVaultContract.getCaseDetailsByCaseId(caseID); 57 | 58 | console.log("Check", caseDetails); 59 | 60 | if ( 61 | caseDetails.caseDocumentHash[caseDetails.caseDocumentHash.length - 1] === 62 | pinataIPFSResponse.data.IpfsHash 63 | ) { 64 | return `File added successfully ✅ `; 65 | } else { 66 | return `Couldn't add case file.`; 67 | } 68 | } catch (error) { 69 | console.error("Error adding case file: ", error); 70 | throw error; 71 | } 72 | }; 73 | 74 | export default uploadCaseDocument; 75 | -------------------------------------------------------------------------------- /frontend-vite/src/components/AdminDashboardComponent.jsx: -------------------------------------------------------------------------------- 1 | import React, {useState, useEffect} from "react"; 2 | import {Link} from "react-router-dom"; 3 | 4 | import getClientDetailsByUID from "../blockchain-api/getClientDetailsByUID"; 5 | import getCasesForClientByUID from "../blockchain-api/getCasesForClientByUID"; 6 | import getLawyerDetailsByUID from "../blockchain-api/getLawyerDetailsByUID"; 7 | import getCasesForLawyerByUID from "../blockchain-api/getCasesForLawyerByUID"; 8 | import getJudgeDetailsByUID from "../blockchain-api/getJudgeDetailsByUID"; 9 | import getCasesForJudgeByUID from "../blockchain-api/getCasesForJudgeByUID"; 10 | import Loader from "./Loader"; 11 | import {shortenWalletAddress} from "@/lib/utils"; 12 | 13 | const AdminDashboardComponent = ({aadharUID, adminType}) => { 14 | const [adminDetails, setAdminDetails] = useState(null); 15 | 16 | const [allCasesOnClient, setAllCasesOnClient] = useState([]); 17 | const [last3Cases, setLast3Cases] = useState([]); 18 | 19 | const [loading, setLoading] = useState(true); 20 | 21 | let result1, result2, justLast3Cases; 22 | 23 | const fetchData = async () => { 24 | try { 25 | if (adminType === "client") { 26 | result1 = await getClientDetailsByUID(aadharUID, "all"); 27 | setAdminDetails(result1); 28 | 29 | // FetchignAllTheCasesOnTheClient 30 | result2 = await getCasesForClientByUID(aadharUID); 31 | setAllCasesOnClient(result2); 32 | 33 | // justTakingTheLast3Cases 34 | justLast3Cases = result2.slice(-3); 35 | setLast3Cases(justLast3Cases); 36 | } else if (adminType === "lawyer") { 37 | result1 = await getLawyerDetailsByUID(aadharUID, "all"); 38 | setAdminDetails(result1); 39 | 40 | result2 = await getCasesForLawyerByUID(aadharUID); 41 | setAllCasesOnClient(result2); 42 | 43 | justLast3Cases = result2.slice(-3); 44 | setLast3Cases(justLast3Cases); 45 | } else if (adminType === "judge") { 46 | result1 = await getJudgeDetailsByUID(aadharUID, "all"); 47 | setAdminDetails(result1); 48 | 49 | result2 = await getCasesForJudgeByUID(aadharUID); 50 | setAllCasesOnClient(result2); 51 | 52 | justLast3Cases = result2.slice(-3); 53 | setLast3Cases(justLast3Cases); 54 | } 55 | } catch (error) { 56 | console.error("Error fetching admin details:", error); 57 | } 58 | }; 59 | 60 | useEffect(() => { 61 | fetchData(); 62 | 63 | setTimeout(() => { 64 | setLoading(false); 65 | }, 2000); 66 | }, []); 67 | 68 | if (loading) { 69 | return ( 70 | <> 71 | ; 72 | 73 | ); 74 | } 75 | 76 | return ( 77 | <> 78 |
79 |
80 | 85 |
86 | 87 |
88 | {/* Left Section */} 89 |
90 |

91 | Your Recent Cases 92 |

93 | 94 | {last3Cases.length > 0 ? ( 95 |
96 | {last3Cases.map((caseInfo, index) => ( 97 |
102 | 103 |
104 |
105 |

106 | Case Subject: {caseInfo.caseSubject} 107 |

108 |
109 | 110 |
111 |

112 | Case ID: {caseInfo.caseId} 113 |

114 |
115 |
116 | 117 |

118 | Filed On: {caseInfo.filedOnDate.toLocaleString()} 119 |

120 | 121 |

122 | Latest case update:{" "} 123 | { 124 | caseInfo.caseProgress[ 125 | caseInfo.caseProgress.length - 1 126 | ] 127 | } 128 |

129 | 130 |
131 | ))} 132 |
133 | ) : ( 134 | <> 135 |
136 |

You don't have any cases yet.

137 |
138 | 139 | )} 140 |
141 | 142 | {/* Right Section */} 143 |
144 |

145 | Profile Information 146 |

147 |
148 | 149 | 150 | 151 | 154 | 157 | 158 | 159 | 162 | 165 | 166 | 167 | 170 | 173 | 174 | 175 | 178 | 181 | 182 | 183 | 186 | 189 | 190 | 191 | 194 | 197 | 198 | 199 | 202 | 205 | 206 | 207 | 210 | 213 | 214 | 215 |
152 | Full Name: 153 | 155 | {adminDetails.name} 156 |
160 | Contact Number: 161 | 163 | {adminDetails.contactNumber} 164 |
168 | Aadhar UID: 169 | 171 | {adminDetails.UID} 172 |
176 | Nationality: 177 | 179 | {adminDetails.nationality} 180 |
184 | Religion: 185 | 187 | {adminDetails.religion} 188 |
192 | Sex: 193 | 195 | {adminDetails.sex} 196 |
200 | Date of Birth: 201 | 203 | {adminDetails.dateOfBirth} 204 |
208 | Wallet Address 209 | 211 | {shortenWalletAddress(adminDetails.walletAddress)} 212 |
216 |
217 |
218 |
219 |
220 | 221 |
222 |

223 | Your Past Cases 224 |

225 |
226 | 227 | 230 | 231 |
232 | 233 | {allCasesOnClient.length > 0 ? ( 234 |
235 | {allCasesOnClient.map((caseInfo, index) => ( 236 |
241 | 242 |
243 |
244 |

245 | Case Subject: {caseInfo.caseSubject} 246 |

247 |
248 | 249 |
250 |

251 | Case ID: {caseInfo.caseId} 252 |

253 |
254 |
255 | 256 |

257 | Case judged by: {caseInfo.associatedJudge} 258 |

259 | 260 |

261 | Filed On: {caseInfo.filedOnDate.toLocaleString()} 262 |

263 | 264 |

265 | {/* Case status : {caseInfo.associatedJudge} */} 266 | Case status:{" "} 267 | 268 | {caseInfo.caseProgress[ 269 | caseInfo.caseProgress.length - 1 270 | ].includes("Case terminated") 271 | ? "Closed" 272 | : "Pending"} 273 | 274 |

275 | 276 |

277 | Latest case progress:{" "} 278 | 279 | {caseInfo.caseProgress[caseInfo.caseProgress.length - 1]} 280 | 281 |

282 | 283 |
284 | ))} 285 |
286 | ) : ( 287 |
288 |

289 | No past cases found in records. 290 |

291 |
292 | )} 293 |
294 | 295 | ); 296 | }; 297 | 298 | export default AdminDashboardComponent; 299 | -------------------------------------------------------------------------------- /frontend-vite/src/components/Footer.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | const Footer = () => { 4 | return ( 5 | 18 | ); 19 | }; 20 | 21 | export default Footer; 22 | -------------------------------------------------------------------------------- /frontend-vite/src/components/HeroSection.jsx: -------------------------------------------------------------------------------- 1 | import {Link} from "react-router-dom"; 2 | 3 | import indianJudiciaryLogo from "../assets/indianJudiciaryLogo.png"; 4 | 5 | const HeroSection = () => { 6 | return ( 7 |
8 |
9 | Indian Judiciary Logo 14 |
15 |
16 |

17 | Project E-Vault 18 |

19 |

20 | A modernized blockchain based eVault storage solution for the Indian 21 | Judiciary. 22 |

23 |
24 |
25 | 29 | Continue as a Client 30 | 31 | 35 | Continue as a Lawyer 36 | 37 | 41 | Continue as a Judge 42 | 43 |
44 |
45 | ); 46 | }; 47 | 48 | export default HeroSection; 49 | -------------------------------------------------------------------------------- /frontend-vite/src/components/Loader.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | const Loader = () => { 4 | return ( 5 |
6 |
7 | {/*
*/} 8 |
9 |
10 | {/*
*/} 11 |
12 |
13 | ); 14 | }; 15 | 16 | export default Loader; 17 | -------------------------------------------------------------------------------- /frontend-vite/src/components/LoginComponent.jsx: -------------------------------------------------------------------------------- 1 | import React, {useState} from "react"; 2 | import {ethers} from "ethers"; 3 | import {Link} from "react-router-dom"; 4 | import {useNavigate} from "react-router-dom"; 5 | 6 | import {ToastContainer, toast} from "react-toastify"; 7 | import "react-toastify/dist/ReactToastify.css"; 8 | 9 | import loginAsAClient from "../blockchain-api/loginAsAClient"; 10 | import loginAsALawyer from "../blockchain-api/loginAsALawyer"; 11 | import loginAsAJudge from "../blockchain-api/loginAsAJudge"; 12 | import {shortenWalletAddress} from "@/lib/utils"; 13 | 14 | const LoginComponent = ({initialFormType}) => { 15 | const navigate = useNavigate(); 16 | 17 | const [formType, setFormType] = useState(initialFormType || ""); 18 | const [isConnected, setIsConnected] = useState(false); 19 | 20 | const [aadharUID, setAadharUID] = useState(""); 21 | const [walletAddress, setWalletAddress] = useState(""); 22 | const [signingUpAs, setSigningUpAs] = useState("lawyer"); 23 | 24 | const connectMetamaskWallet = async () => { 25 | try { 26 | const accounts = await window.ethereum.request({ 27 | method: "eth_requestAccounts", 28 | }); 29 | const account = ethers.utils.getAddress(accounts[0]); 30 | setWalletAddress(account); 31 | setIsConnected(true); 32 | } catch (error) { 33 | console.error("Error connecting to Ethereum:", error); 34 | setIsConnected(false); 35 | } 36 | }; 37 | 38 | const handleSubmit = async (e) => { 39 | e.preventDefault(); 40 | 41 | if (!aadharUID || !walletAddress) { 42 | alert("Please fill in all the required fields."); 43 | return; 44 | } 45 | 46 | const formData = { 47 | aadharUID, 48 | walletAddress, 49 | signingUpAs, 50 | }; 51 | 52 | if (signingUpAs === "lawyer") { 53 | const isLawyerLoggedIn = await loginAsALawyer(aadharUID); 54 | if (isLawyerLoggedIn) { 55 | // Customization: https://fkhadra.github.io/react-toastify/how-to-style/ 56 | toast("Evault login successfull ✅", { 57 | position: "top-right", 58 | autoClose: 1000, 59 | closeOnClick: true, 60 | pauseOnHover: true, 61 | draggable: true, 62 | progress: undefined, 63 | icon: false, 64 | hideProgressBar: true, 65 | closeButton: false, 66 | }); 67 | 68 | setTimeout(() => { 69 | navigate(`/admin/lawyer/${aadharUID}`); 70 | }, 2000); 71 | } else { 72 | alert("Login as a lawyer failed."); 73 | } 74 | } else if (signingUpAs === "judge") { 75 | const isJudgeLoggedIn = await loginAsAJudge(aadharUID); 76 | if (isJudgeLoggedIn) { 77 | // Customization: https://fkhadra.github.io/react-toastify/how-to-style/ 78 | toast("Evault login successfull ✅", { 79 | position: "top-right", 80 | autoClose: 1000, 81 | closeOnClick: true, 82 | pauseOnHover: true, 83 | draggable: true, 84 | progress: undefined, 85 | icon: false, 86 | hideProgressBar: true, 87 | closeButton: false, 88 | }); 89 | 90 | setTimeout(() => { 91 | navigate(`/admin/judge/${aadharUID}`); 92 | }, 2000); 93 | } else { 94 | alert("Login as a judge failed."); 95 | } 96 | } else if (signingUpAs === "client") { 97 | const isClientLoggedIn = await loginAsAClient(aadharUID); 98 | if (isClientLoggedIn) { 99 | // Customization: https://fkhadra.github.io/react-toastify/how-to-style/ 100 | toast("Evault login successfull ✅", { 101 | position: "top-right", 102 | autoClose: 1000, 103 | closeOnClick: true, 104 | pauseOnHover: true, 105 | draggable: true, 106 | progress: undefined, 107 | icon: false, 108 | hideProgressBar: true, 109 | closeButton: false, 110 | }); 111 | 112 | setTimeout(() => { 113 | navigate(`/admin/client/${aadharUID}`); 114 | }, 2000); 115 | } else { 116 | alert("Login as a client failed."); 117 | } 118 | } 119 | }; 120 | 121 | return ( 122 |
123 |
124 |

125 | E-Vault Login 126 |

127 |
128 | 129 |

130 | New user ? 131 |

132 |

133 | Register with E-Vault here 134 |

135 | 136 |
137 |
138 |
139 | 152 |
153 | 154 |
155 | 168 |
169 | 170 |
171 | 184 |
185 |
186 |
187 |
188 |
192 |
193 | setAadharUID(e.target.value)} 199 | /> 200 |
201 | 202 |
203 |
204 | setWalletAddress(e.target.value)} 214 | /> 215 |
216 |
217 | 224 |
225 |
226 | 227 |
228 | 234 |
235 |
236 |
237 | 238 | 242 |
243 | ); 244 | }; 245 | 246 | export default LoginComponent; 247 | -------------------------------------------------------------------------------- /frontend-vite/src/components/Navbar.jsx: -------------------------------------------------------------------------------- 1 | import React, {useState} from "react"; 2 | import {Link, useLocation} from "react-router-dom"; 3 | import {ethers} from "ethers"; 4 | 5 | import indianJudiciaryLogo from "../assets/indianJudiciaryLogo.png"; 6 | 7 | const Navbar = () => { 8 | const [isOpen, setIsOpen] = useState(false); 9 | const location = useLocation(); 10 | const [isMetamaskConnected, setIsMetamaskConnected] = useState(false); 11 | const [metamaskAccount, setMetamaskAccount] = useState(""); 12 | 13 | const toggleNavbar = () => { 14 | setIsOpen(!isOpen); 15 | }; 16 | 17 | const isAdminRoute = location.pathname.startsWith("/admin/"); 18 | 19 | const connectMetamask = async () => { 20 | if (window.ethereum) { 21 | try { 22 | // Request Metamask to connect 23 | await window.ethereum.request({method: "eth_requestAccounts"}); 24 | setIsMetamaskConnected(true); 25 | const provider = new ethers.providers.Web3Provider(window.ethereum); 26 | const signer = provider.getSigner(); 27 | const address = await signer.getAddress(); 28 | setMetamaskAccount(address); 29 | } catch (error) { 30 | console.error("Error connecting to Metamask:", error); 31 | } 32 | } 33 | }; 34 | 35 | return ( 36 | 221 | ); 222 | }; 223 | 224 | export default Navbar; 225 | -------------------------------------------------------------------------------- /frontend-vite/src/components/ProjectStatistics.jsx: -------------------------------------------------------------------------------- 1 | import React, {useEffect, useState} from "react"; 2 | import { 3 | LineChart, 4 | Line, 5 | XAxis, 6 | YAxis, 7 | CartesianGrid, 8 | Legend, 9 | ResponsiveContainer, 10 | Tooltip, 11 | } from "recharts"; 12 | 13 | // this data can be from api or other js files 14 | const data = [ 15 | { 16 | name: "Jan-23", 17 | client: 26, 18 | lawyer: 6, 19 | judge: 1, 20 | cases: 15, 21 | }, 22 | { 23 | name: "Apr-23", 24 | client: 41, 25 | lawyer: 15, 26 | judge: 13, 27 | cases: 16, 28 | }, 29 | { 30 | name: "Jul-23", 31 | client: 42, 32 | lawyer: 32, 33 | judge: 13, 34 | cases: 36, 35 | }, 36 | { 37 | name: "Dec-23", 38 | client: 60, 39 | lawyer: 32, 40 | judge: 13, 41 | cases: 94, 42 | }, 43 | { 44 | name: "Apr-24", 45 | client: 84, 46 | lawyer: 60, 47 | judge: 32, 48 | cases: 106, 49 | }, 50 | ]; 51 | 52 | const ProjectStatistics = () => { 53 | const [counters, setCounters] = useState({ 54 | totalClients: 84, 55 | totalRegisteredLawyers: 60, 56 | totalRegisteredJudges: 32, 57 | totalRecordedCases: 106, 58 | }); 59 | 60 | const counterSpeeds = { 61 | totalClients: 6000, // Counter 1 updates every 2 seconds 62 | totalRegisteredLawyers: 9000, // Counter 2 updates every 3 seconds 63 | totalRegisteredJudges: 30000, // Counter 3 updates every 10 seconds 64 | totalRecordedCases: 4500, // Counter 4 updates every 1.5 seconds 65 | }; 66 | 67 | const counterHeadings = { 68 | totalClients: "Total Clients", 69 | totalRegisteredLawyers: "Total Lawyers", 70 | totalRegisteredJudges: "Total Judges", 71 | totalRecordedCases: "Total Cases", 72 | }; 73 | 74 | useEffect(() => { 75 | const timers = {}; 76 | for (const counter in counterSpeeds) { 77 | timers[counter] = setInterval(() => { 78 | setCounters((prevCounters) => ({ 79 | ...prevCounters, 80 | [counter]: prevCounters[counter] + 1, 81 | })); 82 | }, counterSpeeds[counter]); 83 | } 84 | 85 | return () => { 86 | // Clear all timers on component unmount 87 | for (const counter in timers) { 88 | clearInterval(timers[counter]); 89 | } 90 | }; 91 | }, []); 92 | 93 | return ( 94 |
95 |
96 |

97 | Project Statistics 98 |

99 |
100 | 101 |
102 | {/* LeftSection >>> Data*/} 103 |
104 |
105 | {Object.entries(counters).map(([counter, value]) => ( 106 |
110 |

111 | {counterHeadings[counter]} 112 |

113 |

114 | {value} 115 |

116 |
117 | ))} 118 |
119 |
120 | 121 | {/* RightSection >>> StaticticalChart*/} 122 | 123 |
124 | 125 | 126 | 127 | 134 | 142 | 143 | 144 | 152 | 160 | 168 | 176 | 177 | 178 |
179 |
180 |
181 | ); 182 | }; 183 | 184 | export default ProjectStatistics; 185 | -------------------------------------------------------------------------------- /frontend-vite/src/components/RegisterANewCaseComponent.jsx: -------------------------------------------------------------------------------- 1 | import React, {useState} from "react"; 2 | import registerNewCase from "../blockchain-api/registerNewCase"; 3 | 4 | import {ToastContainer, toast} from "react-toastify"; 5 | import "react-toastify/dist/ReactToastify.css"; 6 | 7 | // Define the initial state 8 | const initialState = { 9 | UIDOfParty1: "", 10 | UIDOfParty2: "", 11 | caseSubject: "", 12 | associatedLawyers: [], 13 | }; 14 | 15 | const RegisterANewCaseComponent = () => { 16 | const [formData, setFormData] = useState({...initialState}); 17 | 18 | const handleSubmit = async (e) => { 19 | e.preventDefault(); 20 | 21 | // Check if any of the required fields are empty 22 | if ( 23 | !formData.UIDOfParty1 || 24 | !formData.UIDOfParty2 || 25 | !formData.caseSubject || 26 | !formData.associatedLawyers.length 27 | ) { 28 | alert("Please fill in all the required fields."); 29 | return; 30 | } 31 | 32 | try { 33 | const registrationResponse = await registerNewCase(formData); 34 | 35 | // Customization: https://fkhadra.github.io/react-toastify/how-to-style/ 36 | toast(`${registrationResponse}`, { 37 | position: "top-right", 38 | autoClose: 2000, 39 | closeOnClick: true, 40 | pauseOnHover: true, 41 | draggable: true, 42 | progress: undefined, 43 | icon: false, 44 | hideProgressBar: true, 45 | closeButton: false, 46 | }); 47 | 48 | // resettingFormSubmission 49 | setFormData({...initialState}); 50 | } catch (error) { 51 | console.error("Error during case registration: ", error); 52 | } 53 | }; 54 | 55 | const handleChange = (e) => { 56 | const {name, value} = e.target; 57 | setFormData((prevData) => ({ 58 | ...prevData, 59 | [name]: value, 60 | })); 61 | }; 62 | 63 | return ( 64 |
65 |
66 |

67 | Register A New Legal Case 68 |

69 | 70 |
71 |
72 | 80 |
81 |
82 | 90 |
91 |
92 | 100 |
101 |
102 | 109 | setFormData((prevData) => ({ 110 | ...prevData, 111 | associatedLawyers: e.target.value 112 | .split(",") 113 | .map((lawyer) => lawyer.trim()), 114 | })) 115 | } 116 | /> 117 |
118 |
119 | 125 |
126 |
127 |
128 | 129 | 133 |
134 | ); 135 | }; 136 | 137 | export default RegisterANewCaseComponent; 138 | -------------------------------------------------------------------------------- /frontend-vite/src/components/SearchCaseDetailsComponent.jsx: -------------------------------------------------------------------------------- 1 | import React, {useState, useEffect} from "react"; 2 | import {Link} from "react-router-dom"; 3 | 4 | import getCaseDetailsByCaseID from "../blockchain-api/getCaseDetailsByCaseID"; 5 | import getJudgeDetailsByUID from "@/blockchain-api/getJudgeDetailsByUID"; 6 | import getLawyerDetailsByUID from "@/blockchain-api/getLawyerDetailsByUID"; 7 | import getClientDetailsByUID from "@/blockchain-api/getClientDetailsByUID"; 8 | 9 | const SearchCaseDetailsComponent = () => { 10 | const [caseID, setCaseID] = useState(""); 11 | const [caseDetails, setCaseDetails] = useState(null); 12 | 13 | const [isUserJudge, setIsUserJudge] = useState(false); 14 | const [isUserLawyer, setIsUserLawyer] = useState(false); 15 | const [isUserClient, setIsUserClient] = useState(false); 16 | 17 | const [userAddress, setUserAddress] = useState(null); 18 | 19 | const handleSubmit = async (e) => { 20 | e.preventDefault(); 21 | 22 | if (!caseID) { 23 | alert("Please fill in all the required fields."); 24 | return; 25 | } 26 | 27 | try { 28 | const caseDetails = await getCaseDetailsByCaseID(caseID); 29 | setCaseDetails(caseDetails); 30 | // console.log("Fetched case details:", caseDetails); 31 | 32 | checkForCaseAdmins(caseDetails); 33 | } catch (error) { 34 | console.error("Error fetching case details:", error); 35 | alert( 36 | "Error fetching case details. There's isn't any case registered with this caseID !" 37 | ); 38 | } 39 | }; 40 | 41 | // checkingIfCaseAdminsAreTryingToViewFurtherCaseDetails? 42 | const checkForCaseAdmins = async (caseDetails) => { 43 | const judgeDetails = await getJudgeDetailsByUID( 44 | caseDetails.associatedJudge, 45 | "walletAddress" 46 | ); 47 | 48 | const lawyerDetails = await Promise.all( 49 | caseDetails.associatedLawyers.map(async (lawyerUID) => { 50 | const lawyerInfo = await getLawyerDetailsByUID( 51 | lawyerUID, 52 | "walletAddress" 53 | ); 54 | return { 55 | walletAddress: lawyerInfo.walletAddress, 56 | }; 57 | }) 58 | ); 59 | 60 | const party1Details = await getClientDetailsByUID( 61 | caseDetails.UIDOfParty1, 62 | "walletAddress" 63 | ); 64 | const party2Details = await getClientDetailsByUID( 65 | caseDetails.UIDOfParty2, 66 | "walletAddress" 67 | ); 68 | 69 | if ( 70 | party1Details.walletAddress.toLowerCase() === userAddress.toLowerCase() || 71 | party2Details.walletAddress.toLowerCase() === userAddress.toLowerCase() 72 | ) { 73 | setIsUserClient(true); 74 | } else { 75 | setIsUserClient(false); 76 | } 77 | 78 | if ( 79 | lawyerDetails[0].walletAddress.toLowerCase() === 80 | userAddress.toLowerCase() || 81 | lawyerDetails[1].walletAddress.toLowerCase() === userAddress.toLowerCase() 82 | ) { 83 | setIsUserLawyer(true); 84 | } else { 85 | setIsUserLawyer(false); 86 | } 87 | 88 | if ( 89 | judgeDetails.walletAddress.toLowerCase() === userAddress.toLowerCase() 90 | ) { 91 | setIsUserJudge(true); 92 | } else { 93 | setIsUserJudge(false); 94 | } 95 | }; 96 | 97 | useEffect(() => { 98 | // Function to handle MetaMask account change 99 | const handleAccountChange = (accounts) => { 100 | setUserAddress(accounts[0]); 101 | }; 102 | 103 | // Listen for MetaMask account changes 104 | if (window.ethereum) { 105 | window.ethereum.on("accountsChanged", handleAccountChange); 106 | } 107 | 108 | const fetchCurrentWalletAddress = async () => { 109 | try { 110 | if (window.ethereum) { 111 | const accounts = await window.ethereum.request({ 112 | method: "eth_requestAccounts", 113 | }); 114 | setUserAddress(accounts[0]); 115 | } else { 116 | console.error("MetaMask not installed or user not logged in"); 117 | } 118 | } catch (error) { 119 | console.error("Error fetching user address:", error); 120 | } 121 | }; 122 | 123 | fetchCurrentWalletAddress(); 124 | 125 | if (caseDetails) { 126 | checkForCaseAdmins(caseDetails); 127 | } 128 | 129 | // Clean up event listener when component unmounts 130 | return () => { 131 | if (window.ethereum) { 132 | window.ethereum.off("accountsChanged", handleAccountChange); 133 | } 134 | }; 135 | }, [userAddress, isUserJudge, isUserLawyer, isUserClient]); 136 | 137 | return ( 138 |
139 |
140 |

141 | Search for case details ? 142 |

143 |

144 | Only associated clients, lawyers, and judges of the case can access 145 | the relevant case details and information 146 |

147 |
148 |
149 | setCaseID(e.target.value)} 155 | /> 156 |
157 |
158 | 164 |
165 |
166 | 167 | {/* Display case details table if available */} 168 | {caseDetails && ( 169 |
170 | {/*

Case Details

*/} 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 192 | 193 | 196 | 197 | 198 |
Case IDCase SubjectParty 1Party 2Filing DateAppointed JudgeAppointed Lawyers
{caseDetails.caseId}{caseDetails.caseSubject}{caseDetails.UIDOfParty1}{caseDetails.UIDOfParty2} 190 | {caseDetails.filedOnDate.toString()} 191 | {caseDetails.associatedJudge} 194 | {caseDetails.associatedLawyers.join(", ")} 195 |
199 | 200 | {/* forMobileScreens */} 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 234 | 235 | 236 |
Case ID:{caseDetails.caseId}
Case Subject:{caseDetails.caseSubject}
Party 1:{caseDetails.UIDOfParty1}
Party 2:{caseDetails.UIDOfParty2}
Filing Date: 222 | {caseDetails.filedOnDate.toString()} 223 |
Appointed Judge:{caseDetails.associatedJudge}
Appointed Lawyers: 232 | {caseDetails.associatedLawyers.join(", ")} 233 |
237 |
238 | {isUserJudge | isUserLawyer | isUserClient ? ( 239 | 240 | 243 | 244 | ) : ( 245 | 248 | )} 249 |
250 |
251 | )} 252 |
253 |
254 | ); 255 | }; 256 | 257 | export default SearchCaseDetailsComponent; 258 | -------------------------------------------------------------------------------- /frontend-vite/src/components/SignUpComponent.jsx: -------------------------------------------------------------------------------- 1 | import {useState} from "react"; 2 | import {ethers} from "ethers"; 3 | import {Link} from "react-router-dom"; 4 | import {useNavigate} from "react-router-dom"; 5 | 6 | import registerToEVault from "../blockchain-api/registerToEVault"; 7 | 8 | import {ToastContainer, toast} from "react-toastify"; 9 | import "react-toastify/dist/ReactToastify.css"; 10 | import {shortenWalletAddress} from "@/lib/utils"; 11 | 12 | const SignUpComponent = ({initialFormType}) => { 13 | const navigate = useNavigate(); 14 | 15 | const [formType, setFormType] = useState(initialFormType || ""); 16 | const [isConnected, setIsConnected] = useState(false); 17 | 18 | const [fullName, setFullName] = useState(""); 19 | const [religion, setReligion] = useState(""); 20 | const [nationality, setNationality] = useState(""); 21 | const [sex, setSex] = useState(""); 22 | const [dob, setDob] = useState(""); 23 | const [contactNumber, setContactNumber] = useState(""); 24 | const [aadharUID, setAadharUID] = useState(""); 25 | const [pan, setPan] = useState(""); 26 | const [walletAddress, setWalletAddress] = useState(""); 27 | const [signingUpAs, setSigningUpAs] = useState("lawyer"); 28 | 29 | const connectMetamaskWallet = async () => { 30 | try { 31 | const accounts = await window.ethereum.request({ 32 | method: "eth_requestAccounts", 33 | }); 34 | const account = ethers.utils.getAddress(accounts[0]); 35 | setWalletAddress(account); 36 | setIsConnected(true); 37 | } catch (error) { 38 | console.error("Error connecting to Ethereum:", error); 39 | setIsConnected(false); 40 | } 41 | }; 42 | 43 | const handleSubmit = async (e) => { 44 | e.preventDefault(); 45 | 46 | // Check if any of the required fields are empty 47 | if ( 48 | !fullName || 49 | !religion || 50 | !nationality || 51 | !sex || 52 | !dob || 53 | !contactNumber || 54 | !aadharUID || 55 | !pan 56 | ) { 57 | alert("Please fill in all the required fields."); 58 | return; 59 | } 60 | 61 | const formData = { 62 | fullName, 63 | religion, 64 | nationality, 65 | sex, 66 | dob, 67 | contactNumber, 68 | aadharUID, 69 | pan, 70 | walletAddress, 71 | signingUpAs, 72 | }; 73 | 74 | try { 75 | const register = await registerToEVault(formData); 76 | 77 | // Customization: https://fkhadra.github.io/react-toastify/how-to-style/ 78 | // Customization: https://fkhadra.github.io/react-toastify/how-to-style/ 79 | toast("Evault login successfull ✅", { 80 | position: "top-right", 81 | autoClose: 1000, 82 | closeOnClick: true, 83 | pauseOnHover: true, 84 | draggable: true, 85 | progress: undefined, 86 | icon: false, 87 | hideProgressBar: true, 88 | closeButton: false, 89 | }); 90 | 91 | // resettingToDefaultValues 92 | setFullName(""); 93 | setReligion(""); 94 | setNationality(""); 95 | setSex(""); 96 | setDob(""); 97 | setContactNumber(""); 98 | setAadharUID(""); 99 | setPan(""); 100 | setWalletAddress(""); 101 | 102 | setTimeout(() => { 103 | navigate(`/admin/lawyer/${aadharUID}`); 104 | }, 2000); 105 | } catch (error) { 106 | console.error("Error during registration: ", error); 107 | } 108 | }; 109 | 110 | const renderFormFields = () => { 111 | switch (formType) { 112 | case "lawyer": 113 | return ( 114 | <> 115 |
116 | setFullName(e.target.value)} 122 | /> 123 |
124 |
125 |
126 | 136 |
137 |
138 | 146 |
147 |
148 | 159 |
160 |
161 |
162 | setDob(e.target.value)} 168 | /> 169 |
170 |
171 | setContactNumber(e.target.value)} 177 | /> 178 |
179 | 180 | ); 181 | case "client": 182 | return ( 183 | <> 184 |
185 | setFullName(e.target.value)} 191 | /> 192 |
193 |
194 |
195 | 205 |
206 |
207 | 215 |
216 |
217 | 228 |
229 |
230 |
231 | setDob(e.target.value)} 237 | /> 238 |
239 |
240 | setContactNumber(e.target.value)} 246 | /> 247 |
248 | 249 | ); 250 | case "judge": 251 | return ( 252 | <> 253 |
254 | setFullName(e.target.value)} 260 | /> 261 |
262 |
263 |
264 | 274 |
275 |
276 | 284 |
285 |
286 | 297 |
298 |
299 |
300 | setDob(e.target.value)} 306 | /> 307 |
308 |
309 | setContactNumber(e.target.value)} 315 | /> 316 |
317 | 318 | ); 319 | default: 320 | return null; 321 | } 322 | }; 323 | 324 | return ( 325 |
326 |
327 |

328 | E-Vault Registration 329 |

330 |
331 | 332 |

333 | Already have an acccount ? 334 |

335 |

336 | Login to E-Vault here 337 |

338 | 339 |
340 |
341 |
342 | 355 |
356 | 357 |
358 | 371 |
372 | 373 |
374 | 387 |
388 |
389 |
390 | 391 |
392 |
396 | {renderFormFields()} 397 | 398 |
399 |
400 | setAadharUID(e.target.value)} 406 | /> 407 |
408 | 409 |
410 | setPan(e.target.value)} 416 | /> 417 |
418 |
419 | 420 |
421 |
422 | setWalletAddress(e.target.value)} 432 | /> 433 |
434 |
435 | 442 |
443 |
444 | 445 |
446 | 452 |
453 |
454 |
455 | 456 | 460 |
461 | ); 462 | }; 463 | 464 | export default SignUpComponent; 465 | -------------------------------------------------------------------------------- /frontend-vite/src/components/ui/dialog.jsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import * as React from "react"; 4 | import * as DialogPrimitive from "@radix-ui/react-dialog"; 5 | import {X} from "lucide-react"; 6 | 7 | import {cn} from "@/lib/utils"; 8 | 9 | const Dialog = DialogPrimitive.Root; 10 | 11 | const DialogTrigger = DialogPrimitive.Trigger; 12 | 13 | const DialogPortal = DialogPrimitive.Portal; 14 | 15 | const DialogClose = DialogPrimitive.Close; 16 | 17 | const DialogOverlay = React.forwardRef(({className, ...props}, ref) => ( 18 | 26 | )); 27 | DialogOverlay.displayName = DialogPrimitive.Overlay.displayName; 28 | 29 | const DialogContent = React.forwardRef( 30 | ({className, children, ...props}, ref) => ( 31 | 32 | 33 | 41 | {children} 42 | 43 | 44 | Close 45 | 46 | 47 | 48 | ) 49 | ); 50 | DialogContent.displayName = DialogPrimitive.Content.displayName; 51 | 52 | const DialogHeader = ({className, ...props}) => ( 53 |
57 | ); 58 | DialogHeader.displayName = "DialogHeader"; 59 | 60 | const DialogFooter = ({className, ...props}) => ( 61 |
68 | ); 69 | DialogFooter.displayName = "DialogFooter"; 70 | 71 | const DialogTitle = React.forwardRef(({className, ...props}, ref) => ( 72 | 80 | )); 81 | DialogTitle.displayName = DialogPrimitive.Title.displayName; 82 | 83 | const DialogDescription = React.forwardRef(({className, ...props}, ref) => ( 84 | 89 | )); 90 | DialogDescription.displayName = DialogPrimitive.Description.displayName; 91 | 92 | export { 93 | Dialog, 94 | DialogPortal, 95 | DialogOverlay, 96 | DialogClose, 97 | DialogTrigger, 98 | DialogContent, 99 | DialogHeader, 100 | DialogFooter, 101 | DialogTitle, 102 | DialogDescription, 103 | }; 104 | -------------------------------------------------------------------------------- /frontend-vite/src/index.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300&family=Nunito+Sans:opsz,wght@6..12,300&display=swap'); 2 | 3 | @tailwind base; 4 | @tailwind components; 5 | @tailwind utilities; 6 | 7 | body { 8 | padding-right: 100px; 9 | padding-left: 100px; 10 | margin: 0; 11 | } 12 | 13 | @media screen and (min-width: 350px) and (max-width: 640px) { 14 | body { 15 | padding-right: 35px; 16 | padding-left: 35px; 17 | } 18 | } 19 | 20 | @layer base { 21 | :root { 22 | --background: 0 0% 100%; 23 | --foreground: 222.2 84% 4.9%; 24 | 25 | --card: 0 0% 100%; 26 | --card-foreground: 222.2 84% 4.9%; 27 | 28 | --popover: 0 0% 100%; 29 | --popover-foreground: 222.2 84% 4.9%; 30 | 31 | --primary: 222.2 47.4% 11.2%; 32 | --primary-foreground: 210 40% 98%; 33 | 34 | --secondary: 210 40% 96.1%; 35 | --secondary-foreground: 222.2 47.4% 11.2%; 36 | 37 | --muted: 210 40% 96.1%; 38 | --muted-foreground: 215.4 16.3% 46.9%; 39 | 40 | --accent: 210 40% 96.1%; 41 | --accent-foreground: 222.2 47.4% 11.2%; 42 | 43 | --destructive: 0 84.2% 60.2%; 44 | --destructive-foreground: 210 40% 98%; 45 | 46 | --border: 214.3 31.8% 91.4%; 47 | --input: 214.3 31.8% 91.4%; 48 | --ring: 222.2 84% 4.9%; 49 | 50 | --radius: 0.5rem; 51 | } 52 | 53 | .dark { 54 | --background: 222.2 84% 4.9%; 55 | --foreground: 210 40% 98%; 56 | 57 | --card: 222.2 84% 4.9%; 58 | --card-foreground: 210 40% 98%; 59 | 60 | --popover: 222.2 84% 4.9%; 61 | --popover-foreground: 210 40% 98%; 62 | 63 | --primary: 210 40% 98%; 64 | --primary-foreground: 222.2 47.4% 11.2%; 65 | 66 | --secondary: 217.2 32.6% 17.5%; 67 | --secondary-foreground: 210 40% 98%; 68 | 69 | --muted: 217.2 32.6% 17.5%; 70 | --muted-foreground: 215 20.2% 65.1%; 71 | 72 | --accent: 217.2 32.6% 17.5%; 73 | --accent-foreground: 210 40% 98%; 74 | 75 | --destructive: 0 62.8% 30.6%; 76 | --destructive-foreground: 210 40% 98%; 77 | 78 | --border: 217.2 32.6% 17.5%; 79 | --input: 217.2 32.6% 17.5%; 80 | --ring: 212.7 26.8% 83.9%; 81 | } 82 | } 83 | 84 | @layer base { 85 | * { 86 | @apply border-border; 87 | } 88 | body { 89 | @apply bg-background text-foreground; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /frontend-vite/src/lib/utils.js: -------------------------------------------------------------------------------- 1 | import {clsx} from "clsx"; 2 | import {twMerge} from "tailwind-merge"; 3 | 4 | export function cn(...inputs) { 5 | return twMerge(clsx(inputs)); 6 | } 7 | 8 | export function shortenWalletAddress(walletAddress) { 9 | if (!walletAddress || typeof walletAddress !== "string") { 10 | return "Invalid wallet address"; 11 | } 12 | 13 | const prefix = walletAddress.slice(0, 10); 14 | 15 | const suffix = walletAddress.slice(-10); 16 | 17 | return `${prefix}...${suffix}`; 18 | } 19 | 20 | export function superShortenWalletAddress(walletAddress) { 21 | if (!walletAddress || typeof walletAddress !== "string") { 22 | return "Invalid wallet address"; 23 | } 24 | 25 | const prefix = walletAddress.slice(0, 3); 26 | 27 | const suffix = walletAddress.slice(-3); 28 | 29 | return `${prefix}...${suffix}`; 30 | } 31 | -------------------------------------------------------------------------------- /frontend-vite/src/main.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import ReactDOM from "react-dom/client"; 3 | import App from "./App.jsx"; 4 | import "./index.css"; 5 | import "./App.css"; 6 | 7 | import {BrowserRouter} from "react-router-dom"; 8 | 9 | ReactDOM.createRoot(document.getElementById("root")).render( 10 | 11 | 12 | 13 | 14 | 15 | ); 16 | -------------------------------------------------------------------------------- /frontend-vite/src/pages/AdminPage.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import {useParams} from "react-router-dom"; 3 | 4 | import AdminDashboardComponent from "../components/AdminDashboardComponent"; 5 | 6 | const AdminPage = () => { 7 | const {aadharUID, adminType} = useParams(); 8 | 9 | return ( 10 | <> 11 | 12 | 13 | ); 14 | }; 15 | 16 | export default AdminPage; 17 | -------------------------------------------------------------------------------- /frontend-vite/src/pages/CaseDetailsPage.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import {useLocation} from "react-router-dom"; 3 | import CaseDetailsComponent from "../components/CaseDetailsComponent"; 4 | 5 | const CaseDetailsPage = () => { 6 | const location = useLocation(); 7 | const searchParams = new URLSearchParams(location.search); 8 | const caseID = searchParams.get("caseid"); 9 | return ( 10 | <> 11 | {/* Pass the caseID as a prop to CaseDetailsComponent */} 12 | 13 | 14 | ); 15 | }; 16 | 17 | export default CaseDetailsPage; 18 | -------------------------------------------------------------------------------- /frontend-vite/src/pages/GetCaseDetailsPage.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import SearchCaseDetailsComponent from "../components/SearchCaseDetailsComponent.jsx"; 3 | 4 | const GetCaseDetailsPage = () => { 5 | return ( 6 |
7 | 8 |
9 | ); 10 | }; 11 | 12 | export default GetCaseDetailsPage; 13 | -------------------------------------------------------------------------------- /frontend-vite/src/pages/HomePage.jsx: -------------------------------------------------------------------------------- 1 | import HeroSection from "../components/HeroSection"; 2 | import ProjectStatistics from "../components/ProjectStatistics"; 3 | 4 | function HomePage() { 5 | return ( 6 | <> 7 | 8 | 9 | 10 | ); 11 | } 12 | 13 | export default HomePage; 14 | -------------------------------------------------------------------------------- /frontend-vite/src/pages/LoginPage.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import {useParams} from "react-router-dom"; 3 | 4 | import LoginComponent from "../components/LoginComponent"; 5 | 6 | const LoginPage = () => { 7 | const {initialFormType} = useParams(); 8 | 9 | return ( 10 | <> 11 | 12 | 13 | ); 14 | }; 15 | 16 | export default LoginPage; 17 | -------------------------------------------------------------------------------- /frontend-vite/src/pages/RegisterNewLegalCasePage.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import RegisterANewCaseComponent from "../components/RegisterANewCaseComponent"; 3 | 4 | const RegisterNewLegalCasePage = () => { 5 | return ( 6 | <> 7 | 8 | 9 | ); 10 | }; 11 | 12 | export default RegisterNewLegalCasePage; 13 | -------------------------------------------------------------------------------- /frontend-vite/src/pages/SignUpPage.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import {useParams} from "react-router-dom"; 3 | 4 | import SignUpComponent from "../components/SignUpComponent"; 5 | 6 | const SignUpPage = () => { 7 | const {initialFormType} = useParams(); 8 | 9 | return ( 10 | <> 11 | 12 | 13 | ); 14 | }; 15 | 16 | export default SignUpPage; 17 | -------------------------------------------------------------------------------- /frontend-vite/src/pages/TestPage.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import Loader from "@/components/Loader"; 3 | 4 | const TestPage = () => { 5 | return ( 6 | <> 7 | 8 | 9 | ); 10 | }; 11 | 12 | export default TestPage; 13 | -------------------------------------------------------------------------------- /frontend-vite/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | module.exports = { 3 | darkMode: ["class"], 4 | content: [ 5 | "./pages/**/*.{js,jsx}", 6 | "./components/**/*.{js,jsx}", 7 | "./app/**/*.{js,jsx}", 8 | "./src/**/*.{js,jsx}", 9 | ], 10 | prefix: "", 11 | theme: { 12 | container: { 13 | center: true, 14 | padding: "2rem", 15 | screens: { 16 | "2xl": "1400px", 17 | }, 18 | }, 19 | screens: { 20 | xs: "350px", 21 | // => @media (min-width: 350px) { ... } 22 | 23 | sm: "640px", 24 | // => @media (min-width: 640px) { ... } 25 | 26 | md: "768px", 27 | // => @media (min-width: 768px) { ... } 28 | 29 | lg: "1024px", 30 | // => @media (min-width: 1024px) { ... } 31 | 32 | xl: "1280px", 33 | // => @media (min-width: 1280px) { ... } 34 | 35 | "2xl": "1500px", 36 | // => @media (min-width: 1500px) { ... } 37 | 38 | "3xl": "1800px", 39 | // => @media (min-width: 1800px) { ... } 40 | }, 41 | extend: { 42 | fontFamily: { 43 | montserrat: ["Montserrat", "sans"], 44 | }, 45 | colors: { 46 | border: "hsl(var(--border))", 47 | input: "hsl(var(--input))", 48 | ring: "hsl(var(--ring))", 49 | background: "hsl(var(--background))", 50 | foreground: "hsl(var(--foreground))", 51 | primary: { 52 | DEFAULT: "hsl(var(--primary))", 53 | foreground: "hsl(var(--primary-foreground))", 54 | }, 55 | secondary: { 56 | DEFAULT: "hsl(var(--secondary))", 57 | foreground: "hsl(var(--secondary-foreground))", 58 | }, 59 | destructive: { 60 | DEFAULT: "hsl(var(--destructive))", 61 | foreground: "hsl(var(--destructive-foreground))", 62 | }, 63 | muted: { 64 | DEFAULT: "hsl(var(--muted))", 65 | foreground: "hsl(var(--muted-foreground))", 66 | }, 67 | accent: { 68 | DEFAULT: "hsl(var(--accent))", 69 | foreground: "hsl(var(--accent-foreground))", 70 | }, 71 | popover: { 72 | DEFAULT: "hsl(var(--popover))", 73 | foreground: "hsl(var(--popover-foreground))", 74 | }, 75 | card: { 76 | DEFAULT: "hsl(var(--card))", 77 | foreground: "hsl(var(--card-foreground))", 78 | }, 79 | }, 80 | borderRadius: { 81 | lg: "var(--radius)", 82 | md: "calc(var(--radius) - 2px)", 83 | sm: "calc(var(--radius) - 4px)", 84 | }, 85 | keyframes: { 86 | "accordion-down": { 87 | from: {height: "0"}, 88 | to: {height: "var(--radix-accordion-content-height)"}, 89 | }, 90 | "accordion-up": { 91 | from: {height: "var(--radix-accordion-content-height)"}, 92 | to: {height: "0"}, 93 | }, 94 | }, 95 | animation: { 96 | "accordion-down": "accordion-down 0.2s ease-out", 97 | "accordion-up": "accordion-up 0.2s ease-out", 98 | }, 99 | }, 100 | }, 101 | plugins: [require("tailwindcss-animate")], 102 | }; 103 | -------------------------------------------------------------------------------- /frontend-vite/vite.config.js: -------------------------------------------------------------------------------- 1 | import path from "path"; 2 | import {defineConfig} from "vite"; 3 | import react from "@vitejs/plugin-react"; 4 | 5 | // https://vitejs.dev/config/ 6 | export default defineConfig({ 7 | plugins: [react()], 8 | resolve: { 9 | alias: { 10 | "@": path.resolve(__dirname, "./src"), 11 | }, 12 | }, 13 | }); 14 | -------------------------------------------------------------------------------- /frontend-vite/vite.config.js.timestamp-1711906103182-8a096b5df01d3.mjs: -------------------------------------------------------------------------------- 1 | // vite.config.js 2 | import { defineConfig } from "file:///C:/Users/LENOVO/Desktop/Active%20Projects/sih-evault-project/frontend-vite/node_modules/vite/dist/node/index.js"; 3 | import react from "file:///C:/Users/LENOVO/Desktop/Active%20Projects/sih-evault-project/frontend-vite/node_modules/@vitejs/plugin-react/dist/index.mjs"; 4 | var vite_config_default = defineConfig({ 5 | plugins: [react()] 6 | }); 7 | export { 8 | vite_config_default as default 9 | }; 10 | //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcuanMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lID0gXCJDOlxcXFxVc2Vyc1xcXFxMRU5PVk9cXFxcRGVza3RvcFxcXFxBY3RpdmUgUHJvamVjdHNcXFxcc2loLWV2YXVsdC1wcm9qZWN0XFxcXGZyb250ZW5kLXZpdGVcIjtjb25zdCBfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfZmlsZW5hbWUgPSBcIkM6XFxcXFVzZXJzXFxcXExFTk9WT1xcXFxEZXNrdG9wXFxcXEFjdGl2ZSBQcm9qZWN0c1xcXFxzaWgtZXZhdWx0LXByb2plY3RcXFxcZnJvbnRlbmQtdml0ZVxcXFx2aXRlLmNvbmZpZy5qc1wiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9pbXBvcnRfbWV0YV91cmwgPSBcImZpbGU6Ly8vQzovVXNlcnMvTEVOT1ZPL0Rlc2t0b3AvQWN0aXZlJTIwUHJvamVjdHMvc2loLWV2YXVsdC1wcm9qZWN0L2Zyb250ZW5kLXZpdGUvdml0ZS5jb25maWcuanNcIjtpbXBvcnQgeyBkZWZpbmVDb25maWcgfSBmcm9tICd2aXRlJ1xuaW1wb3J0IHJlYWN0IGZyb20gJ0B2aXRlanMvcGx1Z2luLXJlYWN0J1xuXG4vLyBodHRwczovL3ZpdGVqcy5kZXYvY29uZmlnL1xuZXhwb3J0IGRlZmF1bHQgZGVmaW5lQ29uZmlnKHtcbiAgcGx1Z2luczogW3JlYWN0KCldLFxufSlcbiJdLAogICJtYXBwaW5ncyI6ICI7QUFBMFosU0FBUyxvQkFBb0I7QUFDdmIsT0FBTyxXQUFXO0FBR2xCLElBQU8sc0JBQVEsYUFBYTtBQUFBLEVBQzFCLFNBQVMsQ0FBQyxNQUFNLENBQUM7QUFDbkIsQ0FBQzsiLAogICJuYW1lcyI6IFtdCn0K 11 | -------------------------------------------------------------------------------- /project-assets/SC_COVER.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitroy-github/vite-project-evault/d07168a329a7b3b7676fb532aeb9714840329a96/project-assets/SC_COVER.png -------------------------------------------------------------------------------- /project-assets/demo_car_accident_image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitroy-github/vite-project-evault/d07168a329a7b3b7676fb532aeb9714840329a96/project-assets/demo_car_accident_image.jpg -------------------------------------------------------------------------------- /project-assets/demo_fir.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitroy-github/vite-project-evault/d07168a329a7b3b7676fb532aeb9714840329a96/project-assets/demo_fir.jpg -------------------------------------------------------------------------------- /project-assets/demo_fir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitroy-github/vite-project-evault/d07168a329a7b3b7676fb532aeb9714840329a96/project-assets/demo_fir.png -------------------------------------------------------------------------------- /project-assets/sc_admin_dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitroy-github/vite-project-evault/d07168a329a7b3b7676fb532aeb9714840329a96/project-assets/sc_admin_dashboard.png -------------------------------------------------------------------------------- /project-assets/sc_case_details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitroy-github/vite-project-evault/d07168a329a7b3b7676fb532aeb9714840329a96/project-assets/sc_case_details.png -------------------------------------------------------------------------------- /project-assets/sc_case_document.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitroy-github/vite-project-evault/d07168a329a7b3b7676fb532aeb9714840329a96/project-assets/sc_case_document.png -------------------------------------------------------------------------------- /project-assets/sc_case_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitroy-github/vite-project-evault/d07168a329a7b3b7676fb532aeb9714840329a96/project-assets/sc_case_search.png -------------------------------------------------------------------------------- /project-assets/sc_home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitroy-github/vite-project-evault/d07168a329a7b3b7676fb532aeb9714840329a96/project-assets/sc_home.png -------------------------------------------------------------------------------- /project-assets/sc_login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitroy-github/vite-project-evault/d07168a329a7b3b7676fb532aeb9714840329a96/project-assets/sc_login.png -------------------------------------------------------------------------------- /project-assets/sc_logo.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitroy-github/vite-project-evault/d07168a329a7b3b7676fb532aeb9714840329a96/project-assets/sc_logo.PNG -------------------------------------------------------------------------------- /project-assets/sc_registration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitroy-github/vite-project-evault/d07168a329a7b3b7676fb532aeb9714840329a96/project-assets/sc_registration.png -------------------------------------------------------------------------------- /project-assets/sc_upload_case_document.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitroy-github/vite-project-evault/d07168a329a7b3b7676fb532aeb9714840329a96/project-assets/sc_upload_case_document.png --------------------------------------------------------------------------------