How anushreejha/blocksharecloud works
• Web Server & User Interface: Represent the Flask application (app.py) along with its static assets (styles.css) and templates (index.html). This is the front-end that interacts with users via web forms for file uploads and downloads.
• File Upload/Processing Module: Highlight the file upload workflow where files are temporarily stored (uploads directory created at runtime) before they are sent to IPFS.
• IPFS Integration: Include the IPFS client functionality (ipfs.py), and note that there is a “go-ipfs” directory with associated scripts and a README for integration purposes. This component handles storing the file in the decentralized storage network (ensure the IPFS daemon is running).
• Blockchain Component: Represent the blockchain module (blockchain.py) which records the metadata (file name and IPFS hash) of each uploaded file, providing traceability and integrity.
• File Download Handler: Illustrate the download process where the IPFS hash is provided, the file is retrieved from IPFS, and then renamed and served with its original name as recorded on the blockchain.
• External Dependencies & Configurations: Mention the requirements file (requirements.txt) for dependencies and the additional deployment/setup steps (e.g., creating uploads/downloads directories, running the IPFS daemon).
Architectural Patterns and Technologies
• MVC Style / Separation of Concerns: Though the project is simple, separate the concerns of presentation (templates and static), business logic (Flask routes in app.py), storage handling (ipfs.py), and metadata management (blockchain.py).
• In-Memory Blockchain: Emphasize that the blockchain is currently non-persistent, making it a lightweight and straightforward traceability mechanism.
• External Service Integration: Clearly mark the dependency on the running IPFS daemon, vital for decentralized file storage.