How harshgour/host-engine works
Main Components
• Website Frontend: Under the “Website” directory, you have traditional HTML, CSS, and JavaScript files that form the user-facing portion of the site (including pages like index.html, documentation.html, upload-files.html). This component is responsible for displaying content and interacting with the user.
• Chrome Extension: The “Extension” directory holds files (HTML, CSS, JS, manifest.json, etc.) that build a Chrome extension. This component may help users interact with the decentralized hosting system (for example, making blockchain or IPFS calls) directly from their browser.
• Smart Contracts/Blockchain Backend: Although details inside “Smart Contracts” are not fully shown in the file tree, this directory is clearly intended to hold Solidity contracts and blockchain logic. The README confirms the use of Ethereum, Solidity, and Web3.js, suggesting that smart contracts manage the domain name system or site hosting records.
• IPFS Network: As part of the decentralized storage solution, IPFS is used to store and retrieve website content. While not explicitly part of the file tree, it is a central piece of the overall architecture mentioned in the README.
Relationships and Interactions
• The Website Frontend and Chrome Extension both serve as client-side interfaces. They interact with the blockchain network using Web3.js, which is evident by their inclusion of JavaScript components.
• These clients send transactions or requests to the Smart Contracts deployed on the Ethereum blockchain, which in turn operate as the decentralized “DNS-like” system linking human-readable names to website content stored on IPFS.
• The IPFS network stores the actual files and media that make up the websites. The smart contracts will contain mappings to the content stored on IPFS, ensuring integrity and decentralized accessibility.
• User actions in the browser (using either the website or extension) trigger these interactions (for example, website upload or domain registration), with event flows moving from the user interfaces → smart contracts → blockchain node → IPFS storage and vice-versa.
Architectural Patterns & Design Principles
• Separation of Concerns: The architecture distinguishes between presentation (Website and Extension), smart contracts (blockchain logic), and storage (IPFS). This makes it easier to manage and scale the system.
• Decentralized Design: By decoupling hosting (IPFS) from control/transaction logic (Ethereum smart contracts), the system mitigates single points of failure.
• Client-Blockchain Integration: Usage of Web3.js (as indicated by the tech stack) bridges the gap between traditional client-side code (HTML/JS in Website and Extension) and blockchain operations.
Relevant Technologies
• Frontend technologies: HTML, CSS, JavaScript, Bootstrap (for styling), and the Chrome extension framework.
• Backend/blockchain components: Ethereum, Solidity (Smart Contracts), Web3.js (for blockchain interactions), and IPFS for storage.