How rohitroy-github/vite-project-evault works
Project Type & Purpose
• The project is a blockchain-based eVault solution focused on the Indian Judiciary. It leverages Ethereum Virtual Machine (EVM) compatible networks (Local Hardhat, Sepolia, Polygon, and Morph testnets) along with IPFS for decentralized document storage.
• The frontend is built with ViteJS and Tailwind CSS, while the backend utilizes Hardhat for smart contract development & testing, NodeJS scripts, and integration with blockchain services using Ethers JS, Metamask, and a service like Pinata for IPFS.
• Primary Use Cases: seamless registration for clients, lawyers & judges; case registration & tracking; document uploads via IPFS; and integration with blockchain for authorization and data immutability.
Analyzing the File Structure
• Two main top-level components:
• “blockchain-hardhat” folder: Contains smart contracts, deployment scripts, tests, configuration files (e.g. hardhat.config.js), and environment templates.
• “frontend-vite” folder: Contains the web client built using ViteJS, React components, pages, and blockchain API calls to interact with the deployed smart contracts.
• Additional folders such as “project-assets” provide images and snapshots for the documentation.
• The presence of directories like “contracts”, “scripts”, “tasks”, and “test” in the blockchain folder indicates a clear separation for managing smart contracts, deployment automation, and testing.
• The frontend folder includes separation of API calls (the “blockchain-api” subfolder), UI components, pages, and configuration files (e.g., tailwind.config.js).
Key Components
a. Blockchain / Backend Components:
• Smart Contracts: Located in “blockchain-hardhat/contracts”, these are the core of the E-Vault functionality.
• Hardhat Environment: Manages local blockchain emulation, testing, and deployment scripts (e.g., deploy_fetchCaseDetailsByAClient.js in “blockchain-hardhat/scripts”).
• Tasks & Testing: Automated tasks (see “blockchain-hardhat/tasks”) and tests (in “blockchain-hardhat/test”) ensure contract correctness.
• Environment Configuration: An .env file (based on .env.example) for setting up network endpoints (Alchemy, etc.) and environment variables.
b. Frontend Components:
• ViteJS-Based Client: “frontend-vite” directory contains the entire client application built with React, Tailwind CSS, and various libraries.
• Blockchain API Integration: Under “frontend-vite/src/blockchain-api”, individual components handle interactions with smart contract functions (login, fetching details, registering cases, etc.).
• UI Components & Pages: Organized under “components” and “pages” directories to separate visual elements, including admin dashboards, case details, login, registration, etc.
• Backend Configuration: “src/backend-config.json” gets updated post-deployment to point to the correct contract addresses based on the network.
c. External Services and Networks:
• Integration with IPFS (using Pinata) for uploading and storing case documents.
• Metamask Wallet for authentication and blockchain interactions.
• Multiple blockchain endpoints – Local Hardhat, Sepolia, and Polygon test networks.
Architectural Relationships & Data Flow
• User Interface (Client) Layer: Represented by the ViteJS based frontend.
• Blockchain Interaction Layer:
• A blockchain API module representing asynchronous communication with deployed smart contracts (via ethers.js, Metamask).
• Blockchain & Smart Contract Layer: The core smart contracts (deployed using Hardhat) handling registration, case details, automatic judge allocation, and progress updates.
• Off-Chain Storage: Show the connection from smart contracts or backend scripts to IPFS for storing documents.
• Deployment & Configuration: Including environment files and the update of “backend-config.json” that bridges the frontend with current blockchain addresses.
• Directional relationships: User actions → Frontend API calls → Blockchain smart contract functions → Document storage (IPFS).