D

DGallery

A decentralised social media application to upload and view images stored on IPFS.

34

The problem DGallery solves

Decentralised storage is one of the up-and-coming aspects of the web3 world. Today's social media apps store the user's data and posts in their central server which is completely in the control of the platform and can become a single point of failure. IPFS solves this problem by using content-based addressing to allow peers to store and share files among themselves.

The DGallery application allows users to post images along with a title/caption - the image metadata (title and author) is stored on the smart contract on the Rinkeby chain while the image file itself is stored on IPFS (using Infura as the pinning service). The image CID is stored on the blockchain forever and the user does not have to depend on any platform to maintain their data. This gives more power and control to the users over their own content. The DGallery application also serves as a tool to browse through the images posted by other people in the community and deepens a sense of community.

Challenges I ran into

The first challenge was to figure out how to integrate IPFS with the React frontend such that the input image can be uploaded to IPFS and a CID can be obtained. The images also needed to be pinned because otherwise they would not persist and become accessible to display on the website. After searching through some solutions I can across a node.js package

ipfs-http-client

, a JavaScript HTTP RPC API client library for IPFS implementations. This provided smooth integration of IPFS with my frontend application. The smart contract development was relatively simpler. I also tried to experiment with the ChakraUI for the first time and had a challenging time getting used to it.

Discussion